RAG - Retrieval Augmented Generation - the instrument to increase the precision of LLMs - Model Hallucination

 RAG - Retrieval Augmented Generation - the instrument to increase the precision of LLMs - Model Hallucination 

Mg. en Ing Carlos Gerardo Said 



In the previous post I mentioned RAG. Let's talk about it. 

In 2020, Patrick Lewis, a doctor in the field of language models who worked at the former Facebook AI Research (now Meta AI Research) publishes together with Ethan Perez from New York University an article titled: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks in which they explained a technique to make current language models more precise and concrete. 

Large Language Models are artificial intelligence models that are trained using Deep Learning algorithms on large sets of information. 

In this way, once trained, they have learned the way in which humans use the spoken and written word, so they are able to offer us general answers with a human pattern to the questions we ask them. 

However, if we are looking for precise answers in a given context, LLMs alone will not provide specific answers or there will be a chance that they will hallucinate and completely make up the answer. 

That LLMs hallucinate means that they generate inaccurate, meaningless or disconnected text. This effect poses potential risks and challenges for organizations using these models outside of the home or everyday environment of personal use of LLMs. The prevalence of hallucination in LLMs, estimated at 15% to 20% for ChatGPT, may have profound implications for the reputation of companies and the reliability of AI systems.  

What is a RAG? 

Precisely, RAG techniques have been developed to improve the quality of responses in specific contexts, such as, for example, in a specific discipline or based on private knowledge repositories such as company databases.  

RAG is an extra technique within artificial intelligence frameworks, which aims to retrieve facts from an external knowledge base to ensure that language models return accurate and up-to-date information. A typical RAG system includes an LLM, a vector database (to conveniently store external data), and a series of commands or questions. That is, in a simplified way, when we ask a question in natural language to an assistant like ChatGPT, what happens between the question and the answer is something like:

The user makes the query, also technically called a prompt. 

The RAG is responsible for enriching that prompt or question with data and facts that it has obtained from an external database that contains relevant information related to the question that the user has asked. This stage is called retrieval. 

The RAG is responsible for sending the enriched or augmented user prompt to the LLM, which is responsible for generating a response in natural language, taking advantage of all the power of the human language that it has learned with its generic training data, but also with the specific data provided in the retrieval stage. 

For example, let's think about a human resources manager at a company. You want to retrieve summarized and aggregated information about one or more employees whose records are in different company databases. 

Let's think that we may be trying to obtain information from salary tables, satisfaction surveys, employment records, etc. An LLM is useful in generating a response with a human pattern. 

However, it is very unlikely to provide consistent and accurate data since it has never been trained with that information due to its private nature. 

In this case, RAG assists the LLM to provide specific data and context with which to return the appropriate response.

Comments

Popular posts from this blog

IBM goes big to keep quantum computers cold

IBM - avances en mantener adecuadamente fríos computadores cuánticos.

Estructura multinivel de los sistemas de agentes de IA