arXiv:2410.09918cs.AIcs.LG2024-10ICLR被引 57

一个模型同时支持快慢思维,推理更准更省时。

Dualformer: Controllable Fast and Slow Thinking by Learning with Randomized Reasoning Traces

  • 用随机丢弃推理过程训练单一模型,实现快慢模式切换。
  • 慢模式下97.6%解题率,少45.5%推理步数,超越基线。
  • 自动模式达96.6%准确率,比基线少59.9%计算量,适合实用部署。

认知理论中人类思维分为快速直觉的系统1和缓慢理性的系统2。类比地,大语言模型可运行于仅输出答案(快模式)或同时输出推理链与答案(慢模式)。我们提出Dualformer,通过在训练中随机丢弃推理痕迹,让单一Transformer模型无缝融合快慢两种推理模式。推理时可配置为快、慢或自动模式。在三种模式下均优于基线:慢模式下,在未见的30×30迷宫任务上达到97.6%最优率,高于使用完整推理数据训练的SearchFormer基线(93.3%),且推理步骤减少45.5%;快模式下,80%最优率远超仅用答案训练的模型(30%);自动模式下,96.6%最优率,推理步数比SearchFormer少59.9%。此外,Dualformer生成的推理路径更具多样性。在数学推理任务上,该方法也通过微调提升了性能,证明其泛化能力。代码已开源。

原文摘要 · Abstract (English)

In cognition theory, human thinking is governed by two systems: the fast and intuitive System 1 and the slower but more deliberative System 2. Analogously, Large Language Models (LLMs) can operate in two reasoning modes: outputting only the solutions (\emph{fast mode}) or both the reasoning chain and the final solution (\emph{slow mode}). We present \dualformer, a single Transformer model that seamlessly integrates both the fast and slow reasoning modes by training on randomized reasoning traces, where different parts of the traces are strategically dropped during training. At inference time, \dualformer can be easily configured to execute in either fast or slow mode, or automatically decide which mode to engage (\emph{auto mode}). It outperforms baselines in both performance and computational efficiency across all three modes: (1) in slow mode, \dualformer achieves $97.6\%$ optimal rate on unseen $30 \times 30$ maze tasks, surpassing the \searchformer baseline ($93.3\%$) trained on data with complete reasoning traces, with $45.5\%$ fewer reasoning steps; (2) in fast mode, \dualformer achieves $80\%$ optimal rate, significantly outperforming the Solution-Only model trained on solution-only data, which has an optimal rate of only $30\%$; (3) in auto mode, \dualformer achieves $96.6\%$ optimal rate with $59.9\%$ fewer steps than \searchformer. Moreover, \dualformer produces more diverse reasoning traces than \searchformer{}. For math reasoning problems, our techniques have also achieved improved performance with LLM fine-tuning, demonstrating its generalization beyond task-specific models. We open source our code at https://github.com/facebookresearch/dualformer.

大模型推理双系统思维效率优化模型泛化

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