Hacking llama.cpp to hot-swap knowledge into Qwen's Ngram PLE table
ortegaalfredo · reddit · 2026-09-03
- Developer ortegaalfredo repurposes the Ngram PLE (prediction lookup) table in the new Qwen architecture as a long-term knowledge store: a patched llama.cpp updates the table in memory on every prompt, letting you hot-swap knowledge without reloading the model.
- Caveats: embeddings are injected early in the layers, so output control is imprecise, though simple modifications can still steer generation.
- Two repos released: a modified llama.cpp-NLTM and an ngram-knowledge-injector that compiles table patches.
- Requires memory-mapped PLE (llama.cpp default) and was only tested with q8 quantization, so it needs substantial RAM. Author suggests this could evolve into a low-cost training approach for models with instantly swappable long-term memory.
More from coding & agent
- Salesforce research: buyer agents concede too easily, images boost persuasion ~17% — msrivastav13 · 2026-12-05
- Grok Build launches agent-driven post-quantum cryptography migration after NSA advisory, with $1,000 credits — ns123abc · 2026-12-05
- Seroter's reading list: post-quantum prep, agent harnesses, and life after 99% AI code — rseroter · 2026-12-05
- WSDM Cup 2027 Offers $10k to Build Autonomous Community Notes Agents — sanmikoyejo · 2026-12-05
- Trying Copilot Studio MCP for agent cloning and Power Automate sync: janky but workable — koltregaskes · 2026-12-05
- xAI launches Grok Bot: autonomous AI teammates that live in Slack and Teams — Baconbrix · 2026-12-05