窥探黑箱内部:通过组件级评估揭示LLM在优化建模中的错误
Peering Inside the Black Box: Uncovering LLM Errors in Optimization Modelling through Component-Level Evaluation
AI总结:
本文提出组件级评估框架,从变量、约束、目标与效率等维度诊断LLM优化建模错误,并揭示约束召回率、RMSE和输出简洁性的关键作用。
摘要:
大语言模型(LLM)正越来越多地被用于将自然语言描述转换为数学优化公式。当前评估通常将公式视为整体,依赖解的准确率或运行时间等粗粒度指标,从而掩盖了结构性或数值错误。在本研究中,我们提出了一个全面的、针对LLM生成公式的组件级评估框架。除传统的最优性差距外,该框架还引入了决策变量与约束的精确率和召回率、约束与目标均方根误差(RMSE),以及基于token使用量和延迟的效率指标。我们在六种提示策略下,跨不同复杂度的优化问题评估了GPT-5、LLaMA 3.1 Instruct和DeepSeek Math。结果表明,GPT-5始终优于其他模型,而思维链、自洽性和模块化提示被证明最为有效。分析表明,求解器性能主要取决于高约束召回率和低约束RMSE,二者共同确保结构正确性和解的可靠性。约束精确率和决策变量指标发挥次要作用,而简洁的输出可提升计算效率。这些发现凸显了NLP到优化建模的三项原则:(i)完整的约束覆盖可防止违约,(ii)最小化约束RMSE可确保求解器层面的准确性,(iii)简洁输出可提高计算效率。所提出的框架为优化建模中LLM的细粒度诊断评估奠定了基础。
英文摘要:
Large language models (LLMs) are increasingly used to convert natural language descriptions into mathematical optimization formulations. Current evaluations often treat formulations as a whole, relying on coarse metrics like solution accuracy or runtime, which obscure structural or numerical errors. In this study, we present a comprehensive, component-level evaluation framework for LLM-generated formulations. Beyond the conventional optimality gap, our framework introduces metrics such as precision and recall for decision variables and constraints, constraint and objective root mean squared error (RMSE), and efficiency indicators based on token usage and latency. We evaluate GPT-5, LLaMA 3.1 Instruct, and DeepSeek Math across optimization problems of varying complexity under six prompting strategies. Results show that GPT-5 consistently outperforms other models, with chain-of-thought, self-consistency, and modular prompting proving most effective. Analysis indicates that solver performance depends primarily on high constraint recall and low constraint RMSE, which together ensure structural correctness and solution reliability. Constraint precision and decision variable metrics play secondary roles, while concise outputs enhance computational efficiency. These findings highlight three principles for NLP-to-optimization modeling: (i) Complete constraint coverage prevents violations, (ii) minimizing constraint RMSE ensures solver-level accuracy, and (iii) concise outputs improve computational efficiency. The proposed framework establishes a foundation for fine-grained, diagnostic evaluation of LLMs in optimization modeling.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。