Methods › General › Position Embeddings › ALiBi
Attention with Linear Biases
ALiBi
Introduced by Ofir Press et al. in Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
archive 2025-07-28 Description, source and code snippet are the archive's method entry.
ALiBi, or Attention with Linear Biases, is a positioning method that allows Transformer language models to consume, at inference time, sequences which are longer than the ones they were trained on.
ALiBi does this without using actual position embeddings. Instead, computing the attention between a certain key and query, ALiBi penalizes the attention value that that query can assign to the key depending on how far away the key and query are. So when a key and query are close by, the penalty is very low, and when they are far away, the penalty is very high.
This method was motivated by the simple reasoning that words that are close-by matter much more than ones that are far away.
This method is as fast as the sinusoidal or absolute embedding methods (the fastest positioning methods there are). It outperforms those methods and Rotary embeddings when evaluating sequences that are longer than the ones the model was trained on (this is known as extrapolation).
In Syntology about another paper, arXiv:2106.03408: verified reference implementation at level V3; retrieve with get_reference_implementation(name='ALIBI'). The lookup matched 'ALIBI' ignoring case. About another paper: this answer is about arXiv:2106.03408, while the archive credits arXiv:2108.12409.
From the lookup's note on this name: The same name also belongs to “Attention with Linear Biases (ALiBi)”, a method in the paper “Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation” (arXiv:2108.12409, 1,356 citations), which the lookup finds cited far more than the paper this answer is about (83 citations), so this answer may be about a different sense of the name. For arXiv:2108.12409: its page on this site · ask the lookup about it.
Origin paper of this answer, arXiv:2106.03408 (its page on this site · its page on Syntology): Syntology's run record for its harvested code, 6 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 5 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 1 unverified (of 7 harvested samples) · 7 pointer-only (licence). The instrument figure counts failures of Syntology's instrument, not of the code. Ran means executed on a synthesized input, not that the code is correct.
Syntology's have check for this name (free, it answers coverage only), read 2026-10-05; ask it again live. A level is the served verification level of that one answer; nothing here is summed across methods.
What each level means, quoted from Syntology's server card: V0 “imports”; V1 “executes against a synthesized fixture and returns a value of the recorded type”; V2 “two implementations GENERATED from the paper's signature and spec agree numerically (1e-6) on fixture inputs” “neither of the two ever read the authors' own code, so V2 measures how unambiguously the paper specifies the method, not fidelity to the authors' implementation (measured 2026-09-11, commit 75eaa77: cross_checked_by is a second LLM on 2,628 of 2,831 served samples)”; V3 “paper-derived property tests pass on both of those same two generations.” The card adds: “No rung on this ladder compares the served code against the authors' implementation, so treat every level as evidence about runnability and internal agreement, not about matching the paper's results.” A level quoted in two parts is one definition the card writes as two clauses joined by a double hyphen, each clause quoted on its own (how these levels are quoted).
Papers archive 2025-07-28
archive papers tagged: 19 · with a code link: 10 · where Syntology ran a sample: 8 (8 with a run with no instrument failure, 0 where every run was a failure of Syntology's instrument) Syntology
Show: all tagged papersonly where code ran (8 of 19 tagged: 8 with a run with no instrument failure, 0 where every run was a failure of Syntology's instrument)
Page 1 of 1: papers 1 to 19 of 19, newest first by the archive's date (ties by slug), in archive order.
Repository counts are the archive's code-links table. A Syntology line states what Syntology ran from that paper's harvested code, as “N ran (of which C constructed an object rather than computing a result; K with no instrument failure: H honoured, V violated, P with no contract checked; I where Syntology's instrument failed) · U unverified”; the instrument figure counts failures of Syntology's instrument, not of the code. It is per sample and not a correctness claim. When the archive marks a repository official for the paper, the line starts with that repository's state (the archive's flag, not a verdict on who wrote the code; “community repositories only” when every sample that ran came from a community repository, “official: no sample here; runs from other or unrecorded repositories” when some came from a repository the paper names or has in its text, or from none recorded); hover it for the repositories the samples that ran came from.
-
A standard transformer and attention with linear biases for molecular conformer generation 24 Jun 2025 · 0 repositories · arXiv:2506.19834
-
SeqPE: Transformer with Sequential Position Encoding 16 Jun 2025 · 1 repository · arXiv:2506.13277Syntology official (archive's flag): 9 ran · 9 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 2 violated, 2 with no contract checked; 5 where Syntology's instrument failed) · 3 unverified (of 12 harvested samples) · 12 pointer-only (licence)
-
Context-aware Biases for Length Extrapolation 11 Mar 2025 · 1 repository · arXiv:2503.08067Syntology official: no sample here; runs from other or unrecorded repositories · 1 ran (of which 1 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified; the one sample that ran constructed an object rather than computing a result (of 1 harvested sample) · 1 pointer-only (licence)
-
zScore: A Universal Decentralised Reputation System for the Blockchain Economy 17 Feb 2025 · 0 repositories · arXiv:2503.05718
-
Linear Recency Bias During Training Improves Transformers' Fit to Reading Times 17 Sep 2024 · 0 repositories · arXiv:2409.11250
-
Towards Inducing Document-Level Abilities in Standard Multilingual Neural Machine Translation Models 21 Aug 2024 · 0 repositories · arXiv:2408.11382
-
Mitigate Position Bias in Large Language Models via Scaling a Single Dimension 4 Jun 2024 · 1 repository · arXiv:2406.02536Syntology official (archive's flag): 17 ran · 17 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 1 honoured, 0 violated, 8 with no contract checked; 8 where Syntology's instrument failed) · 5 unverified (of 22 harvested samples) · 5 pointer-only (licence)
-
Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding? 9 May 2024 · 0 repositories · arXiv:2405.06105
-
MEP: Multiple Kernel Learning Enhancing Relative Positional Encoding Length Extrapolation 26 Mar 2024 · 0 repositories · arXiv:2403.17698
-
Audiobox: Unified Audio Generation with Natural Language Prompts 25 Dec 2023 · 0 repositories · arXiv:2312.15821
-
ScorePerformer: Expressive Piano Performance Rendering With Fine-Grained Control 4 Nov 2023 · 1 repository
-
HyPE: Attention with Hyperbolic Biases for Relative Positional Encoding 30 Oct 2023 · 0 repositories · arXiv:2310.19676
-
BTLM-3B-8K: 7B Parameter Performance in a 3B Parameter Model 20 Sep 2023 · 1 repository · arXiv:2309.11568Syntology official (archive's flag): 6 ran · 6 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified (of 8 harvested samples)
-
SlimPajama-DC: Understanding Data Combinations for LLM Training 19 Sep 2023 · 1 repository · arXiv:2309.10818
-
Voicebox: Text-Guided Multilingual Universal Speech Generation at Scale 23 Jun 2023 · 1 repository · arXiv:2306.15687Syntology 10 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 3 honoured, 3 violated, 2 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified (of 10 harvested samples) · 3 pointer-only (licence)
-
The Impact of Positional Encoding on Length Generalization in Transformers 31 May 2023 · 2 repositories · arXiv:2305.19466Syntology official (archive's flag): 6 ran · 6 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified (of 7 harvested samples)
-
A Vector Quantized Approach for Text to Speech Synthesis on Real-World Spontaneous Speech 8 Feb 2023 · 1 repository · arXiv:2302.04215Syntology official (archive's flag): 2 ran · 2 ran (of which 2 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified; every one of the 2 samples that ran constructed an object rather than computing a result (of 2 harvested samples)
-
Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysis 20 Dec 2022 · 0 repositories · arXiv:2212.10356
-
Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 27 Aug 2021 · 10 repositories · arXiv:2108.12409Syntology official (archive's flag): 4 ran · 16 ran (of which 6 constructed an object rather than computing a result; 13 with no instrument failure: 4 honoured, 0 violated, 9 with no contract checked; 3 where Syntology's instrument failed) · 0 unverified (of 16 harvested samples) · 5 pointer-only (licence)
Tasks archive 2025-07-28
20 shown of 29 tasks the archive attaches to papers tagged with this method, by distinct papers. A task without a page in the catalog is plain text.
| Task | Papers |
|---|---|
| Position | 5 |
| Decoder | 4 |
| Language Modeling | 4 |
| Language Modelling | 4 |
| Sentence | 2 |
| Speech Synthesis | 2 |
| Text to Speech | 2 |
| Text-To-Speech Synthesis | 2 |
| text-to-speech | 2 |
| 8k | 1 |
| Audio Generation | 1 |
| AudioCaps | 1 |
| Code Generation | 1 |
| Diversity | 1 |
| Drug Discovery | 1 |
| FAD | 1 |
| Image Classification | 1 |
| In-Context Learning | 1 |
| Inductive Bias | 1 |
| Knowledge Distillation | 1 |
Usage over time archive 2025-07-28
Components: the archive holds no method-to-method composition, so PwC's Components table cannot be rebuilt; the Papers list carries no Results column for the same reason (the archive does not join its leaderboard rows to method tags).
Categories archive 2025-07-28
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections