arXiv:2411.19943cs.CLcs.AI2024-11ICML被引 89

找出影响大模型推理出错的关键词元,提升数学逻辑能力

Critical Tokens Matter: Token-Level Contrastive Estimation Enhances LLM's Reasoning Capability

  • 通过滚动采样定位推理路径中关键词元
  • 在GSM8K和MATH500上准确率显著提升
  • 适合研究模型推理错误机制与优化训练

数学推理任务对大语言模型(LLMs)构成重大挑战,因其需要精确的逻辑推导与序列分析。本文提出关键词元概念——即推理轨迹中显著影响错误结果的元素。通过滚动采样识别这些词元,并展示其与传统错误词元存在显著差异。在GSM8K和MATH500等数据集上的大量实验表明,识别并替换关键词元可显著提升模型准确率。我们提出一种基于对比估计的高效方法,在大规模数据集中定位关键词元,并将其扩展至直接偏好优化(DPO)训练框架中,形成cDPO方法。在广泛使用的Llama-3(8B和70B)与Deepseek-math(7B)模型上,该方法在GSM8K和MATH500基准测试中均表现出色。结果表明,利用关键词元可有效减少推理错误,推动具备强逻辑推导能力的AI系统发展。代码、标注数据集及训练模型已开源。

原文摘要 · Abstract (English)

Mathematical reasoning tasks pose significant challenges for large language models (LLMs) because they require precise logical deduction and sequence analysis. In this work, we introduce the concept of critical tokens -- elements within reasoning trajectories that significantly influence incorrect outcomes. We present a novel framework for identifying these tokens through rollout sampling and demonstrate their substantial divergence from traditional error tokens. Through extensive experiments on datasets such as GSM8K and MATH500, we show that identifying and replacing critical tokens significantly improves model accuracy. We propose an efficient methodology for pinpointing these tokens in large-scale datasets using contrastive estimation and extend this framework to enhance model training processes with direct preference optimization (DPO). Experimental results on GSM8K and MATH500 benchmarks with the widely used models Llama-3 (8B and 70B) and Deepseek-math (7B) demonstrate the effectiveness of the proposed approach, cDPO. Our results underscore the potential of leveraging critical tokens to reduce errors in reasoning tasks, advancing the development of AI systems capable of robust logical deduction. Our code, annotated datasets, and trained models are available at https://github.com/chenzhiling9954/Critical-Tokens-Matter to support and encourage future research in this promising field.

推理增强提示工程模型优化

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