I think the key quote is: >"Claude's extensive context window has also transformed their approach to handling large codebases. When the 200K context window was released, Hedley notes they "ripped out the entire RAG and just put it in the context window instead and it went from 60 percent accuracy to 98." RAG = Retrieval Augmented Generation Related: What is retrieval-augmented generation, and what does it do for generative AI?: https://github.blog/ai-and-ml/generative-ai/what-is-retrieva... Retrieval Augmented Generation: https://en.wikipedia.org/wiki/Retrieval-augmented_generation Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2021) (apparently the original paper where the term 'RAG' was coined): https://arxiv.org/pdf/2005.11401
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
Patrick Lewis, Ethan Perez, Aleksandra Piktus
Show all 12 authors
Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, Douwe Kiela
2020 · arXiv
- HN score
- 0
- Mentions
- 12
- Readers
- 12
- Months
- 10
From the abstract
Large pre-trained language models have been shown to store factual knowledge in their parameters, and achieve state-of-the-art results when fine-tuned on downstream NLP tasks. However, their ability to access and precisely manipulate knowledge is still limited, and hence on knowledge-intensive tasks, their performance lags behind task-specific architectures. Additionally, providing provenance for their decisions and updating their world knowledge remain open research problems. Pre-trained models with a differentiable access mechanism to explicit non-parametric memory can overcome this issue, but have so far been only investigated for extractive downstream tasks. We explore a general-purpose fine-tuning recipe for retrieval-augmented generation (RAG) -- models which combine pre-trained parametric and non-parametric memory for language generation. We introduce RAG models where the parametric memory is a pre-trained seq2seq model and the non-parametric memory is a dense vector index of Wikipedia, accessed with a pre-trained neural retriever. We compare two RAG formulations, one which conditions on the same retrieved passages across the whole generated sequence, the other can use different passages per token. We fine-tune and evaluate our models on a wide range of knowledge-intensive NLP tasks and set the state-of-the-art on three open domain QA tasks, outperforming parametric seq2seq models and task-specific retrieve-and-extract architectures. For language generation tasks, we find that RAG models generate more specific, diverse and factual language than a state-of-the-art parametric-only seq2seq baseline.
Metadata: arXiv. Abstracts retain their original authors’ rights.
In the conversation
Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels
12 selected excerpts · 12 total mentions
Ragdoll is based on RAG - the knowledge is scoped to documents you define, and is uncensored, even if the model you're using has censorship. For example, if you provided some raunchy URLs as Lara Croft's source of knowledge, you could have realistic conversations about the content there, however sexually unshackled they may be. To test it, I just searched for some known banned words in character.ai and tried them in character.ai. It refused to answer, tried to convince me to not talk about it, and even clarified there's a policy against these words, breaking the 4th wall. I asked the same thing to a character in Ragdoll and can confirm they will speak on it like any other knowledge you provide. Original RAG paper: https://arxiv.org/pdf/2005.11401.pdf Thanks for asking about this, I see this come up a lot on character.ai discussions elsewhere, and I'm going to do a NSFW case study about it soon!
Sometimes the terminology is around but not well distributed. I'm not sure this is the paper that coined it, but here's an example from 2020: https://arxiv.org/abs/2005.11401
Yeah that's a fairly well studied one. Most of these techniques are rather "lossy" compared to extending the context window. The most likely "real solution" is going to be using various tricks and finetuning on higher context lengths to just extend the context window. Here's a bunch of other related methods, Summarizing context - https://arxiv.org/abs/2305.14239 continuous finetuning - https://arxiv.org/pdf/2307.02839.pdf retrieval augmented generation - https://arxiv.org/abs/2005.11401 knowledge graphs - https://arxiv.org/abs/2306.08302 augmenting the network a side network - https://arxiv.org/abs/2306.07174 another long term memory technique - https://arxiv.org/abs/2307.02738
> You could just sum it up for us all rather than do a divert to your blog? Why? Have links gone out of fashion? I even linked directly to the relevant section rather than linking to the top of the page. The paper that coined the term used the hyphen, though I think I prefer it without: https://arxiv.org/abs/2005.11401
this concept already exists and is in practice at many companies that require knowledge driven results. https://arxiv.org/abs/2005.11401
This idea is a simplified version of Retrieval-Augmented Generation (RAG), and RAG has been studied in various research papers, such as the one available at https://arxiv.org/abs/2005.11401
I was taken aback by the terminology too. Isn’t Retrieval-Augmented Generation the standard nomenclature for this pattern? https://arxiv.org/abs/2005.11401
Pretty sure it's not "real" (model) context width. Another wide context model is MosaicML's MPT-7B-StoryWriter-65k+ which they are describing as having a context width of 65k, but then give a bit more detail to say they are using ALiBi - a type of positional encoding that allows longer contexts at inference time than training (i.e beyond the real context width of the model). For these types of "extended context" models to actually reason over inputs longer than the native context width of the model, I assume that there is indeed some sort of vector DB trickery - maybe paging thru the input to generate vector DB content, then using some type of Retrieval Augmented Generation (RAG) to process that using the extended contexts ? Maybe someone from Anthropic or MosaicMl could throw us a bone and give a bit more detail of how these are working ! https://www.mosaicml.com/blog/mpt-7b https://arxiv.org/abs/2005.11401
This more or less is already a thing and it's called RAG [1][2]. It essentially allows you to have a database of embeddings (in this case your book) from which a model can pull knowledge from while producing answers. As for the standard operation of these generative models, the context window is the only working memory it has and so it must see the entire text each time. [1] https://arxiv.org/abs/2005.11401 [2] https://huggingface.co/docs/transformers/model_doc/rag
There was a 2020 paper called Retrieval Augmented Generation that describes this technique too [1]. That paper used BERT embeddings which are a little cheaper and uses BART as a generator. One of the common failure modes of RAG (and I assume your technique as well) is hallucination: basically, making stuff up that isn't in any of the docs [2]. [1] https://arxiv.org/abs/2005.11401 [2] https://parl.ai/projects/hallucination/
Thats true for the physics and math but some of the things are updated all the time. For example you can get a current weather report. And they have structured data about movies, TV shows, music, and notable people [1]. Every time any country has an election you’re going to retrain your model? That gets really expensive really fast. On top of that, the training process isn’t that trustworthy. There’s no guarantee your model won’t accidentally say that e.g. Obama is the president. All of this is to say that the best path forward is to translate questions into queries to an auditable knowledge base and then integrate the responses back into the conversation. It’s a couple years old but the best I’ve seen in this area is Retrieval Augmented Generation [2]. And even that’s imperfect, in my experience. [1] https://www.wolframalpha.com/ [2] https://arxiv.org/abs/2005.11401
Keep following the thread.
More in Language modelsMore from the same topics.
Sparks of Artificial General Intelligence: Early experiments with GPT-4
Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan +11
Artificial intelligence (AI) researchers have been developing and refining large language models (LLMs) that exhibit remarkable capabilities across a variety of domains and tasks, challenging our understanding of learning and cognition.
Language Models are Few-Shot Learners
Tom B. Brown, Benjamin Mann, Nick Ryder +28
Recent work has demonstrated substantial gains on many NLP tasks and benchmarks by pre-training on a large corpus of text followed by fine-tuning on a specific task.
Design Patterns for Securing LLM Agents against Prompt Injections
Luca Beurer-Kellner, Beat Buesser, Ana-Maria Creţu +11
As AI agents powered by Large Language Models (LLMs) become increasingly versatile and capable of addressing a broad spectrum of tasks, ensuring their security has become a critical challenge.
Toolformer: Language Models Can Teach Themselves to Use Tools
Timo Schick, Jane Dwivedi-Yu, Roberto Dessì +5
Language models (LMs) exhibit remarkable abilities to solve new tasks from just a few examples or textual instructions, especially at scale.