# Emulating ALiBi with RoPE

> Hacker News story 49118542 · language: en · submitted 2026-07-31
> Web version: https://zeli.app/story/49118542
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 4 · by [alexlitz](<https://news.ycombinator.com/user?id=alexlitz>) · 💬 0
[original](<https://alexlitzenberger.com/blog/emulating_alibi_with_rope>) · [HN discussion](<https://news.ycombinator.com/item?id=49118542>)

## Summary

LLMs use positional encodings like RoPE and ALiBi to track token positions. This post shows how to emulate ALiBi's linear bias using a fixed RoPE pair, by adding two dimensions to Q and K and tuning the rotation frequency. The author proves that ALiBi is the small-angle limit of this RoPE pair, and validates the approach by reproducing BLOOM-560M's results. Practical limitations, such as choosing frequencies from an existing RoPE base, are also discussed.

## Key quote

> So ALiBi is equivalent to the small-angle limit of a fixed RoPE pair, so as long as you make θ small enough for long contexts, which in turn causes N to be large.

---

## Cite

- Page: https://zeli.app/story/49118542
- Date: 2026-07-31
- Source: alexlitzenberger.com (https://alexlitzenberger.com/blog/emulating_alibi_with_rope)
- Hacker News: https://news.ycombinator.com/item?id=49118542

## Other languages

- ja: https://zeli.app/ja/story/49118542 · markdown: https://zeli.app/ja/story/49118542.md
- de: https://zeli.app/de/story/49118542 · markdown: https://zeli.app/de/story/49118542.md
