> RAG is not used to try to anchor to reality a general LLM by somehow making it come up with sources and links.
but that definitely is one particular use of RAG, i.e. to limit some potential hallucinations by grounding it in data provided in the prompt.
RAG is vector search first. It encodes the query, finds nearest vectors in the vector database, retrieves the fragments attached to those vectors, and then sends those vectors to the LLM for it to summarize them.
A general LLM like Gemini or Claude or ChatGPT first produces an answer to a question, based on its training. This doesn't involve searching any external source at that point. Then after that answer is produced, the LLM can try to find sources that match what it has come up with.
Two common alternatives to vector search:
1. Ask the LLM to identify key terms in the user's question and use those terms with a regular full-text search engine
2. If the content you are answering questions about is short enough - an employee handbook for example - just jam the whole thing in the context. Claude 3 supports 200,000 tokens and Gemini Pro 1.5 supports a million so this can actually be pretty effective.
People, we have to stop talking about what we know as though it's all there is. Don't confuse our knowledge for understanding. Understanding only comes from repeadly trying to prove our understandings wrong and learning how things truly are.
It’s bloody useful if you can’t cram your entire proprietary code base into a prompt.
ID: 1
URL: https://example.com/test.html
Text: lksdjflkdsjlksjkl
And then tell it to use the ID to link to the page.
> but that definitely is one particular use of RAG
One use of RAG doesn't imply that all uses of RAG are for grounding LLM hallucinations.
Additionally, I disdain when fallacies come up in conversation when it doesn't appear someone is making an argument in bad faith. We all use logical fallacies by accident from time to time. A good use of calling them out is when they are used in poor taste. I find that more on Reddit than Hacker News.
I have now also engaged in the Tu Quoque fallacy in this reply. See how annoying they are?
I played with Latent Semantic Indexing[1] as a teen back in early 2000s, which also does kinda that. I haven't read much on RAG, I'm assuming it's some next level stuff, but are there any relations or similarities?
[1]: https://en.wikipedia.org/wiki/Latent_semantic_analysis#Laten...
That’s what GPT does. Or rather, someone hearing about RAG for the first time would have trouble distinguishing what you said from their understanding of how GPTs are already trained.
It isn't just adding a vector based db
It isn't about less hallucination. In fact it doesn't even mandate that result should be referenced nor come from a vector db.
RAG's point is to remove the limit LLMs alone have which is that they are limited to the mind trained data as source of information.
A RAG can be queried for information an LLM doesn't have any knowledge of. The LLM part of a RAG can be instructed to use all sort of information retrieval, such as making a web search, checking the current stock market value of any particular tickers.
The article is nonetheless interesting as it touches on the beauty of LLMs being in their input interface rather than their ability to outputs aggregated content that reads beautifully, usually.
RAG is more than what the author says it is. It's even what the author says is most wanted.
RAG is more comprehensively what the author wants. It can be instructed to provide relevant references, always answer a particular way, and most importantly can get asked to perform (live) search engine queries to find the most up to date information. The example in the article is OK given the recipe is pretty old and has been very likely mined during training.
What about:
> I missed the games Lakers played from the 1st to 21st of April. Could you give me the list of opponents and scores please.
LLMs input interface won't help. RAGs can make LLMs answer that.
Based on the words in the acronym, that seems exactly backwards. The words suggest that it is a generation technology which is merely augmented by retrieval (search), not a retrieval technology that is augmented by a generative technology.
An example of RAG could be: you have a great LLM that was trained at the end of 2023. You want to ask it about something that happened in 2024. You're out of luck.
If you were using RAG, then that LLM would still be useful. You could ask it
> "When does the tiktok ban take effect?"
Your question would be converted to an embedding, and then compared against a database of other embeddings, generated from a corpus of up-to-date information and useful resources (wikipedia, news, etc).
Hopefully it finds a detailed article on the tiktok ban. The input to the LLM could then be something like:
> CONTEXT: <the text of the article>
> USER: When does the tiktok ban take effect?
The data retrieved by the search process allows for relevant in-context learning.
You have augmented the generation of an LLM by retrieving a relevant document.
"Term Frequency - Inverse Document Frequency" apparently: https://www.learndatasci.com/glossary/tf-idf-term-frequency-...
It’s like referring to your notes before answering a question. If your notes are good you’re going to answer well (barring a weird brain fart.) Hallucinating is still possible but extremely unlikely. And a post generation step can check for that and drop responses containing hallucinations
The idea behind RAG is to enhance AI-powered search by leveraging the vast amount of information available in documents. It's a noble goal, but the acronym itself falls short in capturing the essence of what we're trying to achieve. It's like trying to describe the entire field of computer science with a single term - it's just not feasible.
But here's the thing: AI-powered search is not just a concept anymore; it's a reality. I've been working on this problem since 2019, and I can tell you from experience that it works. By integrating OpenAI's GPT-2 with Solr, I was able to create a search engine that could understand natural language queries and provide highly relevant results. And this is just the beginning.
The potential applications of AI-powered search are vast. From Playwright to FFmpeg, I've been applying LLMs to various services, and the results have been nothing short of impressive. But to truly unlock the potential of this technology, we need to think beyond the confines of a single acronym.
That's why I propose a new term: RAISE - Retrieval Augmented Intelligent Search Engine. This term captures the essence of what we're trying to achieve: a search engine that can understand the intent behind a query, retrieve relevant information from a vast corpus of documents, and provide intelligent, contextual responses.
But more importantly, RAISE is not just a term; it's a call to action. It's a reminder that we need to raise the bar in AI-powered search, to push the boundaries of what's possible, and to create tools that can truly revolutionize the way we access and interact with information.
So let's not get bogged down in terminology debates. Instead, let's focus on the real challenge at hand: building intelligent search engines that can understand, retrieve, and respond to our queries in ways that were once thought impossible. And who knows, maybe one day we'll look back at this moment and realize that RAISE was just the beginning of something much bigger.
This seems like a misunderstanding of what RAG is. RAG is not used to try to anchor to reality a general LLM by somehow making it come up with sources and links. RAG is a technology to augment search engines with vector search and, yes, a natural language interface. This concerns, typically, "small' search engines indexing a specific corpus. It lets them retrieve documents or document fragments that do not contain the terms in the search query, but that are conceptually similar (according to the encoder used).
RAG isn't a cure for ChatGPT's hallucinations, at all. It's a tool to improve and go past inverted indexes.