TL;DR
The RFTHGS framework demonstrates that a relatively small, fine-tuned 14B-parameter Large Language Model (LLM) can out-design human experts and massive models like GPT-4o in creating critical components for optimization solvers. By using reinforcement learning with a curriculum-based reward system, the framework evolves high-performance crossover operators for the Hybrid Genetic Search (HGS) algorithm, setting new state-of-the-art results for the Capacitated Vehicle Routing Problem (CVRP).
What Problem Does This Paper Address?
The Vehicle Routing Problem (VRP)—essentially deciding the most efficient way for a fleet of vehicles to deliver goods to customers—is a cornerstone of logistics and an NP-hard combinatorial optimization challenge. For decades, the "gold standard" has been Hybrid Genetic Search (HGS), a solver that uses human-expert-designed "crossover" operators to combine parent solutions into better offspring.
While LLMs have shown promise in "automated heuristic design," most current research relies on prompting massive, closed-source models like GPT-4. These models often struggle with "hallucinations" (generating code that doesn't work) and rarely outperform the best human-designed heuristics in specialized solvers. The authors tackle a fundamental question: Can we fine-tune a smaller, specialized LLM to actually beat human experts at their own game?
Methods
The authors introduce RFTHGS (Reinforcement learning framework for Fine-Tuning HGS), which treats the LLM as a strategic code generator within a closed-loop learning system.
- The Model: They use Qwen-14B, a medium-sized reasoning model, rather than a trillion-parameter giant.
- The RL Algorithm: They employ DAPO (an improved version of Group Relative Policy Optimization, or GRPO). This allows the model to learn from a "group" of generated outputs, comparing them against each other rather than an absolute baseline.
- Curriculum-Based Reward Function: To guide the LLM from generating invalid code to superior heuristics, they use a tiered reward system:
- Tier 1 (Compilability): Reward for code that successfully compiles.
- Tier 2 (Executability): Reward for code that runs without crashing or timing out.
- Tier 3 (Performance): A continuous reward based on how much the new operator reduces the error gap compared to the human-designed baseline.
- Anti-Plagiarism Cache: To prevent the model from simply copying the expert examples provided in the prompt, the authors use Abstract Syntax Trees (ASTs). This mechanism checks the underlying logic of the code; if the model just renames variables but keeps the same structure, it gets penalized.
- Incremental Compilation: To make training computationally feasible, they only recompile the modified operator rather than the entire solver library, speeding up the evaluation loop by 75%.
Datasets
- CVRPLIB (X instances): The standard industry benchmark for the Capacitated Vehicle Routing Problem.
- Training Set: 30 instances sampled from CVRPLIB with up to 400 nodes.
- Evaluation Set: Instances ranging from 100 to 1,000 nodes to test scalability and generalization.
- CVRPTW: A variant (with Time Windows) used to demonstrate the framework's flexibility.
Key Insights and Ideas
- Specialization Beats Scale: A 14B model fine-tuned specifically for C++ optimization tasks can produce more reliable and effective code than general-purpose giants like GPT-4o.
- The "Aha" Moment in Training: Around step 200 of the RL process, the model consistently crosses the "Expert Baseline," transitioning from merely making code work to discovering novel heuristics that humans hadn't implemented.
- Structural Diversity: The AST-based cache is crucial. Without it, LLMs tend to converge on "safe" but unoriginal solutions. Forcing structural diversity leads to the discovery of more complex, high-performing logic.
- Generalization is Real: Even though the model was trained on problems with fewer than 400 nodes, the operators it designed performed even better on massive 1,000-node problems, proving the logic is robust across scales.
Key Results
- Superior Performance: RFTHGS outperformed the original human-designed HGS across all problem sizes. For 1,000-node instances, it achieved a significantly lower error gap (2.09%) compared to the original HGS (2.32%).
- Reliability: RFTHGS achieved a 100% successful compilation rate (16/16) in testing, whereas GPT-4o and GPT-4o-mini hovered around 18% (3/16).
- Beating NCO Baselines: It surpassed leading Neuro-Combinatorial Optimization (NCO) methods and other LLM-based prompting methods (like ReEvo and EoH) by substantial margins.
- Cross-Operator Success: The framework also successfully optimized the "subpopulation" operator, showing it isn't limited to just crossover logic.
Limitations and Future Work
- Computational Cost: Training required approximately 98 GPU hours per device, which is significant for a 14B model.
- Scope: The current work focuses on two specific operators within HGS. The authors suggest extending this to other modules within the solver.
- Safety: As with any LLM-generated code, there is a risk of subtle bugs. While the tiered reward system filters out crashes, formal verification of the generated heuristics remains a future challenge.
- Expansion: The authors plan to apply this framework to other types of VRPs, such as Electric VRPs or Pickup and Delivery problems.
Summary updated