Live data from Hacker News

Zero-Mem: Zero-Token Memory Operations for LLM Agents

arxiv.org

11–17 of 17 posts

Re: Zero-Mem: Zero-Token Memory Operations for LLM Agents

#12
post #4
post #3

I am working on the same thing right now. However, unlike storing conversations in an external retrieval system, I use a local LLM to store the conversation's KV cache and perform retrieval directly on that cache. The method involves running a prefill pass and, after obtaining the attention scores, filtering for the corpus segments that received attention. This aligns with the "zero tokens" approach described in this…

I was doing something similar where I saved user input/model output in a multi-depth node style storage system (each depth having more precise details) with the focus on the model having accurate user fed information. I was mostly focused on retrieval of accurate / useful information based on user query (injecting the database node as additional, high confidence information) Once this(Zero-mem) passes it's peer revie…

I am not an expert on LLMs, but what's preventing you from treating the context as 'virtual memory', and using the attention matrix to 'blank out' tokens which have very low weights and will not contribute much to the input? I imagine most tokens are like this, and you can skip computation on 95% of an 1M (or practically infinite) context.

Re: Zero-Mem: Zero-Token Memory Operations for LLM Agents

#14
post #5

This is actually quite easy to implement at the harness level and the NER can be way more naive because of the typical nature of LLM dialogue (programming, long running tasks etc).

Can confirm. I did a clean-room implementation of this in Rust just by reading the paper. Will update once they release the reference implementation. https://github.com/ptaranat/zeromem

Re: Zero-Mem: Zero-Token Memory Operations for LLM Agents

#16
post #3

I am working on the same thing right now. However, unlike storing conversations in an external retrieval system, I use a local LLM to store the conversation's KV cache and perform retrieval directly on that cache. The method involves running a prefill pass and, after obtaining the attention scores, filtering for the corpus segments that received attention. This aligns with the "zero tokens" approach described in this…

Hah I built a similar thing, stored a few million tokens chunked and precomputed winth Qwen a3e (best ratio of kv-size to tokens after chunking).

Some custom kernels and I was able to find all the relevant paragraphs with full force of qwen reasoning within 0.3s, and with a summary round within 0.7s.

Downside - required 200GB ram/vram ;) A few GBs for model and most of it for caching kvs.

Post reply on HN