Manuscript Offprint
arXiv:2611.01472Causal Optimal-Transport Attention: Positional Priors and Length Extrapolation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Causal masking obstructs the column balancing used by optimal-transport (OT) attention. We study a prefix-consistent unbalanced operator and characterize the positional prior it induces. Under bounded scores, for any fixed balancing strength , its fixed point dilutes attention: every fixed window receives a vanishing share as the context grows. For constant scores, we derive an exact scale-invariant prior. We then classify positional encodings by whether their distant attention mass remains bounded away from one. Discrete window-mass bounds quantify the finite-length dilution of summable log-distance priors near exponent one. Preregistered experiments with 25M- and 100M-parameter language models establish improved loss extrapolation over softmax; exploratory comparisons favor an explicit distance bias at a fraction of the cost. CABLE outperforms RoPE with evaluation-time YaRN on every seed at three training lengths. Changing only the bias beyond the training length moves long-context loss in the predicted direction on all 30 tested checkpoints. Even with exponents constrained above one, many heads approach the summability boundary during training. A margin selected by prior-only calculations for a specified window, length range and growth tolerance controls distant-mass growth in the tested setting. These results connect loss extrapolation to positional decay over the lengths actually evaluated.
1 Introduction
Softmax attention normalizes each query's scores into a distribution over keys. Read through optimal transport, this is one row-normalization step of the Sinkhorn algorithm for an entropic OT problem, and also the exact solution of a one-sided entropic OT problem [19, 34]. Iterating Sinkhorn to convergence also enforces the column marginal [38]; with the uniform marginal used by Sinkformers, every key then receives the same total attention. Doubly stochastic attention has been proposed for non-causal models [34, 42]. It can empirically slow rank collapse, although pure self-attention still approaches rank one with depth [16].
Language models are causal, and here the column constraint breaks in two ways (Section 2). First, the only lower-triangular doubly stochastic matrix is the identity, so balanced OT degenerates. Second, relaxing the column marginal is not enough: any column normalization whose column sums run over all rows makes the output of row depend on row , whose query is computed from the token that row is trained to predict. Under teacher forcing this leaks the label and lowers the validation loss artificially. Recent work on doubly stochastic attention lists the causal column marginal as an open problem [42]; Foss [11] uses prefix column masses to avoid future leakage with a different update (Section 6).
We study the operator that resolves both obstructions: an unbalanced Sinkhorn iteration whose column scaling for row uses only the prefix mass . It is prefix-consistent by construction, interpolates between softmax () and a strongly balancing regime (), and at its fixed point takes the form
where is the log-normalizer of row . In a preregistered comparison at 100M parameters, this operator lowers the validation loss at twice the training length by 0.45 nats relative to softmax. It also beats log- softmax, which multiplies the scores by a factor growing like [5, 25], by 0.30. The correction enters the logits where an additive positional bias would, and the evidence points to its dependence on distance: an explicit learnable log-distance bias with softmax does better, at 40% of the cost.
This paper explains why, and what the result says about positional priors in general. Our main object is the implicit prior of the causal OT operator: the attention pattern it produces when content does not discriminate between keys. The far mass at a given context length is the attention that queries put on keys more than the training length back. Attention dilutes if the share of every window of fixed size vanishes as the context grows. A relative prior is summable if its weights, as a function of distance, have a finite sum; a fixed window then keeps a share bounded away from zero, and the far mass stays bounded. The OT prior is not a function of distance alone, so for it we speak of dilution only.
-
Exact prior. With constant scores, uniformly on compact subsets of (Theorems 6 and 7): the prior depends on the ratio , and near the diagonal it is an exact power law (Theorem 8). The same limit holds after any fixed number of iterations (Theorem 9), and with i.i.d. bounded scores the fixed point factors into this prior times softmax-like content weights (Proposition 10).
-
Far mass of positional encodings. Writing positional schemes as potentials on the logits, we show that finite-dimensional group representations cannot produce a logarithmic kernel (Proposition 12), and which common encodings keep a bounded far mass and which dilute (Proposition 14, whose sufficiency direction for relative biases is due to Qin et al. [33]). Refining finite-length power-law analyses of Marín [22], we give discrete near-boundary window-mass bounds under bounded content (Corollary 16).
-
Experiments. The OT operator's gain over softmax holds in a preregistered test at 100M parameters, and exploratory analyses trace it to the distance prior (Section 5.1). Across fifteen positional schemes, far mass and long-context loss group by the cases of Proposition 14, not by the form of the bias (Section 5.2). Changing a trained model's bias only beyond the training length moves its long-context loss in the predicted direction on all 30 checkpoints, and a margin on a learned exponent bounds the far mass during training (Section 5.3); CABLE beats RoPE with YaRN on every seed at three training lengths (Section 5.2).
Scope. All theory concerns causal attention with a prefix-consistent operator. Without a causal constraint the column marginal is a genuine constraint and none of the results apply; we return to this in Section 7. Our measure of extrapolation is the validation loss beyond the training length, which rewards not being disturbed by distant context rather than using it.
2 Background: attention as optimal transport under a causal mask
Attention. One head of a Transformer [43] maps queries , keys and values (; will denote a scaling vector) to outputs with attention weights
where is the head dimension, an optional additive positional bias, and the keys that query may attend to: under the causal mask of a language model, with support . With the kernel this is , where rownorm divides each row of by its sum over . We keep the temperature explicit (all models use ) because it is the entropic regularization strength: row of softmax maximizes , , over probability vectors [26, §§2.2–2.3].
Entropic optimal transport and Sinkhorn. Entropic OT [7, 30], with cost , sums this objective over the rows and constrains both marginals,
with solution . Sinkhorn's algorithm alternates the row and column scalings,
each step enforcing one marginal exactly (divisions are entrywise). With and the start the first row step gives : softmax is the first half iteration of Sinkhorn [34]. In the log domain acts as a bias on key that lowers the logits of keys receiving more than their share .
Unbalanced transport and . Replacing the hard column constraint in (2) by a penalty keeps the row step and damps the column step,
[6, Table 1]; see also Fukunaga and Kasai [12]. Only the fraction of the balancing bias is applied: is balanced Sinkhorn and returns softmax. The row constraint stays hard, so every output is a weighted average of the values; relaxing it too would give row a total mass growing like a power of under a causal mask, and outputs beyond the training length larger than any seen in training.
Two obstructions to the column constraint.
Lemma 1 (Triviality of causal doubly stochastic matrices). A nonnegative lower-triangular matrix with all row and column sums equal to one is the identity.
Proof. Column has a single entry , so and row has no other mass. Removing row and column leaves a matrix with the same property; induct.
Relaxing the column marginal avoids this degeneracy, but a column sum over all rows makes row depend on rows and leaks labels under teacher forcing (Section 1). We call an operator prefix-consistent if row of its output depends only on rows of its input, and require it under a causal mask.
The prefix-consistent unbalanced operator. Following the prefix-mass construction of Foss [11], we replace the column mass by (), the mass that column has received from rows . Starting from the all-ones array , iteration sets
where is the prefix mass of , is the entrywise product, and acts entrywise. Unlike the vector of (3), and are lower-triangular arrays: the scaling that row applies to key depends on . Every iteration ends with a row normalization, so the output is row-stochastic; is softmax. The damping acts on the accumulated scaling , as in unbalanced Sinkhorn; damping the relative update instead would keep the balanced fixed point, the identity of Lemma 1. At a fixed point with :
(FP)
where is the normalizer of row . The operator solves no single OT problem: row is balanced against the prefix mass available at time . The correction sits where an additive positional bias would. Under uniform attention grows with distance, since distant keys have been seen by more queries, so the correction down-weights them; Section 3 makes this precise. We use and throughout, and write with ; Appendix A collects the notation.
Bounded scores. In a pre-norm Transformer [49] every attention layer reads a LayerNorm output [3], whose norm is bounded by a constant of the model, so queries, keys and every quantity computed linearly from the input are bounded independently of the length (bounded inputs). The scores are bounded by if for all . This holds for dot-product scores with rotary encodings [40], which preserve norms, and fails for biases that decrease without bound in the distance, such as ALiBi's [32] or a log-distance bias . Section 3 shows that bounded scores dilute attention, and a position term escapes this only by such unbounded decay.
3 The implicit prior of causal OT attention
This section asks which preference over positions the operator imposes by itself, with no positional encoding added. The fixed point is computed row by row (Section 3.1); under bounded scores every fixed window loses its share of attention (Section 3.2); without content the prior has an explicit, scale-invariant shape (Section 3.3), which survives finite iterations and i.i.d. content (Section 3.4). All proofs are in Appendix B. Throughout, and is the fixed point (FP) unless stated otherwise; denotes a window length, which in the experiments is the training length.
3.1 A row recursion
Prefix consistency turns (FP) into a recursion over rows. Given rows , let be the mass that column has received (). Since , the unknowns of row solve
Here and are known from the previous rows and the scores; only the and the normalizer are unknown, which is why we drop the row index.
Lemma 2. For any , (FP) has a unique solution, obtained row by row from (6). Each is increasing in and decreasing in , and , i.e. , with equality on the diagonal. At every fixed finite length, iteration (5) converges to this solution.
The mass a column has received is determined, up to a constant factor, by the normalizers of the rows that have seen it.
Lemma 3. For ,
For constant scores the sum is , the clock time elapsed since key appeared. This elapsed time fixes , and with it the correction , up to a factor between and , which tends to away from the diagonal (Lemma 18). Both lemmas hold for arbitrary scores.
3.2 Dilution
How much attention can a fixed window keep? The row normalizer sets the scale of every entry of a row, and it is at most of order :
Lemma 4. If then . With constant scores, .
Theorem 5 (Dilution under bounded scores). If , then for all
For every and every bounded content, no fixed window keeps a positive share of attention as the context grows: attention dilutes. The bound is asymptotic, saying nothing until , and it says that attention spreads out, not in what shape; the shape can be computed exactly once content is removed.
3.3 The scaling limit with constant scores
With constant scores what remains is the prior the operator imposes by itself. Let
Theorem 6 (Asymptotics of the row normalizers). With constant scores, . For , .
The bound of Lemma 4 is thus attained up to a factor that depends on alone.
Theorem 7 (Scale-invariant limit shape of the implicit prior). With constant scores, for every , uniformly in ,
The prior depends on the key only through its relative position , and its total mass is . It increases toward the query, where it has an integrable singularity at , and decays only logarithmically toward the start of the context , so a key at any fixed fraction of the context keeps a weight of order .
Theorem 7 excludes keys near the diagonal, where the window mass is decided. There for , and the limit becomes a power law.
Theorem 8 (Power law near the diagonal). Let and let solve . With constant scores,
-
for fixed ,
-
for with , .
The two regimes, fixed in (1) and in (2), match: by Lemma 21, , and since , the limit in (1) behaves for large like the power law of (2). The fixed point is thus described exactly at every scale: a discrete profile for , the power law for , and for (Figure 1). Globally the prior depends on , not on : its scale invariance concerns relative position , whereas a relative position bias depends on distance alone. For softmax every entry lies in ; the OT operator attains the slower rate that Theorem 5 allows: for a fixed window, (Remark 22), and for a window the share tends to .
3.4 Finite iterations and content
A trained model differs in two ways: implementations stop after a few iterations, and the scores carry content. Under constant and i.i.d. scores respectively, neither changes the shape.
Theorem 9 (Limit shape after finitely many iterations). With constant scores and any fixed , the -th iterate (5) satisfies uniformly on .
Further iterations change only a constant, which the row normalization removes, so the prior is set by , not by the number of iterations. Convergence in is slow when is small and large: with two iterations at the amplitude is 13% too large for (Appendix D.3). Lemma 2 gives convergence in at fixed length, without a rate uniform in length.

