LiveLoRA: Exact KV Cache Migration Across LoRA Updates for LLM Agents
Organizations: Ryquo · App-In Club
Abstract
Updating an LLM adapter should not require replaying the full interaction history of every active session. Yet reusing key-value (KV) cache entries computed under an earlier version mixes model versions, while full-history re-prefill becomes increasingly costly as histories and session fleets grow. We introduce LiveLora, a model-runtime co-design for exact final-block KV cache migration. Frozen lower decoder blocks and fixed K/V adapter down-projections preserve each token's base projections and low-rank coordinates across adapter versions. The runtime reconstructs candidate K/V, reevaluates the latest token through the final block, and commits the adapter, cache, and next-token logits together. We prove continuation equivalence to full-history re-prefill in exact arithmetic under the stated model assumptions. On Qwen2.5-3B-Instruct, median paired publication speedups over full-history re-prefill average across five runs for 32 active sessions with 8K tokens each. Serving benchmarks show approximately 4.8% decoding overhead relative to native cached decoding. Compared with retained-boundary replay, compact retention gives a reduction in additional session storage at 8K, with similar measured publication-plus-decoding cost. LiveLora allows persistent LLM agents to adopt new adapter versions without replaying their full interaction histories.
Figures & tables
| Representation | Retained history bytes | Candidate-version work |
|---|---|---|
| Compact, fixed | Reconstruct K/V; reevaluate latest token | |
| Trainable | Recompute coordinates and K/V; reevaluate latest token | |
| Normalized inputs | Recompute base and adapter K/V; reevaluate latest token | |
| Boundary residuals | Replay the final block over the history |
| Latency (ms/token) | Added cost versus | ||||
|---|---|---|---|---|---|
| Context | Native | Guarded | LiveLoRA | Native | Guarded |
| 2K | 20.851 | 21.699 | 21.855 | 4.81% | 0.72% |
| 8K | 20.829 | 21.642 | 21.818 | 4.75% | 0.81% |
| 32K | 21.604 | 22.506 | 22.659 | 4.88% | 0.68% |
| Publication (ms/update) | Publication + decoding (ms) | |||||
|---|---|---|---|---|---|---|
| Tokens/update | LiveLoRA | Boundary | Full | LiveLoRA | Boundary | Full |
| 32 | 9.66 | 15.11 | 155.82 | 1,429.29 | 1,429.25 | 1,706.36 |
| 128 | 10.55 | 15.47 | 156.87 | 5,662.15 | 5,628.49 | 5,892.03 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Tokens | Sessions | LiveLoRA ms | Re-prefill ms | Median speedup | 5th-pctl. speedup |
|---|---|---|---|---|---|
| 2,048 | 1 | 17.15 [16.31,17.93] | 40.78 [40.40,41.10] | 2.38 [2.29,2.48] | 2.22 [2.19,2.27] |
| 8,192 | 1 | 17.17 [15.94,18.29] | 150.05 [149.40,150.69] | 8.79 [8.23,9.45] | 8.36 [7.89,8.90] |
| 16,384 | 1 | 17.59 [16.75,18.20] | 347.19 [346.00,348.36] | 19.78 [19.10,20.77] | 18.01 [17.36,18.60] |
| 32,700 | 1 | 18.03 [17.68,18.34] | 919.21 [914.45,923.63] | 51.06 [50.10,52.07] | 46.09 [44.81,47.80] |
| 8,192 | 8 | 29.16 [28.63,29.63] | 1,128.21 [1,121.70,1,135.47] | 38.70 [38.10,39.39] | 36.51 [35.60,37.12] |
| 8,192 | 32 | 65.71 [63.80,67.60] | 4,534.46 [4,511.63,4,557.90] | 68.98 [67.08,71.39] | 62.96 [60.61,66.06] |
| Case | KV cache MiB | LiveLoRA MiB | Steady OH | Decode OH [95% CI] |
|---|---|---|---|---|
| 2K 1 | 72.0 | 76.3 | 6.04% | 21.94% [20.34,23.38] |
| 8K 1 | 288.0 | 299.2 | 3.90% | 22.33% [20.96,23.62] |
| 16K 1 | 576.0 | 596.4 | 3.55% | 22.25% [21.31,23.40] |
| 32.7K 1 | 1,149.6 | 1,188.3 | 3.37% | 19.17% [18.13,20.11] |
| 8K 8 | 2,304.0 | 2,381.6 | 3.37% | 24.24% [22.81,25.51] |
| 8K 32 | 9,216.0 | 9,521.2 | 3.31% | 24.02% [22.46,25.51] |
| LiveLoRA , normalized | Retained boundary | |
|---|---|---|
| Publication (ms/update) | 6.55 [5.65, 8.29] | 15.95 [14.95, 17.09] |
| Decoding (ms/token) | 19.45 [18.34, 20.90] | 19.42 [18.38, 20.80] |
| Publication + decoding (ms) | 19,940.61 | 19,945.65 |
| Final retained state (MiB) | 36.47 | 36.46 |
KV-Cache Management
Key-value (KV) cache management reduces and coordinates Transformer attention state to make long-context inference faster and more memory-efficient.
See all 220 papers