How AHN works: Lossless vs. Compressed Memory
mainArtificial Hippocampus Networks (AHNs) are designed for efficient long-context modeling by combining two types of memory:
- Lossless Memory: Typically the attention mechanism's Key-Value (KV) cache. It stores exact input information but grows linearly with sequence length, making it computationally expensive for very long contexts.
- Compressed Memory: Typically an RNN-style hidden state. It maintains a constant size and fixed computational cost per token, but it suffers from information loss.
The AHN Mechanism: AHNs continually convert information from the lossless memory (located outside the current sliding attention window) into a compact, compressed form. The model then uses both the lossless information within the sliding window and the compressed memory to make predictions, allowing for efficient long-context processing.