LLM as a Tool, Not an Agent: Code-Mined Tree Transformations for Neural Architecture Search

arXiv:2604.16555 · cs.LG, cs.AI, cs.CV · Submitted 2026-04-17 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: We're looking at the paper: "LLM as a Tool, Not an Agent".

Jane: Detailed Research Summary of LLMasTool: A Hybrid NAS Framework for Open-Ended Architecture Search As a diligent researcher,

Tom: First, who's behind it and why it matters.

Paper summary: Tom: So we’re talking about this paper now called "LLM as a Tool, Not an Agent: Code-Mined Tree Transformations for Neural Architecture Search". Basically they’re saying current AI tools that try to design whole architectures are messy and biased.

Jane: That sounds like a big problem because designing models is supposed to be automated, right? So what’s the main idea here for this paper?

Tom: The core thesis is that we shouldn't treat the LLM as an autonomous architect that just spits out a finished design. Instead, it’s better used as a tool inside a solid algorithmic structure.

Lu: Exactly. They argue that conventional search methods are too restricted, and agentic LLMs aren't reliable enough to guarantee you get something actually buildable for your computer to run >

Meng: So what’s the mechanism they use instead of just letting the LLM design everything? How do they keep it controlled?

Tom: They propose a framework called LLMasTool which uses hierarchical trees to represent the architectures. This lets them do reliable tree transformations instead of relying on messy code generation >

Jane: Hierarchical trees sound more structured than just looking at lines of code. Can you explain what that means for building a neural network?

Lu: It means they start by mining reusable modules from arbitrary source code to build a module database, which acts as the foundation for the search space >

Lalam: And this module database feeds into the tree representation where full architectures are built as these hierarchical trees, allowing evolution through tree transformations rather than just code generation >

Tom: So they take an existing structure, say a ResBlock or a ConvBlock from some source code, and they can swap, insert, or delete parts of it using these defined rules >

Jane: It sounds like they are using the LLM to help with the fine-grained stuff while the algorithm handles the big picture choices. Is that right?

Tom: That’s spot on. At each step of evolution, they have a coarse-level planning guided by a diversity-guided algorithm using Bayesian modeling to improve exploration efficiency >

Meng: How does that Bayesian part help them explore better when you don't want to just try everything randomly? What are the numbers we can look at?

Tom: They use Hierarchical Bayesian-Thompson Sampling, which they say improves the efficiency of open-ended exploration by using a history of past transformations within the tree structure >

Jane: So it’s not just throwing random ideas at it; it’s learning from what worked in previous steps during the search process >

Lu: The authors are showing that this approach bridges reliable algorithmic evolution with LLM assistance for stable and open-ended model evolution, moving past the limitations of current agentic approaches >

Tom: And on the results side, they show improvements over existing NAS methods. They claim gains of zero point six nine points on CIFAR-ten one point eight three points on CIFAR-one hundred and two point six eight points on ImageNet16-one hundred twenty >

Meng: Those are decent gains compared to the baselines they ran, but we have to remember those are just benchmarks. What about the limitations they admit? Where does this system stop working?

Jane: They mention that LLM-driven NAS often suffers from limited controllability and difficulty guaranteeing executability for complex designs, especially when the LLM is used as an autonomous agent for end-to-end generation >

Tom: And they also flag that proposals from LLMs tend to be biased toward recurring patterns in their training corpus, which limits truly open-ended exploration >

Lalam: They make it clear they aren't trying to merge the two paradigms into one thing, but integrating them through this tree representation is what makes the stability work >

Jane: So if I’m listening just for my commute or cooking instructions, what does this actually change for me?

Lu: It means we are getting architectures that are more robust and stable because they pass a check for executability via those tree transformations, not just a text prompt >

Tom: Basically, they prove that using the LLM as a precise editing tool inside an executable framework is better than letting it be the sole generator >

Meng: For deployment at scale, I’m still worried about how much work goes into building that initial module database and how stable those tree transformations are when you have millions of architectures to test >

