DilutionAttention v0.1.0 · results

Attention that keeps working past its training context

Dilution attention divides each query's softmax bid on a key by the demand that key has already absorbed from earlier queries. Trained at 16K tokens with no position encoding, 209-million-parameter models built on it retrieve planted keywords out to 128K tokens — eight times their training context — in both seeds, with no scaling rule and no fine-tuning. Softmax trained the same way retrieves 0.17–0.19 at its own context and nothing beyond it.

8×

training context, retrieval held

0.91–1.00 to 128K, both seeds

0.17–0.19

softmax at its own 16K context

same recipe, no position encoding

0

learned parameters in the operator

same O(T²) class as softmax

2.2×

softmax's training time

the cost, measured at 16K

The headline comparison is between 24-layer, 209-million-parameter decoders trained at a 16K context on 4.19 billion FineWeb-Edu tokens (a Chinchilla-matched budget), two seeds per arm. Every arm shares the architecture, data, schedule and learning rate; only the attention operator, its position encoding and the seed differ.

The operator

Standard attention lets every query spend a fixed budget across the keys behind it, and nothing records how much of a key other queries have already used. Dilution keeps the softmax bids and adds a price: before a bid is honoured it is divided by the demand its key has already received from earlier queries, so a key that many queries have claimed yields a smaller share. Each query's shares are then renormalised to sum to one.

p         = causal_softmax(q k^T / sqrt(d))     # bids
committed = exclusive_cumsum_cols(p)            # demand from earlier queries
share     = p / (committed + p + eps)           # each bid against cumulative demand
A         = share / rowsum(share);   out = A @ v

One softmax, one cumulative sum and one renormalisation: the same O(T²) class as standard attention, with nothing learned inside the operator. Cached decoding needs the ordinary key/value cache plus one running demand total per key and head.

The closest precedent is temporal attention (Sankaran et al., 2016), which divides each raw attention score by the scores earlier decoder steps gave the same source position, then renormalises. Dilution keeps that division but changes what is accumulated and what it is divided by. It accumulates softmax-normalised bids, so every query adds exactly one unit of demand in total, whatever the magnitude of its raw scores, and every share stays at or below one. And it counts the current bid in the demand, which keeps the operator defined where a key first becomes visible.

The second change is load-bearing in causal self-attention. Dividing by earlier demand alone gives zero at each key's first query — the key itself — so that entry wins its row outright; a model trained that way kept its first layer as an identity map and lost 0.072 nats (one seed each). Whether normalised bids beat raw exponentials in practice is untested: our raw-exponential runs overflowed. The contribution here is this form as a language model's self-attention, the controlled study around it, and exact fused kernels.

Retrieval past the trained context

The models were asked to retrieve a keyword planted at varying depths in haystacks from 3.8K to 256K tokens. Everything to the right of the vertical rule is longer than any sequence the model saw in training. Each row is one trained model; the seeds are shown separately because how far a model reaches varies between seeds of the same recipe.

Retrieval past the trained contextHeatmap of keyword-retrieval accuracy by haystack length for 209M models trained at 16K. Both dilution seeds without position encoding stay at 0.91 to 1.00 out to 128K and reach 0.63 to 0.79 at 256K. The alt6 hybrid holds to 32K and fades by 64K to 128K. Softmax with RoPE falls to chance by 32K, and softmax without position encoding retrieves 0.17 to 0.19 at 16K and chance beyond.Keyword retrieval by haystack length · 209M parameters, trained at 16Kshare of planted keywords retrieved · chance is 0.14 · every seed shownin contextpast the trained context · no fine-tuning3.8K16K24K1.5×32K2×64K4×128K8×256K16×Dilution, no position encodingseed 1337 †1.001.000.990.960.990.960.63seed 23571.001.001.001.001.000.910.79Alt6: dilution + RoPE softmax, NTK past 16Kseed 13371.001.001.001.000.410.14–seed 23571.001.001.001.000.970.430.14Softmax + RoPE (control), NTK past 16Kseed 13371.000.790.170.140.14––seed 23570.970.640.640.140.14––Softmax, no position encoding (control)seed 1337 †0.460.190.110.130.140.140.14seed 23570.420.170.140.140.140.140.14
Likelihood-scored retrieval: eight candidate keywords, one disqualified by a control prior, so chance is 1/7 ≈ 0.14. In-context cells use 20 depth placements and cells past the context use 10. Models with RoPE layers use dynamic NTK scaling past the trained context; models without position encoding run unmodified. – not evaluated. † scored with the earlier version of the protocol: the checkpoint was trained further afterwards and could not be re-scored.

Long documents

Keyword retrieval is synthetic, so the same models were also scored on real long text: 29 books from PG-19, out-of-domain for a model trained on educational web pages, read to 128K tokens. Loss is averaged over each range of positions.

