Skip to content
inference.academy

glossary/memory/radix-attention

RadixAttention

also radix tree cache

SGLang's prefix cache: every stored sequence is a path in a radix tree keyed by tokens, so a new request walks the tree as far as its prompt matches and computes only the remainder. Shared prefixes are shared nodes, which is what lets many users' contexts hold one copy of a system prompt. Eviction is least-recently-used over leaves, so the cache keeps what is being extended and drops what has gone quiet.


one node

Per shared system prompt, however many users are attached below it.


See it happen


Related