Contrastive Concept-Tree Search for LLM-Assisted Algorithm Discovery
Introduces Contrastive Concept-Tree Search (CCTS), leveraging hierarchical semantic concepts to improve LLM-assisted algorithm discovery efficiency.
Key Findings
Methodology
This paper proposes Contrastive Concept-Tree Search (CCTS), which extracts hierarchical semantic representations from generated programs and learns a contrastive model to guide parent selection. By reweighting candidates based on likelihood ratios between high- and low-performing solutions, CCTS biases the search toward beneficial concept combinations, avoiding misleading ones. It employs a tree-structured concept hierarchy, cross-entropy updates, and likelihood ratio scoring to steer the search process. Empirical results on Erdős-style combinatorics problems demonstrate that CCTS outperforms baseline fitness-based methods, producing interpretable, task-specific concept trees and significantly improving search efficiency.
Key Results
- CCTS achieves over 15% higher average scores within fixed iteration budgets across multiple combinatorial tasks, with 20% faster convergence compared to baselines. The method generates concept trees that are both meaningful and interpretable, revealing key semantic components. Synthetic environment experiments show that CCTS can accurately recover ground-truth concept structures and learn to avoid low-utility concepts, confirming its ability to identify useful semantic features. These results highlight the importance of learning which concepts to avoid for effective search.
Significance
This work advances the understanding of how to exploit the internal representations of LLMs for structured algorithm discovery. By explicitly modeling the semantic space as a hierarchy and guiding search with contrastive learning, it addresses the limitations of traditional black-box, fitness-driven methods. The approach enhances both efficiency and interpretability, paving the way for more reliable and transparent AI systems capable of discovering novel algorithms in complex, poorly understood domains, with broad implications for scientific discovery and automated reasoning.
Technical Contribution
The paper introduces a hierarchical, contrastive learning framework that models program semantics as a concept tree, combined with a probabilistic likelihood ratio for parent selection. It employs a Tree-structured Parzen Estimator (TPE) for efficient estimation of concept utility, enabling biasing of search toward promising regions. The method integrates exploration mechanisms to discover new concepts and suppress misleading ones, providing a novel, interpretable, and scalable approach to guided program search within the context of LLM-assisted algorithm discovery.
Novelty
This is the first work to incorporate explicit hierarchical semantic representations and contrastive probabilistic models into the search process for algorithm discovery. Unlike prior approaches that rely solely on fitness signals, CCTS leverages a structured concept hierarchy and likelihood ratios to guide search, enabling the model to learn which semantic components contribute positively or negatively, thus significantly enhancing search efficiency and interpretability.
Limitations
- The effectiveness depends on accurate concept extraction; if the semantic concepts are poorly defined or noisy, the guidance may weaken. Computational costs are relatively high, especially when scaling to larger program spaces or deeper hierarchies. The approach may struggle with highly complex tasks where the concept hierarchy becomes too sparse or ambiguous, limiting its generalization. Further research is needed to optimize concept extraction and model scalability.
Future Work
Future directions include integrating multi-modal data to enrich concept representations, applying reinforcement learning to adapt search policies dynamically, and extending the framework to more complex, real-world problems. Developing methods for automatic, scalable concept hierarchy construction and exploring transferability across domains are also promising avenues to enhance the robustness and applicability of the approach.
AI Executive Summary
Recent advances in large language models (LLMs) have opened new avenues for automated algorithm discovery. Traditional methods rely heavily on fitness-driven evolutionary algorithms, which treat program space as a black box, limiting efficiency and interpretability. Recognizing these limitations, this study introduces Contrastive Concept-Tree Search (CCTS), a novel framework that explicitly models the semantic structure of algorithms as a hierarchy of concepts. By extracting hierarchical semantic features from generated programs and employing a contrastive learning approach, CCTS learns to bias the search process toward promising concept combinations while avoiding misleading ones.
The core innovation lies in representing programs as nodes within a dynamically evolving concept tree, where each node encodes a semantic concept. The model then uses likelihood ratios between high- and low-performing solutions to reweight parent node selection, effectively guiding the search toward regions of the concept space associated with better performance. This approach combines probabilistic modeling, exploration mechanisms, and hierarchical organization to improve search efficiency.
Empirical evaluations on Erdős-style combinatorial problems demonstrate that CCTS consistently outperforms baseline methods such as greedy, uniform, and k-elites strategies. It achieves over 15% higher average scores within the same iteration budget and converges 20% faster. Additionally, the learned concept trees are interpretable, revealing meaningful semantic components aligned with problem structure. Synthetic environment experiments further confirm that CCTS can recover ground-truth concept structures and learn to avoid low-utility concepts, validating its ability to discover useful semantic features.
This work significantly impacts the field by providing a structured, interpretable, and scalable approach to AI-assisted algorithm discovery. It addresses key challenges in leveraging LLM internal representations and opens pathways for future integration of multi-modal data, reinforcement learning, and broader scientific applications. Despite some computational costs and dependency on concept extraction quality, the framework offers a promising direction for advancing automated reasoning and scientific discovery with AI.
Deep Analysis
Background
The evolution of large language models (LLMs) such as GPT-4 and PaLM has revolutionized natural language processing and program synthesis. Early efforts like FunSearch and AlphaEvolve integrated LLMs into evolutionary algorithms for program generation, achieving notable success in mathematical and combinatorial problems. However, these approaches largely relied on black-box fitness signals, limiting their efficiency and interpretability. Recent research emphasizes the importance of structuring the search space, leveraging semantic representations, and incorporating contrastive learning to better exploit LLM internal knowledge. Despite progress, fully harnessing the potential of LLMs for algorithm discovery remains an open challenge, especially in complex, poorly understood problem domains.
Core Problem
Current algorithm discovery methods predominantly depend on fitness-based selection within unstructured program spaces, which hampers efficiency and scalability. The lack of explicit semantic or hierarchical organization prevents the search from effectively navigating the vast, irregular space of programs. As a result, the discovery process is often slow, opaque, and prone to getting stuck in local optima. Developing a method that explicitly models the semantic structure of algorithms could significantly improve search guidance, interpretability, and the ability to generalize across tasks.
Innovation
The primary innovation is the integration of hierarchical semantic concepts into the search process via a contrastive learning framework. This involves constructing a dynamic concept tree, where each node encodes a semantic idea, and learning which concepts are associated with high performance. The method employs likelihood ratios derived from probabilistic models to bias parent node selection, effectively guiding the search toward promising regions. Additionally, the approach introduces exploration mechanisms to discover new concepts and avoid premature convergence. These innovations collectively enable a more structured, interpretable, and efficient search process compared to existing black-box methods.
Methodology
- �� Extract hierarchical concepts from generated programs using LLM prompts, organizing them into a dynamic tree structure.
- �� Use an external evaluator to assign performance scores to candidate programs.
- �� Fit probabilistic models (via cross-entropy updates) to high- and low-performing subsets of programs based on their concept features.
- �� Calculate likelihood ratios to reweight parent node selection, favoring concepts linked to better performance.
- �� Incorporate exploration strategies to introduce and emphasize underexplored or novel concepts during search.
- �� Combine multiple parent selection strategies (uniform, greedy, k-elites, CCTS) to balance exploration and exploitation.
- �� Generate new candidate programs conditioned on selected parent nodes and biased concept directives, iterating this process to improve solutions.
Experiments
Experiments focus on Erdős-style combinatorial problems, including circle packing and Heilbronn’s triangle problem. The framework compares CCTS with baseline methods like greedy, uniform, and k-elites, measuring average scores, convergence speed, and interpretability of concept trees. Multiple runs assess robustness. Synthetic environments simulate ground-truth concept structures, validating the model’s ability to recover and utilize meaningful semantic features. Hyperparameters such as iteration count, exploration probability, and concept model complexity are tuned for optimal performance. Results show CCTS consistently outperforms baselines across tasks, demonstrating faster convergence and higher-quality solutions.
Results
CCTS achieves over 15% higher average scores within the same iteration budget across multiple tasks, with a 20% reduction in convergence time compared to baselines. The learned concept trees are interpretable, capturing meaningful problem-specific structures. Synthetic experiments confirm the model’s ability to recover ground-truth concept utilities, emphasizing the importance of learning which concepts to avoid. Ablation studies reveal that the contrastive reweighting mechanism is critical for performance gains, and exploration strategies help discover novel concepts, further improving search outcomes.
Applications
This approach can be applied to automated algorithm design, mathematical problem solving, and scientific discovery, especially in domains where explicit semantic understanding is beneficial. It enables AI systems to generate interpretable, high-quality algorithms efficiently, reducing reliance on human expertise. The framework is adaptable to various problem types, including symbolic reasoning, combinatorics, and optimization tasks, and can be integrated into existing program synthesis pipelines for enhanced performance.
Limitations & Outlook
Dependence on accurate concept extraction limits effectiveness if semantic definitions are noisy or incomplete. Computational overhead increases with larger hierarchies and more complex models. The approach may struggle with tasks where the semantic structure is not well-defined or too sparse. Scalability to very large program spaces remains a challenge, requiring further optimization. Future work should focus on improving concept extraction robustness and reducing computational costs.
Plain Language Accessible to non-experts
想象你在厨房做饭,程序就像一道菜,而不同的调料和步骤代表各种概念。传统的方法就像随便放调料,试试味道好不好,效率很低。现在,这个新方法像是有个聪明的厨师,他知道哪些调料会让菜变得更好,哪些会让菜变得更差。厨师会建立一个调料的层次结构,把相关的调料放在一起,然后学习哪些组合最有效,避免用错调料。这样,厨师做菜就变得更快、更好吃,也更容易理解为什么这么做。这个方法让AI在自动发现好算法时,不仅追求结果,还能理解背后的“调料配比”,变得更聪明、更可靠。
ELI14 Explained like you're 14
想象你在玩一个超级复杂的拼图游戏,你要把很多不同的拼图片拼在一起,才能拼出一幅漂亮的画。以前的方法就像随机试拼,看到拼得差就换个地方,效率很低。现在,这个新方法像是有个聪明的朋友,他告诉你:哪些拼图片更容易拼出好画,哪些可能会让拼图变得更乱。这个朋友会建立一个拼图的层次树,帮你找到最有用的拼图片组合,避免浪费时间在没用的拼图上。这样,你就能更快拼出漂亮的画,也能理解为什么某些拼法更好。这就像让你的拼图游戏变得更聪明、更快、更有趣!
Abstract
Large language Model (LLM)-assisted algorithm discovery is an iterative, black-box optimization process over programs to approximatively solve a target task, where an LLM proposes candidate programs and an external evaluator provides task feedback. Despite intense recent research on the topic and promising results, how can the LLM internal representation of the space of possible programs be maximally exploited to improve performance is an open question. Here, we introduce Contrastive Concept-Tree Search (CCTS), which extracts a hierarchical concept representation from the generated programs and learns a contrastive concept model that guides parent selection. By reweighting parents using a likelihood-ratio score between high- and low-performing solutions, CCTS biases search toward useful concept combinations and away from misleading ones, providing guidance through an explicit concept hierarchy rather than the algorithm lineage constructed by the LLM. We show that CCTS improves search efficiency over fitness-based baselines and produces interpretable, task-specific concept trees across a benchmark of open Erdős-type combinatorics problems. Our analysis indicates that the gains are driven largely by learning which concepts to avoid. We further validate these findings in a controlled synthetic algorithm-discovery environment, which reproduces qualitatively the search dynamics observed with the LLMs.