2025-01-23 · 进阶 · 机器学习 · 自然语言处理

O1-Pruner: Length-Harmonizing Fine-Tuning for O1-Like Reasoning Pruning

本文提出了O1-Pruner,一种基于长度和谐微调的推理剪枝方法,旨在减少长思考LLMs的推理开销,同时保持准确性。

更新于 2025-01-23。作者:Haotian Luo、Li Shen、Haiying He、Yibo Wang、Shiwei Liu、Wei Li、Naiqiang Tan、Xiaochun Cao、Dacheng Tao。

中文摘要

最近,长期以来被认为具有推理能力的LLM,如OpenAI的O1,采用了类似于人类思考复杂问题的扩展推理过程。这种推理范式显著提升了模型的问题解决能力,并取得了令人鼓舞的结果。然而,长时间的推理过程导致推理时间大幅增加。一个紧迫的挑战是在确保准确性的同时,降低长时间LLM的推理开销。在这篇论文中,我们通过实验证明,长时间推理模型在根据问题难度和推理冗余有效分配token预算方面存在困难。为了解决这个问题,我们提出了长度谐调微调(O1-Pruner),旨在最小化推理开销的同时保持准确性。这种有效的微调方法首先通过预采样估计LLM的基线性能,然后使用RL风格的微调来鼓励模型在准确性的约束下生成更短的推理过程。这使得模型能够在保持准确性的同时,以更低的冗余实现高效的推理。在各种数学推理基准测试上的实验表明,O1-Pruner不仅显著降低了推理开销,还实现了更高的准确性,为这一挑战提供了一个新颖且前景广阔的解决方案。我们的代码即将在https://github.com/StarDewXXX/O1-Pruner上发布。

英文摘要

Recently, long-thought reasoning LLMs, such as OpenAI's O1, adopt extended reasoning processes similar to how humans ponder over complex problems. This reasoning paradigm significantly enhances the model's problem-solving abilities and has achieved promising results. However, long-thought reasoning process leads to a substantial increase in inference time. A pressing challenge is reducing the inference overhead of long-thought LLMs while ensuring accuracy. In this paper, we experimentally demonstrate that long-thought reasoning models struggle to effectively allocate token budgets based on problem difficulty and reasoning redundancies. To address this, we propose Length-Harmonizing Fine-Tuning (O1-Pruner), aiming at minimizing reasoning overhead while maintaining accuracy. This effective fine-tuning method first estimates the LLM's baseline performance through pre-sampling and then uses RL-style fine-tuning to encourage the model to generate shorter reasoning processes under accuracy constraints. This allows the model to achieve efficient reasoning with lower redundancy while maintaining accuracy. Experiments on various mathematical reasoning benchmarks show that O1-Pruner not only significantly reduces inference overhead but also achieves higher accuracy, providing a novel and promising solution to this challenge. Our code is coming soon at https://github.com/StarDewXXX/O1-Pruner

解读

一句话总结

本文提出了O1-Pruner,一种基于长度和谐微调的推理剪枝方法,旨在减少长思考LLMs的推理开销,同时保持准确性。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:长思考LLMs在推理过程中存在长度不和谐现象,导致冗余的计算开销。 • 现有方案不足:现有的解决方案在减少推理时间的同时,往往牺牲了准确性。 • 研究目标:提出一种方法,在保证准确性的前提下,减少长思考LLMs的推理开销。

问题2:论文的核心创新点是什么?

• 技术创新:提出长度和谐微调(O1-Pruner)方法,通过预采样估计LLM的基线性能,并使用RL风格的微调来鼓励模型在准确性约束下生成更短的推理过程。 • 方法改进:利用RL算法优化长度和谐损失函数,实现推理过程的长度和谐。 • 优势:与现有方法相比,O1-Pruner在保持高准确性的同时,显著减少了推理时间。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在多个数学推理基准测试上进行了实验,包括MATH、GSM8k和GaoKao。 • 性能提升:O1-Pruner在平均长度上优于基线和竞争方法,同时保持了较高的准确性。 • 对比结果:与基线和竞争方法相比,O1-Pruner在平均长度上降低了40.5%(对于Marco-o1-7B)和34.7%(对于QwQ-32B-Preview),同时提高了准确性。

问题4:这个研究的实际应用价值是什么?

• 应用场景:适用于需要长思考LLMs进行推理的场景,如数学问题解决、逻辑推理等。 • 实施建议:建议在实际部署时,根据具体任务选择合适的超参数和训练数据集。 • 局限与展望:目前O1-Pruner主要针对数学推理任务,未来可以扩展到其他领域,并进一步优化其性能。

来源