Long-document loss by positionLine chart of loss by position along 29 PG-19 books. Past the first thousand positions and inside the 16K trained context, all models sit between 3.4 and 3.9 nats, with dilution slightly behind softmax with RoPE. Past 16K, dilution stays flat at about 3.6 to 128K, the alt6 hybrid rises to 4.0 to 4.2, softmax with RoPE and NTK scaling rises to 5.3 to 5.5, and softmax without position encoding to 6.2.Loss along 29 PG-19 books, out to 128K tokens · 209M, trained at 16Knats per token, by position in the book · lower is better3.54.04.55.05.56.05121K2K4K8K16K32K64K128Kposition in the book (end of each range, tokens)past the trained context →Softmax, no PE6.20Softmax + RoPE, NTK5.34 / 5.54Alt6 hybrid, NTK3.98 / 4.21Dilution, no PE3.60
Past the trained context, dilution's loss stays flat to eight times its training length, while softmax with RoPE and NTK scaling ends 1.7–1.9 nats worse. Inside the context the ordering reverses on these out-of-domain books: dilution trails softmax with RoPE by 0.05–0.08 nats. Dilution's other 1× seed was trained on to twice the tokens; at that budget both dilution seeds stay flat to 128K (3.33–3.41 nats) while both softmax-without-position-encoding seeds climb to 7.3–8.5.

Generated text

Loss is measured on text the model is given. To check that the models also write, each continued the same 256 validation prompts, and a larger model (SmolLM2-1.7B) scored how natural the continuations were.

Judged sample quality inside and past the trained contextBar chart of judge bits per byte. With a 16K prompt every model scores 1.06 to 1.12. With a 32K prompt, two times past the trained context, dilution scores 1.14 and the alt6 hybrid 1.20, while softmax with RoPE degrades to 1.87 and 2.15.Judged quality of generated text · 209M, trained at 16Kjudge bits per byte of 256-token continuations · lower is more natural16K prompt (inside the trained context)32K prompt (2× past it)dilution, no PEseed 23571.121.14alt6 hybridseed 13371.101.20alt6 hybridseed 23571.061.20softmax + RoPEseed 13371.111.87softmax + RoPEseed 23571.122.14
Nucleus sampling (top-p 0.9), 256 prompts per cell; the human continuation scores 0.65–0.70. Inside the trained context the models are level. At twice the context, softmax with RoPE writes incoherent text while dilution stays within 0.03 of its in-context score. The judge reads only the last 4,096 tokens of each prompt, so this shows dilution remains a working language model past its window, not that it uses information from 32K tokens back. With no position encoding at twice the training budget, dilution scores 1.00 / 1.02 at 2× past the context, softmax 3.33 / 2.31.

What it costs

Inside the trained context the gain is small, and dilution is slower to train. The alternating hybrid, which gives each operator its own best position mode, has the best in-domain loss and recovers part of the speed.

In-domain loss and training throughputDot plot and bar chart. Validation loss for two seeds each: alt6 3.039 and 3.040, dilution without position encoding 3.057 and 3.055, softmax with RoPE 3.088 and 3.079, softmax without position encoding 3.212 and 3.291. Training throughput: dilution 33.4K tokens per second, alt6 44.0K, softmax with RoPE 71.9K, softmax without position encoding 74.7K.In-domain loss and training cost · 209M, trained at 16KValidation loss · lower is betterTraining throughput · tokens/s3.003.103.203.30dilution, no PE3.057 / 3.05533.4Kalt6 hybrid3.038 / 3.04044.0Ksoftmax + RoPE3.088 / 3.07971.9Ksoftmax, no PE3.212 / 3.291*74.7K
Validation loss on one common slice of held-out FineWeb-Edu, seeds 1337 / 2357. *This softmax seed hit gradient spikes early in training and never recovered. Throughput is the logged training rate on one RTX PRO 6000 Blackwell with the released fused kernels: at 16K, dilution takes about 2.2× softmax's training time. The in-domain margin depends on context length: softmax with RoPE is ahead by 0.036 nats at a 1K context, and dilution ahead by 0.028 at 16K.

What this does not establish

These are controlled results at up to 209 million parameters. They do not establish that the behaviour holds at substantially larger scale, and the retrieval test is synthetic: likelihood-scored keyword retrieval, not a downstream long-context task.

How far retrieval extends varies between seeds, and loss does not show it. Both seeds above hold to eight times their context, but trained on to twice the tokens, one seed reaches only about twice its context while the other stays near-flat, at nearly identical loss (2.857 and 2.854). Across the settings we ran, the range runs from 2× to 8×, and we report it as a range rather than a single number.

Why dilution extrapolates is not established. A plausible reason is that the running demand total carries no distance scale, but that has not been tested causally. Inside the trained context, dilution is not a better language model than softmax with RoPE in general: in-domain it leads by 0.028 nats at 16K and trails by 0.036 at 1K, and on out-of-domain books it trails by 0.05–0.24 nats.

Everything behind these charts

Every number on this page is backed by a raw record. The release ships the reference implementation and fused Triton kernels with exact gradients for training, prefill and cached decoding; the training and evaluation code; the configuration, metrics and data provenance of the 101 runs behind the results; every result file behind these charts, including per-sample generation metrics from which a script recomputes every published statistic; an evidence ledger that keeps withdrawn claims; the weights of all 16 models; and a technical report. Code is Apache-2.0 licensed; documentation and results are CC BY 4.0.