You are moving from a dense transformer to a Mamba-attention hybrid. What changes in your serving stack?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Short version: the model gets much cheaper at long context, and your cache manager gets much harder. Memory stops growing with context, and prefix caching stops being free.
Full worked answer with diagram
Short version: the model gets much cheaper at long context, and your cache manager gets much harder. Memory stops growing with context, and prefix caching stops being free.
Layers no longer share a cache shape. In a dense transformer every layer stores the same KV per token, so one uniform block pool works. A hybrid mixes full-attention layers, which append per-token KV, with Mamba or linear-attention layers, which hold a fixed-size recurrent state updated in place. Engines handle this with a unified allocator over heterogeneous per-layer state: vLLM groups layers by type and forces one page size across groups, which in practice means raising the attention block size until an attention page is at least as large as a Mamba page. That produces attention block sizes in the hundreds of tokens instead of 16.
Prefix caching is where it bites. A KV block is token-addressable, so you can match, share and roll back at token granularity. A recurrent state is one vector summarising everything seen so far: you cannot slice it or trim the last 30 tokens, only snapshot it at chosen boundaries and replay forward. So reuse becomes explicit state checkpointing, with a mode choice trading pool memory against hit rate, and engine support for it is still maturing.
The trap follows from the block size. Matching is block-granular, so a prompt shorter than one block has zero complete blocks and gets roughly a 0% hit rate, while a prompt just past the block boundary can hit almost entirely. Short-prompt chat traffic falls off a cliff with no obvious cause.
Memory flips. KV no longer grows linearly with context on most layers, so your ceiling is not KV-per-token times context times batch any more. Concurrency is capped by a near-flat per-sequence state, on the order of megabytes for mid-sized hybrids. Redo the memory budget and the fleet-sizing arithmetic from the capacity questions rather than carrying the old formula across.
Anything that moves cache must move state. Prefill/decode disaggregation and KV offload now transfer recurrent state as well as blocks. Also watch low-concurrency latency: the Mamba kernels are typically Triton, so CUDA graph coverage matters more than on a dense model.
Worth sketching. It shows how one allocator constraint turns into a short-prompt cache cliff.
flowchart TD
M["Hybrid model: a few attention layers,<br/>mostly Mamba or linear layers"] --> A["Attention layer: KV blocks,<br/>token-addressable, sliceable"]
M --> S["Mamba layer: fixed-size state,<br/>updated in place, not sliceable"]
A --> U["Unified allocator, one page size<br/>across all layer groups"]
S --> U
U --> B["Attention block size raised to match<br/>mamba page, hundreds of tokens"]
B --> H["Prompt shorter than one block:<br/>no complete block, 0% cache hit"]
S --> C["Reuse needs explicit state checkpoints<br/>plus replay forward"]
What a good answer covers
- Short version: the model gets much cheaper at long context, and your cache manager gets much harder
- Memory stops growing with context, and prefix caching stops being free
- Layers no longer share a cache shape
- In a dense transformer every layer stores the same KV per token, so one uniform block pool works
- A hybrid mixes full-attention layers, which append per-token KV, with Mamba or linear-attention layers,…
Key terms: Memory flips
In the glossary: Prefix caching · Mamba / SSM · vLLM · Attention · Prefill · Decode
Interviewer follow-ups to expect
Why can you not roll a Mamba state back by 30 tokens the way you can drop KV blocks, and what does that cost an agent that edits its own history?
Your hybrid deployment reports a 0% prefix cache hit rate on chat traffic but 90% on RAG traffic. What do you check first?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep