zmem Lets Inference Servers Ground LLMs in Latent Retrieved Context
Latent Tools and Latent Context: Grounding Generation in Deterministic Sources
The mechanism decouples retrieval from the context window, so long-document QA and enterprise knowledge workloads no longer trade prompt size for accuracy. Teams running private corporate corpora should evaluate latent context against standard RAG pipelines, since zmem reports accuracy on par with in-context sources at far lower token and latency cost. The finding that DeepSeek-V4-Flash needs no training to accept pre-mounted pages, while Qwen3.5-9B needs only a small LoRA, gives inference-server builders a practical adoption path.
A new paper proposes zmem, a mechanism that lets an inference server supply deterministic sources during generation at the model's own request, addressing hallucination on post-training or private knowledge. On LD3, a byte-level hybrid-attention model, and Qwen3.5-9B, correct answers on private sources rose from 3/16 and 0/12 (all wrong answers fabricated) to 15/16 and 9/12, matching source-text-in-context with prompts 10-14 times shorter. With self-issued searches, the model answered 44/48 held-out questions on synthetic memos.
Mechanically, the model writes a search instruction as a line inside its own thinking (a latent tool); the server executes it and returns a page that the generator itself encodes and mounts on all full-attention layers (latent context). The page is visible to later tokens but never enters the sequence or conversation, so generation is never interrupted. The document store uses an inverted literal index with 1.2 ms per search over 312 MB and instant updates; pages are cached by content. Pages encoded by the generator are partly readable without training and fully readable with a small LoRA, while trusting pages mounted mid-thinking requires on-policy preference training.
Performance gains are concrete: over 8 turns, prefill per turn drops from 2.7-2.9 s to 0.49 s, and a page cache hit cuts time to first token from 2.0 s to 0.23 s. On DeepSeek-V4-Flash, pre-mounted pages work without training and match in-context source text with 13-19 times fewer dialogue tokens; mid-thinking KV pages reach 47/61 on search-page QA versus 53/61 under prefix replay.
Latent Tools and Latent Context: Grounding Generation in Deterministic Sources
A generator's knowledge lives in its parameters, so knowledge that appeared after training or exists only inside an organization is out of its reach, and models often fabricate answers about it. We propose zmem, which lets the inference server supply deterministic sources during generation at the model's request. The model writes a search instruction on a line of its own in its thinking (a latent tool); the server executes it in place and writes the result as a page, which the generator itself encodes and which is mounted on all full-attention layers (latent context). The page is visible to all later tokens but never enters the sequence or the conversation, and generation is not interrupted. The document store uses an inverted literal index (1.2 ms per search over 312 MB; updates take effect at once), and pages are cached by content. On LD3, a byte-level hybrid-attention model, and on Qwen3.5-9B we find: (1) on private sources, correct answers rise from 3/16 and 0/12 without sources, every wrong answer fabricated, to 15/16 and 9/12, on par with source text in context and with prompts 10-14 times shorter; with self-issued searches the model answers 44/48 held-out questions on synthetic memos. (2) Pages encoded by the generator itself and mounted on all full-attention layers are partly readable without training and fully readable with a small LoRA. (3) Trusting pages mounted mid-thinking needs training, and on-policy preference training forms the habit of using sources. (4) Pages do not occupy the context: over 8 turns, prefill per turn drops from 2.7-2.9 s to 0.49 s, and a page cache hit cuts time to first token from 2.0 s to 0.23 s. On DeepSeek-V4-Flash, pre-mounted pages work without training and match source text in context with 13-19 times fewer dialogue tokens; with pages written into the KV mid-thinking, search-page QA reaches 47/61 versus 53/61 under prefix replay.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include zmem, RAG, LD3, Qwen3.5-9B.
Primary source verification: published directly by arXiv: DeepSeek with first-party authority. Cross-source corroboration: 2 independent sources have covered this development (including Lxfater), confirming industry-wide signal strength.
- Lxfater11-29 05:30Source