Stream2LLM: Overlap Context Streaming and Prefill for Reduced Time-to-First-Token (TTFT)
Organizations: Georgia Tech, Atlanta, USA
Abstract
Context retrieval systems for LLM inference face a critical challenge: high retrieval latency creates a fundamental tension between waiting for complete context (poor time-to-first-token) and proceeding without it (reduced quality). Streaming context incrementally--overlapping retrieval with inference--can mitigate this latency, but doing so with concurrent requests introduces new challenges: requests contend for GPU compute and memory, and scheduling must adapt to dynamic context arrivals. We present Stream2LLM, a streaming-aware LLM serving system for concurrent prefill-decode disaggregated deployments. Stream2LLM introduces adaptive scheduling and preemption for two distinct retrieval patterns: append-mode (progressive context accumulation) and update-mode (iterative refinement with cache invalidation). It decouples scheduling decisions from resource acquisition, enabling flexible preemption strategies guided by hardware-specific cost models, and uses longest common prefix matching to minimize redundant computation when input changes dynamically. To evaluate Stream2LLM, we collect two large-scale, real-world streaming workloads based on web crawling and approximate nearest neighbor search. Our evaluation demonstrates that streaming architecture delivers up to 11x TTFT improvements, with cost-aware scheduling providing critical benefits under memory pressure, all while maintaining throughput parity with non-streaming baselines. Code: https://github.com/rajveerb/stream2llm/tree/mlsys_artifact
Figures & tables
| Append Mode | Update Mode | |||
|---|---|---|---|---|
| Policy | Rating | Key Behavior | Rating | Key Behavior |
| DEFAULT vLLM | Poor | Ignores arrival timing | Poor | Ignores recomputation cost |
| FCFS | Good | No recency awareness | Moderate | No update prioritization |
| MCPS | Good | Tracks progress | Poor | Unstable under updates |
| LCAS | Good | Prioritizes recent input | Good | Prioritizes recent updates |
| Metric | Mean | P50 | P75 | P95 |
|---|---|---|---|---|
| ANNS (Update Mode, 500 queries) | ||||
| Total Tokens per Query | 13K | 10K | 15K | 31K |
| Retrieval Latency (s) | 4.5 | 3.9 | 5.3 | 8.5 |
| Crawler (Append Mode, 4,322 queries) | ||||
| Total Tokens per Query | 9.1K | 5.8K | 11.3K | 28.9K |
| Retrieval Latency (s) | 9.9 | 9.3 | 11.6 | 16.7 |
| Crawler Workload | ANNS Workload | |||||||||||
| Recompute | Swap | Cost-Based | Recompute | Swap | Cost-Based | |||||||
| Scheduler | P50 | P99 | P50 | P99 | P50 | P99 | P50 | P99 | P50 | P99 | P50 | P99 |
| vLLM-NS | 0.64s | 8.97s | 0.64s | 8.97s | 0.64s | 8.97s | 0.72s | 6.56s | 0.72s | 6.56s | 0.72s | 6.56s |
| vLLM-S | 8.59 | 0.78 | 7.29 | 0.66 | 8.25 | 0.71 | 2.53 | 0.19 | 2.26 | 0.18 | 2.63 | 0.19 |
| FCFS | 8.77 | 10.03 | 7.78 | 6.69 | 8.30 | 8.62 | 2.70 | 1.84 | 2.37 | 1.26 | 2.70 | 2.04 |
| LCAS | 8.61 | 9.23 | 7.32 | 4.80 | 7.82 | 9.14 | 2.38 | 1.79 | 1.62 | 0.97 | 2.44 | 1.79 |
| Policy | Recomp. | Swap | Cost-Based |
| Crawler Workload | |||
| vLLM-S | 2,448 | 779 | 1,735 (17%/83%) |
| FCFS | 3,552 | 709 | 1,575 (21%/79%) |
| LCAS | 12,564 | 1,049 | 3,486 (21%/80%) |
| MCPS | 3,316 | 721 | 1,741 (19%/81%) |
| ANNS Workload | |||
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
LLM Inference
Large language model inference studies how models generate outputs efficiently, reliably, and securely across hardware and workloads.
See all 267 papers