atlas

Research map / Large language models / Language, safety and interpretability

Let the Code LLM Edit Itself When You Edit the Code

ICLR 2025 · Large language models › Language, safety and interpretability · approach: Parallel and early-exit decoding · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Positional Integrity Encoding (PIE), which removes and reapplies RoPE rotations to cached keys so that code KV caches can be updated after real-time edits without full recomputation, cutting KV-update overhead by over 85% on RepoBench-C-8k with DeepSeek-Coder models.

Problem

Real-time code edits force LLM code assistants to re-encode the entire KV cache for next-line prediction, which is expensive for long contexts; naively reusing edited KV entries causes temporal (positional) confusion and degrades accuracy.

Approach

Build on RoPE: since the rotary positional information lives in cached keys, remove the old rotation from each post-edit key and re-apply the correct rotation for its new position with a single matrix multiplication, avoiding recomputation of subsequent KV entries while keeping positional indices unique and consecutive.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use PIE instead of full KV-cache recomputation after code editsDeepSeek-Coder 6.7B · RepoBench-C-8k XF-F insertion, deletion, and editionEM: 28.95 -> 28.83; 28.95 -> 28.86; 28.95 -> 28.07 (Python)No clear effect
Use PIE instead of full KV-cache recomputation after code editsDeepSeek-Coder 6.7B · RepoBench-C-8k XF-F insertion, deletion, and editiontime: 561ms -> 50ms; 561ms -> 43ms; 705ms -> 54ms (Python)Helped
Use Conflict Fast Encoding instead of full KV-cache recomputationDeepSeek-Coder 6.7B · RepoBench-C-8k XF-F insertion, deletion, and editionEM: 28.95 -> 5.35; 28.95 -> 0.51; 28.95 -> 11.26 (Python)Hurt
Use PIE instead of full KV-cache recomputation after code editsDeepSeek-Coder 6.7B · HumanEval and HumanEval-XPass@1: 49.4 -> 43.9; 50.3 -> 49.7Mixed
Use PIE instead of Conflict Fast EncodingDeepSeek-Coder 6.7B · HumanEval and HumanEval-XPass@1: 11.0 -> 43.9; 15.5 -> 49.7Helped
Use PIE instead of Conflict Fast EncodingDeepSeek-Coder 6.7B · RepoBench-C-8k contextually related insertion, 5–15 linesEM: 7.92 -> 27.40 (Python, 5 lines); 2.81 -> 30.04 (Java, 5 lines)Helped
Reuse the pre-edit context without modifying its KV cacheDeepSeek-Coder 6.7B · HumanEval and HumanEval-XPass@1: 49.4 -> 17.7; 50.3 -> 29.2Hurt

Surprising findings

Limitations

Experimental setup

Datasets: RepoBench-C-8k HumanEval HumanEval-X

Benchmarks: RepoBench-C-8k HumanEval HumanEval-X

Metrics: Exact Match Edit Similarity Pass@1 latency (ms) cosine similarity of KV representations KL divergence of token distributions

Baselines: Full-recomputation Conflict Fast Encoding Reuse baseline

Builds on: RoPE DeepSeek-Coder KV cache

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy