首页 > AI前沿 > Latent Tools and Latent Context: Grounding Generation in Deterministic Sources

Latent Tools and Latent Context: Grounding Generation in Deterministic Sources

arXiv自然语言 2026-12-02 13:00 2 阅读 查看原文

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.

Evaluation Results

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.