Reinforced Fast Weights via Next-Sequence Prediction

Hee Seung Hwang, Xindi Wu, Sanghyuk Chun, Olga Russakovsky, Zhiwei DengNeurIPS 2026

TL;DR

Fast weight architectures solve the quadratic memory bottleneck of standard Transformers by compressing past context into a fixed-size, evolving memory matrix—yet we still train them using myopic, single-token predictions. This paper introduces ReFINE, a reinforcement learning framework that trains fast weight models to predict coherent multi-token sequences from uncertain points in a text. By teaching the memory state to plan ahead rather than just survive the next step, ReFINE dramatically stabilizes long-horizon generation and boosts long-context retrieval and QA performance.

What Problem Does This Paper Address?

Standard Transformers have an eidetic memory: they store explicit representations of every past token in a growing Key-Value (KV) cache. It works brilliantly, until a massive document makes compute and memory costs explode quadratically.

Fast weight architectures (like DeltaNet and LaCT) offer a sleek alternative. Instead of hoarding past tokens, they maintain a fixed-size weight matrix that dynamically updates itself as each new token arrives—essentially performing online learning on the fly. Constant memory overhead, fast inference.

Here is the catch: compressing thousands of tokens into a bounded matrix makes these models prone to forgetting and compounding errors. Yet, we train them with standard Next-Token Prediction (NTP), using teacher-forcing (feeding ground-truth tokens at every step). NTP only asks: "Given perfect history, can your memory predict the single next word?" It never checks if the memory state stays healthy as it evolves over multiple steps of the model's own predictions. As a result, during real-world generation, small deviations snowball, causing the model's internal representations to drift wildly off course compared to standard Transformers.

Figure 1: (a) Adapted from Zhang et al. [13]. Fast weight models replace the KV-cache in standard transformers with a recurrent fixed-size memory (W), updated according to Eq. (1). (b) Standard NTP provides token-level supervision through cross-entropy loss at each position. REFINE provides sequence-level supervision by optimizing the rewards of multi-token rollouts at high-entropy positions with RL. (c) Fast weight models show larger divergence in the last layer’s output representations, measured by Euclidean distance between predicted and ground truth response trajectories, than standard transformers. REFINE substantially reduces this divergence compared to SFT. Error bars show ±1σ across 50 independent generations.

Methods

To bridge the gap between recurrent memory and myopic supervision, the authors propose Next-Sequence Prediction (NSP)—supervising multi-token continuations—and optimize it using ReFINE (Reinforced Fast weIghts via Next sEquence prediction).

Generating multi-token rollouts at every single word in a long document would bankrupt your GPU budget, and grading them with strict cross-entropy would unfairly punish valid synonyms (e.g., penalizing "cars are fast" when the text says "automobiles move quickly"). ReFINE solves both problems with four steps:

  1. Entropy-Based Token Selection: Pass the sequence through the model, divide it into equal chunks, and sample one high-entropy (high uncertainty) token position per chunk. This focuses compute where the model actually struggles.
  2. Rollout Generation: Truncate the text at those tricky positions and have the model autoregressively generate short $k$-token continuations (e.g., $k=5$).
  3. Self-Supervised Reward Assignment: Instead of requiring exact word matches, ReFINE compares the final-layer hidden states of the generated rollout against the ground-truth tokens using cosine similarity. Depending on whether the goal is generalization or strict memorization, this smooth semantic reward can be blended with a binary exact-match reward.
  4. RL Optimization: Standardize the rewards across chunks in the sequence and update the model using Group Relative Policy Optimization (GRPO), blended with standard NTP loss so the model doesn't forget basic language modeling.
Figure 2: REFINE. We forward the sequence through the policy model and compute token-level entropy values, which we use to sample a target token position from each equal-length chunk in the sequence (Entropy-Based Token Selection). Prefixes are copied from the original sequence up to each target token, and the policy model predicts continuations (Rollout Generation). Reward is computed based on the generated rollouts and ground truth tokens (Reward Assignment). Finally, we update the policy model with GRPO (Optimization with RL).

Crucially, ReFINE is phase-agnostic: you can plug it into mid-training (adapting base models to long contexts), post-training (instruction tuning), and test-time training (TTT) (adapting to a specific prompt on the fly before answering).

Datasets

No new benchmarks are introduced; the authors use established long-context suites:

  • Mid-training & Validation: 200M tokens from Long-Data-Collections, with next-token validation tracked on Booksum.
  • Post-training & Evaluation: Synthetic multi-document QA (SQuADQA, HotpotQA) and Needle-in-a-Haystack (NIAH) retrieval tasks from the RULER benchmark (4K to 16K context lengths).
  • Broad Evaluation: 12 diverse tasks (QA, summarization, coding) from LongBench (up to 16K tokens), plus QMSum and SAMSum for analyzing memory drift.

