Optimizing Retrieval-Augmented Generation with Elasticsearch for Enhanced Question-Answering Systems

Jiajing Chen,Runyuan Bao,Hongye Zheng,Zhen Qi,Jianjun Wei,Jiacheng Hu
2024-10-18
Abstract:This study aims to improve the accuracy and quality of large-scale language models (LLMs) in answering questions by integrating Elasticsearch into the Retrieval Augmented Generation (RAG) framework. The experiment uses the Stanford Question Answering Dataset (SQuAD) version 2.0 as the test dataset and compares the performance of different retrieval methods, including traditional methods based on keyword matching or semantic similarity calculation, BM25-RAG and TF-IDF- RAG, and the newly proposed ES-RAG scheme. The results show that ES-RAG not only has obvious advantages in retrieval efficiency but also performs well in key indicators such as accuracy, which is 0.51 percentage points higher than TF-IDF-RAG. In addition, Elasticsearch's powerful search capabilities and rich configuration options enable the entire question-answering system to better handle complex queries and provide more flexible and efficient responses based on the diverse needs of users. Future research directions can further explore how to optimize the interaction mechanism between Elasticsearch and LLM, such as introducing higher-level semantic understanding and context-awareness capabilities, to achieve a more intelligent and humanized question-answering experience.
Information Retrieval
What problem does this paper attempt to address?
This paper aims to improve the accuracy and quality of large - language models (LLMs) in answering questions by integrating Elasticsearch into the Retrieval - Augmented Generation (RAG) framework. Specifically, the study uses version 2.0 of the Stanford Question Answering Dataset (SQuAD) as the test dataset and compares the performance of different retrieval methods, including traditional methods based on keyword matching or semantic similarity calculation, BM25 - RAG and TF - IDF - RAG, as well as the newly proposed ES - RAG scheme. The research results show that ES - RAG not only has obvious advantages in retrieval efficiency, but also performs excellently in key indicators such as accuracy, which is 0.51 percentage points higher than TF - IDF - RAG. In addition, the powerful search ability and rich configuration options of Elasticsearch enable the entire question - answering system to better handle complex queries and provide more flexible and efficient responses according to the diverse needs of users. Future research directions can further explore how to optimize the interaction mechanism between Elasticsearch and LLM, for example, by introducing more advanced semantic understanding and situation - awareness capabilities to achieve a more intelligent and user - friendly question - answering experience.