What Is Retrieval-Augmented Generation aka RAG?

Admin

What Is Retrieval-Augmented Generation aka RAG?

Retrieval-augmented generation, or RAG, is a technique for improving generative AI models by connecting them to specific and relevant data sources. The approach helps large language models, or LLMs, give answers that are more accurate, more reliable and grounded in source material rather than broad parameterized knowledge alone.

The term was coined in a 2020 paper led by Patrick Lewis, who now leads a RAG team at AI startup Cohere. Lewis said, “We definitely would have put more thought into the name had we known our work would become so widespread,” and, “We always planned to have a nicer sounding name, but when it came time to write the paper, no one had a better idea,” according to the article.

Lewis and colleagues developed the method to link generative AI services to external resources, especially ones with current technical details. The paper, with coauthors from the former Facebook AI Research (now Meta AI), University College London and New York University, called RAG “a general-purpose fine-tuning recipe” because it can be used by nearly any LLM to connect with practically any external resource.

RAG gives models sources they can cite, which lets users check claims. It can also help reduce hallucination, a problem where a model gives a plausible but incorrect answer. The article says developers can implement the process with as few as five lines of code, making it faster and less expensive than retraining a model with additional datasets.

The technique is being adopted by companies including AWS, IBM, Glean, Google, Microsoft, NVIDIA, Oracle and Pinecone. NVIDIA’s AI Blueprint for RAG gives developers a starting point for using NVIDIA NeMo Retriever models to build scalable, customizable data extraction and retrieval pipelines.

The article also says developers and IT teams can use an NVIDIA Launchable to experiment with deploying a RAG pipeline. A significant part of this pipeline is NVIDIA NeMo Retriever, with NVIDIA NIM microservices offered as part of the NVIDIA AI Enterprise software platform.

RAG can also run on PCs equipped with NVIDIA RTX GPUs, where users can link to private knowledge sources such as emails, notes or articles while keeping the data source, prompts and response private and secure. The article says RAG on a PC can be accelerated by TensorRT-LLM for Windows.

The history of the technique goes back to the early 1970s, when researchers in information retrieval prototyped question-answering systems using natural language processing, initially on narrow topics such as baseball. The article also notes Ask Jeeves and IBM’s Watson as earlier milestones in question answering before LLMs.

In a 2020 paper and related work, the basic process is described as converting a user query into an embedding or vector, comparing it with vectors in a knowledge base, retrieving matching data and passing it back to the LLM, which then combines that material with its own response. The article says the embedding model continuously updates machine-readable indices, sometimes called vector databases, as new knowledge bases become available.

Many developers use LangChain to chain together LLMs, embedding models and knowledge bases, and NVIDIA uses it in its reference architecture for retrieval-augmented generation. The article says the future of generative AI lies in agentic AI, where LLMs and knowledge bases are dynamically orchestrated to create autonomous assistants.

Source: blogs.nvidia.com.

Companies can share verified announcements through Newz9’s international press release submission page.