ReFT: Reasoning with Reinforced Fine-Tuning

2024年01月17日
提升大型语言模型(LLMs)的推理能力的一种方法是使用Chain-of-Thought(CoT)注释进行监督微调(SFT)。然而,这种方法的泛化能力不够强,因为训练仅依赖于给定的CoT数据。例如,在数学问题求解中,训练数据中通常只有一个注释的推理路径。直观地说,如果算法能够在给定问题的情况下从多个注释的推理路径中学习,那将更好。为了解决这个问题,我们提出了一种简单而有效的方法,称为强化微调(ReFT),以增强用于推理的学习LLMs的泛化能力,以数学问题求解为例。ReFT首先使用SFT热身模型,然后采用在线强化学习,具体来说,在本文中使用PPO算法进一步微调模型,其中自动从问题中采样大量推理路径,并且奖励自然地来自于基本事实的答案。 GSM8K、MathQA和SVAMP数据集上的广泛实验表明,ReFT明显优于SFT,并且性能可以通过组合推理时间策略(例如多数投票和重新排序)进一步提高。请注意,ReFT通过从与SFT相同的训练问题中学习而不依赖于额外或增强的训练问题来获得改进。这表明ReFT具有更强的泛化能力。
One way to enhance the reasoning capability of Large Language Models (LLMs) is to conduct Supervised Fine-Tuning (SFT) using Chain-of-Thought (CoT) annotations. This approach does not show sufficiently strong generalization ability, however, because the training only relies on the given CoT data. In math problem-solving, for example, there is usually only one annotated reasoning path for each question in the training data. Intuitively, it would be better for the algorithm to learn from multiple annotated reasoning paths given a question. To address this issue, we propose a simple yet effective approach called Reinforced Fine-Tuning (ReFT) to enhance the generalizability of learning LLMs for reasoning, with math problem-solving as an example. ReFT first warmups the model with SFT, and then employs on-line reinforcement learning, specifically the PPO algorithm in this paper, to further fine-tune the model, where an abundance of reasoning paths are automatically sampled given the question and the rewards are naturally derived from the ground-truth answers. Extensive experiments on GSM8K, MathQA, and SVAMP datasets show that ReFT significantly outperforms SFT, and the performance can be potentially further boosted by combining inference-time strategies such as majority voting and re-ranking. Note that ReFT obtains the improvement by learning from the same training questions as SFT, without relying on extra or augmented training questions. This indicates a superior generalization ability for ReFT.
许愿