Memory Inception: Latent-Space KV Cache Manipulation for Steering LLMs

Andy Zeyi Liu, Michael Zhang, Ilana Greenberg, Adam Alnasser, Lucas Baker, John SousNeurIPS 2026

TL;DR

How do you get a Large Language Model (LLM) to remember complex instructions over a long conversation without eating up memory or watching its persona slowly fade away? Enter Memory Inception (MI), a training-free method that encodes text reminders directly into latent key-value (KV) memory banks and attaches them only to the handful of attention layers that actually matter. It delivers the expressive, nuanced control of traditional prompting with up to a 118× reduction in guidance KV-cache storage, allowing you to hot-swap an AI’s personality mid-chat or boost its physics reasoning without touching the visible transcript.

What Problem Does This Paper Address?

Right now, if you want to steer an LLM's behavior—say, giving it a specific persona or a checklist of problem-solving heuristics—you generally have two flawed options:

  1. Prompting: You put verbal instructions directly into the context window. It’s expressive and flexible, but it caches tokens across every single layer of the transformer. Worse, as conversations drag on, the prompt's influence gets diluted by new text, and changing instructions mid-stream causes "context contamination" from earlier turns.
  2. Activation Steering: Methods like Contrastive Activation Addition (CAA) add fixed directional vectors directly to the model's hidden states. It’s lightweight and stays outside the transcript, but it’s a blunt instrument—great for nudging a single simple concept, terrible at conveying multi-part, structured heuristics.

The authors ask: can we find a middle ground in latent attention space that marries the rich, structured expressiveness of prompting with the surgical efficiency of activation steering?

Methods

Memory Inception (MI) treats model steering as a selective KV-cache allocation problem. Instead of feeding reminder text into the visible prompt, MI turns it into an invisible "side-bank" of memory that only specific parts of the model read.

Figure 1: Memory inception (MI). Reminder text is encoded into latent memory bank slots in the KV cache, then appended to a subset of automatically chosen layers, heads, or key-value groups. MI improves on prompting by keeping the reminder outside the visible transcript. Unlike contrastive activation steering, which acts consistently on specific hidden states, MI can act differently per query based on the attention directed to the reminder slots.

Here is how the pipeline works without changing any model weights:

  • Text-Derived KV Banks: Guidance text (like personality descriptors or math heuristics) is wrapped in a template and run through the frozen LLM once. The resulting keys and values at the descriptor positions are extracted and saved as a compact memory bank.
  • Canonical Pre-RoPE Storage: Modern LLMs use Rotary Position Embeddings (RoPE), which tie keys to specific token positions. To keep memory banks position-independent and reusable at any point in a conversation, MI stores keys before RoPE is applied, canceling out the live query's rotary phase during attention calculation.
  • Automated Site Selection: Not every layer needs to read the reminder. Using calibration queries, MI automatically scores and selects only the top-$m$ layers and top-$k$ attention heads (for Llama-3.1) or KV groups (for Qwen3) whose queries align strongest with the target bank relative to a reference bank.
  • Bank-Level Routing: During inference, selected heads attend to both the normal conversation history and the attached memory banks (which can include target, opposite-reference, and auxiliary heuristic banks), mixing their outputs dynamically based on the live query.

Datasets

Because MI is training-free, datasets are used strictly for calibration and evaluation across four regimes:

  • Big Five Personality (Self-Eval & Generation): Public-domain IPIP-50-style Likert questionnaires and open-ended text generation judged on trait shifts and coherence.
  • Dialogue Shift (Newly Introduced): A new benchmark of 204 branching cases across 34 scenarios (evaluated at 5, 16, and 24 turns) designed to test whether a model can cleanly pivot its behavioral style mid-conversation without rewriting the transcript.
  • HARDMath & PHYSICS: Existing challenging benchmarks in applied mathematics and university-level physics, where models are steered using natural-language reasoning heuristics extracted from held-out examples.
  • GSM8K & MMLU: Used as sanity checks to ensure persona steering doesn't degrade general reasoning capabilities.

Key Insights and Ideas

  • Guidance doesn't fade over long contexts: In 24k-token "noisy" prefill tests, standard prompting loses its grip as the conversation grows. Because MI’s latent banks sit outside the sequential transcript at canonical positions, its steering signal stays remarkably persistent.
  • Clean mid-dialogue pivots: If you tell a prompted model to switch from "anxious" to "supportive" at turn 24, the old transcript poisons the shift. With MI, you simply detach the old KV bank and attach the new one—changing behavior on a dime without rewriting history.
  • Task difficulty dictates layer depth: An ablation on Qwen3 revealed that steering an "easy" trait aligned with the model's default persona (agreeableness) works with just 1 layer, whereas inducing an unnatural trait (neuroticism) requires attaching banks to 10+ layers before taking effect.

Key Results

Tested primarily on Meta-Llama-3.1-8B-Instruct and Qwen3-30B-A3B (plus gpt-oss-120b):

  • Massive KV-Cache Compression: Under content-matched accounting, MI slashes guidance-derived KV storage across the board—by 6.4× to 23× on dialogue and personality tasks, 63–74× on HARDMath, and 60–118× on PHYSICS.
Figure 2: Estimated KV cache storage. Grey bars show the KV cache storage consumed by prompt- ing. In comparison, orange bars show MI’s KV cache inferred from content-matched accounting. We also report the prompt-to-bank storage ratios. The vertical axis uses a log scale in MiB.
  • Structured Reasoning Gains: On PHYSICS with Qwen3, MI beats both the plain model (73.9%) and visible prompting (75.4%), achieving 76.9% overall and winning 10 out of 12 subject×mode cells. On HARDMath, MI improves over the plain model (63.8% vs. 61.0%), though it trails visible prompting (67.3%).
  • Superior Mid-Chat Pivots: On Qwen3 dialogue shifts, MI achieves a post-shift alignment score of 0.816, handily beating CAA (0.526) and Prompting (0.438).
  • Personality Control: MI consistently outperforms CAA on drift-adjusted personality scores across both models while trading wins with full-context prompting—and causes less collateral damage to GSM8K/MMLU scores than visible prompts.

Limitations and Future Work

The authors are candid about several caveats:

  • Garbage in, garbage out: Just like standard prompting, MI's effectiveness depends heavily on how well the underlying guidance text is phrased.
  • Model sensitivity varies: Qwen3 showed clear gains from MI, whereas Llama-3.1 exhibited sharper tradeoffs between steerability and response quality.
  • System-level metrics: While MI shrinks guidance KV tensors dramatically and improves per-token throughput over long prompts (51.5 vs. 46.4 tok/s on HARDMath), the paper does not claim rigorous end-to-end latency or total VRAM savings (in fact, MI generated longer reasoning traces, taking more wall-clock time overall).
  • Covert Steering Risks: Because MI operates invisibly outside the transcript, it could be misused for hidden prompt injections or undisclosed behavioral manipulation—Prompting the authors to recommend strict audit logging and user disclosure in real-world deployments.

Summary updated

BibTeX
@inproceedings{liu2026memory,
  author = {Andy Zeyi Liu and Michael Zhang and Ilana Greenberg and Adam Alnasser and Lucas Baker and John Sous},
  title = {{Memory Inception: Latent-Space KV Cache Manipulation for Steering LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Z45sLXr4O9},
}
Figure