TL;DR
Traditional AutoML tools restrict their search to a rigid, predefined menu of algorithms and hyperparameters, returning complex, hard-to-edit framework objects. This paper introduces LACE (LLM-Automated Code Evolution), a framework that uses a Large Language Model (LLM) within an evolutionary loop to generate and refine complete, executable Python pipeline classes. LACE matches the performance of state-of-the-art AutoML systems while delivering fully transparent, human-editable code that practitioners can modify and reuse directly.
What Problem Does This Paper Address?
Automated Machine Learning (AutoML) has drastically simplified model development, but existing approaches suffer from two major limitations:
- Rigid Search Spaces: Systems like
auto-sklearnorAutoGluonoperate within a fixed grammar of curated preprocessors and learners. They can tune hyperparameters but cannot invent novel pipeline structures or write custom logic outside their predefined boundaries. - Black-Box Outputs: Traditional AutoML tools return complex, framework-specific fitted objects. If a data scientist wants to tweak a specific preprocessing step or alter an ensemble's voting weights in production, they must navigate cumbersome framework APIs rather than editing clean, standalone code.
Furthermore, recent attempts to use LLMs as end-to-end data science agents often suffer from benchmark contamination (the LLM recognizing a public dataset by name and recalling the optimal pipeline from its training data) or hidden optimization loops. LACE addresses these challenges by treating code itself as the search space while strictly controlling the information boundary to prevent data leakage.
Methods
LACE combines evolutionary computation with the code-generation capabilities of LLMs using a $(\mu + \lambda)$ evolutionary loop (specifically setting $\mu = 4$ parents and $\lambda = 12$ offspring).
The process unfolds in several key steps:
- Leakage-Controlled Prompting: To prevent dataset recognition, the LLM (acting as the variation operator) is only given a coarse, non-identifying task summary (e.g., "binary classification, ~5,000 samples, mostly numeric"). It never sees dataset names, feature names, or raw data.
- Code Generation: The LLM outputs a standalone,
scikit-learn-compatible Python class implementing a simple__init__(fit) and__call__(predict) interface. - Isolated Evaluation: Each candidate program is executed in an isolated subprocess on inner-validation splits. If the code throws an error, the raw traceback and line number are captured and fed back to the LLM as debugging context for the next generation.
- Elitist Truncation: Pipelines are scored based on validation performance, and the best programs are retained to seed the next generation with random mutation instructions (e.g., "refine the preprocessing" or "add/remove a base model").
Datasets
The authors evaluated LACE across all 68 classification tasks in the standardized amlb-classification-all OpenML benchmark suite. This suite spans a diverse range of tabular datasets, scaling from 100 to nearly 5 million instances, and featuring up to 10,000 dimensions.
Key Insights and Ideas
- Code as an Infinite Search Space: Instead of optimizing parameters over a fixed grid, LACE allows the LLM to write custom prediction-combination logic directly in NumPy or Python. For instance, it can explicitly hardcode custom weights for an ensemble of an SVC and a Random Forest, which a human engineer can later inspect and manually adjust.
- Prompts Shape the Search Space: An ablation study revealed that the effective search space is defined by what components are announced in the prompt, not just what packages are installed. When the authors explicitly mentioned the availability of a tabular foundation model (
TabPFN), the LLM immediately began creatively embedding it into voting ensembles. - Self-Correction via Feedback: Evolutionary feedback effectively "fixes" broken code. While first-shot LLM generations frequently failed or threw syntax/runtime errors (especially with weaker open-source models), the evolutionary loop achieved a 100% recovery rate, ensuring every final pipeline returned was valid and executable.
Key Results
The authors evaluated LACE using three LLM backbones: GPT-5.4-mini, DeepSeek-V4-Flash, and Qwen3-Coder-Next.
- Competitive Performance: LACE powered by
GPT-5.4-minisignificantly outperformed mature AutoML baselines likeauto-sklearnandH2O, as well as an untunedXGBoostbaseline. It achieved statistical parity withAutoGluon, the strongest search-based baseline evaluated. - Full Benchmark Coverage: While newer tabular foundation models (like
TabPFNandTabICL) achieved higher raw accuracy on smaller datasets, they failed or timed out on larger, high-dimensional tasks. LACE maintained 100% coverage across the entire benchmark suite. - Continuous Improvement: The evolutionary loop drove steady gains throughout the run, with the median run realizing 91% of its eventual performance improvement by candidate 50.
Limitations and Future Work
- High Computational Cost: Evaluating 100 code candidates per task means fitting and scoring pipelines hundreds of times. For massive datasets, this can translate to dozens of wall-clock hours per run, though the authors note that adaptive or early-stopping budgets could mitigate this.
- Lack of Hyperparameter Tuning: Currently, LACE relies entirely on the default hyperparameter values chosen by the LLM in the generated code. Integrating an external numerical optimizer (like Optuna) to fine-tune the parameters of the LLM's proposed structure is a clear next step.
- Prompt-Based Constraints: Constraints (like avoiding internal cross-validation loops) are requested via the prompt rather than strictly enforced by the execution runtime. Static analysis revealed minor rule violations in a small percentage of final pipelines generated by weaker backbones.
Summary updated