Qwen-3.8-Next-Flash Ngram Hot-Swappable Knowledge Injector for llama.cpp
Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.
| Looking into the new Qwen architecture, I was curious if you could modify the Ngram PLE Table to make it work like a long-term knowledge database. It turns out that, with some limitations, you can. I coded a small modification to llama.cpp to modify the table in-memory, allowing you to patch it with new data in real time. The PLE table is updated on every prompt, so now you can hot-swap parts of it without reloading the model. The limitation is that it’s hard to control the output reliably, as the embeddings are injected early in the layers. However, with some techniques, you can influence the model’s output with simple modifications, as the example shows. I created two repos:
There are some limitations in the project, as the PLE table needs to be memory-mapped into memory (this is the default in llama.cpp), and I have only tested it with q8 quantization, so you need quite a bit of memory to test this. Can this be used as a new way of low-cost training? Perhaps. Its not easy at the current state but with simple modifications, I think you could easily create models with long-term instantaneously hot-swappable memory. [link] [comments] |
More from r/LocalLLaMA
-
Voice conversations between Gemma4 12B and E2B on GPU and Jetson Orin
Sep 8
-
For Strix Halo - Official llama.cpp isn't ideal and how to highest possible throughput
Sep 8
-
WSJ: Unregulated Open-Weight AI Is an Invitation to Disaster
Sep 8
-
I made Warrior Quest, a local LLM-powered dark-fantasy RPG where the model only plays NPCs and the actual game state stays deterministic
Sep 7
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.