Information-theoretic and geometric compression have been widely studied as possible explanations for generalization. Yet their temporal dynamics in recurrent networks remain largely unexplored. Using discretized LSTMs, whose finite embedding space enables direct estimates of information quantities, we observe pronounced compression across the final timesteps of many datasets. We explain this effect through three competing mechanisms: (i) class separability permits stronger compression at the final timestep; (ii) shared recurrent dynamics propagate this pressure across timesteps with similar activation states, making its extent depend on temporal stationarity; and (iii) limited representational capacity opposes prolonged compression because it restricts information available for subsequent computation. We systematically test these mechanisms through controlled synthetic interventions and real-world sequence tasks. Our results identify class separability, temporal stationarity, and network capacity as key determinants of temporal compression, and suggest that compression acts as a regularizer-potentially beneficial when excess capacity is available, but harmful to generalization when it consumes memory needed for the task.
Figures & tables
Fig. 1 : Embedding entropy and target information of last recurrent layer of an LSTM as it evolves over time. Each trajectory corresponds to a training trial. Left: Dataset MNIST stroke . Right: Dataset Tiselac
Fig. 2 : Empirically estimated embedding entropy I^(X;H) after directly optimizing pre-embeddings to minimize softmax loss. Entropy is plotted over the separation cost λsep , which penalizes separating pre-embeddings which are initially close. The resulting classifier accuracies are shown for λsep∈{0,0.1,3.0} .
Fig. 3 : Embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t . LSTM networks are trained and evaluated on the synthetic AR dataset. Each experiment comprises five trials, shown in different colors. Test set accuracies are displayed above the subplots. Left: No EOS token ( tEOS=0 ). Middle: EOS token only at final timestep ( tEOS=1 ). Right: EOS token for final 10 timesteps ( tEOS=10 ).
tEOS
I^(X;H140)
I^(X;H150)
ΔI^(X;Ht)
Convergence epoch
0
3.5±0.5
3.5±0.5
−0.06±0.01
97±49
1
5.2±0.7
3.4±0.4
−1.81±0.65
53±14
10
5.3±0.5
2.5±0.4
−2.87±0.40
59±22
TABLE I : Embedding entropy I^(X;Ht) at t∈[140,150] and their difference. The epoch at which training accuracy surpassed 98 % of it’s maximum value, is also given. Mean and standard deviation are computed over 5 trials.
Fig. 4 : Information content behavior of a network trained and tested on AR dataset with alternating information. Left Embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t when training on informative end and no EOS signal. Shown are the first 5 trials, with their average displayed in black. Middle: Same, but trained on uninformative end . Right: Change in information content between the beginning and end of each phase, excluding the first two and final phases of each trial. Error bars indicate the mean and standard deviation for each color–symbol combination.
Dataset
EOS
1 Layer
2 Layers
MNIST stroke
×
90.69±0.58
93.99±0.42
✓
91.12±0.64
94.07±0.30
Tiselac
×
82.27±0.86
82.11±0.87
✓
81.11±1.29
82.11±0.89
ElectricDevices
×
60.83±2.87
65.38±2.12
✓
61.43±3.15
66.99±2.45
TABLE II : Generalization performance of LSTM networks across four experimental setups for each dataset, combining the presence or absence of an EOS signal with either one or two LSTM layers. Shown are the mean and standard deviation of the accuracy over the best-performing 90% of trials (27 of 30).
Dataset
1 Layer
2 Layers
r
p -value
r
p -value
MNIST stroke
0.44
7.8×10−4
0.15
2.6×10−1
Tiselac
0.45
6.9×10−4
0.45
5.1×10−4
ElectricDevices
0.03
8.3×10−1
0.31
2.3×10−2
AR short
0.39
3.8×10−3
0.07
5.9×10−1
TABLE III : Pearson correlations between test accuracy and time-averaged embedding entropy 1/T∑t=1TI^(X,Ht) , computed across all 54 of 60 trials, irrespective of whether an EOS signal was present. p -values <0.05 are shown in bold.
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
Fig. 5 : Illustration of the straight-through estimator. The elliptical contour plot shows the level sets of the loss, and the arrows display the negative gradient field. (a) shows the updates when no quantizer is used, i.e., Equation ( 2 ). (b) displays the STE updates given by Equation 5 , using the derivative of the identity function as the surrogate ρ(⋅) . Note that the update is fully determined by the gradient at the quantized values, namely the vertices of the square. Even though the minimum lies in the first quadrant, updates in the second quadrant may flip h2=sign(h~2) , while updates in the fourth quadrant may flip h1=sign(h~1) . In either case, such flips can increase distance to the loss-minimizing quadrant. Thus, STE updates are not guaranteed to eventually reach the loss-minimizing vertex h=(1,1) . (c) shows the STE updates when using the derivative of tanh as the surrogate ρ(⋅) . Note that vectors near the quantization boundaries are pulled towards them, as the derivative of tanh is largest near 0 . The vector field can be transformed into that of (b) by applying a strictly monotonic transformation to each coordinate. (d) shows an example where even though the loss is convex and STE moves us locally closer to the loss-minimizing orthant, we are not guaranteed to get closer with discrete steps.
Fig. 6 : Visualizations from the MNIST stroke dataset. The digit plots are generated by drawing the strokes as instructed by the sequence of pen moves. (a) shows the histogram of stroke counts in the training set. (b) shows randomly selected digits from sequences containing five strokes. (c) shows randomly selected digits from sequences containing three or fewer strokes, while (d) shows the corresponding digits generated from the resampled sequences.
Fig. 7 : Illustration of the stroke resampling procedure. The blue curve shows the stroke after rescaling and smoothing. Target points are placed equidistantly with respect to the Euclidean arc length of the blue curve and are generally located between its elements by linear interpolation. The orange curve is the resulting discrete stroke, where each movement is chosen to approach the next target point as closely as possible subject to the discrete movement constraints. The original digit had a longer sequence length, and therefore the associated blue curve is downscaled by the factor rs before resampling, resulting in the shorter steps taken by blue compared to orange trajectory.
Fig. 8 : Sequences λι[t] used to generate the AR datasets, controlling the informativeness of the input sequences x . For visualization, a vertical offset was added to each sequence; in reality, λι[t]∈0,1 . Left: Examples of λι[t] used to generate training sequences in the informative end mode. Right: The λι[t] sequence used for all test sequences, together with the λι[t] sequence used during the early epochs of curriculum learning.
Fig. 9 : Information content behavior of networks trained and tested on AR dataset with alternating measurement noise . Shown is embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t for all ten trials. The average embedding entropy and target information, aggregated over trials for each timestep t , is shown in black. Time intervals with λι(t)=0 in the test sequences are shown in red, while those with λι(t)=1 are shown in green. Top: No EOS information present during training and testing ( tEOS=0 ). Bottom: EOS information is present during training and testing with tEOS . Left: Networks are trained on informative end . Right: Networks are trained on uninformative end .
Fig. 10 : Information content behavior of networks trained and tested on AR dataset with alternating information noise . Shown is embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t for all ten trials. The average embedding entropy and target information, aggregated over trials for each timestep t , is shown in black. Time intervals with λι(t)=0 in the test sequences are shown in red, while those with λι(t)=1 are shown in green. Top: No EOS information present during training and testing ( tEOS=0 ). Bottom: EOS information is present during training and testing with tEOS . Left: Networks are trained on informative end . Right: Networks are trained on uninformative end .
Fig. 11 : Effect of training on informative end compared to uninformative end on the information content dynamics, with and without an EOS token. Shown is the change in information content between the beginning and end of each phase, excluding the first two and final phases of each trial. Error bars indicate the mean and standard deviation for each color–symbol combination. Left: Uninformative phases during training and testing were generated using measurement noise . Right: Same, except that information noise was used for uninformative phases.
Dataset
EOS
1 Layer
2 Layers
MNIST stroke
×
6.00±0.24
6.08±0.24
✓
6.21±0.31
6.39±0.20
Tiselac
×
6.45±0.27
5.81±0.29
✓
6.35±0.32
5.97±0.41
ElectricDevices
×
5.15±0.44
5.22±0.27
✓
4.93±0.48
5.38±0.35
Appendix
TABLE IV : Average embedding entropy, aggregated over timesteps, of LSTM networks across four experimental setups for each dataset, combining the presence or absence of an EOS signal with either one or two LSTM layers. Shown are the mean and standard deviation of the entropy in bits, over the best-performing 90% of trials (27 of 30).
Dataset
1 Layer
2 Layers
t -statistic
p -value
t -statistic
p -value
MNIST stroke
2.7
1.1×10−2
5.2
3.5×10−6
Tiselac
-1.2
2.2×10−1
1.7
1.1×10−1
ElectricDevices
-1.8
8.0×10−2
1.9
6.5×10−2
AR short
4.0
1.8×10−4
9.7
5.3×10−13
Appendix
TABLE V : Statistical results of Welch’s t -test assessing the effect of EOS signal presence on the average embedding entropy reported in Table IV . A positive t -statistic means the presence of EOS leads to higher average embedding entropy.
Dataset
1 Layer
2 Layers
t -statistic
p -value
t -statistic
p -value
MNIST stroke
2.5
1.4×10−2
0.7
4.7×10−1
Tiselac
-3.8
4.3×10−4
0.0
9.9×10−1
ElectricDevices
0.7
4.8×10−1
2.5
1.4×10−2
AR short
5.2
4.1×10−6
2.0
5.1×10−2
Appendix
TABLE VI : Statistical results of Welch’s t -test assessing the effect of EOS signal presence on the accuracies reported in Table II . p -values <0.05 are shown in bold. A positive t -statistic means the presence of EOS leads to higher accuracy.
Fig. 12 : Embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t for different datasets, showing all 30 independently trained LSTMs per dataset, each with a single recurrent layer. The black lines show the respective averages across trials at each timestep. The dataset is indicated by the label on the left. Left: Without EOS signal, Right: With EOS signal ( tEOS=1 ).
Fig. 13 : Embedding entropy I^(X;Ht) and target information I^(Ht;Y) over timesteps t for different datasets, showing all 30 independently trained LSTMs per dataset, each with two recurrent layers. The black lines show the respective averages across trials at each timestep. The dataset is indicated by the label on the left. Left: Without EOS signal, Right: With EOS signal ( tEOS=1 ).
Fig. 14 : Accuracies of all 30 independently trained LSTMs per dataset with a single recurrent layer, using post-training early stopping. Top left: MNIST stroke . Top right: Tiselac . Bottom left: ElectricDevices . Bottom right: AR short .
Fig. 15 : Accuracies of all 30 independently trained LSTMs per dataset with two recurrent layers, using post-training early stopping. Top left: MNIST stroke . Top right: Tiselac . Bottom left: ElectricDevices . Bottom right: AR short .
Recurrent models process long contexts efficiently by compressing their history into a fixed-size state, but modern architectures typically do so in a single causal pass over the sequence. Each input must therefore be compressed before the model knows how it will later be used, forcing a limited state to compromise across possible future demands. We introduce dynamic compression, which allows a recurrent model to selectively revisit past tokens and revise its fixed-size state through additional recurrent updates. The model need not preserve every part of the history at uniformly high fidelity in its recurrent state, because lower-fidelity information can be revisited from the retained raw sequence when it becomes relevant. We study this in a controlled setting where the model first learns multiple functions in-context and, later in the same sequence, encounters a series of few-shot tasks that each require it to identify and reuse one of those functions. A single-pass model must preserve every function at sufficient fidelity for any future task, whereas selective re-scanning allows the model to revisit and refine only the function currently needed. We find that dynamic compression substantially reduces the recurrent state required for accurate reuse and scales more favorably as the number of stored functions grows. These results demonstrate a computation--memory tradeoff in which recurrent models can spend more computation revisiting their history to make more effective use of a fixed-size state.
Jyothish Pari, Ryan Bahlous-Boldi, Pulkit Agrawal
Improbable AI Lab, Massachusetts Institute of Technology
Recursive computation repeatedly compresses or reuses intermediate states, creating a simple tension: information that must remain useful across longer recursive paths is also exposed to more opportunities for loss before reaching the final prediction. Existing reconstruction or local-prediction objectives provide tractable supervision, but do not ensure that the retained information remains sufficient for subsequent recursive computation. We identify local predictive sufficiency with recursive predictive closure: controlling local predictive deficiencies at individual interfaces controls the resulting discrepancy at the root. We then turn this principle into a tractable training procedure. Starting from a variational characterization, we derive finite predictive tests and an empirical predictive deficiency that measures predictive value retained across compression. Its predictive sensitivities define margin-relaxed half-space constraints on parameter updates, and we project the host optimizer's proposed update onto their intersection only when predictive preservation would otherwise be violated. Across temporal graphs, language memory, vision-language-action control, and recursive self-improvement, the method matches or improves the corresponding host models under matched compression budgets, with larger gains under heavier recursive or memory demands, while better preserving predictive information across successive transformations. Crucially, the same task-agnostic predictive-preservation principle is instantiated across all four settings through host-compatible interventions while keeping the endpoint task, backbone, and evaluation protocol fixed. These results establish predictive preservation at recursive interfaces as a general training principle for recursive compression.
Peilin Wang, Feng Shiyang, Hongfu Gao +4
Shandong University · National University of Singapore · Tsinghua University
Despite the increasing prevalence of large language models (LLMs), we still have a limited understanding of how their representational spaces are structured. This limits our ability to interpret how and what they learn or relate them to learning in humans. We argue LLMs are best seen as an instance of lossy compression, where over training they learn by retaining only information in their training data relevant to their objective(s). We show pre-training results in models that are optimally compressed for next-sequence prediction, approaching the Information Bottleneck bound on compression. Across an array of open weights models, each compresses differently, likely due to differences in the data and training recipes used. However even across different families of LLMs the optimality of a model's compression, and the information present in it, can predict downstream performance on across a wide array of benchmarks, letting us directly link representational structure to actionable insights about model performance. In the general case the work presented here offers a unified Information-Theoretic framing for how these models learn that is deployable at scale.