arXiv:2509.14093cs.SEcs.AI2025-09被引 8

让大模型推理更高效:自动压缩思维链,不降准确率。

Reasoning Efficiently Through Adaptive Chain-of-Thought Compression: A Self-Optimizing Framework

  • 通过自适应过滤和采样,动态压缩思维链长度。
  • 平均缩短42.1%输出,降低5倍延迟,减少截断与死循环。
  • 适合对效率和确定性要求高的代码生成任务。

思维链(CoT)推理通过提示中间步骤提升大语言模型在算术、逻辑和常识任务中的准确性与鲁棒性,但带来高计算开销:更长输出导致延迟增加、内存与键值缓存占用上升。在软件工程任务中,简洁确定的输出尤为重要。我们基于代码生成基准开展实证研究,发现更长的思维链并不总有效:过度推理常引发截断,准确率下降,延迟最高达五倍,失败输出始终比成功输出更长。这挑战了‘更长推理更好’的假设,凸显自适应控制的必要性。为此,我们提出SEER(自增强高效推理)框架,结合Best-of-N采样与任务感知自适应过滤,根据预推理输出动态调整阈值,以减少冗余与计算负担。在三个软件工程任务和一个数学任务上评估显示,SEER平均缩短思维链42.1%,减少截断,消除多数无限循环。结果表明,SEER是提升CoT增强型大模型效率与鲁棒性的实用方案,尤其适用于资源受限场景。

原文摘要 · Abstract (English)

Chain-of-Thought (CoT) reasoning enhances Large Language Models (LLMs) by prompting intermediate steps, improving accuracy and robustness in arithmetic, logic, and commonsense tasks. However, this benefit comes with high computational costs: longer outputs increase latency, memory usage, and KV-cache demands. These issues are especially critical in software engineering tasks where concise and deterministic outputs are required. To investigate these trade-offs, we conduct an empirical study based on code generation benchmarks. The results reveal that longer CoT does not always help. Excessive reasoning often causes truncation, accuracy drops, and latency up to five times higher, with failed outputs consistently longer than successful ones. These findings challenge the assumption that longer reasoning is inherently better and highlight the need for adaptive CoT control. Motivated by this, we propose SEER (Self-Enhancing Efficient Reasoning), an adaptive framework that compresses CoT while preserving accuracy. SEER combines Best-of-N sampling with task-aware adaptive filtering, dynamically adjusting thresholds based on pre-inference outputs to reduce verbosity and computational overhead. We then evaluate SEER on three software engineering tasks and one math task. On average, SEER shortens CoT by 42.1%, improves accuracy by reducing truncation, and eliminates most infinite loops. These results demonstrate SEER as a practical method to make CoT-enhanced LLMs more efficient and robust, even under resource constraints.

思维链推理优化大模型代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。