OptWeaver: Learning What to Remember for Optimization Modeling
Abstract
Large language models have advanced automatic optimization modeling from natural-language descriptions. Recent knowledge-augmented methods improve performance by retrieving relevant knowledge from solved problems. However, retrieval relevance does not guarantee modeling applicability or specify how the retrieved knowledge should participate in model construction. Moreover, knowledge updates after failures may not match the localized source of the error. We propose OptWeaver, a bidirectional framework that organizes accumulated modeling knowledge into reusable skills for forward model construction and backward knowledge evolution. For each problem, OptWeaver first adapts reusable skills into temporary task-specific guidance. It then turns this guidance into concrete modeling decisions and weaves them through mathematical dependencies into a modeling graph for solver code generation. When execution fails, OptWeaver traces the same construction structure backward to localize the responsible source and guide targeted repair. Reusable principles distilled from validated repairs are incorporated into the skill system for reuse, with changes localized to relevant modeling knowledge. This design makes knowledge use explicit during model construction and aligns knowledge updates with the attributed source of modeling failures. Across six benchmarks, OptWeaver achieves an average accuracy of 78.35%, exceeding the strongest average baseline by 6.40%. The learned skills also transfer across model families, model scales and modeling frameworks.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.