Optimization of Retrieval-Augmented Generation Context with Outlier Detection

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Bulgakov, Vitaly
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917709229326336
author Bulgakov, Vitaly
author_facet Bulgakov, Vitaly
contents In this paper, we focus on methods to reduce the size and improve the quality of the prompt context required for question-answering systems. Attempts to increase the number of retrieved chunked documents and thereby enlarge the context related to the query can significantly complicate the processing and decrease the performance of a Large Language Model (LLM) when generating responses to queries. It is well known that a large set of documents retrieved from a database in response to a query may contain irrelevant information, which often leads to hallucinations in the resulting answers. Our goal is to select the most semantically relevant documents, treating the discarded ones as outliers. We propose and evaluate several methods for identifying outliers by creating features that utilize the distances of embedding vectors, retrieved from the vector database, to both the centroid and the query vectors. The methods were evaluated by comparing the similarities of the retrieved LLM responses to ground-truth answers obtained using the OpenAI GPT-4o model. It was found that the greatest improvements were achieved with increasing complexity of the questions and answers.
format Preprint
id arxiv_https___arxiv_org_abs_2407_01403
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Optimization of Retrieval-Augmented Generation Context with Outlier Detection
Bulgakov, Vitaly
Information Retrieval
Artificial Intelligence
Computation and Language
Machine Learning
In this paper, we focus on methods to reduce the size and improve the quality of the prompt context required for question-answering systems. Attempts to increase the number of retrieved chunked documents and thereby enlarge the context related to the query can significantly complicate the processing and decrease the performance of a Large Language Model (LLM) when generating responses to queries. It is well known that a large set of documents retrieved from a database in response to a query may contain irrelevant information, which often leads to hallucinations in the resulting answers. Our goal is to select the most semantically relevant documents, treating the discarded ones as outliers. We propose and evaluate several methods for identifying outliers by creating features that utilize the distances of embedding vectors, retrieved from the vector database, to both the centroid and the query vectors. The methods were evaluated by comparing the similarities of the retrieved LLM responses to ground-truth answers obtained using the OpenAI GPT-4o model. It was found that the greatest improvements were achieved with increasing complexity of the questions and answers.
title Optimization of Retrieval-Augmented Generation Context with Outlier Detection
topic Information Retrieval
Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2407.01403