Figure 1: The implicit prior with constant scores. Left: the last row of the fixed point at (circles, every 100th key) against the limit shape of Theorem 7 (lines). Right: the same row near the diagonal for , multiplied by so that the power law of Theorem 8(2) is the line 1. The fixed point (circles) follows the discrete profile of Theorem 8(1) at small , the power law for , and the limit shape , here , as approaches .
Proposition 10 (Factorization of the fixed point under i.i.d. content). Let be i.i.d. with and . Then, almost surely, and, for every ,
The fixed point is the universal prior times the content weights that softmax would use: summed over many rows, the column mass averages the content out (numerically within 2%, Appendix D.2).
4 A potential view of positional biases
Section 3 showed that the OT correction acts as a positional prior that dilutes under bounded scores, as softmax does, and that a position term escapes dilution only by decreasing without bound in the distance. This section asks which explicit schemes do better, that is, keep a bounded far mass. We write every scheme as a potential on the logits,
with a multiplicative group action (RoPE [40], GRAPE-M [50]), an additive or path potential (ALiBi [32], KERPLE [4], GRAPE-A/AP [50], FoX [18], CABLE [45], and the OT correction ), and the row's log-normalizer . A bias is relative if for all . Proofs are in Appendix C. Terms that depend only on the row drop out, which already identifies several schemes with simpler ones:
Proposition 11. Adding to row of the logits, for any that may depend on row 's content, leaves both softmax and the fixed point (FP) unchanged.
Consequently, a path potential whose increments do not depend on the endpoint, , is the column potential ; ALiBi and the Forgetting Transformer [18, 32] are of this kind (for ALiBi see also Litman and Guo [20, Prop. G.6]). CABLE [45], with a content clock , reduces to the rank-one interaction .
4.1 Kernels of finite-dimensional representations
Let position enter through a representation on a space of dimension : the bias of query on key is with the kernel , where the vectors are set by the encoding's parameters and, for a multiplicative encoding, by the content. The results below hold for every and . This covers additive encodings built from group actions and, for orthogonal , the dot-product score at fixed .
Proposition 12. (i) For , is an exponential polynomial, with the nonzero eigenvalues of and polynomials . (ii) No real of this form satisfies with . (iii) If the scores are bounded by , softmax satisfies ; with an orthogonal multiplicative encoding and bounded inputs, attention therefore dilutes.
Part (ii) rules out logarithmic kernels for every finite-dimensional construction; part (iii) says that rotary-type encodings cannot avoid dilution on their own.
4.2 Which encodings keep a bounded far mass
We say that attention keeps a bounded far mass if, for some window , the mass beyond distance stays below a constant smaller than one for every . This excludes dilution, where the mass beyond every fixed window tends to one. For a relative bias with bounded content, keeping a bounded far mass is the same as having summable weights : the window's share is over , up to the factor . Biases that depend on content have no single sequence of weights, so for them, and in Section 5, we use far mass. A linear lower bound on the decay suffices:
Lemma 13. Let with , and , . For every fixed , the OT fixed point obeys
for every ; softmax is the case .
Proposition 14 (Far mass of common encodings). Assume bounded inputs (Section 2). For each head:
-
ALiBi, FoX, GRAPE-A, GRAPE-AP [50] and OT on ALiBi (O2) keep a bounded far mass for all parameter values;
-
RoPE, GRAPE-M and the OT operator dilute for all parameter values;
-
a log-distance bias keeps a bounded far mass if and dilutes if , and so does KERPLE's with and in place of ;
-
with an exponent set by the query's input, on the distance (P6) or on a content clock (LC), the head keeps a bounded far mass if and dilutes if , over the admissible inputs ;
-
CABLE keeps a bounded far mass if its clock's pre-activation is bounded below by a positive constant over the admissible inputs, and dilutes if it is never positive.
In the cases left open by the last two items, the outcome depends on the input sequence. Summability as a sufficient condition for sliding-window approximation of attention outputs, including the threshold for logarithmic kernels, is due to Qin et al. [33]; the dilution items are the converse direction under bounded scores, which for softmax is the dispersion result of Veličković et al. [46]. The bound for O2 holds at the fixed point for each fixed , and is not uniform as .
4.3 Power priors near the boundary
Proposition 15 (Window mass of power-law priors). For the prior and constant content, the mass within distance of the diagonal at row is for , for , and tends to for , where . Bounded content changes these quantities by at most a factor .
The boundary dilutes only logarithmically. Marín [22] studies finite-length power-law normalization and continuous retention windows. The following bounds treat discrete window mass with bounded content.
Corollary 16 (Log-distance exponents near one at finite length). For with and constant content, the mass within distance of the diagonal at row satisfies
Bounded content changes these bounds by at most a factor .
Up to lengths of order such a bias therefore dilutes like , and it approaches its summable limit only once (Figure 2).
5 Experiments
All models are decoder-only pre-norm Transformers trained from scratch on FineWeb-Edu [28] (sample-10BT) with the GPT-2 tokenizer and evaluated on a held-out shard. Extrapolation is measured by the validation loss (nats per token) beyond the training length ; is its mean at and . The far mass is the attention on keys more than back, averaged over the queries in the second half of two validation sequences and over layers and heads. Four experiments were preregistered, with decision rules fixed and unit-tested before any run, and all reported runs come from committed code; analyses outside the preregistered rules are called exploratory where they appear. Configurations, the rules and their outcomes (Table 11), supplementary results, and the public code version are in Appendix E. We first ask where the extrapolation gain of the OT operator comes from (Section 5.1), then compare far mass and long-context loss across positional schemes and training lengths (Section 5.2), and finally change the tail of the bias, at test time and during training, to test whether it matters causally (Section 5.3).

Figure 2: Attention mass beyond a window at row for the prior with constant content (Corollary 16), against the context length; the shaded range is the one used in our experiments; (dashed) nearly overlaps . The linear bias (dotted) uses ALiBi's slopes and keeps a bounded far mass (Lemma 13); its far mass is averaged over eight heads.
5.1 The positional effect of causal OT
We compare the prefix-consistent operator with softmax at 99.2M non-embedding parameters, RoPE, and 2B tokens, three seeds per arm: softmax, log- softmax [5, 25], and the operator with , run for a fixed number of iterations (5) whose residual is checked after training (Appendix E.1).
At , is lower than softmax by 0.455 and than log- softmax by 0.303, on every seed (Table 1).
Table 1: OT attention at 100M: validation loss in nats per token (mean sd over three seeds) at the training length (1024) and at twice the training length. The last row is an exploratory follow-up with the same configuration.
| Arm | val@1024 | val@2048 | s/step |
|---|---|---|---|
| softmax | 3.0439 0.0023 | 3.5970 0.0285 | 0.42 |
| log- softmax | 3.0459 0.0032 | 3.4456 0.0596 | 0.45 |
| OT, | 3.0388 0.0038 | 3.3379 0.0471 | 0.98 |
| OT, | 3.0344 0.0010 | 3.1423 0.0544 | 1.54 |
| softmax + learnable | 3.0254 0.0023 | 3.0147 0.0075 | 0.62 |
Exploratory analyses support a positional explanation of this gain. In separate 25M screening models with , the correction averaged over all query-key pairs at the same distance decays like with (, against at most 0.75 for a linear fit), so it multiplies the attention weights by about ; with constant scores Theorem 8 gives . An explicit learnable log-distance bias with softmax beats at both lengths on every seed, at 40% of the cost (Table 1, last row), and evaluation-time YaRN scaling with temperature [29] recovers 97% of the OT gain for a softmax model. These comparisons do not separate the distance part of the trained correction from its content part (Appendix E.2).

