ALiBi, decode the acronym and pinpoint where in the pipeline it injects position
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.