A Structural Theory of Position Bias in Transformers
Organizations: University of Hamburg Hamburg, Germany
Abstract
Transformer models systematically favor certain token positions, yet the architectural origins of this position bias remain poorly understood. This bias is closely connected to the Lost-in-the-Middle phenomenon, where models underutilize information placed in the middle of the context. We show that causal Transformer architectures induce a systematic position-bias prior that can help explain the influence profiles associated with Lost-in-the-Middle. To characterize this prior, we develop a structural theory based on cumulative attention rollout with layerwise residual mixing. At finite depth, we isolate the competing positional drifts induced by causal masking, residual mixing, and positional encoding. Their interaction produces broad, often U-shaped profiles. At infinite depth, prior work predicts inevitable collapse under attention-only theory and identifies the discrepancy with observed Transformer behavior as an open problem. Under the stated boundedness assumptions, our residual-aware analysis replaces inevitable collapse with a dichotomy governed by cumulative attention mixing. Empirically, across 30 model-dataset settings, our adaptive residual-aware rollout closely matches measured input-token influence and reduces the average profile discrepancy by approximately 85% relative to both the attention-only and fixed-residual rollout baselines.
Figures & tables
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | FineWeb-Edu | DCLM-Baseline | Wikipedia | ||||||
| (a) Wu | (b) Abnar | (c) Ours adaptive | (a) Wu | (b) Abnar | (c) Ours adaptive | (a) Wu | (b) Abnar | (c) Ours adaptive | |
| falcon-rw-7b | 0.66 | 0.63 | 0.03 | 0.66 | 0.64 | 0.02 | 0.68 | 0.65 | 0.05 |
| mpt-7b | 0.62 | 0.58 | 0.15 | 0.59 | 0.55 | 0.19 | 0.66 | 0.62 | 0.11 |
| mpt-30b | 0.61 | 0.61 | 0.02 | 0.58 | 0.58 | 0.04 | 0.65 | 0.65 | 0.02 |
| bloom-7b1 | 0.63 | 0.58 | 0.13 | 0.61 | 0.56 | 0.15 | 0.67 | 0.61 | 0.10 |
| bloom-176b | 0.65 | 0.65 | 0.11 | 0.63 | 0.63 | 0.06 | 0.69 | 0.69 | 0.11 |
| Model | FineWeb-Edu | DCLM-Baseline | Wikipedia | ||||||
| Cross- layer | Within- layer | Combined | Cross- layer | Within- layer | Combined | Cross- layer | Within- layer | Combined | |
| falcon-rw-7b | 0.17 | 0.00 | 0.17 | 0.31 | 0.00 | 0.31 | 0.20 | 0.00 | 0.20 |
| mpt-7b | 0.01 | 0.00 | 0.01 | 0.02 | 0.00 | 0.02 | 0.01 | 0.00 | 0.01 |
| mpt-30b | 0.10 | 0.00 | 0.10 | 0.17 | 0.00 | 0.17 | 0.39 | 0.00 | 0.39 |
| bloom-7b1 | 0.03 | 0.00 | 0.03 | 0.03 | 0.00 | 0.03 | 0.03 | 0.00 | 0.03 |
| bloom-176b | 0.02 | 0.00 | 0.02 | 0.02 | 0.00 | 0.02 | 0.02 | 0.00 | 0.02 |
| Model | (a) Wu | (b) Abnar | (c) Ours adaptive |
| falcon-rw-7b | 0.46 | 0.20 | 0.14 |
| mpt-7b | 0.46 | 0.18 | 0.16 |
| mpt-30b | 0.82 | 0.45 | 0.07 |
| bloom-7b1 | 0.45 | 0.15 | 0.14 |
| bloom-176b | 0.74 | 0.49 | 0.16 |
| qwen2.5-7b | 0.72 | 0.55 | 0.05 |
| Model | (a) Wu | (b) Abnar | (c) Ours adaptive | Blank-out vs. gradient |
| falcon-rw-7b | 0.72 | 0.69 | 0.09 | 0.10 |
| mpt-7b | 0.66 | 0.62 | 0.11 | 0.08 |
| mpt-30b | 0.60 | 0.59 | 0.04 | 0.03 |
| bloom-7b1 | 0.68 | 0.63 | 0.08 | 0.06 |
| bloom-176b | 0.59 | 0.59 | 0.17 | 0.06 |
| qwen2.5-7b | 0.65 | 0.62 | 0.09 | 0.06 |
| Prefix mass | Recency mass | ||||
| Model | Predicted | Measured [95% CI] | Predicted | Measured [95% CI] | |
| bloom-7b1 | 0.8 | [ ] | [ ] | ||
| 1.2 | [ ] | [ ] | |||
| mpt-7b | 0.8 | [ ] | [ ] | ||
| 1.2 | [ ] | [ ] | |||
| falcon-rw-7b | 0.8 | [ ] | [ ] | ||
| Model | KL | Top-1 | KL | Top-1 |
| bloom-7b1 | 0.03 | 91% | 0.02 | 93% |
| mpt-7b | 0.22 | 83% | 0.08 | 85% |
| falcon-rw-7b | 0.09 | 88% | 0.05 | 89% |
| qwen2.5-7b | 0.08 | 88% | 0.03 | 92% |
| qwen3-8b-base | 0.05 | 90% | 0.03 | 94% |
| Model | (a) Wu | (b) Abnar | (c) Ours relative norm | (d) Ours norm-Shapley |
| falcon-rw-7b | 0.66 | 0.63 | 0.19 | 0.03 |
| mpt-7b | 0.62 | 0.58 | 0.09 | 0.15 |
| mpt-30b | 0.61 | 0.61 | 0.16 | 0.02 |
| bloom-7b1 | 0.63 | 0.58 | 0.04 | 0.13 |
| bloom-176b | 0.65 | 0.65 | 0.08 | 0.11 |
| qwen2.5-7b | 0.63 | 0.59 | 0.29 | 0.12 |
| Resource | License | Link | Notes / Citation |
| Falcon | Apache 2.0 | Model repository | [ Penedo et al., 2023 ] |
| MPT | Apache 2.0 | Model repository | [ Mosaic, 2023a , Mosaic, 2023b ] |
| BLOOM | BigScience RAIL License v1.0 | Model repository | [ Scao et al., 2022 ] |
| Qwen2.5 (7B, 32B) | Apache 2.0 | Model repository | [ Qwen Team, 2024 ] |
| Qwen2.5 (72B) | Qwen License Agreement | Model repository | [ Qwen Team, 2024 ] |
| Qwen3-8B-Base | Apache 2.0 | Model repository | [ Qwen Team, 2025 ] |