Sim-LLM: Optimizing LLM Inference at the Edge through Inter-Task KV Reuse
ELVIA analysis
Independent review pending
The first reported finding concerns “Cache insertion order does not preserve task identity”. The released assembly can associate a task with another task’s values. Historical incidence is unknown.
Problem 1. Cache insertion order does not preserve task identity
MinorEvidence and reasoning
Problem statement
The matching loop is cache-first, while deletion and sequential reinsertion use current-batch indices. Neither sorted current indices nor unique current targets are enforced.
Proof
Matches delete the first two current rows, leaving value Insert cache value at row then at row output is while task-specific assignment requires Zero attention logits and constant row values transfer the same mismatch to the attention output. Single or correctly ordered matches can pass.
Possible revision
Choose at most one cache entry per current task under a declared tie rule, then assign each final row by its original task index rather than insertion order.
An explicit local correction is described; author adoption and a corresponding published erratum are not established.
Problem 2. Already rotated keys receive another rotary transform
MinorEvidence and reasoning
Problem statement
The traced producer stores post-RoPE keys; the consumer inserts those keys before applying RoPE to the assembled tensor.
Proof
At position raw key is stored as Equal-position reuse should retain it, but the consumer returns A correspondingly rotated query changes its dot product from to Position zero is a passing special case.
Possible revision
Insert post-RoPE caches after rotating new keys. To move a cached key from position to apply with trustworthy positional metadata.
An explicit local correction is described; author adoption and a corresponding published erratum are not established.
Problem 3. A fresh target-layer cache is appended to itself
MinorEvidence and reasoning
Problem statement
`forward_predict_prompt` overwrites the incoming-cache variable with the current output, then concatenates its target layer with the same output layer.
Proof
With no incoming past and a three-token prompt, both operands are The target cache becomes a three-layer layout has lengths instead of The duplication occurs after initial hidden states are computed.
Possible revision
Keep the incoming cache under a distinct name and return the fresh target cache once. Append a prefix only where the documented backend returns new segments rather than already accumulated states.
An explicit local correction is described; author adoption and a corresponding published erratum are not established.
Problem 4. Reference bits do not implement exact LRU
MinorEvidence and reasoning
Problem statement
The branch labeled LRU stores a reference bit and clears leading set bits rather than recording chronological recency.
Proof
For slots access order leaves bits The code clears them and replaces slot zero, evicting most-recent true LRU evicts The same bit vector represents several different recency orders.
Possible revision
Specify the reference-bit approximation, or maintain timestamps/an ordered recency structure and evict the actual oldest access under a deterministic batch convention.
An explicit local correction is described; author adoption and a corresponding published erratum are not established.
Problem 5. Unequal prompt lengths fail the tokenwise matcher
MinorEvidence and reasoning
Problem statement
The matcher directly compares tokenwise cached and current embeddings without a common-length alignment contract.
Proof
Nonzero shapes and cannot broadcast across token dimensions and Equal padded widths avoid this failure, as in fixed-width settings, but do not solve general K/V alignment. Repository issue # opened April already reported the concern.
Possible revision
Not available
Supporting record & provenance
Work status
Current version
Version 1
Minhao Liu · Initial report · Version 1
Independent review pending
Original claim and review scope
To tackle this challenge, this paper presents Sim-LLM, a novel inference optimization mechanism that leverages task similarity to reduce KV cache memory consumption for LLMs.
NeurIPS 2025 official proceedings PDF (current publisher bytes, checked 2026-10-21); Abstract, PDF p. 1
Actual review scope
The recorded inspection concerns these source locations: Section 3.3, PDF p.6; Algorithm 1, PDF p.25; modeling_llama_lsh.py, lines 120–171 and 1522–1535; Section 3.3, PDF p.6; modeling_llama_lsh.py, lines 153–171, 753–782 and 2172–2197; forward_predict_prompt, modeling_llama_lsh.py, lines 2172 and 2239–2254; Section 3.3, PDF p.6; Appendix B.1, PDF p.23; Algorithm 1, PDF p.25; source lines 1544–1547 and 2214–2234; Public repository issue #1; modeling_llama_lsh.py, lines 1522–1535.