structuring retrieval w trie of fuzzy hashes π€ https://x.com/jd_pressman/status/1866945192533823715
One of my more crank-ish interests is speculating on what "main program" GPT learns. Usually if you ask deep learning practitioners about this they'll insist it's a Turing Machine soup and there is no main program. If you ask a question like "how do the different parts editing the residual stream avoid stepping on each others toes?" the usual answer you receive is that the optimizer notices if they toe-step and changes them to stop. I find this very implausible in the sense that the transformer massively outperforms e.g. an MLP even if the MLP is very large. So clearly the self attention mechanism, which is mathematically a soft hashmap, must be doing something that isn't obvious on first inspection. While thinking very hard about the problem of how to track problem state in weave-agent, which is IMO one of the most impressive things humans do once you have generative models that rival the human generative models, I realized that fuzzy hashmaps are actually a very powerful data structure because they let you implement *location* in the vein of place cells in the hippocampus. People used to believe place cells indexed over physical location, but they clearly don't, and the question of *location* is crucial for agency because we associate problem state with locations and being able to pull up relevant state when we enter into the relevant location is a ton of how we maintain long term coherence. Now, if you have situation embeddings by say, taking parts of an agent trace and embedding them, and then store notes or other state associated with that fuzzy key, then later when you reach a relevant situation you can pull up that key with a vector search based on embedding the situation you're in now even if the last time you encountered the thing was far outside your context window. A *tree* of nested fuzzy hashmaps lets us exploit this kind of lookup to create something like a trie. Because the fuzzy hashes are functionally a content addressing scheme, different weird machines in the transformer turing soup avoid needing lots of communication overhead by finding their relevant location in the residual stream by computing the fuzzy hash to see if their contribution is needed and then if it is they can execute and add their edit without stepping on the toes of other machines because the fuzzy hashmap tree naturally segments it so that related edits wind up appended to similar places in the residual stream and relevant information reliably reaches the weird machine that it needs to make the edit correctly. https://t.co/w3Qbdp23vj Note that in the sparse rate reduction objective the self attention layer does gradient descent to compress the token set and then the MLP layer sparsifies it. This could be analogous to something like going down many branches of the soft trie at once and then pooling them back together into a unified representation afterwards. In weave-agent I decided that a similar data structure is probably the best way to build up the umwelt that represents the problem state. We can re-imagine the single thread of execution agent that manages a kanban board with unit tests as a recursively delegating agent that allocates its resources to subagents in a call tree where each subagent is functionally a set of unit tests + return value schema optimizing towards some goal. The results returned by the subagents get appended to their local parent's area in a nested hashmap. This is not actually yet a fuzzy hashmap, but I was planning to use a fuzzy hashmap for retrieval over task state associated with locations/situations later.