Frontier Lab Notes

Long Context and Efficient Sequence Models

Long-context modeling asks how LLMs can read, retain, retrieve, and reason over very long sequences without attention cost exploding.

Primary sources:

The Long-Context Problem

Full attention scales quadratically in sequence length during prefill/training:

cost ~= O(T^2)

For generation, the KV cache grows linearly with context length and layers:

memory ~= O(T * layers * kv_heads * head_dim)

Long context is therefore both an algorithm problem and a serving problem.

Three Kinds Of Long Context

Do not treat all long context as the same.

1. Retrieval Context

The answer is somewhere in the prompt. The model must find and use it.

Failure mode:

2. Working-Memory Context

The model must maintain evolving state across a long interaction or document.

Failure mode:

3. Reasoning Context

The model must use long chains of intermediate computation.

Failure mode:

Positional Generalization

Position schemes matter because a model trained on shorter lengths may fail at longer lengths.

Approaches include:

The key lesson: "supports 1M tokens" is not the same as "reliably reasons over 1M tokens."

Efficient Attention

Approaches:

Each approach trades expressivity, implementation complexity, and hardware efficiency.

State-Space And Recurrent Alternatives

Models such as Mamba, RWKV, and RetNet explore alternatives to full attention.

Why they are interesting:

Why transformers remain dominant:

Evaluation Traps

Long-context benchmarks can be misleading.

Ask:

Research Questions

Related