NoteBankRead the paper

NoteBank

History Replays Itself: Unleashing Long-Context Capability in Linear Attention

PaperCode Coming soonBibTeX

Abstract

Linear attention promises the efficiency needed for long-context language modelling, yet its fixed-size recurrent state must simultaneously support ongoing computation and preserve information from an ever-growing history. This coupling has reinforced a prevailing view that the state’s memory capacity defines the model’s long-context capability. We challenge this presumed ceiling: recurrent computation need not bear the full burden of long-term storage. We introduce NoteBank, a sparse episodic memory that archives selected text before future queries are known, uses the backbone’s native features for writing and addressing, and reads retrieved evidence through its native forward computation via replay. This training-free, plug-and-play interface requires no external embedding model, separately trained retriever, or separate neural reader. At one million tokens, it raises Gated DeltaNet’s mean accuracy across six RULER retrieval tasks from 1.7% to 70.3%, with no observed significant retrieval degradation from 4K to 1M tokens. This recovery adds ≤0.025% to analytical FLOPs, with persistent context storage approximately 1/2,600 that of a Transformer’s full MHA KV cache at matched width, depth, and precision. Experiments extend from three 1.3B recurrent backbones to Mamba-2-8B and post-trained Qwen3.5-9B, demonstrating gains on LongBench v1/v2 and MemoryAgentBench. Together, these results show that sparse evidence storage and native replay can substantially expand the long-context capability of pretrained linear attention models while retaining the efficiency of recurrent computation.

An illustrative example 🕵️

Remember more. Train nothing. Sparse notes and native replay recover million-token retrieval.

Million-token retrieval, without training

At 1M tokens, GDN retrieval accuracy rises from 1.7% to 70.3%—with frozen weights.

Mean accuracy over six RULER retrieval tasks from 4K to 1M tokens. NoteBank outperforms Plain and JRT on GDN, GDN-2, and Mamba-2, with gains of 68.6, 66.6, and 37.8 percentage points at 1M.
GDN: NoteBank retrieval performance from 4K to 1M tokens; 68.6 percentage-point gain at 1M.
GDN-2: NoteBank retrieval performance from 4K to 1M tokens; 66.6 percentage-point gain at 1M.
Mamba-2: NoteBank retrieval performance from 4K to 1M tokens; 37.8 percentage-point gain at 1M.
Six RULER retrieval tasks · 1.3B modelsView full-size figure
Explore all six retrieval tasks

Single-needle and multi-evidence retrieval across context lengths.

Full RULER results by task, backbone, context length, and replay budget. Click to enlarge.

How NoteBank works

NoteBank architecture: write historical spans, address the archive with native features, and replay retrieved evidence through the frozen backbone.

1 Write

Save selected original text as each chunk is processed—before the question is known.

2 Address

Use the question’s native features to find relevant notes.

3 Replay

Read the retrieved notes, then the question, through the same backbone.

Almost a free lunch

Million-token memory, at a small additional cost.

Added computation

≤0.025%

additional FLOPs at 1M-token context

Analytical FLOPs, not latency.

Context storage
Full MHA KV cache192 GiB
74.5 MiBGDN + NoteBank

~2,600× smaller (for 1M tokens)

State + archive vs. matched full-MHA KV cache. Excludes weights and workspace.

GDNGDN-2Mamba-2

1M tokens · Drag either axis to explore. Recorded analytical costs; state + archive storage.

Measured runtime at 1M tokens
03 · MEASURED INFERENCE

And in wall-clock time?

GDN · H100 · batch size 1 · 32 generated tokens

Plain
125.11 s
+ NoteBank
140.64 s

At 1M tokens: +12.4% latency · peak GPU memory: 2.93 → 3.27 GiB, including model weights.

Plug-and-play · No additional training

NoteBank + Qwen3.5-9B

Beyond synthetic retrieval: stronger document QA and agent memory.

LongBench v2

Plain+ NoteBank
46.149.3

+3.2 percentage points

MemoryAgentBench

Plain+ NoteBank
55.756.8

+1.1 percentage points

Scores (%) · LongBench v2: 375 QA/dialogue examples · MemoryAgentBench: 2,100 QA examples.

LongBench v1 results

12-task average. NB-TF is training-free; NB-LoRA adapts the reader.

LongBench v1 · 1.3B backbones
BackbonePlain+ NB-TF+ NB-LoRA
Gated DeltaNet15.4916.0723.03
Mamba-26.7913.4317.10

BibTeX

@misc{nanbo2026notebank,
  title = {History Replays Itself: Unleashing Long-Context Capability in Linear Attention},
  author = {Li Nanbo and Firas Laakom and Yilan Zhang and Piotr Piękos and Yimeng Chen and Liangyu Wang and Yifan Xu and Mateusz Ostaszewski and Dandan Guo and Wenyi Wang and Yanning Dai and Yuhui Wang and Jürgen Schmidhuber},
  year = {2026},
  note = {Preprint}
}

Preprint citation. An arXiv identifier will be added upon release.

Acknowledgement

The research reported in this publication was supported by funding from King Abdullah University of Science and Technology (KAUST) - Center of Excellence for Generative AI, under award number 5940.

Share on WeChat

Scan with WeChat, then share with friends or to Moments.

QR code for https://nanboli.github.io/notebank-page/ https://nanboli.github.io/notebank-page/