While large language models (LLMs) have demonstrated great success across a variety of natural language processing tasks, LLMs are constrained in their applicability by unacceptable hallucination rates when it comes to areas that require grounded reasoning. For example, on sets of complex systematic reviews and domain-specific legal Q&As, vanilla language models are producing tens of percent unsubstantiated responses. The paradigm of retrieval-augmented generation has become the standard for grounding pre-trained language models on external, non-parametric information. However, naive implementations of retrieval-augmented generation suffer from the combined error of retrieval and generation steps. State-of-the-art approaches are taking advantage of grounding protocols and self-reflective verification loops, transforming simple semantic similarity search into enterprise-grade domain engines. Hallucinations can occur in both the retrieval and the generation stages of retrieval-augmented generation models. First, embedding model failures can lead to semantically dissimilar texts being merged together due to proximity in the embedding space. Second, coarse-grained document chunking practices lead to relevant information being split between multiple chunks, thus providing only partial information about a topic. Third, source document curation failures lead to the inclusion of noisy evidence from a range of different databases. Generation stage hallucinations stem from faithfulness drift, where the model relies on parametric memories instead of retrieved context. Generation failures also include context overgeneralization, where models extrapolate beyond the retrieved documents and fail to provide domain-specific justification for claims, and contradictory context resolution failures, which contain hallucinated information to resolve contradictions between documents. Modern approaches to retrieval-augmented generation utilize advanced grounding protocols to mitigate hallucinations emanating from naive document encoding and similarity search. First, context-graph retrieval-augmented generation approaches replace document chunks with graph structures and vector databases with graph databases. In context-graph retrieval-augmented generation approaches, relevant information is encoded as sets of triples stored in graphs. Second, modern approaches to context-graph retrieval-augmented generation utilize hybrid vector-graph similarity, which allows the retrieval-augmented generation models to avoid drift during hops, e.g., when querying complex ownership hierarchies in the legal domain. Another direction of improving grounding in retrieval-augmented generation involves the implementation of structured cross-document synthesis. Structured cross-document synthesis approaches utilize document chunk scoring, fact extraction from retrieved chunks, and language model synthesis of the answer based on the combination of facts. Modern retrieval-augmented generation approaches also utilize strict output contracts, which require the language model to explicitly cite particular chunks of evidence from the database. If a language model is unable to identify relevant chunks for supporting a particular claim, it is obliged to reject the claim, replacing unsubstantiated information with statements about the absence of supporting evidence. After generating a hallucination-free response, retrieval-augmented generation models perform self-reflective checks to identify additional unsubstantiated claims, which are then edited prior to responding to the user. Self-reflective retrieval-augmented generation approaches utilize reflection tokens, special prompting tokens that allow the model to evaluate the quality of its response. Specifically, four types of evaluative tokens prompt the model to identify whether additional information needs to be retrieved, whether the retrieved passage provides sufficient evidence for supporting a claim, whether a particular sentence was generated based on the retrieved text, and whether the sentence is overall useful. If the model identifies a particular assertion as unsubstantiated, it can edit the response to exclude the claim or replace it with information retrieved from the database. Thus, the implementation of self-reflective tokens allows retrieval-augmented generation models to identify claims that do not benefit from additional evidence and remove them from the response.

Source: Make Customer Service Reps Smarter with RAG (Retrieval-Augmented Generation)

Verification frameworks for retrieval-augmented generation typically utilize multiple agents to vote on sources to retrieve and responses to generate, identifying hallucinations in both the retrieval and the response generation stages. Instead of prompting a single model to perform self-reflective editing of its own hallucinations, verification frameworks utilize multiple language model agents to vote on sources to retrieve and responses to generate. By performing parallel processing during both retrieval and response synthesis, verification frameworks minimize the error probability of the final output while avoiding the high computational costs of multi-stage sequential processing. Consensus-based verification frameworks can utilize voting mechanisms to prioritize certain sources, particular evidence paragraphs, or specific response claims during retrieval-augmented generation. Assessing the factual accuracy of large language models typically requires more nuanced considerations than captured by standard evaluation metrics, such as ROUGE and BLEU scores. Thus, the FActScore framework utilizes automated theorem proving to evaluate factual assertions in the generated response, outperforming standard evaluation methods. Similarly, the RAGTruth benchmark utilizes specialized evaluation metrics for word- and sentence-level hallucination detection, focusing on the context faithfulness of retrieval-augmented generation models. Finally, self-consistency scoring methods, such as N-Best Disagreement, utilize temperature-sampled responses to analyze distributional shifts at the token level. The analysis of token distribution allows the identification of the claims that are most likely to be hallucinated. Through the implementation of enhanced grounding mechanisms and post-hallucination verification frameworks, modern approaches to retrieval-augmented generation significantly reduce the error rates of large language models. In particular, in medical domain applications, standard large language model fine-tuning practices fail to address rare edge cases, whereas multi-evidence grounding approaches reduce clinical model errors to an acceptable level. In legal technology use cases, chunk-based similarity search leads to retrieving superseded information, whereas graph-based evidence structures allow following regulatory updates. Finally, in financial modeling applications, hallucinations during financial report analysis are reduced by supplementing tabular data with grounded textual evidence. Thus, computer science approaches to grounded verifiable synthesis replace naive text generation, addressing the demands of enterprise application domains. Sources: https://openreview.net/pdf?id=hSyW5go0v8 https://arxiv.org/abs/2305.14251 https://arxiv.org/abs/2401.00396

Reference links