HDFlow:通过混合思维和动态工作流增强LLM复杂问题解决
HDFlow: Enhancing LLM Complex Problem-Solving with Hybrid Thinking and Dynamic Workflows
September 25, 2024
作者: Wenlin Yao, Haitao Mi, Dong Yu
cs.AI
摘要
尽管近年来大型语言模型(LLMs)取得了一些进展,但它们在需要多步推理和结合各种技能的复杂推理问题上的表现仍然有限。为了解决这一问题,我们提出了一个新颖的框架 HDFlow,用于利用LLMs进行复杂推理,该框架以自适应方式结合快速和慢速思维模式。我们的方法包括两个关键组成部分:1)一种用于缓慢、深思熟虑推理的新方法,称为动态工作流,它自动将复杂问题分解为更易处理的子任务,并动态设计工作流程来组装专门的LLM或符号推理工具来解决子任务;2)混合思维,这是一个通用框架,根据问题复杂性动态结合快速和慢速思维。最后,我们提出了一种易于扩展的方法,用于自动合成一个包含27K个具有挑战性的推理问题的大规模数据集,用于复杂推理,以及一种混合思维调优方法,该方法在此数据集上训练较小的LLMs,以内化快速/慢速混合推理策略。对四个推理基准数据集的实验表明,我们的慢速思维与动态工作流明显优于“思维链”,而混合思维在提供最高准确性的同时,在计算效率和性能之间提供了有效的平衡。使用我们的混合思维方法进行微调还显著提升了开源语言模型的复杂推理能力。结果展示了慢速思维、动态工作流和混合思维在扩展LLMs解决复杂问题的前沿中的潜力。代码和数据将在\url{https://github.com/wenlinyao/HDFlow.}发布。
English
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 LLMsCode and data will be
released at \url{https://github.com/wenlinyao/HDFlow.}.Summary
AI-Generated Summary