Jane: That’s a fair point. So, what do we actually get from this paper as a concept for the future of AI design?

Lu: It suggests that instead of chasing full autonomy from the LLM, we should focus on creating these structured frameworks where the LLM assists with local decisions inside those constraints >

Tom: Yeah, so it’s about using code mining to get reliable starting points and then using that structure to guide a more intelligent search process >

Meng: It’s still complex setup work, but it shows a clear way to get better performance on those specific image classification tasks they tested, like ImageNet16-one hundred twenty >

Jane: We’ve seen how this paper uses code mining and tree representations to make the search space manageable and executable, which is a big step for practical AI design.

Conclusion: Tom: So we’re looking at the conclusion of this paper, "LLM as a Tool, Not an Agent: Code-Mined Tree Transformations for Neural Architecture Search." Basically, they're wrapping up how they used LLMs to search for neural network designs.

Jane: They’re arguing that you shouldn't just think of the LLM as a robot that builds the whole thing from scratch. They want it to be a precise tool working within a structured system.

Lu: That’s right, they re-framed the whole search process around tree transformations instead of just asking the LLM for code generation. It’s about controlled evolution.

Meng: So what does this mean for us when we're actually shipping models? Does it solve the problem of getting architectures that are reliable and executable?

Tom: It tackles that directly by using these tree structures, which guarantees validity through transformation rules rather than hoping the LLM writes perfect code.

Jane: It also uses a mix of things to guide the search. The algorithm handles the big picture exploration, and then the LLM just fills in the small gaps for those specific steps.

Lalam: I’m confident in this direction because it builds on established ways we represent architectures, but it adds that layer of executable constraint that current agentic systems lack.

Tom: They showed performance gains on CIFAR-ten and ImageNet16-one hundred twenty which is the number you have to look at. It proves the structure helps exploration more than just letting the LLM run wild.

Lu: The real impact here is showing that this hybrid approach—combining rule-based mining with LLM assistance in a tree framework—is a much more stable way to do open-ended NAS.

Jane: So, for someone who only listens, it means we’re looking at architectures that are more predictable and less likely to fail when we try to deploy them.

Meng: It still seems like there's a lot of setup work involved in building that initial module database before you can even start the search process.

Tom: Yeah, yeah, the infrastructure cost is real, but they proved the methodology works for getting those better results on standard tasks.

Lu: The future direction here is seeing how we scale these tree transformations across much larger models and more complex architectures.

Sony Group Corporation

cs.LG, cs.AI, cs.CV

Submitted: 2026-04-17

Updated: 2026-10-19

Comments: 58 pages

Code: https://github.com/huggingface/pytorch-image-models

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 84/100

The gist: Detailed Research Summary of LLMasTool: A Hybrid NAS Framework for Open-Ended Architecture Search As a diligent researcher, I have meticulously analyzed the provided text snippets from the arXiv

Key concepts

Hierarchical Tree Representation
Architectures are structured like trees where nodes represent components and branches represent connections. This structure allows for precise, rule-based modifications rather than free-form text generation. It makes it possible to perform valid, executable edits on the architecture step-by-step.
Algorithm-Based Module Mining
This component automatically searches arbitrary source code to identify and extract reusable neural network modules. This process builds a reliable foundation for the search space by providing pre-defined, high-quality building blocks that can be reliably integrated into new architectures.
Coarse-to-Fine Evolution Strategy
The search process is split into two parts: a coarse level guided by an algorithm using Bayesian modeling for broad exploration, and a fine level where the LLM assists in resolving the remaining small details. This balances algorithmic control with LLM flexibility to ensure meaningful evolutionary steps.

Terminology

Summary

Detailed Research Summary of LLMasTool: A Hybrid NAS Framework for Open-Ended Architecture Search

