Artificial needles to real haystacks: Improving retrieval capabilities in LLMs
arxiv.org
arxiv.org
Do a task using the list of dictionaries below.
Dictionary [1] {122: 765, 4548: 1475, 4818: 4782} Dictionary [2] {526: 290, 9205: 9318, 9278: 1565} ...
Dictionary [32] {2931: 8364, 196: 1464, 812: 5363} ...
Dictionary [85] {344: 1579, 116: 617, 330: 411}
Above is a list of dictionaries such that each key and value is an integer. Report the
value of key 2931 and the dictionary it is in.
Desired answer: The value of key 2931 is 8364 and it is in Dictionary [32].
This task doesn't teach any new facts, but seems to encourage better ability to random-access data from a large context.A lot of the needle trained models clearly can’t reason with stuff everywhere in a long context even if they can retrieve. I would like to see some extensions that require some reasoning.
I guess you could use words as dict vals and ask it what sentence a set of keys spells, and to answer the sentence with a set of keys. Lots of interesting possibilities.
Actually very much like blockchain, in that it’s slower and less efficient but they put it into everything inclusinf Iced Tea.
The only difference is that AI weights are inscrutable and people don’t know what it will do, while blockchain’s actual achivement is precisely the opposite — knowing and proving what the code will do. But still, it is not a hammer for every nail!
Then we finally get back to the shit covered meat we all crave
“LLM, make your lookup more efficient. kthxbai”
Imo the best way to handle this is RAG + multi-shot prompting (+ symbolic mapping to an actual data structure). For example, a pre-processing step where you partition the context by "records," another step where you insert (and potentially split up the records) in a RAG database, and another step where you make fuzzy queries. So, if you ask for record 1234 you get an exact match on that line (or set of lines, or record, or whatever) of the original context. And if you ask for "elephant" but there's no "elephant" in the context, you might get the "hippo" record because of the RAG reranking.
This is a lot of work, and is essentially a data pipeline, but the results are much better-curated than just fine-tuning and hoping that generalized needle-in-a-haystack search will work reliably as part of a language model.
RAG will go away, decision multimodal models / LLMs will take over. No here yet, but inevitable I believe.
If you're building something that needs to be easy to work with, and that humans can understand the limitations of, splitting the network up into stages and having human-interpretable intermediate values is a good architecture choice.
like I would rather use code to find apriltags than a vit or other model
But that’s not the point, the point is a task that’s trivial to generate and exercises 10s-100s of thousands of tokens of context in a falsifiable way.
Even gpt4 gets tripped up when there's too many exact instructions needed to be executed on an input. That's why it's common that breaking a task into multiple steps and multiple improves performance.
It's wonderful to see improvements possible on smaller models.