Persistent Recurrent Memory Between Transformer Layers - Improves Language Model Generalization
Abstract
We introduce a simple architectural modification to decoder-only transformers: a persistent recurrent state that observes hidden representations via cross-attention, updates itself through a GRU, and modulates subsequent processing via gated addition. Inserted between the lower and upper halves of a 6-layer transformer, this module adds only 3.7\% additional parameters while reducing evaluation loss from to , corresponding to a 28.5\% reduction on held-out language modeling data. The improvement is statistically significant across 5 random seeds () and corresponds to reduced overfitting (generalization gap 0.12 vs 0.26). Through controlled ablations, we demonstrate that the improvement stems entirely from the persistent memory topology, not from auxiliary self-prediction objectives. A model with identical topology but no auxiliary loss performs equivalently, while a random auxiliary loss provides no benefit. Representation probing reveals that the persistent state encodes narrative position (52\% vs 33\% chance level)---information that standard attention maintains less efficiently. Our results suggest that bridging transformer layers with a lightweight recurrent memory is a simple, effective approach to improving generalization in small-scale language models.
Create a lesson
Related papers
Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models
Shared title terminologycs.CLHui Chen, Joshua Elsdon, Can Goksen
Implementation of Machine Translation for the Uzbek Language Based on Transformer Models
Shared title terminologycs.CLMukhammadjon Musaev, Mannon Ochilov
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
Generalization through Lexical Abstraction in Transformer Models: The Case of Functional Words
Shared title terminologycs.CLGiuseppe Samo, Vivi Nastase, Paola Merlo
Improving Mathematical Reasoning Capabilities in Large Language Models via Reasoning Process Error Classification
Shared title terminologycs.CLRuna Yoshida, Kosuke Nishida, Kyosuke Nishida
How resampling method can help us: Improving the Delta model
Shared title terminologycs.CLJacques Savoy