Dualformer:通过随机化推理轨迹学习实现可控的快慢思考
Dualformer: Controllable Fast and Slow Thinking by Learning with Randomized Reasoning Traces
AI总结:
提出Dualformer模型,通过在随机化推理轨迹上训练,无缝集成快慢两种推理模式,在迷宫和数学推理任务中均显著提升了性能与计算效率。
摘要:
在认知理论中,人类思维受两个系统支配:快速、直觉的系统1和较慢但更深思熟虑的系统2。类似地,大型语言模型(LLMs)可以在两种推理模式下运行:仅输出解决方案(快模式)或同时输出推理链和最终解决方案(慢模式)。我们提出了Dualformer,这是一个单一的Transformer模型,通过在随机化推理轨迹上进行训练,无缝集成了快慢两种推理模式,在训练期间会策略性地丢弃轨迹的不同部分。在推理时,Dualformer可以轻松配置为以快模式或慢模式执行,或自动决定采用哪种模式(自动模式)。它在所有三种模式下均在性能和计算效率上优于基线:(1)在慢模式下,Dualformer在未见的30×30迷宫任务上达到97.6%的最优率,超越了在包含完整推理轨迹的数据上训练的Searchformer基线(93.3%),且推理步骤减少了45.5%;(2)在快模式下,Dualformer达到80%的最优率,显著优于仅在解决方案数据上训练的Solution-Only模型,后者的最优率仅为30%;(3)在自动模式下,Dualformer达到96.6%的最优率,步骤比Searchformer减少59.9%。此外,Dualformer比Searchformer产生更多样化的推理轨迹。对于数学推理问题,我们的技术在LLM微调中也取得了更好的性能,证明了其超越特定任务模型的泛化能力。我们在https://github.com/facebookresearch/dualformer开源了代码。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。