ALiBi (Press et al., 2022) drops positional embeddings and instead adds a penalty to attention scores proportional to distance: query i attending to key j ≤ i gets a bias of , with a different slope per head. Models trained this way extrapolate to longer contexts. It's used in BLOOM and MPT.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial