ALiBi, decode the acronym and pinpoint where in the pipeline it injects position
ALiBi = Attention with Linear Biases. It adds a per head linear distance penalty to pre softmax scores; no input position embedding.
Imagine a group chat where every person hears every other person, but each listener wears a different pair of headphones. Some headphones get louder the closer the speaker sits; others barely change with distance. The chat itself has no name tags, no seating chart, no announcement of who is two seats away from whom. The volume curves are the only source of position information. ALiBi is that volume curve applied to attention: instead of telling tokens where they sit, it just turns down the volume on far away tokens by a fixed amount that grows with distance. Different attention heads use different volume curves, so some heads focus on nearby tokens and others still hear the whole room.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6-8 min: ALiBi acronym + injection point + formula + slope schedule + length extrapolation property + comparison to RoPE and PE + production adoption.
Real products, models, and research that use this idea.
- BLOOM 176B (BigScience, 2022) shipped with ALiBi as its positional scheme.
- MPT-7B and MPT-30B (MosaicML, 2023) used ALiBi and advertised length extrapolation past training context.
- Modern frontier LLMs (Llama 4 Maverick, Mistral, Qwen 3.5, DeepSeek V4) converged on RoPE with PI or YaRN rather than ALiBi.
- Several efficient serving research stacks still favor ALiBi because the closed form bias composes well with FlashAttention kernels.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy did frontier labs move from ALiBi to RoPE plus extension tricks?
QHow does ALiBi interact with FlashAttention?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying ALiBi modifies the input embeddings or the Q/K vectors. It does neither. The bias lives at the score matrix, one line after the QK^T multiplication.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.