Reproduce “SentenceKV: Efficient LLM Inference via Sentence-Level Semantic KV Caching” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Yuxuan Zhu, Ali Falahati, David H. Yang, Mohammad Mohammadi Amiri

SentenceKV introduces a method for efficient Large Language Model inference by using sentence-level semantic KV caching, significantly reducing GPU memory usage and maintaining stable, low latency while preserving accuracy for contexts up to 256K tokens. It demonstrated 97.5% retrieval accuracy on the Needle In A Haystack benchmark with a 128-token budget.

Key insights

  • Sentences are natural, self-contained semantic units, making them a more effective and robust granularity for KV caching and retrieval than individual tokens or arbitrary chunks.
  • Offloading full KV pairs to CPU and dynamically retrieving them based on sentence-level semantic similarity effectively mitigates memory bottlenecks without sacrificing contextual coherence.
  • Using pre-computed mean key vectors and mean query aggregation provides a computationally lightweight mechanism for semantic retrieval, avoiding the high overhead of complex clustering methods.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.