As a diligent researcher, I have meticulously analyzed the provided text snippets from the arXiv paper concerning LLMasTool, which introduces a novel Neural Architecture Search (NAS) framework designed to bridge the gap between reliable algorithmic search and the generative power of Large Language Models (LLMs). This summary integrates the core concepts, contributions, methodology, and empirical results presented in both sections to provide a comprehensive understanding of this state-of-the-art approach.

Core Problem and Motivation

The fundamental challenge addressed by LLMasTool lies in the limitations of existing NAS methods:

  1. Conventional Algorithm-Driven NAS: These methods rely on hand-crafted search spaces, which inherently restrict open-ended exploration and manual design effort.

  2. Agentic LLM Approaches (e.g., LLMatic, LeMo-NADe): While leveraging LLMs to reduce manual design, current implementations struggle to reliably generate complex, valid architectures. Furthermore, their proposals are often biased toward narrow patterns observed in the training data of the underlying LLM.

The authors aim to create a framework that harnesses the strengths of both paradigms: the reliability and structure of algorithmic search and the flexibility and knowledge incorporation capabilities of LLMs, without allowing the LLM to become an autonomous, potentially unreliable, architecture generator.

The LLMasTool Framework: A Hybrid Architecture

LLMasTool is introduced as a hybrid NAS framework characterized by a fundamental shift in how architectural evolution is conceptualized. Instead of relying on direct code generation by the LLM, it defines the evolution step as a tree transformation. This representation provides three critical advantages:

  1. Precise and Executable Edits: Representing architectures as hierarchical trees allows for precise, rule-based transformations that ensure the resulting architecture is executable and valid.

  2. Seamless Knowledge Reuse: Existing research knowledge can be directly incorporated as pre-defined sub-trees (modules), enabling the seamless integration of well-established components into the search space.

  3. Structured Construction: Complex architectures can be constructed in a concise and highly structured manner through these tree operations.

The framework is built upon three synergistic, core components:

1. Algorithm-Based Module Mining (Rule-Based Component):

This component constructs a reliable and diverse search space by automatically extracting reusable modules from arbitrary source code. This provides the necessary constraint and diversity foundation for the search process, moving beyond purely LLM-driven suggestions.

2. Deploy-Friendly Tree Representation:

This is the structural backbone of LLMasTool, enabling precise, executable transformations on DNN architectures represented as hierarchical trees. This structure is key to allowing coarse-grained decisions to be managed by the algorithm while ensuring fine-grained edits are valid and efficient.

3. Coarse-to-Fine Evolution Strategy (Hybrid Planning):

This strategy governs the search process and is the mechanism for balancing algorithmic control with LLM flexibility:

  • Coarse-Level Planning (Algorithm Guided): High-level exploration is guided by a diversity-guided algorithm, which leverages Bayesian modeling to improve exploration efficiency. This ensures broad coverage and prevents premature convergence.

  • Fine-Grained Edits (LLM Assisted): The LLM is employed not as an autonomous generator, but as a tool to resolve the remaining degrees of freedom within the tree transformation steps, ensuring that the evolved architecture maintains validity and achieves a meaningful evolutionary trajectory.

Key Methodological Innovations

The synergy between these components is what drives the method's superior performance. The authors explicitly state that the performance gain does not originate from the LLM alone, but from this interplay:

Performance Gain proportional to Synergy between (1) Module Mining, (2) Tree Representation, and (3) Coarse-to-Fine Planning with Bayesian Sampling.

Furthermore, they introduce a sophisticated mechanism to enhance exploration efficiency:

  • Hierarchical Bayesian-Thompson Sampling: By observing that the coarse-to-fine decision making naturally induces a hierarchical history of decisions within the tree structure, the authors leverage this structure to introduce Hierarchical Bayesian-Thompson Sampling. This technique significantly improves the efficiency of open-ended exploration by intelligently guiding subsequent steps based on past transformations.

The framework achieves an efficient exploration–exploitation trade-off without being rigidly committed to any single heuristic, balancing rule-based algorithmic rigor with LLM flexibility.

Empirical Results and Conclusion