Figure 3: Exploratory: far mass (top) and validation loss (bottom) against the evaluation length at 25M, means over two seeds, one column per case of Proposition 14; each row shares its vertical axis. Values for every arm, including the small differences within the bounded case, are in Table 7.
5.2 Far mass and long-context loss across encodings and training lengths
The preregistered screening trains models with 25M non-embedding parameters, and 0.5B tokens, two seeds per arm, with fifteen positional schemes (Table 6): RoPE alone (B0), additive distance biases with linear and logarithmic kernels and learned or input-gated exponents, a log bias on a content clock, three GRAPE encodings [50], FoX [18], CABLE [45], and the OT operator on RoPE (O1) and on ALiBi (O2). Every scheme with a distance or path bias reaches , against 3.865 for RoPE alone and 3.573 for OT on RoPE. Contrary to our preregistered expectation, power-law biases do not extrapolate best: the linear family (CABLE, ALiBi, GRAPE-A, FoX) is at least as good.
In an exploratory analysis of the thirty checkpoints, far mass and long-context loss move together and group as Proposition 14 predicts (Figure 3). The schemes that dilute for all parameters gain far mass with length, up to 0.63–0.90 at 16L, and their loss rises: the dilution of Theorem 5 is visible already at these lengths, although its bound is not. Those with a bounded far mass for all parameters stay at 0.01–0.02 and their loss keeps falling. Those decided by learned parameters lie in between: CABLE learns a clock that ticks and keeps its far mass at 0.05, and the log-bias schemes follow their learned exponents, most of which stay below one (Table 7). The same grouping holds at 100M (Appendix E.3).
This grouping is a correlation at one training length. A preregistered retest at 100M compares CABLE, the best scheme of the screening, with RoPE under evaluation-time YaRN scaling (B0 + YaRN-t) on new seeds at , 2048 and 4096, with a threshold of 0.01 set from the paired-difference standard deviations (0.0013–0.0027). The earlier test failed its 0.117 threshold, set from B0's absolute seed spread, with an improvement of 0.058; the new test does not revise that outcome (Appendix E.3). CABLE's is lower on every seed at each length (Table 2). Part of the gap is a lower loss at L; the rest, measured from each arm's own loss at L, is smaller at longer L, but training length, model quality and effective context change together, so we report this split only descriptively.
Table 2: Retest at 100M on new seeds: B0 + YaRN-t minus CABLE in (range over seeds), B0 minus CABLE at the training length (), and their difference, the gap beyond measured from each arm's own loss at . Absolute losses are in Table 9.
| Training length (seeds) | gap in | gap at | gap beyond |
|---|---|---|---|
| 1024 (5) | 0.059 (0.055–0.063) | 0.019 | 0.040 |
| 2048 (3) | 0.065 (0.062–0.071) | 0.030 | 0.035 |
| 4096 (3) | 0.074 (0.070–0.078) | 0.045 | 0.029 |



