Despite recent advancements in large language models (LLMs), their performance on complex reasoning problems requiring multi-step thinking and combining various skills is still limited. To address this, we propose a novel framework HDFlow for complex reasoning with LLMs that combines fast and slow thinking modes in an adaptive manner. Our approach consists of two key components: 1) a new approach for slow, deliberate reasoning called Dynamic Workflow, which automatically decomposes complex problems into more manageable sub-tasks and dynamically designs a workflow to assemble specialized LLM or symbolic reasoning tools to solve sub-tasks; 2) Hybrid Thinking, a general framework that dynamically combines fast and slow thinking based on problem complexity. Finally, we propose an easy-to-scale method for automatically synthesizing a large-scale dataset of 27K challenging reasoning problems for complex reasoning and a hybrid thinking tuning method that trains smaller LLMs on this dataset to internalize the fast/slow hybrid reasoning strategies. Experiments on four reasoning benchmark datasets demonstrate that our slow thinking with dynamic workflows significantly outperforms Chain-of-Thought, and hybrid thinking achieves the highest accuracy while providing an effective balance between computational efficiency and performance. Fine-tuning using our hybrid thinking approach also significantly boosts the complex reasoning capabilities of open-source language models. The results showcase the promise of slow thinking, dynamic workflows, and hybrid thinking in expanding the frontier of complex problem-solving with LLMs\footnote{Code and data will be released at \url{https://github.com/wenlinyao/HDFlow}.}.
翻译:尽管大语言模型(LLM)近期取得了显著进展,但在需要多步推理和多种技能结合的复杂推理问题上,其性能仍存在局限。为解决这一问题,我们提出了一种新颖的LLM复杂推理框架HDFlow,该框架以自适应方式结合了快速与慢速两种思维模式。我们的方法包含两个关键组成部分:1)一种称为动态工作流的慢速审慎推理新方法,能够自动将复杂问题分解为更易处理的子任务,并动态设计工作流以组合专门的LLM或符号推理工具来求解子任务;2)混合思维,这是一个根据问题复杂度动态结合快速与慢速思维的通用框架。最后,我们提出了一种易于扩展的方法,用于自动合成包含27K个挑战性推理问题的大规模数据集以支持复杂推理,并提出了一种混合思维微调方法,在该数据集上训练较小的LLM以内化快速/慢速混合推理策略。在四个推理基准数据集上的实验表明,我们基于动态工作流的慢速思维显著优于思维链方法,而混合思维在实现最高准确率的同时,有效平衡了计算效率与性能。使用我们的混合思维方法进行微调,也显著提升了开源语言模型的复杂推理能力。这些结果展现了慢速思维、动态工作流与混合思维在拓展LLM复杂问题求解前沿方面的潜力\footnote{代码与数据将在 \url{https://github.com/wenlinyao/HDFlow} 发布。}。