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.
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:
- 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.
- Rollout Generation: Truncate the text at those tricky positions and have the model autoregressively generate short $k$-token continuations (e.g., $k=5$).
- 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.
- 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.
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