Recursive Introspection: Teaching Language Model Agents How to Self-Improve

Yuxiao Qu, Tianjun Zhang, Naman Garg, Aviral Kumar

Introduction

While Large Language Models (LLMs) have become remarkably capable, they often suffer from a "one-shot" limitation. If they make a mistake in their initial reasoning, they rarely correct it when prompted to "try again" unless provided with specific external hints. Even the most powerful proprietary models struggle with true intrinsic self-correction. Previous research has even hypothesized that this capability might be impossible to instill through standard fine-tuning alone, as models trained on "perfect" gold-standard answers do not learn how to bridge the gap between their own specific errors and the correct solution.

To address this, researchers introduce RISE (Recursive IntroSpEction), a novel fine-tuning framework that transforms LLMs into agents capable of iterative self-improvement. By treating a single prompt as a multi-turn Markov Decision Process (MDP), RISE teaches models to recognize their own mistakes and refine their answers over multiple attempts, significantly outperforming standard parallel sampling techniques on complex reasoning tasks.

RISE Framework vs. Standard Inference

The RISE Framework

RISE re-frames the problem of answering a prompt as a multi-turn MDP. In this framework, the "state" consists of the initial prompt combined with the history of previous failed attempts and environment feedback. The "action" is the model's subsequent response.

Multi-Turn MDP and Data Collection in RISE

The training process involves several key components:

  1. Iterative Data Collection: RISE uses an "on-policy" approach. The model attempts a problem, and if it fails, it generates multiple "revision" candidates. These revisions are sourced either from the model itself (self-distillation) or a more capable "teacher" model (distillation). Crucially, the model must see its own specific types of failures to learn how to fix them.
  2. Policy Improvement: The model is fine-tuned on these sequences using Reward-Weighted Regression (RWR). This objective prioritizes learning from successful corrections while still exposing the model to the distribution of errors it is likely to make.
  3. Knowledge Boosting: Prior to the main training loop, the model undergoes a brief supervised fine-tuning (SFT) phase on high-quality multi-turn data to ensure it understands the format and mechanics of self-correction.
  4. Inference Strategies: At test time, the model can operate "with an oracle" (stopping as soon as a verifier confirms the answer is correct) or "without an oracle" (using majority voting across multiple turns of self-correction).

Experimental Setup and Key Findings

The authors evaluated RISE on several challenging reasoning and coding benchmarks, including GSM8K (grade school math), MATH (advanced competition math), MBPP & CoNaLa (Python programming), and SVAMP (for testing out-of-distribution generalization).

Sequential Reasoning Outperforms Parallel Sampling

A major finding is that one model "thinking" sequentially for five turns often produces better results than five independent models (or samples) "thinking" in parallel and taking a majority vote. This suggests the model actively utilizes the computation and context of previous turns to narrow down the correct answer. The authors liken this to Diffusion models: by breaking generation into a sequence of conditional steps, the model expresses a much more complex and flexible distribution of answers than a single-turn model could.

Performance Gains and Scaling

  • Math Reasoning: RISE improved Llama-2-7B's performance on GSM8K by 17.7% over five turns. Mistral-7B saw an even larger 23.9% improvement. Remarkably, a Mistral-7B model trained with RISE achieved a 5-turn performance that exceeded the self-correction capabilities of GPT-3.5.
  • Code Generation: On the MBPP coding benchmark, RISE elevated the initial success rate from 19.0% to 27.0%, while simultaneously boosting the 5-turn success rate.
  • Favorable Scaling: RISE demonstrates favorable scaling properties; more capable base models (like Llama-3-8B compared to Llama-2-7B) actually gain more from the RISE procedure.
  • Robustness: The models showed significant performance gains on out-of-distribution tasks like SVAMP, proving that they learned a generalizable skill of self-improvement rather than simply memorizing the training set.

Limitations and Future Directions

While RISE presents a significant step forward, it comes with limitations. The iterative training process is computationally expensive, requiring multiple rounds of data generation and fine-tuning. Furthermore, while the "self-distillation" variant is effective, the most potent version of RISE still benefits from an initial "knowledge boosting" phase using a stronger teacher model like GPT-4.

Currently, the models are fine-tuned on specific domains (math or code). Integrating RISE into general instruction-tuning pipelines is a vital next step. Finally, sequential self-correction naturally increases inference latency compared to a single-shot response, which may limit its immediate applicability in real-time systems without further optimization.

Summary updated

BibTeX
@inproceedings{qu2024recursive,
  author = {Yuxiao Qu and Tianjun Zhang and Naman Garg and Aviral Kumar},
  title = {{Recursive Introspection: Teaching Language Model Agents How to Self-Improve}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=DRC9pZwBwR},
}
Figure