Contrastive Concept-Tree Search (CCTS)
- The paper introduces CCTS, a framework that leverages a contrastive probabilistic model to select candidate programs based on a learned semantic hierarchy.
- CCTS constructs an interpretable concept tree to dynamically guide parent selection, balancing exploration and exploitation for improved fitness outcomes.
- Empirical results show that CCTS outperforms fitness-only methods on tasks like circle packing by reducing variance and accelerating convergence.
Contrastive Concept-Tree Search (CCTS) is a methodological framework for improving LLM-assisted algorithm discovery by explicitly leveraging a learned hierarchy of semantic concepts. CCTS formulates discovery as an iterative search where the LLM proposes candidate programs, an external evaluator provides fitness feedback, and, crucially, the semantic concepts underlying each candidate are extracted to organize search in a concept space. This approach employs a contrastive probabilistic model over the extracted concept vectors to guide selection of historical solutions, actively reweighting parent selection toward semantically promising and away from misleading concept combinations and thus refining the search through an interpretable concept hierarchy, rather than relying solely on program lineage or fitness (Leleu et al., 3 Feb 2026).
1. Iterative Search Framework and Archive Structure
CCTS operates as an evolutionary optimization loop tailored for program synthesis. At iteration , the algorithm maintains an archive
where is a previously generated candidate program, is its task-specific fitness as determined by an external evaluator , and is the program’s binary semantic concept feature vector obtained via an LLM extraction function .
The iterative process comprises the following core steps:
- Parent Selection: Parents are chosen from the archive according to a sampling policy , with CCTS using learned contrastive weights over concept representations.
- Prompt Construction: The LLM prompt composes the fixed task description and a concise LLM-generated context summarizing recent candidates.
- Child Generation: The LLM generates a new candidate conditional on the current prompt and selected parents.
- Evaluation and Archive Update: The external evaluator computes , extracts the activated concept vector , and these are appended to .
This framework enables iterative refinement of candidate solutions, supporting dynamic incorporation of new concepts as the search progresses.
2. Extraction and Organization of Hierarchical Concept Representations
Semantic abstraction in CCTS centers on the dynamic construction of a concept tree , with nodes representing program concepts (e.g., "circle center spacing", "boundary reflection"). Each concept possesses a unique parent , forming a rooted hierarchy that encodes semantic specialization.
Concept Extraction: Following each program generation, the LLM is directly prompted: “List the semantic concepts or heuristics used by this program.” Extracted items are represented as a binary vector , indicating active concepts, subject to the ancestor-closure constraint ().
Tree Growth: When discovers a previously unseen concept, a new leaf node is appended to and attached to its most suitable parent, as determined by the LLM’s explanation. Empirically, evolves from a small set of general concepts to a broader hierarchy of specialized nodes, facilitating fine-grained semantic tracking of candidate programs.
3. Contrastive Probabilistic Modeling of Concepts
CCTS partitions the archive into "good" and "bad" subsets via a dynamic fitness threshold , frequently set such that half the archive is considered high-performing. Two class-conditional probabilistic models are fit over the observed concept vectors:
Maximum-likelihood estimation (cross-entropy) determines Bernoulli parameters for each node :
The joint over any valid binary vector factors as
A contrastive likelihood-ratio weight is then defined for each observed :
This ratio quantifies, in a statistically grounded manner, which concept combinations are disproportionately frequent among high-performing solutions, enabling targeted biasing of parent selection.
4. Guided Search and Semantic Edits via the Concept Tree
As new candidates are generated and annotated, CCTS grows and updates contrastive model parameters (, ) online. Parent sampling proceeds in two modes:
- Exploit (probability ): Archive entries are sampled with probability proportional to .
- Explore: Uniform sampling regardless of encourages diversity.
Additionally, at each iteration, a "semantic edit" can be performed by injecting a directive into the LLM prompt to emphasize or avoid a particular conceptual motif. The concept selected for editing is drawn from nodes with the highest contrast (largest ) and a novelty bonus for underexplored leaves, which increases the likelihood of discovering semantically novel algorithmic heuristics.
5. Empirical Evaluation Against Fitness-Only Baselines
CCTS is benchmarked against several parent selection baselines:
- Uniform: Random parent selection.
- Greedy: Top-1 by fitness.
- k-Elites: Uniform selection from the top- () candidates by fitness.
Empirical results on open Erdős-type combinatorics problems (circle packing, arithmetic Kakeya, Heilbronn’s triangle, squares-in-square) demonstrate that CCTS:
- Achieves higher mean and median fitness faster (e.g., for circle packing, attains the known optimum in ∼20 iterations, compared to more than 30 for k-Elites).
- Exhibits narrower performance variance, reducing the frequency and severity of failure modes.
- Ablation studies confirm that both contrastive weighting and semantic exploration independently contribute to these search improvements.
Fitness-only selection is shown to amplify spurious correlations—concepts favored by the LLM but not causally linked to true task progress—whereas CCTS differentially suppresses misleading concepts through contrastive estimation, resulting in more robust exploration of solution space (Leleu et al., 3 Feb 2026).
6. Experiments in Controlled Synthetic Environments
To further probe CCTS, experiments were conducted in a synthetic setting where the LLM is replaced with a generative "teacher" branching-process concept tree populated according to explicit generative parameters (branching rate , maximum depth ), and fitness is defined as a weighted sum of concepts with additive noise.
Under this model, candidate mutation is prescribed: active concepts are inherited with probability , and children acquire new concepts stochastically, either locally or globally. The feature extractor is subject to controlled noise (depth-dependent false negatives).
CCTS, applied in this setting, demonstrates:
- Nearly identical qualitative learning curves to LLM-based runs.
- Strong correlation () between the learned contrastive signal () and the true discriminative log-odds assigned by the teacher.
- The optimal exploitation probability () shifts as the branching factor of the concept tree is varied, suggesting that task-dependent adjustment of exploration-exploitation balance is beneficial.
7. Strengths, Limitations, and Prospective Extensions
Advantages:
- Leverages the LLM’s semantic prior while mitigating spurious or misleading biases via contrastive statistical modeling.
- Converts black-box fitness optimization into a process conducted over an explicit, interpretable, and evolving hierarchy of semantic concepts.
- Delivers improved mean fitness, tighter performance distributions, and interpretable insights into task-specific conceptual strategies.
Limitations:
- The model is factorized and thus ignores higher-order interactions among concepts and their contextual dependencies.
- Algorithmic hyperparameters (e.g., , novelty bonus rate , prompt engineering) require careful tuning for each task domain.
- Reliance on the LLM’s conceptual extraction ability can limit overall performance if prompts are suboptimal or concept extraction fails.
Potential Extensions:
- Augmenting the probabilistic model to capture richer dependencies (e.g., graphical models or neural approaches for concept co-occurrence).
- Integrating CCTS with multi-parent crossover mechanisms or MAP-Elites style archives to further diversify exploration.
- End-to-end learning of hierarchical concept embeddings to facilitate smoother navigation and interpolation in concept space.
- Dynamic adjustment of the exploration/exploitation schedule conditioned on properties of the evolving concept hierarchy (e.g., observed branching rate, maximum depth).
These properties position CCTS as a distinctive approach for LLM-assisted algorithm discovery, emphasizing semantic transparency, principled guidance, and interpretable solution structure (Leleu et al., 3 Feb 2026).