Gradual Forgetting: Logarithmic Compression for Extending Transformer Context Windows
Billy Dickson, Zoran Tiganj
TL;DR
This work tackles extending transformer context without architectural changes by introducing a scale-invariant input preprocessing step that compresses the distant past using a log-spaced memory bank (Scale-Invariant Temporal History, SITH). The compressed history, computed as $\tilde{f}(t,\overset{*}{\tau})=\sum_{t'=1}^{M}\Phi(t',\overset{*}{\tau}) f(t-t')$ with $\Phi(t,\overset{*}{\tau})=\frac{k^{k+1}}{k!}\left(\frac{t}{\overset{*}{\tau}}\right)^k e^{-k t/\overset{*}{\tau}}$, is concatenated with the most recent uncompressed tokens and processed by an unmodified transformer. Experiments on WikiText-103 and PG-19 show perplexity improvements that grow with the memory size, achieving competitive results for models of similar parameter counts and demonstrating the practical viability of cognitive-inspired short-term to long-range memory mappings for language modeling.
Abstract
Most approaches to long-context processing increase the complexity of the transformer's internal architecture by integrating mechanisms such as recurrence or auxiliary memory modules. In this work, we introduce an alternative approach that modifies the input representation itself, rather than the transformer architecture. Inspired by cognitive models of human memory, our method applies a scale-invariant logarithmic compression to the input tokens. The resulting compressed representation is processed by a standard, unmodified transformer, preserving architectural simplicity. We evaluate this approach on the WikiText-103 and PG-19 language modeling benchmarks, showing a reduction in perplexity compared to uncompressed baselines. Moreover, performance improves consistently with longer compressed temporal contexts, showing that input-level logarithmic compression is a simple and effective way to extend a transformer's long-range memory.
