TL;DR
Imagine if a friend forgot a decade of your love for coffee just because you ordered tea once on a whim—or, conversely, refused to accept that you actually quit caffeine months ago. Current LLM memory systems often struggle with this exact dilemma, reacting either too hastily to passing remarks or clinging stubbornly to outdated facts. PreCoMem fixes this by borrowing an idea from neuroscience—predictive coding—treating an AI’s memories as dynamic, confidence-weighted beliefs with an explicit "waiting room" for ambiguous clues, allowing conversational agents to evolve smoothly alongside real humans.
What Problem Does This Paper Address?
As LLMs transition from one-off question answerers to long-term companions spanning thousands of turns, simply dumping chat transcripts into a vector database isn't enough. Agents face the memory stability–plasticity problem: how do you keep core user profiles stable for personalization while remaining flexible enough to adapt when a user’s life or preferences genuinely change ("belief drift")?
Most existing systems rely on brittle heuristics—like appending every observation or overwriting old entries based on recency. In noisy, multi-session chats where users rarely say "Update my profile: I hate coffee now," this causes two opposite failures: premature overwrites from transient chatter, or "old-memory pull," where outdated facts drown out genuine changes.
Methods
Inspired by predictive coding—the theory that the brain learns primarily from mismatches between expectation and reality—PreCoMem stores editable beliefs (FACTs and provisional HYPOTHESIS items) paired with continuous confidence weights $w \in [0, 1]$, linked to an immutable cache of raw conversation snippets for provenance.
Each turn runs in a two-phase loop:
- Memory Leveraging: Recalls the top-$K$ beliefs by combining semantic similarity, lexical overlap (BM25), and topic relevance, multiplied directly by each belief's confidence weight.
- Memory Evolution: Evaluates the new user turn against recalled beliefs using a novel signal called Effective Surprisal ($S_{\text{eff}}$). First, it calculates raw surprisal by blending semantic deviation and a contradiction score. Crucially, it multiplies this by retrieval reliability—derived from the entropy of retrieval scores. If recall is diffuse and uncertain, surprisal is dampened so the system doesn't overreact to bad search results.
Based on two thresholds, $S_{\text{eff}}$ routes the turn into one of three deterministic update rules (where an LLM sub-agent only estimates bounded local scalars like severity, leaving the math to closed-form equations):
- MAINTAIN (Low Surprisal): Consistent evidence reinforces existing beliefs, nudging weights toward 1.
- PROFILE (Medium Surprisal): Ambiguous or novel cues enter a "waiting room" as low-confidence
HYPOTHESISnodes. Without repeated support, they decay away; with repeated reinforcement, they graduate intoFACTs. - CORRECT (High Surprisal + Reliable Recall): Reliably contradicted
FACTs softly decay into low-confidence "deprecated" hooks while the new fact is recorded at high confidence.
Datasets
The authors evaluate on several established long-context benchmarks: LoCoMo (1,540 multi-session questions), LongMemEval-S (500 questions testing knowledge updates and temporal reasoning), PersonaMem-v2 (20,000+ implicit preferences at 32k and 128k context lengths), AMemGym, and LoCoMo-Plus.
To specifically stress-test gradual attitude shifts amidst keyword-matched chatter and entity confounders, they introduce DiMoBench (five 350-turn dialogues with 1,000 QA pairs around an implicit preference reversal) and DiMoBench-XL (extending to 1,050 turns and three sequential drifts).
Key Insights and Ideas
- A "waiting room" prevents memory whiplash: Binary commit/ignore rules force premature decisions. Buffering ambiguous clues in the
PROFILEstage lets weak signals accumulate across sessions before overwriting established facts. - Mechanism beats model scale: When holding the answering model fixed, delegating memory construction to PreCoMem running on a one-tier-smaller LLM backbone consistently outperforms the larger model's native memory system across 12 head-to-head tests.
- Linearly growing storage, constant retrieval surface: Even as raw stored items grow over 1,050 turns, the effective memory mass (sum of confidence weights) plateaus around ~27 items. Softly decayed facts naturally sink out of top-$K$ retrieval (occupying just 1.0% of slots) without needing destructive hard deletes.
- Deterministic guardrails tame LLM variance: Having LLMs output bounded scalars plugged into closed-form update equations—rather than letting the LLM decide the entire memory write end-to-end—boosts accuracy by ~3 points and slashes cross-seed variance by 20×.
Key Results
PreCoMem achieves state-of-the-art accuracy across all tested benchmarks:
- LoCoMo: Reaches 85.06% overall with
gpt-4.1(+1.02 over TiMem) and 73.57% withgpt-4o-mini(+1.69). - LongMemEval-S (
gpt-4.1): Hits 89.39% overall (+3.23 over EverMemOS), shining brightest where memory actually changes: Single-Session Preference (+9.24 over O-Mem) and Knowledge Update (+4.75). - PersonaMem-v2 (
gpt-4.1): Scores 72.31% (32k) and 67.84% (128k) on open-ended tasks, beating EverMemOS by +3.37 and +2.89 points. - DiMoBench Drift Recovery: Following a preference reversal at turn 200, PreCoMem recovers fastest and stabilizes at 84% accuracy, whereas top baselines plateau at 78–80% and Mem0 stalls at 54%.
Limitations and Future Work
The authors note that their evaluation is currently limited to text-based English dialogue benchmarks; extending confidence-weighted belief consolidation to multilingual settings and multimodal interactions remains open for future work. Additionally, because memory updates only act on recalled items, beliefs that fail to enter the top-$K$ retrieval window during a turn cannot be directly updated at that step.
Summary updated