Latent Tools and Latent Context: Grounding Generation in Deterministic Sources
Liwei Zhang, ZhiMing Tong, Mochen Guan, Linzhe Li, Xinguang Xiao
Abstract
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.
Create a lesson
Metadata
- Categories
- cs.CL, cs.LG
- Comments
- Full text in English (pp. 1-29) followed by the full text in Chinese (pp. 30-46). 46 pages, 1 figure, 12 tables
Related papers
Grounding and Source Dependence: Complementary Alignment Scoring for S2ST Data Filtering
Shared title terminologycs.CLQixu Chen, Satoshi Nakamura
Sublanguage Alignment: A Linguistically-Grounded Evluation Method for Domain-Specific Text Generation
Shared title terminologycs.CLJustin Hofenbitzer, Jacqueline Lammert, Bernhard Haller et al.
Conflict-Aware Retrieval-Augmented Generation: Knowledge Conflict Detection, Reranking, and Adaptive Context Selection
Shared title terminologycs.CLAlaa Zahweh, Hadi Hasan, Ali Chehab
Not All Evidence Is Equal: Source-Sensitive Calibration in Large Language Models
Shared title terminologycs.CLSercan Karakaş, Yusuf Şimşek
Generative Curation Yields Bigger and Better Data for Pretraining LLMs
Shared title terminologycs.CLMichael J. Ryan, William Held, Suhas Kotha et al.
Evaluating Sparse, Dense, and Hybrid Retrieval-Augmented Generation for Sinhala Question Answering
Shared title terminologycs.CLAneegha Thithiesha Mahabaduge, Nisansa de Silva