Learning to Reason from Feedback at Test-Time

Yanyang Li, Michael R. Lyu, Liwei Wang

Introduction

Large Language Models (LLMs) often struggle with complex reasoning tasks, such as high-level mathematics or competitive programming, where a single-shot answer is rarely sufficient. This paper introduces Feedback-based Test-Time Training (FTTT), a novel approach that enables LLMs to learn from their mistakes during inference. Unlike traditional methods that rely on expanding the context window, FTTT updates the model's internal weights. To facilitate this efficiently, the authors present OPTUNE, a lightweight, learnable optimizer designed to predict optimal weight updates from gradients.

The Challenge of Test-Time Reasoning

Current strategies for improving LLM reasoning at test-time generally fall into two categories:

  1. Sequential Revision: The model iteratively refines its answer based on previous attempts. However, this often leads to "context bloat," where the increasing prompt length introduces noise and position bias.
  2. Parallel Sampling: The model generates multiple independent attempts (e.g., Best-of-N). While computationally efficient, this method is "blind" to previous failures, causing the model to repeat similar errors.
Comparison of reasoning strategies: (a) Sequential Revision, (b) Parallel Sampling, and (c) the proposed Feedback-based Test-Time Training.

FTTT addresses these issues by treating neural network weights as a dynamic memory buffer, allowing the model to "internalize" feedback without cluttering the context.

Methodology

Feedback-based Test-Time Training (FTTT)

FTTT converts feedback into a training signal. When a verifier identifies an incorrect answer, the model is trained to predict the feedback "Your answer is incorrect." To provide a richer signal, the model also generates a "self-reflection"—a summary of its own errors. This reflection acts as a "silver-standard" label for an auxiliary distillation loss, helping the model correct its reasoning path.

OPTUNE: A Learnable Test-Time Optimizer

Standard fine-tuning techniques like LoRA can be slow and unstable during inference. OPTUNE is a small neural network trained to act as an optimizer. It uses rank decomposition to project high-dimensional gradients into a smaller "gradient space," effectively learning how to predict the optimal weight update $\Delta W$ from a single failure.

Evaluation and Key Insights

The researchers evaluated FTTT and OPTUNE using Llama-3.1-8B-Instruct and Mistral-7B-Instruct-v0.3 across benchmarks like MATH, GSM8K, MBPP, and HumanEval.

As shown in the table above, FTTT is unique in its ability to combine self-reflection, memory (via weight updates), and length generalization. Key insights include:

  • Weights as Fast Memory: Shifting the "memory" of errors from the context to the weights maintains a clean reasoning path.
  • Gradients as Information Compression: OPTUNE demonstrates that gradients are a highly efficient way to capture the "direction" of improvement compared to processing thousands of tokens of history.

Results

  • Performance Scaling: With 32 attempts, FTTT consistently outperformed Best-of-N and Self-Refine baselines, particularly on the MATH dataset.
  • Optimizer Efficiency: OPTUNE outperformed five standard PEFT methods (including LoRA), improving performance by an average of 2.58% while using only ~439K trainable parameters.
  • Speed: On GSM8K, OPTUNE reduced the required GPU hours from 4 to 1.5 compared to the standard FTTT baseline.

Limitations and Future Work

While promising, the current FTTT framework relies on binary (correct/incorrect) feedback. Future research could explore continuous feedback signals, such as reward model scores. Additionally, the method's performance is sensitive to the quality of the initial attempt; extremely poor first guesses can result in noisy gradients that hinder effective updates. Extending this "weight-based memory" to open-ended or creative tasks remains an area for further exploration.

Summary updated

BibTeX
@inproceedings{li2025learning,
  author = {Yanyang Li and Michael R. Lyu and Liwei Wang},
  title = {{Learning to Reason from Feedback at Test-Time}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure