Skip to main content
Back to timeline
arXivSource publication:

Optimization modeling drops fixed retrieval rules: COMPASS learns template traversal as a policy, with the largest accuracy gains on complex problems

Synopsis

Translating natural-language optimization problems into solver code hinges on the quality of template retrieval. Structured retrieval methods had relied on traversal rules that were fixed or decided by a language model at inference time, so retrieval could not improve from past successes and failures. COMPASS organizes the template library as a directed acyclic graph and uses a deep Q-network to learn a reusable traversal policy from template-level judgments and solver execution feedback, scoring newly inserted templates in a shared semantic space; across several LLM backbones and optimization-modeling benchmarks it consistently beats heuristic structured retrieval, with the largest gains on complex and mixed-category problems.

Source-provided article image: COMPASS: Composable Policy-Amortized Structured Search for LLM-Based Optimization Modeling
arXiv

Interpretation

Optimization-template retrieval becomes a policy that can be learned from modeling experience instead of a traversal rule fixed at inference time. Earlier structured methods organized modeling knowledge into hierarchical taxonomies, but their traversal rules were fixed at inference time or driven by the language model, so retrieval could not learn from which templates previously led to valid formulations, feasible solver runs, or execution failures. Across six optimization-modeling benchmarks and several LLM backbones, COMPASS improves consistently over heuristic structured retrieval, reaching 61.6 accuracy on MAMO-Complex with DeepSeek-V3 as the generation backbone versus 56.4 for the strongest retrieval baseline.

The system represents the template library as a directed acyclic graph and treats retrieval as a sequential decision process over template nodes. A deep Q-network learns a reusable traversal policy from template-level judgments and solver execution feedback, replacing fixed heuristic traversal. In a controlled comparison against DAG-Greedy, which shares the same template library, generator and executor, COMPASS is more accurate on every benchmark, 61.6 versus 54.5 on MAMO-Complex and 66.0 versus 63.0 on IndustryOR.

Problem descriptions and template nodes are embedded in one shared semantic space, so newly inserted templates can be scored directly from their text descriptions. The policy no longer binds to fixed template identifiers, so the template library can grow without redefining the action space. In paired McNemar tests on MAMO, COMPASS is significant against DAG-Greedy on both MAMO-Easy and MAMO-Complex at p=0.001, correcting 17 instances DAG-Greedy missed on MAMO-Complex while losing only 2.

Perspective

Evaluation covers six benchmarks, NL4Opt, MAMO-Easy, MAMO-Complex, LPWP, IndustryOR and OptMATH, with DeepSeek-V3 and GPT-5-mini as generation backbones and transfer to Qwen-32B, LLaMA-8B and DeepSeek-R1; all experiments use standardized prompt templates with a fixed structure.

The experiments cannot fully cover the diversity of real-world optimization tasks, solver interfaces, data formats and future language models; LLM-based optimization modeling also remains sensitive to prompt design, and prompt variation can affect problem interpretation, retrieved templates and generated solver code.