Repository navigation
[Case Study] Agent Context Compaction Breaks RadixAttention Prefix Caching (10.1% -> 99.6% Hit Rate) #46591
yansu202511
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi SGLang team & @LianminZheng,
We wanted to share a production case study that directly validates and highlights the sensitivity of RadixAttention / Prefix Caching in long-horizon LLM Agent workflows.
During multi-hour agent runs, we observed that context compaction (summarization) caused a massive prefill stall (TTFT >200s on ~80k context), collapsing the prefix cache hit rate to only 10.1%.
The Mechanism (Breaking the Radix Tree)
The root cause was an upper-layer orchestration mistake:
The Fix
By simply keeping the compaction request's message prefix token-identical with normal conversation turns (and extracting the archive for output splicing without deleting it from the prompt), the cache hit rate immediately recovered from 10.1% to 99.6%:
Full Repro Kit & D
All reactions