What this thread does
Compare cold and reused-prefix output, then run llama.cpp's context diagnostic against the real DeepSeek model before assuming a sampling problem (ggerganov, bertusmt).
Do first: run ./bin/test-llama-context -m model.gguf -c 4096, replacing model.gguf with your model path; this is maintainer ggerganov's October 26 diagnostic (comment).
Diagnostic: single-token output corruption
bertusmt's October 21 issue #30944 calls the symptom “single-token output corruption”. The initial report used Linux/CUDA 13.2, two RTX PRO 6000 Blackwell GPUs, DeepSeek-V4.1-Flash-1017 UD-IQ3_S, and draft branch commit b72050d. It observed substitutions after prompt-prefix reuse with either lazy-mode setting and proposed an Engram token-history mismatch as the cause. That mechanism is a reporter hypothesis.
Findings and reported mitigations
- Later main-branch evidence: vikcious, October 26, says “the same bug exists in Main”. In a follow-up, vikcious identifies 0.7.0-dev build 11896, commit
9125a2ebe, Linux x86_64 and eight RTX 3090s with UD-Q2_K_XL. This extends the report beyond the original draft branch without establishing all released builds as affected. - First workaround: bertusmt reports that
"cache_prompt": falseon requests removed the substitutions in the comparison harness, at the cost of full prompt processing (issue #30944). Compare exact expected output on the same input before relying on this mitigation. - Concurrent restore case: songwanqian, October 28, used four RTX 6000D GPUs, UD-Q3_K_XL, unified KV cache and eight slots. The symptom was that warm concurrent responses “lose the needle”. The reporter points instead to checkpoint restoration while another sequence is active; full-state restoration and synchronization probes did not resolve that reproduction.
- Separate reported controls: songwanqian reports correct output in its comparison with
-ctxcp 0,--no-cache-promptor--no-cont-batching, used separately. Those results are specific to its concurrent workload; they do not prove the original Engram hypothesis or a general runtime repair (reproduction matrix). - Fix status: As checked 2026-11-24, am17an's PR #31292 merged on 2026-11-03, addressing state restoration with partial offload; #30944 was closed and reopened that day and remains open. The repair is listed in v0.9.0, released November 4, 2026. The earlier “Not looking good yet!” reply preceded the merge; a November 3 follow-up on the issue still reports corruption on build 11985 (
6f4cc4d72) when restoring from the host-memory prompt cache, with--cache-ram 0reported as a workaround. Closure does not establish that every corruption case is resolved.
Limits
These reports concern DeepSeek-V4.1-Flash-1017 with specific CUDA builds, quantizations and offload layouts. The concurrent restore matrix is one reporter's case; it does not explain every serial corruption report. Other backends and generic repetition are outside this evidence.
Not for: Qwen reprocessing the full prompt; see llama-cpp-qwen-agent-full-prompt-reprocessing-preserve-thinking.
Started from a post by @bertusmt, packaged by the editor. Original post