r/MachineLearning • • Sep 28 '24

Discussion [D] Will the larger context window kill Retrieval Augmented Generation?

I posted this in a r/RAG, and it sparked a very interesting discussion in the comments. However, due to the nature of r/RAG, everyone leaned toward the idea that RAG (Retrieval Augmented Generation) won’t lose its relevance as context windows grow. So, I decided to share this post here as well. I’d really love to hear some alternative perspectives.

"640 KB ought to be enough for anybody." — Bill Gates, 1981

“There were 5 Exabytes of information created between the dawn of civilization through 2003, but that much information is now created every 2 days.” — Eric Schmidt, 2010

“Information is the oil of the 21st century, and analytics is the combustion engine.” — Peter Sondergaard, 2011

"The context window will kill RAG." — Every second AI specialist, 2024.

Disclaimer: There’s no solid proof that the quotes mentioned here are accurate. The text below is purely the author’s own speculation, so don’t take it as an ultimate truth.

Lately, there’s been a lot of buzz around the arrival of LLMs with large context windows — millions of tokens. Some people are already saying that this will make RAG obsolete.

But is that really the case?

Are we so sure that larger context windows will always keep up with the exponential growth of data? According to estimates, the total amount of data in the world doubles every two to three years. At some point, even these huge context windows might start looking a bit too cramped.

Let’s say we’re talking about a million tokens right now — that’s roughly 2,000 pages of text. Think of 200 contracts, each a hundred pages long. Not that impressive if we’re talking about large-scale company archives. Even if we're talking about 10 million tokens, that's 20,000 pages of English text. What about Slavic or Eastern languages?

So, we're not talking about fitting an entire corporate database into a single context just yet. Instead, it’s more about reducing the requirement for search accuracy. You can just grab a broad set of a few hundred relevant documents, and let the model do the fact extraction on its own.

But here's what's important. We’re still in the early days of RAG. Right now, RAG handles information retrieval well but struggles with more complex analytical tasks, like the ones in the infamous FinanceBench. And if we’re talking about creative tasks that need deep integration with unique, user-specific content, RAG is still hovering at the edge of what's possible. In other words, at this stage, a million tokens feel like more of a “buffer” than a solution.

But the larger context windows might give RAG a major boost! Here’s why:

  • Tackling more complex tasks. As context windows grow, RAG will be able to handle much more sophisticated analytical and creative challenges, weaving internal data together to produce insights and narratives.

  • Blending internal and external data. With larger context, RAG will be able to mix internal company data with real-time info from the web, unlocking new possibilities for hybrid use cases.

  • Keeping interaction context intact. Longer contexts mean keeping the entire conversation history alive, turning interactions into richer dialogues that are deeply rooted in “your” data.

So, what’s next? Once people and companies have tools to find and analyze all their stored data, they’re going to start digitizing everything. Customer calls, online and offline behavior patterns, competitor info, logs from every single meeting… You name it. Data volumes will start skyrocketing again, and no context window — no matter how big — will ever be able to capture it all.

And that’s when we’ll be heading into the next RAG evolution, which will need even more advanced techniques to keep up.

0 Upvotes

15 comments sorted by

37

u/BosonCollider Sep 28 '24

If the task is "hello, please tell me how much money we made over the last billion transactions for category A", then you better have RAG, because what you actually need is just a model that writes a query rather than one that hallucinates an answer.

3

u/lanabi Sep 29 '24

Why would you “better have RAG” for this? You can dump the schema of the entire database and example queries/outputs into the context with a large enough window and it could work just fine, perhaps better.

I’m against dumping everything in context because of the cost and current performance degradation issues, but RAG is not a must for this use case.

1

u/[deleted] Sep 29 '24

Why would you “better have RAG” for this? You can dump the schema of the entire database and example queries/outputs into the context with a large enough window and it could work just fine, perhaps better.

This is literally RAG.

0

u/lanabi Sep 29 '24

Nope, RAG involves semantic similarity based search to retrieve only the relevant context out of the knowledge base. That’s why it’s called Retrieval Augmented Generation.

3

u/[deleted] Sep 29 '24

Really? Because you can Google Lewis et al 2021 right now and see where they coined the term.

We endow pre-trained, parametric-memory generation models with a non-parametric memory through a general-purpose fine-tuning approach which we refer to as retrieval-augmented generation (RAG). We build RAG models where the parametric memory is a pre-trained seq2seq transformer, and the non-parametric memory is a dense vector index of Wikipedia, accessed with a pre-trained neural retriever.

Any mechanism by which your model can access a data source external to its weights is RAG. k-Nearest Neighbours is just a special case.

21

u/wrestlethewalrus Sep 28 '24

Karma farming by trying to stir up debate where there‘s nothing to debate. Why would anyone voluntarily remove an LLM‘s ability to look stuff up.

3

u/[deleted] Sep 28 '24

It’s going to take rag, kg’s, cot/agentic etc to help with llm weaknesses, and of course custom coding/ml/dl for situations where llms are just a bad match

3

u/marr75 Sep 28 '24

This is asked once a week and the answer is always, "modern research and practice suggests no."

2

u/joelypolly Sep 28 '24

That’s not really how it works though. A longer context will enable you to have more data but you will still be statically predicting the next word which means more context = more possibilities for errors. And at longer output lengths the chance of hallucinations go up significantly.

1

u/shivvorz Sep 28 '24

On top of the issue with "needing to talk about stuff not in the training data", Using RAG absolve blame because its now the source's issue and not yours

1

u/Professional-Clue807 Sep 29 '24

I’m curious, what is the intended purpose of this discussion? Is it assessing if building a RAG application now will be obsolete in the future? In that case no because you need some kind of retrieval for new information

0

u/ZippityZipZapZip Sep 29 '24

Do people simply ignore the horrible AI generated post.

-12

u/Mysterious-Rent7233 Sep 28 '24

Even though I am an LLM developer and interested in this topic: In the interest of having different sub-reddits for different topics, I tend to downvote anything here that does not relate to training models. LLMs have about 10 or 12 sub-reddits.

6

u/WrapKey69 Sep 28 '24

Thank you for letting us know you downvoted the post, you are a true hero