arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.03227cs.AI
收藏

评估基于提示和执行的方法在LLM中确定性计算中的表现

Evaluating Prompting and Execution-Based Methods for Deterministic Computation in LLMs

Virginia Tech(弗吉尼亚理工学院)

Hongkun Yu

AI总结:

本文评估了多种提示策略在需要精确输出的任务中的表现,发现PoT通过生成可执行代码实现完美准确率,而其他方法存在误差积累或计算开销大等问题。

摘要:

大型语言模型(LLMs)在自然语言理解和推理方面表现出色,但其执行精确、确定性计算的能力尚不明确。本文系统评估了多种提示策略,包括链式思维(CoT)、由少到多分解、程序思维(PoT)和自一致性(SC),在需要精确无误输出的任务中,如二进制计数、最长子串检测和算术评估中的表现。为支持本研究,我们引入了一个合成数据集,包含多样化的自然语言指令,以在多种任务类型中控制评估精确计算。结果表明,标准提示方法在序列任务中仅能获得中等准确率。CoT提供有限的改进,而由少到多分解则因误差累积而受损。相比之下,PoT通过生成可执行代码并将其委托给外部解释器,实现了完美准确率。自一致性通过多数投票提高鲁棒性,但带来显著的计算开销。我们进一步训练了一个小型领域专用模型(CodeT5-small)来生成可执行程序,该模型在所有任务上的保留合成测试数据中实现了完美准确率,且训练成本极低。总体而言,我们的发现表明LLMs可能模拟推理模式而非可靠执行精确符号计算。对于确定性任务,结合LLMs与外部工具或使用专用模型提供了更可靠和高效的解决方案。

英文摘要:

Large Language Models (LLMs) have demonstrated strong capabilities in natural language understanding and reasoning. However, their ability to perform exact, deterministic computation remains unclear. In this work, we systematically evaluate multiple prompting strategies, including Chain-of-Thought (CoT), Least-to-Most decomposition, Program-of-Thought (PoT), and Self-Consistency (SC), on tasks requiring precise and error-free outputs, including binary counting, longest substring detection, and arithmetic evaluation. To support this study, we introduce a synthetic dataset with diverse natural language instructions, enabling controlled evaluation of exact computation across multiple task types. Our results show that standard prompting methods achieve only moderate accuracy on sequence-based tasks. CoT provides limited improvement, while Least-to-Most suffers from error accumulation. In contrast, PoT achieves perfect accuracy by generating executable code and delegating computation to an external interpreter. Self-Consistency improves robustness through majority voting, but incurs substantial computational overhead. We further train a small domain-specific model (CodeT5-small) to generate executable programs, which achieves perfect accuracy on held-out synthetic test data across all tasks with minimal training cost. Overall, our findings suggest that LLMs may simulate reasoning patterns rather than reliably perform exact symbolic computation. For deterministic tasks, combining LLMs with external tools or using specialized models provides a more reliable and efficient solution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