Figure 4: Test-time interventions beyond the training length: loss change at the longest length ( at 25M, at 100M) for each of the 30 checkpoints, with the mean of each group (bar). Colours are the case of the arms each intervention is applied to; the panels have separate linear axes (values in Table 10, loss curves of three checkpoints in Figure 5).
5.3 Interventions on the tail, at test time and during training
The summability criterion behind Proposition 14 motivates interventions on the bias tail. It concerns attention dilution under bounded content scores; it does not guarantee lower loss. We test whether removing tail decay raises long-context loss and imposing summable decay lowers it. On trained checkpoints at 25M and 100M, we change the total additive bias only at distances , preserving the bias within the training length; measured losses agree within . Cap replaces by , removing tail decay; repair continues it as , a summable power-law tail; window subtracts from RoPE's zero bias, with the geometric mean of the ALiBi slopes. Caps are applied to the schemes with a bounded far mass, repairs to log-bias schemes and windows to RoPE alone. During training, we constrain the exponents of the learnable log bias (P1) to , by the reparametrization , and then to with a margin chosen in advance from the far mass of the prior over the lengths in use (Appendix E.5).
The loss at the longest length moves in the preregistered direction on all 30 checkpoints, by +0.039 on average for caps, -0.200 for repairs and -2.25 for windows, and the far mass moves with it (Figure 4, Table 10). The constraint lowers the 32L loss by 0.575 relative to on every seed, but the far mass still grows by 0.044 from 4L to 16L, above the preregistered tolerance 0.02, because many heads settle just above one, where by Corollary 16(i) they dilute like . With the far mass grows by 0.004 and the 32L loss is 0.042 below that of on every seed, at a loss 0.005 higher (Table 3); the growth falls with the margin on every seed, consistent with the prior-based prediction.
These test-time interventions establish that changing tail decay causally affects loss in the models and lengths tested. They do not establish that summability generally lowers loss, or isolate far
Table 3: Training-time margin at 25M, : validation loss and far-mass growth from 4L to 16L (preregistered tolerance 0.02), means over three seeds. Far mass and the share of heads at the bound are in Appendix E.5.
| Arm | 1× | 32× | far-mass growth |
|---|---|---|---|
| P1, | 3.444 | 3.427 | 0.032 |
| P1, | 3.445 | 3.395 | 0.015 |
| P1, | 3.448 | 3.385 | 0.004 |
| ALiBi (P4) | 3.441 | 3.355 | -0.006 |
mass from other changes, such as attention entropy (Section 7); finite evaluations cannot establish asymptotic summability. During training, the preselected margin controls far-mass growth in the tested setting, but also meets the tolerance (0.015), so the smallest sufficient margin is undetermined. At least linear decay controls far mass without an exponent margin (Lemma 13); in this experiment ALiBi also has lower 32L loss, by 0.030 relative to .
6 Related work
Attention as optimal transport. Sinkformers [34] and efficient balancing methods [10, 42] study transport-based attention; rank decay is analyzed for softmax [8] and Sinkhorn [16]. Sparse Sinkhorn attention [41] sorts key blocks. Foss [11] uses prefix masses and undamped updates ; we analyze damped accumulated scalings (5). GOAT learns a reference measure [19, 20]; ours arises from prefix balancing. Unbalanced Sinkhorn supplies the damping [6, 12, 35]. Its convergence theory fixes matrix size [31, 36]; we study length asymptotics.
Positional biases and length extrapolation. Vetcha [47] studies score decompositions and convergent normalization. The relative, group-based and content-dependent schemes are described in Section 4. First Passage Attention uses path extrema [21], outside our additive-path reduction. Qin et al. [33] prove a summability condition for sliding-window approximation, including KER-PLE's threshold; we classify far mass (Proposition 14). Marín [22] analyzes finite-length power priors, fits effective exponents and tests distance biases. We bound discrete window mass under bounded content (Corollary 16), constrain explicit exponents and intervene only beyond the training length (Section 5.3). Scale-invariant attention designs distance-dependent Gaussian logits [1]; our ratio prior follows from the constant-score OT fixed point (Theorem 7).
Dilution and temperature. Softmax dispersion is known [44, 46]; Godavarti [13] proves a far-mass lower bound under uniformly bounded logits. Theorem 5 extends this to the implicit prefix-mass correction. Score scaling and sparse normalizers counteract dispersion [5, 25, 44]; geometric limits are studied by Mudarisov et al. [24]. Rotary selection [37] and data-aware rotations [17] can improve finite-length performance. Randomized YaRN changes training-time positions [23]; our baseline uses evaluation-time scaling. Sharp attention can still retrieve the wrong position [39]; concentration alone does not ensure retrieval.
7 Discussion and conclusion
We characterized the positional prior of prefix-consistent causal OT, proving dilution under bounded scores and an exact scale-invariant limit for constant scores. We classified common positional encodings by far mass and gave discrete window-mass bounds near the summability boundary. Language-model experiments connect positional decay to loss extrapolation through tail interventions and trained exponent margins, while exploratory comparisons favor explicit distance biases as an efficient alternative to OT.
Theoretical limitations. The exact prior shape requires constant or i.i.d. bounded scores; how correlations and key-specific affinities modify it remains uncharacterized. The dilution bound can be loose, and rates of approach to the limiting shape and iteration counts sufficient uniformly over context length remain unproved. The theory concerns prefix-consistent causal attention and classifies attention mass; it gives no general loss or retrieval guarantee and does not cover bidirectional or cross-attention.
Experimental limitations. Experiments use one corpus, 25M–100M models and limited lengths; the far-mass and retrieval probes are exploratory, and comparisons retain optimization and model-quality confounds. The OT comparisons do not establish an independent benefit from column balancing, and bias interventions change far mass together with other attention properties (Section 5). The margin is sufficient only in the tested setting, without a minimality guarantee, and low far mass with stable loss does not establish effective distant retrieval or copying (Appendix E.6).
Declarations
Funding and competing interests. This research was self-funded by the author and received no external funding. The author declares no competing interests.
AI assistance. Anthropic Claude was used to assist with theoretical derivations, code implementation, and experimental analysis. OpenAI Codex assisted proof development, regression tests, literature checks and manuscript revision, including consistency checks against code and experimental records. The author takes responsibility for the content of this work.
References
[1] Ben Anson, Xi Wang, and Laurence Aitchison. Scale-invariant attention. In Advances in Neural Information Processing Systems, 2025.
[2] Kazuoki Azuma. Weighted sums of certain dependent random variables. Tôhoku Mathematical Journal, 19(3):357–367, 1967.
[3] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
[4] Ta-Chung Chi, Ting-Han Fan, Peter J. Ramadge, and Alexander I. Rudnicky. KERPLE: Kernelized relative positional embedding for length extrapolation. In Advances in Neural Information Processing Systems, 2022.
[5] David Chiang and Peter Cholak. Overcoming a theoretical limitation of self-attention. In Annual Meeting of the Association for Computational Linguistics, 2022.
[6] Lénaïc Chizat, Gabriel Peyré, Bernhard Schmitzer, and François-Xavier Vialard. Scaling algorithms for unbalanced optimal transport problems. Mathematics of Computation, 87(314):2563–2609, 2018. doi: 10.1090/mcom/3303.
[7] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, 2013.
[8] Yihe Dong, Jean-Baptiste Cordonnier, and Andreas Loukas. Attention is not all you need: Pure attention loses rank doubly exponentially with depth. In International Conference on Machine Learning, 2021.
[9] Graham Everest, Alf van der Poorten, Igor Shparlinski, and Thomas Ward. Recurrence Sequences, volume 104 of Mathematical Surveys and Monographs. American Mathematical Society, 2003.
[10] Dylan B. Forde. Block-wise differentiable Sinkhorn attention: Tail-refinement gradients with a single-active-dustbin bridge. arXiv preprint arXiv:2605.08123v3, 2026.
[11] David Tom Foss. Causal prefix-Sinkhorn attention: Leak-free column balancing for autoregressive transformers. doi:10.13140/RG.2.2.24121.74087, 2026. Working draft v0.4, August 18.
[12] Takumi Fukunaga and Hiroyuki Kasai. On the convergence of semi-relaxed Sinkhorn with marginal constraint and OT distance gaps. arXiv preprint arXiv:2205.13846, 2022.
[13] Mahesh Godavarti. Why do accumulated transformations extrapolate? arXiv preprint arXiv:2606.24975, 2026.
[14] Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, 2nd edition, 1994.
[15] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13-30, 1963.
[16] Michela Lapenna, Rita Fioresi, and Bahman Gharesifard. Sinkhorn doubly stochastic attention rank decay analysis. Transactions on Machine Learning Research, 2026.
[17] Jarod Lévy, Mathurin Videau, Jad Yehya, Jean-Rémi King, Stéphane d'Ascoli, and Thomas Moreau. RoPE is dead, long live RoPE: Towards scalable data-aware positional encodings. arXiv preprint arXiv:2609.34556, 2026.
[18] Zhixuan Lin, Evgenii Nikishin, Xu Owen He, and Aaron Courville. Forgetting transformer: Softmax attention with a forget gate. In International Conference on Learning Representations, 2025.
[19] Elon Litman. Scaled-dot-product attention as one-sided entropic optimal transport. arXiv preprint arXiv:2508.08369, 2025.
[20] Elon Litman and Gabe Guo. You need better attention priors. In International Conference on Machine Learning, 2026. URL https://arxiv.org/abs/2601.15380v2.
[21] Yuxuan Liu. First passage attention. arXiv preprint arXiv:2610.22714, 2026.
[22] Carles Marín. Predicting how transformers attend: Analytic power-law theory, phase transitions, and practical compression tools. doi:10.5281/zenodo.19826343, April 2026. Technical report.
[23] Manas Mehta, Fangcong Yin, and Greg Durrett. Randomized YaRN improves length generalization for long-context reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 30045–30055. Association for Computational Linguistics, 2026. doi: 10.18653/2026.findings-emnlp.1409.
[24] Timur Mudarisov, Mikhail Burtsev, Tatiana Petrova, and Radu State. Limitations of normalization in attention mechanism. arXiv preprint arXiv:2508.17821, 2025.
[25] Ken M. Nakanishi. Scalable-softmax is superior for attention. arXiv preprint arXiv:2501.19399, 2025.
[26] Vlad Niculae and Mathieu Blondel. A regularized framework for sparse and structured neural attention. In Advances in Neural Information Processing Systems, volume 30, 2017.
[27] Frank W. J. Olver, Daniel W. Lozier, Ronald F. Boisvert, and Charles W. Clark, editors. NIST Handbook of Mathematical Functions. Cambridge University Press, 2010.
[28] Guilherme Penedo, Hynek Kydlíček, Loubna Ben allal, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von Werra, and Thomas Wolf. The FineWeb datasets: Decanting the web for the finest text data at scale. In Advances in Neural Information Processing Systems, 2024.
[29] Bowen Peng, Jeffrey Quesnelle, Honglu Fan, and Enrico Shippole. YaRN: Efficient context window extension of large language models. In International Conference on Learning Representations, 2024.
[30] Gabriel Peyré and Marco Cuturi. Computational optimal transport. Foundations and Trends in Machine Learning, 11(5-6):355–607, 2019.
[31] Khiem Pham, Khang Le, Nhat Ho, Tung Pham, and Hung Bui. On unbalanced optimal transport: An analysis of Sinkhorn algorithm. In International Conference on Machine Learning, 2020.
[32] Ofir Press, Noah A. Smith, and Mike Lewis. Train short, test long: Attention with linear biases enables input length extrapolation. In International Conference on Learning Representations, 2022.
[33] Zhen Qin, Yiran Zhong, and Hui Deng. Exploring transformer extrapolation. In AAAI Conference on Artificial Intelligence, pages 18897–18905, 2024. doi: 10.1609/aaai.v38i17.29855.
[34] Michael E. Sander, Pierre Ablin, Mathieu Blondel, and Gabriel Peyré. Sinkformers: Transformers with doubly stochastic attention. In International Conference on Artificial Intelligence and Statistics, 2022.
[35] Thibault Séjourné, Gabriel Peyré, and François-Xavier Vialard. Unbalanced optimal transport, from theory to numerics. arXiv preprint arXiv:2211.08775, 2022.
[36] Thibault Séjourné, François-Xavier Vialard, and Gabriel Peyré. Faster unbalanced optimal transport: Translation invariant Sinkhorn and 1-D Frank-Wolfe. In International Conference on Artificial Intelligence and Statistics, 2022.
[37] Subham Singh, Ashutosh Mishra, and Subha Raut. Relative positions generalize, absolute positions memorize: An implicit-bias account of length generalization in attention. arXiv preprint arXiv:2607.18759, 2026.
[38] Richard Sinkhorn and Paul Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343–348, 1967.
[39] Michal Spiegel, Michal Štefánik, Marek Kadlčik, Valeria Ruscio, Martin Fajčik, and Josef Kuchař. Attend or perish: Benchmarking attention on algorithmic reasoning. In Proceedings of the 9th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, pages 707–725. Association for Computational Linguistics, 2026. doi: 10.18653/2026.blackboxnlp-1.41.
[40] Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murstadha, Bo Wen, and Yunfeng Liu. RoFormer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021.
[41] Yi Tay, Dara Bahri, Liu Yang, Donald Metzler, and Da-Cheng Juan. Sparse Sinkhorn attention. In International Conference on Machine Learning, 2020.
[42] Huy Tran, Max Milkert, and David Hyde. ASAP: Amortized doubly-stochastic attention via sliced dual projection. arXiv preprint arXiv:2605.12879, 2026.
[43] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
[44] Pavlo Vasylenko, Hugo Pitorro, André F. T. Martins, and Marcos Treviso. Long-context generalization with sparse attention. In International Conference on Learning Representations, 2026.
[45] Ali Veisi, Hamidreza Amirzadeh, and Amir M. Mansourian. Context-aware biases for length extrapolation. In Conference on Empirical Methods in Natural Language Processing, pages 30374–30395, 2025. doi: 10.18653/v1/2025.emnlp-main.1545.
[46] Petar Veličković, Christos Perivolaropoulos, Federico Barbero, and Razvan Pascanu. Softmax is not enough (for sharp size generalisation). In International Conference on Machine Learning, 2025.
[47] Nitin Vetcha. Towards infinite length extrapolation: A unified approach. arXiv preprint arXiv:2601.06113, 2026.
[48] Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In International Conference on Learning Representations, 2024.
[49] Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tie-Yan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, 2020.
[50] Yifan Zhang, Zixiang Chen, Yifeng Liu, Zhen Qin, Huizhuo Yuan, Kangping Xu, Yang Yuan, Quanquan Gu, and Andrew Chi-Chih Yao. Group representational position encoding. In International Conference on Learning Representations, 2026. URL https://arxiv.org/abs/2512.07805.
A Notation
The table lists the symbols used across several sections; the last column gives the first definition. Symbols that appear only within a proof are defined where they are used.
| Symbol | Meaning | Defined in |
|---|---|---|
| Attention and the causal OT operator | ||
| sequence (context) length | Sec. 2 | |
| query (row) and key (column) indices, | Sec. 2 | |
| attention score of query for key | Eq. (1) | |
| additive positional bias, part of | Eq. (1) | |
| temperature, the entropic regularization strength | Eq. (1) | |
| Gibbs kernel, ; constant scores means | Sec. 2 | |
| set of keys visible to query ; under the causal mask | Eq. (1) | |
| attention matrix, row-stochastic and supported on ; from Sec. 3 on, the fixed point (FP) unless stated otherwise | Eq. (1) | |
| rownorm | row normalization, dividing each row by its sum | Sec. 2 |
| damping of the column update, ; is softmax, balanced Sinkhorn; all results assume | Eq. (4) | |
| exponent of the column correction, | Eq. (FP) | |
| prefix column mass , the attention key has received from queries | Sec. 2 | |
| -th iterate of the operator; is softmax | Eq. (5) | |
| normalizer of row of the fixed point | Eq. (FP) | |
| clock, the cumulative row normalizer: | Eq. (FP) | |
| score bound, for all | Sec. 2 | |
| The implicit prior | ||
| scaling constant, | Sec. 3.3 | |
| limit of with constant scores, ; for | Thm. 6 | |
| relative position of a key, | Thm. 7 | |
| limit shape of the prior with constant scores, | Thm. 7 | |
| window length: the most recent keys, ; in the experiments, the training length. Far mass counts the keys at , one fewer than the complement of the window | Sec. 3 | |
| mean kernel entry, , for i.i.d. scores | Prop. 10 | |
| Positional biases | ||
| log-normalizer of row in the potential form of the logits | Sec. 4 | |
| exponent of a log-distance bias, | Sec. 4 | |
B Proofs for Section 3
Notation is as in Appendix A, with and , the empty sum: column receives no mass before row , so the first increment of every column, on the diagonal, starts from zero ( in (6)). Small positive parameters in the proofs are written and .
Structure. The row recursion gives well-posedness and the column-mass sandwich. Bounds on row normalizers give dilution and feed the bootstrap of Lemma 20. This proves Theorem 6 and, after averaging content, Proposition 10. The shape results follow from Theorem 6; finite iterations have a separate proof.
Elementary facts. We use three, labeled by what they concern: harmonic sums, monotone sums, and an integral. All are standard: (H) and (M) are the integral comparisons behind the asymptotics of harmonic numbers [14, §§6.3 and 9.5], and (I) is Euler's integral for the Gamma function [27,
Eq. 5.2.1]. We include one-line proofs.
(H) For integers and , , and is at least both and . The first two compare with over and ; the third bounds every term by .
(M) Let be integers. If is increasing on , then , since on ; if is decreasing, the inequalities reverse, , and the left one holds even when has an integrable singularity at . We apply it to the increasing and with , and to the decreasing .
(I) For , : substitute in with .
B.1 Well-posedness and the sandwich
Lemma 2. For any , (FP) has a unique solution, obtained row by row from (6). Each is increasing in and decreasing in , and , i.e. , with equality on the diagonal. At every fixed finite length, iteration (5) converges to this solution.
Proof. Row of (FP) is (6), which involves only rows through . For fixed , is continuous and strictly increasing from to on , so is well defined, continuous, strictly increasing in , with limits and . Hence takes the value 1 at exactly one . Induction on gives existence and uniqueness. Since is increasing in , decreases in ; since , , with equality when , i.e. on the diagonal.
For convergence, fix row , put , and write and . With ,
Its entries are nonnegative and its row sums equal , so is a global -contraction in . Row 1 has for all . Inductively, convergence of rows before gives . Let be the unique fixed point of . Then
For this implies : iterate the inequality and split its geometrically weighted error sum at any fixed index. Induction completes the proof; the limit satisfies (FP). No rate uniform in is asserted.
Lemma 3. For ,
Proof. Fix column . Row adds to , with . Then
(7) and the right end equals . Summing over gives the upper bound. For the lower bound, column mass never decreases, so for ; summing, .
The left end of (7) gives a second lower bound, used in Lemma 18, which is nearly tight where the increments are small against the accumulated mass. Since , the column mass telescopes over the rows that see it,
and the term of row is the increment (7) with and . On the diagonal , and the term is by Lemma 2. For , write the increment ratio , so that ; the left end of (7) and from (FP) give
Summing,
Each term differs from the upper bound of Lemma 3 only by the factor , which tends to one as ; for near one, (8) is weaker than the lower bound of Lemma 3.
B.2 Bounded scores: dilution, the a priori bound, and the increment ratio
Throughout this subsection the scores are bounded, , that is for all ; constant scores are the case , (Proposition 11), and every constant below is then to be read at . We first bound the row normalizers from above, which gives dilution, and then from below, together with the ratio of a row's increment to a column's mass; the last two results feed the proof of Theorem 6 and of Proposition 10.
Lemma 4. If then . With constant scores, .
Proof. Rows 1, ..., t carry total mass t on columns 1, ..., t, so . By (FP) and Jensen's inequality for the convex map ,
Theorem 5 (Dilution under bounded scores). If , then for all
Proof. By Lemmas 2 and 4, ; take the power . A window of length has at most entries.
The column sum and the normalization. Write
by Lemma 3, and ; with constant scores . Lemma 3 and turn the row normalization into
(S_{B})
The next two lemmas prepare the proofs of Theorem 6, which explains how they are used, and of Proposition 10: an a priori lower bound on from the right side of , and a bound on the ratio of a row's increment to a column's mass.
Lemma 17. If for all , then for all , where . For constant scores this is with .
Proof. Induction on . Row 1 has the single entry , so , since . Assume for . For , (H) gives , and . The right side of (S) with , then (M) and (I), give
With this reads . If , the right side is below , because ; contradiction.
Lemma 18. Let for all and . For ,
for constant scores this is . Consequently the relative deficit
is small away from the diagonal. There are constants depending only on and such that for all :
-
for every , , which tends to 0;
-
for and , .
These are upper bounds; only their convergence to zero is used below.
Proof. Ratio. We use only the lower bound of Lemma 3, . Raised to the decreasing power and to the increasing power , it bounds the numerator and the denominator of :
dividing gives . By Lemma 4, ; by Lemma 17 and (H), .
Deficit. by Lemma 3. For the upper bound, compare (8) with and use on : with , the deficit satisfies
It remains to bound this right side, with the ratio bound just proved, and the denominator of in each range.
Case (1). For , , which takes out a common factor. With the ratio bound and ,
extending the sum to and applying the first bound of (H) with . Together with , the deficit is at most for every . For , Lemma 17 and (H) bound the denominator of below by a constant,
For the deficit is at most ; since , dividing gives (1) with , which does not depend on .
Case (2). For , , and as in case (1), now with ,
so the deficit is at most . By (H) the denominator is at least
Dividing gives (2) with . For , and these constants reduce to those of the constant-score case.
B.3 Auxiliary estimates: the ends of a row and a bootstrap
Two arguments recur in the proofs of Theorems 6 and 9 and Proposition 10, and we state them once.
The ends of a row. Write for . Each of these proofs bounds a row by the profile , and needs that the keys far from the query and near it carry a share that vanishes with , uniformly in .
Lemma 19. Let with for all . Then for and ,
Proof. For , , and there are fewer than such . For , gives with , and (M) for the decreasing gives
A bootstrap. The proofs of Theorem 6 and Proposition 10 share one argument, which we isolate here as a statement about a positive sequence : the row normalizers, rescaled by in Proposition 10. Write , , ,
The row normalization expresses as a sum over the differences , which are built from the earlier normalizers, so an asymptotic bound (or ) on the earlier rows yields a bound on the current one. The lemma assumes the two inequalities that make this work: in the middle range , a lower and an upper bound on carrying the same factor , up to errors that vanish with and . Both then turn a bound on the earlier rows into the bound on the current row. Since has slope , is a contraction in log scale; is its unique fixed point on , and if and only if . Applied to the limits superior and inferior, this pins both to .
Lemma 20. Let with , and suppose there is a constant such that for every , for all large ,
(i)
Then .
Proof. Let and , and , which tends to as by (I).
Upper bound: . Fix and , and with for . For large , every satisfies , so (H) gives . Since is increasing, (M) and the substitution give , and (i) yields
Letting and then gives , that is, , so .
Lower bound: . Fix , and with for . For large , (H) gives for , and by (M) and (I), . So (ii) yields
Letting and then gives , that is, , so . Since , both equal .
B.4 Proof of Theorem 6
Theorem 6 (Asymptotics of the row normalizers). With constant scores, . For , .
From here on, until Proposition 10, the scores are constant: , so , , and Lemmas 17 and 18 hold with and . With , becomes the normalization sandwich
(S)
whose two sides differ by the factor .
Strategy. We apply Lemma 20 with , so that . Hypothesis (i) is the left side of (S). For (ii), the right side of (S) alone would not do: it lacks the factor , and the argument of the lemma would give only , which lies below . Away from the diagonal, however, a row's increment is negligible against the mass the column has accumulated, and Lemma 18(1) shows that is then close to the upper end of Lemma 3. This restores the factor in the middle range; the rest of the sum is the error .
Proof. By Lemmas 4 and 17, . Fix .
Hypothesis (i). The terms on the left of (S) are positive, so keeping only gives , which is at least the right side of (i).
Hypothesis (ii). Split the normalization into the middle range and the two ends. By Lemma 3, Lemma 17 and (H),
so by Lemma 19 the two ends contribute at most with . In the middle range, Lemma 18(1) gives with , so for large this part is at most . Together these give (ii).
Lemma 20 gives . Finally, for , , , and .
B.5 Proofs of Theorems 7 and 8
Theorem 7 (Scale-invariant limit shape of the implicit prior). With constant scores, for every , uniformly in ,
Proof. . Take in Lemma 18(1): uniformly for , . Theorem 6 says that . Every in satisfies , so
for large, with a bound that does not depend on ; with , . Hence uniformly in , and since there, the additive is a factor . Hence
and by the definition of .
Near the diagonal the row normalizers vary little across the rows that a column has seen, so the column behaves as if every normalizer were equal. The discrete profile of Theorem 8 is that column with all normalizers equal to one.
Lemma 21. Let and . Then is the mass of a column after rows when every row normalizer equals one, , and .
Proof. Each increment is , which is (6) for one column with . The argument of Lemma 3 with gives , and (7) gives . Since the increments tend to 0 while , , so and .
Theorem 8 (Power law near the diagonal). Let and let solve . With constant scores,
-
for fixed , ;
-
for with , .
Proof. (1) The increments of column in rows are determined by through (6), continuously. If all equal , homogeneity maps and Lemma 21 give . By Theorem 6, uniformly for and ; continuity gives the claim.
(2) By Lemma 18(2), as , uniformly in . By Theorem 6, uniformly for , , so when . Then
and . The two regimes match by Lemma 21.
Remark 22. Let be the mass within distance of the diagonal, with constant scores. Fixed window. By Theorem 8(1) for the increments telescope, . By Lemma 21, as , and , so the limit is . Thus the rate of Theorem 5 is attained, while the dependence on is rather than the bound's . Proportional window. For , : on by uniform convergence (Theorem 7), and the range contributes by (9), Lemma 19 and . As , since , which matches the fixed window with .
B.6 Proof of Theorem 9 (finite iterations)
Theorem 9 (Limit shape after finitely many iterations). With constant scores and any fixed , the k-th iterate (5) satisfies uniformly on .
The proof is an induction on , in which each step passes from the scaling limit of the scalings to that of the row, and from the row to the column mass. The two passages do not depend on , and we state them first as lemmas about arrays. Write , so that , and
“Uniformly” means uniformly in as , with , for every ; every compact subset of lies in such an interval, and on it uniformly and .
Lemma 23. Let with for all , and uniformly, for a constant . Then .
Proof. By (I), . Fix and split both the sum and the integral at and : over , , , and over , , . With the Riemann sum , the triangle inequality gives
Only (1) uses the convergence: it is at most . (2) tends to zero because is continuous on . (3) is at most by Lemma 19. (4) is elementary: on and give and . Hence
for every ; the left side does not depend on .
Lemma 24. Let for , with for all and uniformly. Then uniformly.
Proof. Fix and let , . Column is seen by rows , and row sees it at relative position . Fix and split the rows at .
Rows with . Here for , so lies in the fixed interval , and every row index tends to infinity. The hypothesis, applied with in place of , gives uniformly in and . The error contributes , since this sum is at most . The main part is with , which is positive and decreasing in because is increasing. By (M) it differs from
by at most two terms of size (one from (M), one from rounding the lower limit to an integer), and the right side tends to uniformly because uniformly.
Rows with , i.e. , are the rows nearest the diagonal of column ; here the bound on replaces the convergence. With , gives , since and . The range is once , and (M) for the decreasing gives , so
in which the powers of cancel. The missing integral is at most , by and . Letting gives uniformly.
Strategy. The proof does not use the fixed point. With constant scores every iterate is an explicit function of the previous one, and an induction on shows first that every iterate has the order of the limit shape (Step 1) and then, with Lemmas 23 and 24, that it converges to it (Step 2).
Unrolling (5) with gives ; with , . Write for the harmonic sums. For we use:
(R0) (integral comparison; and with );
(R1) , and it equals by (M) and (I);
(R2) uniformly in (a Riemann sum for ; the first term, , has the order of ).
Here means two-sided bounds with constants depending only on (and below on ).
Step 1: two-sided bounds. We show by induction on that , and . For , and by (R0), so . From , (R1) gives and (R2) gives ; then .
Step 2: limits. We show by induction on that for a constant
and, in the induction step, that uniformly, which is the theorem. Step 1 provides a constant with and for all ; these bounds control the ends of a row, where the induction hypothesis says nothing.
Base case . , so and . By (H), , and , so uniformly. Since is bounded below by a positive constant and is uniformly continuous away from zero, satisfies with .
Induction step. Assume .
(a) Row normalizer and shape. By Step 1, and Lemma 23, . Since ,
(b) Column mass. By Step 1, (a) and Lemma 24, uniformly.
(c) Next iterate. On , , so the quotient converges uniformly to , and is uniformly continuous on compact subsets of . Hence
with , which is .
The exponent identity keeps the shape fixed from k = 2 on; only changes, and it cancels in the row normalization of (a).
B.7 Proof of Proposition 10 (i.i.d. content)
Proposition 10 (Factorization of the fixed point under i.i.d. content). Let be i.i.d. with and . Then, almost surely, and, for every ,
Let , with i.i.d. entries in , and . Write
so that Lemma 3 reads . Constants below depend only on and and may change from line to line; is the -field generated by rows of .
Strategy. In the constant-score proof, plays two roles: it is the column sum that controls , and it is built from the row normalizers. With content, the column sum is and the row normalization weights each column by . Both sums average independent entries: (Lemma 27) and (Lemma 28), almost surely and uniformly over the relevant ranges. The rescaled normalizers then satisfy the constant-score equations up to vanishing errors, which are the hypotheses of the bootstrap Lemma 20. The column law of large numbers needs two tools: a deterministic bound on how much one entry moves a row's normalizer (Lemma 25), and a maximal concentration inequality for martingales (Lemma 26).
Deterministic bounds. Every with entries in satisfies Lemmas 2-4, with , and the bounded-score Lemmas 17 and 18:
(D1) (Lemma 17).
(D2) , and for every , (Lemma 18(1)).
(D3) For , ; for every , , hence .
(D4) The near and far parts of a row are small: by Lemma 3, , since by (D1) and (H); so by Lemma 19, for the parts with and sum to at most .
Two tools. Write for the normalizer of a row with masses and entries , that is, the unique with , where and (Lemma 2).
Lemma 25. Let , and let differ only in the coordinate . If solves the row for at , then
Proof. The elasticity , the relative change of x per relative change of , follows by differentiating :
the same in because and enter only through . It is used twice. First, at , replacing by leaves every with unchanged and multiplies by a factor with , since the elasticity lies in ; so the row sum becomes
and : above one by , below one by with and . Second, the elasticity of the row sum, , is a weighted mean of elasticities and so at least ; restoring the row sum to one therefore moves by at most .
Lemma 26. Let , , be a martingale with respect to a filtration , with and . Then for , .
This is the maximal form of the Azuma–Hoeffding inequality [2, 15]: Hoeffding's lemma gives , and Doob's maximal inequality for the submartingale with , applied to and , gives the bound.
Lemma 27. Almost surely,
Proof. The difference is . Its weights depend on the summands: is computed from row , which contains . We remove this dependence by leaving one entry out. For let
the normalizer of row with the actual masses and entries except that is replaced by . Let , so that and, the entries being independent, is independent of . Then is -measurable: by the row recursion, , is a measurable function of rows of ; and is Borel, because is continuous and increasing in (proof of Lemma 2), so is closed. The modified row still has unit mass on columns , so the proof of Lemma 4 gives . Define
so that : a martingale part, whose weights are decoupled from the summands, and a leave-one-out error.
The martingale part. Since is -measurable and bounded, and is independent of with mean ,
by the tower property. Moreover is -measurable, and since and lie in ,
So is a martingale with respect to , and by Lemma 26,
The right side is summable over . By the Borel–Cantelli lemma, almost surely the event on the left occurs for only finitely many ; applying this to for every gives, almost surely,
The leave-one-out error. Row solves the row equation with masses , entries . and solution , and changes only the entry , from to . By Lemma 25, , hence , and with ,
for , by (D3).
Lemma 28. Almost surely, for every ,
and for all and ,
Proof. The weights are rather than the of the row normalization: contains the own term , which depends on , whereas is -measurable and the entries of row t are independent of . In the middle range the weights are bounded: by Lemma 3 and (D3) applied to row t-1, ; near the diagonal they are not, and at j = t the mass is zero. Conditionally on the sum is a sum of at most t independent centered terms, each in an interval of length , so Hoeffding's inequality [15] bounds the probability that it exceeds ut by for u > 0, which is summable in t; Borel–Cantelli over t and over rational u, gives (11). The own term of row t changes the weights only by a factor: with by (D2), and gives (12).
Proof of Proposition 10. The normalizers. Fix an outcome in the almost-sure events of Lemmas 27 and 28; everything below is deterministic. We apply Lemma 20 to , so that and . Compared with Theorem 6 there are three errors, each controlled by an earlier step: the content weights in the row sum (11), the own term of row (12), and the gap between and (10).
By Lemmas 4 and 17, . The lemma asks for (i) and (ii) for every and every tolerance , so fix both. For , Lemma 17 and (H) give . Each of the three errors above tends to zero, and we make them small relative to a tolerance
chosen so that the errors add up to at most in (i) and (ii). Since , an additive error of at most in is a factor in , and, as ,
For large , depending on , and the fixed outcome, the following hold for all : by (10) at rows and and , both and differ from by at most ; by Lemma 18(1) at row with (note ), ; the factor in (12) is at least ; and the sum in (11) is at most in absolute value.
Hypothesis (i). Keeping the middle range and using (12), (11), (Lemma 3) and ,
By (13), the factor costs at most , so the total additive error is at most ; with this is (i) for .
Hypothesis (ii). The near and far parts of are at most by (D4). In the middle range, (12) and (11) give , and Lemma 18(1) at row gives
Dividing by , with . Since and , this is (ii) for .
Lemma 20 gives , that is, .
The shape. Let with . By (D2), with uniformly. By (10), , and as in the proof of Theorem 7, gives , both uniformly in . Since ,
uniformly, and turns the factor into an additive .
C Proofs for Section 4
Structure. The proofs are short and independent of one another, except that Proposition 14 collects results proved elsewhere. Two arguments recur:
(B) Bounded content. If the content part of every score lies in , each softmax weight changes by a factor in in the numerator and in the normalizer, so every ratio of attention masses changes by a factor in . This reduces Proposition 15 and Corollary 16 to constant content.
(Z) The normalizer of a power prior. With constant content and the prior , the mass within distance of the diagonal at row is with , so the question is how grows.
C.1 Row shifts and finite-dimensional kernels
Proposition 11. Adding to row of the logits, for any that may depend on row 's content, leaves both softmax and the fixed point (FP) unchanged.
Proof. Softmax: the numerator and the denominator of row are multiplied by . Fixed point: in (FP), is absorbed by , and depends only on ; by Lemma 2 the solution is the same.
Proposition 12. (i) For , is an exponential polynomial, with the nonzero eigenvalues of and polynomials . (ii) No real of this form satisfies with . (iii) If the scores are bounded by , softmax satisfies ; with an orthogonal multiplicative encoding and bounded inputs, attention therefore dilutes.
Proof. (i) By the Cayley–Hamilton theorem, satisfies a linear recurrence with constant coefficients, whose solutions are exponential polynomials in the nonzero eigenvalues of A for [9].
(ii) Let be the largest with and the largest degree among those terms. Then , where has nonzero coefficients and distinct frequencies, so its mean square tends to and for infinitely many . Hence ( ), is bounded ( , ), or along a subsequence; none is compatible with .
(iii) The diagonal term bounds the normalizer below, so . For an orthogonal , by the Cauchy–Schwarz inequality, which is bounded under bounded inputs.
C.2 Far mass
Lemma 13. Let with , and , . For every fixed , the OT fixed point obeys
for every t; softmax is the case .
Proof. Lemma 2 gives and . Since ,
Summing over gives the bound.
Proposition 14 (Far mass of common encodings). Assume bounded inputs (Section 2). For each head:
-
ALiBi, FoX, GRAPE-A, GRAPE-AP [50] and OT on ALiBi (O2) keep a bounded far mass for all parameter values;
-
RoPE, GRAPE-M and the OT operator dilute for all parameter values;
-
a log-distance bias keeps a bounded far mass if and dilutes if , and so does KERPLE's with and in place of ;
-
with an exponent set by the query's input, on the distance (P6) or on a content clock (LC), the head keeps a bounded far mass if and dilutes if , over the admissible inputs ;
-
CABLE keeps a bounded far mass if its clock's pre-activation is bounded below by a positive constant over the admissible inputs, and dilutes if it is never positive.
Proof. Under bounded inputs every linear function of the input lies in a fixed interval , with depending on the function. Bounded far mass in the first item follows from Lemma 13 once with ; each such bound on a path potential follows from a bound on its increments.
-
ALiBi, including OT on ALiBi, is linear with slope .
-
FoX: . Under bounded inputs , so each increment is at most , which is .
-
GRAPE-AP: each increment is . Since has norm and is orthogonal, the argument is at most by the Cauchy-Schwarz inequality, and each increment is at most .
-
GRAPE-A: , where and the gates have the form . The argument lies in because has norm and is a unit vector, so each gate lies in and, whatever the inputs, , so .
-
Dilution: RoPE and GRAPE-M by Proposition 12(iii); the OT operator by Theorem 5.
-
Log-distance biases: by Proposition 15, the mass within a fixed window tends to zero for , and for the mass beyond is at most for every . For KERPLE, lies between and , so the weights differ from those of by bounded factors and the same conclusions hold.
-
Query-dependent exponents: P6 is the case , , of LC, with clock ticks , so and . If for all admissible , the weight at distance is at most times the diagonal one, whose tail sum beyond tends to zero uniformly in . If for all , every weight at distance is between and times the diagonal one, so the mass within is at most .
-
CABLE: with for the clock's pre-activation , and . If for all admissible inputs, and Lemma 13 applies. If always, is constant and ; CABLE has no RoPE, so the scores are bounded content alone and softmax dilutes as in Proposition 12(iii).
C.3 Power priors
Proposition 15 (Window mass of power-law priors). For the prior and constant content, the mass within distance of the diagonal at row is for , for , and tends to for , where . Bounded content changes these quantities by at most a factor .
Proof. By (Z) the window mass is . Comparing the decreasing with its integral, as in (M) of Appendix B: for , for , for , increases to . For the far mass beyond is moreover at most
for every , since (the diagonal term). Bounded content enters through (B).
Corollary 16 (Log-distance exponents near one at finite length). For with and constant content, the mass within distance of the diagonal at row satisfies
Bounded content changes these bounds by at most a factor .
Proof. By (Z), with . Let . Since is decreasing, integral comparison gives
Write , so that ; from , dividing by gives .
(i) gives the lower bound. If , then , which gives the upper bound.
(ii) gives the lower bound. The tail satisfies , and , so , which is the upper bound. Bounded content enters through (B).
D Numerical checks of the theory
We check finite-length identities and bounds (Appendix D.1), compare finite lengths with the limits (Appendix D.2), and measure effects the theory does not quantify (Appendix D.3). The tests are in packages/geoattn-core/tests/. “Recursion” solves (6) row by row in float64; “operator” runs the iteration (5) in float32.
D.1 Finite-length identities and bounds
These checks hold entrywise up to rounding, or fail. In test_unbalanced_recursion: the recursion agrees with the operator after 400 iterations to , for constant and random scores (Lemma 2); both bounds of Lemma 3 hold, with equality on the diagonal; , and with constant scores for up to 0.9 and (Lemmas 4, 17, 18); and for (Theorem 5). In test_potential_framework: row terms leave softmax and the fixed point unchanged while a column term does not (Proposition 11); the far mass of a linear bias is bounded uniformly in the length, GRAPE-A, FoX and GRAPE-AP decay at least linearly, and CABLE's stopped clock is a counterexample (Lemma 13, Proposition 14); and both bounds of Corollary 16, as well as those on and in its proof, hold for from to 1, and ; at and the upper bound in (ii) is within 1% of the window mass.
D.2 Comparison with the limits
Table 4 compares finite lengths with the limits as ; the tolerances describe the tested settings, not uniform error bounds.
Table 4: Limit statements against finite lengths. Tests in test_unbalanced_scaling, except Theorem 6 (test_unbalanced_recursion) and the last row (test_potential_framework).
| Result | Limit | Finite length |
|---|---|---|
| Thm. 6 | decreases towards ; about above it at | |
| Thm. 7 | within 2% at , error halves from to 1024 | |
| Thm. 8Remark 22 | discrete profile, then window mass | within 1% for at : doubling from 512 to 1024 multiplies it by to 2%; within 5% of the limit |
| Thm. 9 | : ratio to constant in to 1% at (the amplitude: Appendix D.3) | |
| Prop. 10Prop. 15 | near mass like , , or | binned mean within 2% of oneratio across lengths within 10% of the rate |
For constant scores, at is 0.8449, 0.8410, 0.8398 () for , 0.6471, 0.6398, 0.6375 (0.6366) for , and 0.3833, 0.3743, 0.3715 (0.3704) for ; longer single computations at are closer still. The limit shape: is compared with for and , for example 0.515 against 0.514 at , . Near the diagonal (), at is 0.7982, 0.4933, 0.3809, 0.2008, 0.0706, against 0.7979, 0.4931, 0.3808, 0.2008, 0.0709 from the discrete profile and 0.0705 from the power law at . With i.i.d. scores uniform on , the mean of over the last 64 rows lies in for , and near 0.05, 0.3, 0.7, 0.9.
D.3 Effects the theory does not quantify
The theorems give limits, not rates; the following are measured, not proved.
Finite iterations. With the main deviation in the tested settings is the amplitude: is nearly constant in but not one. It is 1.20, 1.13 and 1.09 at for , 1.76 at for , and within 1.3% of one at for . With the error is mainly a tilt in , of 4–15% for at (scripts/finite_iteration_rate.py).
The fixed point. The error of above shrinks roughly like over the tested lengths for all three values of . This is the approach to the limit in , not the convergence of the iteration in .
i.i.d. content. At the standard deviation of over the last 64 rows grows with and , from 0.015 to 0.098: a mean close to one coexists with appreciable row-to-row variation.
E Experimental details and supplementary results
E.1 Setup
Data. FineWeb-Edu [28] sample-10BT at revision 87f09149, tokenized with the GPT-2 tokenizer, documents separated by end-of-text tokens. Validation uses shard 013 (20M tokens). File hashes are recorded in the data manifest; the validation file has hash prefix 318c97404e7d7482.
Models and training. Decoder-only pre-norm Transformers with tied embeddings, AdamW with warmup and cosine decay, bf16 autocast (Table 5). The OT arms use a fused Triton kernel for the prefix iteration, with () and () iterations chosen so that the fixed-point residual is at most ; each run re-measured the residual after training. Gradients flow through the unrolled iterations, not through the fixed point. Per head, these iterations cost work at length . The kernel stores prefix carries at row-block boundaries and recomputes within blocks during backward; at fixed block size the saved state remains . The learnable log-distance exponents are , initialized log-spaced in over the heads; P6 and LC add a linear gate of the layer input to , and KERPLE's , start uniform in and as in its code.
Table 5: Training configurations; 32,768 tokens per step at both scales. Arms differ only in their position encoding and normalizer; their settings are the overrides listed in the accompanying configuration files (configs/exp0002/arms.yaml).
| Screening (25M) | Confirmation (100M) | |
|---|---|---|
| Width / depth / heads | 512 / 8 / 8 | 768 / 14 / 12 |
| MLP ratio, vocabulary | 4, 50,304 (tied) | 4, 50,304 (tied) |
| Non-embedding parameters | 25.2M | 99.2–99.5M |
| Training length | 512 | 1024 (also 2048, 4096) |
| Micro-batch × accumulation | 32 × 2 | 8 × 4 (4 × 4, 2 × 4) |
| Tokens / steps | 0.5B / 15,258 | 2B / 61,035 |
| Learning rate | (CABLE variant: ) | |
| Warmup, schedule | 750 steps, cosine to | 1,220 steps, cosine to |
| Weight decay, gradient clip | 0.1, 1.0 | 0.1, 1.0 |
| Hardware | RTX 4090 | A100-SXM4-80GB, RTX 4090, DGX Spark |
Table 6: Positional schemes, with . “Bounded far mass” is the guarantee of Proposition 14 under bounded inputs, where the conditional cases are stated in full. As in their papers, GRAPE-A, GRAPE-AP, FoX and CABLE are used without RoPE; so is P5. Every other arm with a bias adds it to RoPE.
| Arm | Position term | Bounded far mass |
|---|---|---|
| B0 | RoPE, no bias | no (dilutes) |
| P1 | RoPE + learnable , one exponent per head | iff |
| P2 | as P1 with fixed exponents (log-spaced 0.1-1) | no (dilutes) |
| P3 | RoPE + KERPLE log kernel [4] | iff |
| P4 (ALiBi) | RoPE [32] | yes |
| P5 | P1 without RoPE | iff |
| P6 | RoPE , exponent gated by the query's input | if |
| LC | as P6 on a content clock, | if |
| GRAPE-M | multiplicative group action (RoPE-like) | no (dilutes) |
| GRAPE-A | additive group action, gated linear in | yes |
| GRAPE-AP | path-integral bias | yes |
| FoX | cumulative log forget gate | yes |
| CABLE | content clock with per-query weight, | if the clock ticks at a positive rate |
| O1 | RoPE with the OT operator, | no (dilutes) |
| O2 | ALiBi with the OT operator, | yes (fixed point) |
Evaluation. Losses at different lengths average over the same initial predicted tokens of the validation stream: 2M at 100M and in the interventions, 262,144 in the far-mass probe. YaRN-t applies YaRN frequency interpolation and its attention temperature at evaluation time. The far mass uses two validation sequences per length: for each query in the second half of a sequence, the attention on keys more than one training length back, averaged over these queries, layers and heads.
E.2 OT mechanism and screening
OT mechanism. In 25M screening models, the distance part explains a layer-averaged 11–27% of the variance of the OT correction across , and 18–19% at . A single 100M run at half the learning rate is worse at both lengths; this comparison tests only that lower rate. To remove the built-in distance decay, the uniform-target operator replaces the target column mass 1 by , the mass that uniform attention delivers, that is, by in (5); its fixed point is , and with constant scores the correction vanishes. Trained like the screening arm (25M, , , two seeds), its loss at and is 3.481 and 3.968, against 3.468, 3.483 for the original target and 3.471, 3.635 for softmax; added to the explicit log-distance bias (3.461, 3.423) it worsens both lengths (3.469, 3.485). Since the target also changes the fixed point, this does not isolate the content part. The prefix operator also reduces attention sinks, the mass on the first token [48]; we did not find this to matter for extrapolation (exploratory).
Screening. Table 6 defines the arms and Table 7 gives their results. B0 with evaluation-time YaRN reaches . With the same bias, adding OT is slightly worse (O2 against ALiBi: +0.005 and +0.004 on the two seeds). The share of exponents above one is taken over heads, or heads queries for P6 and LC.
Table 7: Screening at 25M, , means over two seeds, grouped by the cases of Proposition 14. Loss in nats per token over 2M predictions; far mass from the probe of Section 5; last column, the share of learned exponents above one.
| Case | Arm | far mass | ||||
|---|---|---|---|---|---|---|
| dilutes | B0 | 3.474 | 3.865 | 0.679 | 0.889 | - |
| GRAPE-M | 3.471 | 3.930 | 0.701 | 0.899 | - | |
| O1 | 3.469 | 3.573 | 0.428 | 0.646 | - | |
| P2 | 3.461 | 3.460 | 0.424 | 0.627 | 0.00 | |
| learned | P5 | 3.489 | 3.498 | 0.253 | 0.480 | 0.34 |
| P6 | 3.460 | 3.440 | 0.364 | 0.561 | 0.18 | |
| P1 | 3.461 | 3.432 | 0.370 | 0.551 | 0.15 | |
| P3 | 3.463 | 3.413 | 0.192 | 0.279 | 0.64 | |
| LC | 3.456 | 3.403 | 0.221 | 0.309 | 0.56 | |
| CABLE | 3.467 | 3.400 | 0.089 | 0.050 | - | |
| bounded | ALiBi (P4) | 3.465 | 3.408 | 0.030 | 0.024 | - |
| GRAPE-A | 3.475 | 3.417 | 0.013 | 0.010 | - | |
| GRAPE-AP | 3.485 | 3.428 | 0.023 | 0.020 | - | |
| FoX | 3.490 | 3.429 | 0.015 | 0.008 | - | |
| O2 | 3.469 | 3.413 | 0.032 | 0.024 | - |
E.3 Confirmation and retests at 100M
Adoption rule (preregistered). The configuration of Section 5.1, three seeds per arm: B0, log-n softmax, ALiBi, CABLE (screening rank 1, with a learning-rate variant chosen by a preregistered rule), LC (rank 2, exploratory), GRAPE-M, GRAPE-AP and O2; B0 + YaRN-t is evaluated on the B0 checkpoints. Adoption requires mean paired gains over B0 and B0 + YaRN-t above , a positive gain on every seed, and mean loss at most 0.01 above B0. Here is B0's seed standard deviation of ; GRAPE replaces the primary prior if GRAPE-M or GRAPE-AP beats it, and OT is unfrozen only if O2 beats it and ALiBi.
Table 8: Confirmation at 100M: validation loss in nats per token (mean sd over three seeds). YaRN-t is defined only for arms with RoPE. CABLE uses the learning-rate variant selected by the preregistered rule.
| Arm | , YaRN-t | ms/step | |||
|---|---|---|---|---|---|
| B0 (RoPE) | 257 | ||||
| log-n softmax | 347 | ||||
| GRAPE-M | - | 262 | |||
| GRAPE-AP | - | 482 | |||
| ALiBi (P4) | 260 | ||||
| O2 (P4 + OT) | 1582 | ||||
| LC | 341 | ||||
| CABLE | - | 287 | |||
| CABLE, B0's lr | - | 287 |
Outcome. Every arm with a distance or path bias reaches , against 3.95–4.20 for B0, GRAPE-M and log-n (Table 8). CABLE beats B0 + YaRN-t by 0.058 (0.059, 0.060, 0.056 per seed) with a 1× loss 0.017 lower than B0, but does not meet the adoption rule: , set by the seed spread of B0's (4.046, 4.144, 4.151), is far above the seed standard deviations of the paired differences (0.0013–0.0027). Neither switching rule is triggered: GRAPE does not beat CABLE, and O2 is worse than ALiBi on every seed (0.0031–0.0047).
Retests (preregistered). The retests of Section 5.2 compare CABLE with B0 + YaRN-t on new seeds, with the threshold 0.01 set from the spread of the paired differences above. They are new tests and do not change the outcome of the original adoption rule; the absolute losses are in Table 9.
Table 9: Retest at 100M on new seeds: validation loss in nats per token (mean ± sd) at the training length (1×) and .
| Length (seeds) | 1× | |||
|---|---|---|---|---|
| B0 | CABLE | B0 + YaRN-t | CABLE | |
| 1024 (5) | 3.0445 ± 0.0039 | 3.0258 ± 0.0012 | 3.0391 ± 0.0039 | 2.9801 ± 0.0012 |
| 2048 (3) | 3.0233 ± 0.0028 | 2.9932 ± 0.0012 | 3.0302 ± 0.0039 | 2.9649 ± 0.0012 |
| 4096 (3) | 3.0201 ± 0.0045 | 2.9749 ± 0.0009 | 3.0343 ± 0.0038 | 2.9602 ± 0.0009 |
Far mass at 100M (exploratory). LC uses two seeds because the seed-0 checkpoint backup is incomplete; other arms use three. From 2× to 8× the far mass of B0, GRAPE-M and log-n grows from 0.41–0.47 to 0.81–0.89, and the loss of B0 and GRAPE-M rises by 1.35–1.41 from 4× to 16×; ALiBi, GRAPE-AP and O2 stay below 0.015, CABLE falls from 0.07 to 0.04, and their loss stays flat. LC is in between (far mass 0.18 to 0.37, 44% of per-query exponents above one, loss +0.38).
E.4 Test-time interventions
Checkpoints. The interventions act on the total additive bias of each head after loading a trained checkpoint and are applied in both the reference and the fused attention. Caps are applied to ALiBi, GRAPE-A, FoX and CABLE at 25M and to ALiBi and both CABLE variants at 100M, repairs to P1, P2, P6 (25M) and LC (100M), windows to B0 (Table 10). Figure 5 shows one 25M checkpoint per intervention.
Decision rule. The preregistered threshold (Table 11) applies to the mean over all checkpoints of one type of intervention, pooled across arms and scales. Table 10 splits these sets by scale only for reporting, so the 100M LC repair mean (-0.009) is not tested against the threshold on its own.
Repair. For LC the anchor is read on the content clock, but the tail beyond it continues in token distance ; the tail exponent 1.5 also weakens the decay of any head whose learned exponent exceeds it. The same repair on the three 100M checkpoints with a token-distance log bias (Table 1, last row), evaluated with scripts/exp0003_tail.py --mode repair --mult 8, is exploratory.


