TL;DR
Lattice is a novel recurrent neural network (RNN) mechanism that solves the KV cache bottleneck in Transformers by compressing sequence history into a fixed number of memory slots. By framing memory compression as an online optimization problem, Lattice updates its memory exclusively with information orthogonal to its current state, eliminating data redundancy and achieving a 4x compression gain over competing architectures.
What Problem Does This Paper Address?
While Transformers excel at capturing long-range dependencies, their standard attention mechanism requires storing a Key-Value (KV) cache that grows linearly with sequence length. This leads to quadratic time and space complexity, creating a massive memory bottleneck during long-sequence inference.
Alternative architectures like State Space Models (SSMs) and linear RNNs attempt to fix this by using a fixed-size hidden state. However, their memory update rules are typically additive and state-agnostic—meaning the model writes new information without considering what is already stored. This causes "key interference" and overcapacity, where new tokens accidentally overwrite or dilute crucial historical context.
Lattice addresses this by introducing a state-dependent, non-linear compression layer that intelligently filters out redundant information before it ever touches the memory.
Methods
Lattice conceptualizes memory retention as a continuous, online optimization problem. It splits learning into two loops:
- The Outer Loop: Standard backpropagation that trains the model's projection weights across the entire dataset.
- The Inner Loop (State Update): A fast, token-by-token update of the internal memory state ($S_t$) designed to minimize a reconstruction loss.
The core innovation is the Orthogonal State Recurrence (OSR). When a new token arrives, Lattice decomposes it into two components relative to the current memory slot: a parallel component (information already captured by the memory) and an orthogonal component (entirely novel information). Lattice discards the parallel component and updates the memory slot only with the orthogonal component.
To keep the memory stable over long sequences, Lattice constrains the state vectors to a unit sphere via column-wise normalization. Mathematically, this elegant trick makes the update equivalent to performing gradient descent on a Riemannian manifold.
To scale training on modern hardware, the authors introduce a chunk-wise parallel form. Because the exact recurrence is non-linear and cannot use standard associative scans, Lattice linearizes the gradients within non-overlapping chunks, allowing parallelized matrix multiplications on GPUs and TPUs.
Datasets
The authors evaluated Lattice across several benchmarks:
- FineWeb-Edu: Used for standard language modeling and zero-shot common-sense reasoning tasks.
- Books3 (from The Pile): Used to analyze how well the model scales as context lengths grow from 512 up to 16k tokens.
- The Pile: Used for short-context evaluations (2k and 8k tokens).
- Multi-Query Associative Recall (MQAR): A synthetic, recall-intensive benchmark requiring the model to retrieve multiple key-value pairs over long distances to test raw memory capacity.
Key Insights and Ideas
- Memory as a Dynamic Dictionary: Instead of relying on heuristic gating mechanisms (like standard LSTMs or GRUs), memory updates can be derived directly from optimization principles using a single gradient descent step.
- Orthogonality Prevents Interference: Forcing updates to be orthogonal to the existing state ensures that the model never wastes memory capacity on redundant data, drastically reducing interference.
- Inherent Forgetting via Projection: Explicit forget gates are largely unnecessary. Projecting the updated states back onto the unit sphere inherently acts as an adaptive forgetting mechanism, stabilizing the model over long sequences.
Key Results
Lattice consistently outperforms strong sub-quadratic baselines (including Mamba2, GLA, TTT, and DeltaNet) as well as Transformer++ across various context lengths and model sizes.
- 4x Compression Gain: In ablation studies, Lattice with only a quarter of the memory slots ($m=16$) outperformed TTT with full memory ($m=64$), proving that the orthogonal update mechanism utilizes fixed-state capacity far more efficiently.
- Downstream Accuracy: On zero-shot common-sense reasoning benchmarks (such as PIQA, HellaSwag, and WinoGrande), Lattice achieved the highest average accuracy among all tested sub-quadratic models.
- Robust Associative Recall: On the challenging MQAR task, while baselines degraded as context length scaled from 1024 to 2048, Lattice maintained high accuracy across both lengths.
Limitations and Future Work
Despite its strong performance, Lattice has two notable limitations:
- Computational Overhead: Computing the orthogonal projection introduces an extra $O(dm)$ computational cost per step compared to simpler, fully linear RNNs.
- Parallelization Bottleneck: Because the exact update rule is fundamentally non-linear, Lattice cannot utilize inter-chunk parallelization via associative scans. This limits its raw hardware utilization compared to purely linear models.
The authors suggest that future work should focus on developing hardware-optimized kernels or exploring multi-stage hierarchical training processes to maximize TPU/GPU throughput.
Summary updated