SemPIC: Learning Semantic Position-Independent KV Caches

Hui Xie, Peng Xiao, Yutong Deng\textsuperscript, Shuoran Dou, Jian Yang +1 more
7/30/2026
cs.AI

No official code found. Best implementation: jn12-29/SemPIC (0 stars, MIT, last commit 2026-09-09).

Abstract

Long-context retrieval and agentic workloads repeatedly reuse the same documents under changing instructions, histories, and document orders. Prefix caching cannot exploit this reuse, while position-independent caching (PIC) remains unreliable because independently compiled KV states lack the future context in which they will be consumed. Our diagnostics show that a learned boundary-conditioned baseline sharply reduces attention deviation near reusable-block boundaries but leaves interior and task-level residuals, motivating adaptation of the document representation itself. We present \emph{SemPIC}, which trains a LoRA-enabled Writer to compile native per-layer document KVs through behavioral distillation while retaining the pretrained decoder as an unchanged Reader. Adaptation is confined to offline cache construction, preserving the standard KV interface and cache-hit decoding path. We further introduce KV Gradient Checkpointing, which reduces peak training memory without severing gradients through cached KVs. Across three models and four tasks, SemPIC raises mean micro-F1 over KV Packet from 0.53 to 0.60, approaching Full Recompute at 0.62.

View on arXivView PDF

Code Implementations(1)

jn12-29/SemPICCommunity25%
MIT

Official implementation of "SemPIC: Learning Semantic Position-Independent KV Caches."

01Shell, PythonJul 30, 20261 months agoMIT
kvcachellmllm-inferenceloraposition-independent-caching+1 more

Similar Papers

Cite this paper

@article{xie2026sempic,
  title  = {SemPIC: Learning Semantic Position-Independent KV Caches},
  author = {Hui Xie and Peng Xiao and Yutong Deng\textsuperscript and Shuoran Dou and Jian Yang and Jinyang Guo},
  year   = {2026},
  eprint = {2607.28069},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.28069v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.28069.svg)](https://codeofpaper.com/paper/2607.28069)

Discussion