Figure 5: Loss against the evaluation length for one 25M checkpoint per intervention, before (dark grey) and after; the curves coincide up to the training length by construction.
Table 10: Test-time interventions beyond the training length (Figure 4). Loss change in nats at (25M) or (100M), mean and range over checkpoints; far mass at the same length before and after. The losses agree within in every case.
| Checkpoints (seeds each) | Scale | Loss change | Far mass | ||
|---|---|---|---|---|---|
| before | after | ||||
| cap | ALiBi, GRAPE-A, FoX, CABLE (2) | 25M | +0.060 (+0.008 to +0.161) | 0.007-0.058 | 0.036-0.201 |
| cap | ALiBi, CABLE, CABLE (default lr) (3) | 100M | +0.020 (+0.012 to +0.064) | 0.003-0.045 | 0.036-0.093 |
| repair | P1, P2, P6 (2) | 25M | -0.264 (-0.312 to -0.198) | 0.55-0.63 | 0.32-0.39 |
| repair | LC (2) | 100M | -0.009 (-0.011 to -0.008) | 0.36-0.37 | 0.26-0.27 |
| repair | log bias, exploratory (3) | 100M | -0.182 (-0.210 to -0.166) | 0.58-0.61 | 0.39-0.44 |
| window | B0 (2) | 25M | -1.93 (-1.96 to -1.90) | 0.89 | 0.03 |
| window | B0 (3) | 100M | -2.46 (-2.55 to -2.34) | 0.87-0.88 | 0.01 |
E.5 Training-time constraints and margins
Why is not enough. Experiment 0003 trains P1 with exponents constrained to (gt1) or (lt1), the free P1 and ALiBi, three seeds at 25M. At the same loss (3.438–3.444), ALiBi, gt1, free and lt1 reach losses 3.359, 3.430, 3.888, 4.005 and far masses 0.023, 0.163, 0.554, 0.585. gt1 passes the loss test but fails the far-mass growth test (Table 11): 39–44% of its heads have , with per-seed minima of 1.0001–1.0002. These heads have transition scales above and remain in regime (i) of Corollary 16 through 32L (). Post hoc, the prior with the learned exponents predicts far-mass growths of 0.067, 0.234, 0.254 for gt1, free and lt1, against 0.044, 0.197, 0.205 measured.
Choosing the margin. The margin of experiment 0004 follows from a window, a length range and a tolerance; the transition indicator alone does not decide whether a tolerance is met. For the prior with all heads at , and the far mass averaged as in Section 5, the growth from 4L to 16L is 0.088, 0.043 and 0.010 for , 0.25, 0.5, so of these only 0.5 meets the tolerance 0.02, although already at .
Trained margins. In experiment 0004 (seeds 3-5, Table 3) the far mass at is 0.160, 0.113, 0.071 for , 0.25, 0.5 and 0.023 for ALiBi; 23-30%, 25-28% and 27-31% of the heads end within 0.01 of . The prior with the learned exponents predicts growths of 0.067, 0.023, 0.006, against 0.032, 0.015, 0.004 measured; the prediction leaves out the trained content scores.
E.6 Distant retrieval and copying
Retrieval. Passkey and needle retrieval on the confirmation checkpoints, , five key depths, 20 trials each. B0, log- and GRAPE-M fail beyond the training length; ALiBi, O2 and LC succeed at only at the depth closest to the query. CABLE's passkey accuracy is 0.94 at and 0.54 at ; the needle accuracy at is 0.23, both averaged over five depths. At the farthest depth (about 3,700 tokens back), the corresponding accuracies are 0.62 and 0.05. On the repetitive passkey filler its clock can pause: its far mass is 0.19–0.20 at (0.04 on natural text), and its attention to the key span 0.04 at (others ).
Distant copying. A 128-token target fragment ends a 5L-token validation sequence (). The copying gain is the reduction of its loss when the fragment tokens earlier is a copy of the target rather than a different fragment (64 shared trials; a shuffled copy gains at most 0.02). ALiBi, O2, GRAPE-AP and LC gain 1.13–1.45 nats at , 0.08–0.33 at and at most 0.009 at and ; CABLE gains 1.52, 0.88, 0.256 and 0.107 (within 0.006 on five new seeds; 0.17 and 0.07 at , for training length 2048); B0 at most 0.014. In every CABLE checkpoint one to three heads of layers 5–6 put 0.6–1.0 of their attention on the passkey.
E.7 Run provenance and preregistered outcomes
Public code: https://github.com/homw314159-spec/causal-ot-attention, tag v0.1.0 (commit e60a38f). The public release has a fresh history; the reported runs record clean development commits and were not rerun for this release. The file configs/reproduction.yaml provides training recipes for experiments 0001–0004; docs/experiments.md maps the protocols and probes to scripts. It summarizes the preregistrations rather than publishing their original change logs. Development history, data and checkpoints are not distributed.
0001: twelve runs and one learning-rate run, plus the log-distance-bias runs. 0002: screening, thirty runs; confirmation, 27 runs on two A100-SXM4-80GB machines (runs lost with the first were retrained and reproduce their losses to 0.0011). 0003: retest, sixteen runs on one four-GPU A100 machine; training-time intervention, twelve runs on an RTX 4090. 0004: retest at 4096 (six runs; two seeds on an RTX 4090, one on a DGX Spark, the arms of a seed on the same machine) and margins (twelve runs, RTX 4090).
Table 11: Preregistered tests and their outcomes. Loss thresholds apply to mean paired gains; “every seed” and “every checkpoint” require consistent signs. Far-mass thresholds apply to seed means; all thresholds were fixed before the runs.
| Exp. | Test | Observed | Outcome |
|---|---|---|---|
| 0001 | best below softmax at by 0.0100, every seed | 0.0095 | fails |
| 0001 | best below softmax / log- at by 0.057, every seed | 0.455, 0.303 | holds |
| 0002 | CABLE below B0 + YaRN-t in by , every seed | 0.058 | fails |
| 0002 | GRAPE or O2 beats CABLE (switching rules) | no | not triggered |
| 0003 | CABLE below B0 + YaRN-t in by , every seed | 0.059, 0.065 | holds |
| 0003 | gt1 below lt1 at by 0.01, every seed | 0.488–0.678 | holds |
| and far-mass growth : gt1 , lt1 | 0.044, 0.205 | fails | |
| 0003 | cap, repair, window: every checkpoint, pooled mean above 0.01 (0.1) | 30/30 | holds |
| 0004 | as 0003's retest, at | 0.074 | holds |
| 0004 | : far-mass growth ; below at by 0.01 | 0.004, 0.042 | holds |
| 0004 | far-mass growth ordered , every seed | 3/3 | holds |