FunL2O: LLM-Guided Feature Function Design for Learning to Optimize

Bingheng Li, Junyang Cai, Yupeng Zhang, Bistra Dilkina, Jayant Kalagnanam, Dzung T. PhanarXiv 2026

TL;DR

FunL2O introduces an automated framework that uses Large Language Models (LLMs) to design executable feature functions for Learning-to-Optimize (L2O) pipelines. By embedding an LLM in an evolutionary program-search loop, FunL2O generates optimized Python code for data preprocessing that consistently outperforms traditional hand-crafted features across both continuous and discrete optimization tasks.

What Problem Does This Paper Address?

Learning-to-Optimize (L2O) methods use machine learning to accelerate traditional optimization solvers by predicting solutions, warm starts, or branching decisions. However, a major bottleneck in these pipelines is the feature function—the component that translates raw optimization problem data into tensors that neural networks can understand.

Historically, these feature functions have been manually hand-crafted and kept fixed across domains. Designing them is difficult because it isn't just about selecting features; it requires writing executable code that respects complex mathematical invariants, maintains strict dimensional shapes, and avoids information leakage (e.g., accidentally using target solutions during training). FunL2O addresses this gap by automating the discovery of these feature functions, shifting the burden from manual engineering to algorithmic evolution.

Methods

FunL2O utilizes an "L2O-in-the-loop" evolutionary program search inspired by DeepMind's FunSearch. The process operates as follows:

  1. Specification & Prompting: The framework defines a pipeline-specific Semantic Contract that outlines available data fields, required output formats, and invariants. This contract, along with a vocabulary of optimization concepts, forms the prompt for the LLM.
  2. Program Generation & Validation: The LLM proposes candidate feature functions written in executable Python code. A validator checks these candidates statically and dynamically (using a small probe instance) to ensure they satisfy the semantic contract. Invalid programs are discarded or sent back for repair.
  3. Evaluation via Retraining: Valid candidate programs replace the original feature function in the L2O pipeline. Crucially, the underlying L2O model is retrained from scratch using the new feature representation, and its performance is measured using downstream solver metrics (like objective gap or iteration savings).
  4. Update & Selection: The highest-performing programs are added to a program pool, which serves as the "elite context" to guide the LLM in generating the next generation of features.

Importantly, once the search is complete, the chosen feature function is deployed as standard Python preprocessing code. No LLM is required at deployment time.

Figure 1: FunL2O searches over executable feature functions. Each proposal must satisfy a pipeline-specific semantic contract, after which the original L2O model is retrained and evaluated. Measured optimization outcomes determine the elite programs supplied to the next generation.

Datasets and Tasks

The authors evaluated FunL2O across eight distinct L2O pipelines spanning continuous and discrete optimization problems:

  • Linear Programming (LP) Solution Prediction: Evaluated using the IPM-MPNN architecture across five combinatorial problem distributions (Independent Set, Set Cover, Combinatorial Auction, Facility Location, and GNNLP).
  • Constrained Solution Prediction: Tested on FSNet and DC3 frameworks across nine 1,000-variable quadratic programming (QP), quadratically constrained quadratic programming (QCQP), and second-order cone programming (SOCP) tasks.
  • Solver-Facing Roles: Applied to PDHG-Net (PageRank LP warm starts), Smart Initial Basis, and Learning to Pivot (simplex pivot scores).
  • Mixed-Integer Linear Programming (MILP): Evaluated on Predict-and-Search and Learned Backdoors branching tasks using Combinatorial Auction (CA), Maximum Independent Set (MIS), and Minimum Vertex Cover (MVC) instances.

Key Insights and Ideas

  • Representation is a Powerful Lever: Without changing the neural network architecture, loss functions, training schedules, or the downstream solvers, simply optimizing the input representation yielded massive performance gains.
  • Semantic Structure > Dimensionality: To prove the LLM wasn't just winning by making the feature vectors wider, the authors ran "matched-width" controls using random projections. The evolved features significantly beat the random controls, demonstrating that the LLM discovered genuinely useful mathematical relationships (such as normalizing variable costs by column coverage).
  • LLM-Agnostic Success: The framework successfully improved performance using four different frontier models: Claude-Opus-4.8, GPT-5.5, Gemini-3.1-Pro, and DeepSeek-Math-V2, showing that the method is robust to the choice of the underlying generator.

Key Results

Across all continuous and discrete tasks, the evolved feature functions consistently outperformed hand-crafted baselines:

  • Continuous Optimization: On IPM-MPNN, FunL2O reduced the median objective gap by up to 49.4% (on Set Cover). For highly complex nonconvex SOCP problems in FSNet, the optimality gap plummeted from 933.85% to 141.28%, while simultaneously boosting feasibility rates from 0.25 to a perfect 1.00.
  • Solver Efficiency: For PDHG-Net, iteration savings increased from 42.44% to 51.05%. In simplex pivoting, the geometric mean of the pivot count dropped by 26.2%.
  • Mixed-Integer Search: In MILP backdoor branching, FunL2O significantly reduced the mean wall time across all domains, cutting Maximum Independent Set (MIS) solver time from 59.1 seconds down to 46.0 seconds.
Table 2: Results across continuous-optimization L2O pipelines. Prediction gaps and solver costs are lower-is-better; saving metrics and accuracy are higher-is-better. Prediction results show clean-test medians over four paired searches. Feasibility is reported as handcrafted to FunL2O. Positive IR always denotes improvement.

Limitations and Future Work

The primary limitation of FunL2O is its high offline computational cost. Because evaluating a single candidate feature function requires retraining the entire L2O model from scratch and running downstream solvers, a full search can take dozens of GPU/CPU hours. While this cost is safely amortized in repeated-optimization deployment scenarios, making the search loop more sample-efficient remains an open challenge.

Additionally, the authors utilized a relatively simple evolutionary loop (relying primarily on prompt context rather than complex crossover/mutation operators), suggesting that integrating more sophisticated genetic algorithms could yield even stronger representations in future iterations.

Summary updated

BibTeX
@misc{li2026funl,
  author = {Bingheng Li and Junyang Cai and Yupeng Zhang and Bistra Dilkina and Jayant Kalagnanam and Dzung T. Phan},
  title = {{FunL2O: LLM-Guided Feature Function Design for Learning to Optimize}},
  year = {2026},
  eprint = {2607.27389},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.27389},
}
Figure