Key Insights and Ideas

  • Sequence supervision cures memory drift: Measuring the Frobenius norm between memory matrices during predicted vs. ground-truth trajectories shows that ReFINE actively stabilizes fast weight updates over long horizons, keeping the memory state from derailing.
  • Optimizing sequences improves single-token accuracy: Counterintuitively, mid-training with ReFINE improves validation next-token accuracy on Booksum significantly more than directly optimizing next-token prediction via SFT—proving that multi-step feedback teaches better representations even for immediate predictions.
  • RL works without "reasoning" traces: Recent RL breakthroughs in LLMs rely on instruction-tuned models generating explicit chain-of-thought traces. ReFINE shows RL can directly upgrade base pre-trained architectures lacking reasoning skills, purely through self-supervised representation alignment.
  • Match the reward to the training phase: Smooth cosine-similarity rewards work best during mid-training where broad generalization matters, whereas binary exact-match rewards shine during test-time training where memorizing the immediate prompt is paramount.

Key Results

Tested on two distinct fast weight models—LaCT-760M and DeltaNet-1.3B—ReFINE consistently beats NTP-based Supervised Fine-Tuning (SFT):

  • LongBench: Mid-training with ReFINE yields average relative gains of 25% (LaCT-760M: 13.5 $\rightarrow$ 16.9) and 8% (DeltaNet-1.3B: 15.7 $\rightarrow$ 17.0) over SFT mid-training. Adding ReFINE at test-time pushes scores even higher (18.0 and 17.9, respectively).
  • RULER Multi-Doc QA: ReFINE boosts average QA scores across all phases—improving LaCT-760M by 8.5% (mid-training), 15.3% (post-training), and 9.5% (TTT), and DeltaNet-1.3B by 20.3%, 11.0%, and 15.0% over SFT counterparts.
  • Long-Context Retrieval: On RULER Multi-key NIAH, ReFINE mid-training lifts DeltaNet-1.3B by +23.5% over the base model and +8.8% over SFT.

Limitations and Future Work

  • Reward degradation on long rollouts: Performance peaks around a rollout length of $k=5$ and dips at $k=7$. Averaging token-level cosine similarities loses sharpness as sequences grow longer and diverge syntactically, pointing to a need for richer, holistic sequence-level semantic rewards.
  • Fixed rollout horizons: Because the ideal lookahead distance depends on local context, dynamically adjusting $k$ per prefix could isolate meaningful phrases better than a fixed window.
  • Rollout compute overhead: Generating rollouts from multiple truncated prefixes requires recomputing or managing states separately. Future architectural support for efficiently sharing and branching fast weight states across prefixes will allow ReFINE to scale to much larger compute budgets.

Summary updated

Abstract

Fast weight architectures offer a promising alternative to standard transformers for long-context modeling by replacing the KV-cache with a recurrently updated fixed-size memory. Despite this architectural shift, they are typically trained with the same next-token prediction (NTP) objective as standard transformers. This creates a mismatch: fast weight models rely on an evolving memory state to support future predictions, while NTP provides only token-level supervision for the immediate next token. We address this mismatch with next-sequence prediction (NSP), a sequence-level extension of NTP that trains models to produce coherent multi-token continuations from their recurrent memory state. To optimize this sequence-level objective, we propose ReFINE ($\textbf{Re}$inforced $\textbf{F}$ast we$\textbf{I}$ghts via $\textbf{N}$ext s$\textbf{E}$quence prediction). ReFINE selects informative token positions based on prediction entropy, generates multi-token rollouts, assigns sequence-level rewards, and optimizes the model with Group Relative Policy Optimization (GRPO). ReFINE is applicable throughout the training lifecycle of pre-trained language models: mid-training, post-training, and test-time training. Experiments on LaCT-760M and DeltaNet-1.3B show that ReFINE consistently outperforms NTP-based supervised fine-tuning in needle-in-a-haystack retrieval, long-context question answering, and diverse tasks in LongBench. ReFINE provides an effective and versatile framework for improving long-context modeling in fast weight architectures.
BibTeX
@inproceedings{hwang2026reinforced,
  author = {Hee Seung Hwang and Xindi Wu and Sanghyuk Chun and Olga Russakovsky and Zhiwei Deng},
  title = {{Reinforced Fast Weights via Next-Sequence Prediction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=A1sw6FviPQ},
}
Figure