LLMasTool has demonstrated significant efficacy in open-ended NAS:

  • Performance Gains: The method achieved state-of-the-art results, yielding performance improvements of 0.69 points on CIFAR-10, 1.83 points on CIFAR-100, and 2.68 points on ImageNet16-120.

  • State-of-the-Art Achievement: The framework achieves state-of-the art results, significantly outperforming previous methods in openended NAS.

  • Validation of Coarse Planning: The results confirm that the coarse-to-fine decision making remains crucial even under standard training settings, underscoring the necessity of exploration that is not constrained by inherent LLM biases.

**In conclusion, LLMasTool represents a fundamental departure from direct architecture generation methods (like LLMatic or LeMo-NADe). By reformulating the search process as a sequence of tree transformations guided by rule-based algorithms and augmented by an LLM acting as a precise editing tool, it successfully balances algorithmic control with generative flexibility to achieve superior, state-of-the-art performance in open-ended NAS.

Improvements for AI systems

  1. Bold header: Integration of LLMs as tools in a hierarchical tree-based NAS framework enables stable and open-ended model evolution. This allows architectures to be evolved through reliable tree transformations rather than code generation, which circumvents the current limitation where current LLMs struggle to reliably generate complex, valid architectures.

  2. Bold header: The coarse-to-fine decision framework utilizes a hybrid approach where a diversity-guided algorithm leverages Bayesian modeling for coarse planning, while the LLM resolves the remaining degrees of freedom to ensure a meaningful evolutionary trajectory and an executable generated architecture. This prevents exploration from being entirely biased toward a narrow set of patterns observed in their training data.

  3. Bold header: Automated module mining from arbitrary source code constructs a reusable module database by inspecting constructor arguments, which allows the search process to manipulate hyperparameters such as channel width, kernel sizes, and internal modules. This directly facilitates the direct reuse of existing implementations and knowledge assets without relying on LLM memorization.

  4. Bold header: The architecture is represented as a deploy-friendly hierarchical tree, which simplifies the integration of complex human-written code blocks by allowing for a top-down design process, making it easy to start with a rough architecture and progressively refine its details.

  5. Bold header: A novel hierarchical Bayesian-Thompson sampling scheme is introduced, which balances exploration and exploitation by accumulating historical outcomes at upper layers to guide decision-making. This prevents the search from becoming too sparse to enable anything beyond random sampling, leading to a more efficient exploration–exploitation trade-off.

  6. Bold header: The system can perform state-of-the-art results, improving performance by 0.69, 1.83, and 2.68 points on CIFAR-10, CIFAR-100, and ImageNet16-120, demonstrating effectiveness across various benchmark datasets under open-ended NAS settings.

Abstract

Neural Architecture Search (NAS) aims to automatically discover high-performing deep neural network (DNN) architectures. However, conventional algorithm-driven NAS relies on carefully hand-crafted search spaces to ensure executability, which restricts open-ended exploration. Recent coding-based agentic approaches using large language models (LLMs) reduce manual design, but current LLMs struggle to reliably generate complex, valid architectures, and their proposals are often biased toward a narrow set of patterns observed in their training data. To bridge reliable algorithmic search with powerful LLM assistance, we propose LLMasTool, a hierarchical tree-based NAS framework for stable and open-ended model evolution. Our method automatically extracts reusable modules from arbitrary source code and represents full architectures as hierarchical trees, enabling evolution through reliable tree transformations rather than code generation. At each evolution step, coarse-level planning is governed by a diversity-guided algorithm that leverages Bayesian modeling to improve exploration efficiency, while the LLM resolves the remaining degrees of freedom to ensure a meaningful evolutionary trajectory and an executable generated architecture. With this formulation, instead of fully agentic LLM approaches, our method explores diverse directions beyond the inherent biases in the LLM. Our method improves over existing NAS methods by 0.69, 1.83, and 2.68 points on CIFAR-10, CIFAR-100, and ImageNet16-120, demonstrating its effectiveness.

Sources

Related papers