How We Increased Search Accuracy for RAG based GPT from 65% to 90%
Retrieval Augmented Generation (RAG) represents a groundbreaking approach in information retrieval, where the accuracy of search results directly influences the quality of generated answers. In essence, RAG combines traditional search mechanisms with Large Language Model's ability to understand and generate answers. Search accuracy becomes particularly significant when considering that the answers generated by RAG are only as accurate as the documents it retrieves.
In this article we will explore how we improve search arruracy for RAG application from 65% using basic text search to over 90%.
The Initial Framework: Setting the Stage for Advanced Search
Our initial setup for testing and improving accuracy involved several key components:
This foundational structure was essential for our subsequent enhancements.
?? Basic Text Search: The Starting Point
The initial approach was basic text search, a straightforward method:
How Basic Text Search Operates
Initial Results
Though basic text search was a good starting point, it was clear that more sophisticated methods were needed.
?? Implementing Search Term Expansion: Enhancing Queries
To improve upon basic text search, we introduced a Search Term Expansion with the following approach:
Integrating Search Term Expansion was a key move in bridging the gap between simple queries and the complex content within our documents.
领英推荐
?? Semantic Reranking: The Leap to Contextual Understanding
While text search is great for finding an initial set of documents, it often lacks a contextual understanding of the questions. As a result, the relevancy score - typically ranked using BM25 or RRF methods for text-based searches - of the resulting documents is often not accurate. To solve this, we have enabled the Semantic Ranking feature in Cognitive Search, which uses natural language understanding to analyze the initial set of documents returned from the search and then re-ranks them based on its own natural language understanding capability.
Impact on Accuracy
?? Final Refinement: Incorporating Sample Questions
The last refinement involved adding sample questions to documents:
Enhancing Document Relevance
Accuracy Improvement
?? What didn't make the cut
In addition to the features that enhanced our search accuracy, we evaluated other functionalities but ultimately chose not to implement them. This includes
Final Thoughts: Striking the Right Balance
Our efforts to boost RAG's search result accuracy from 65% to 90% were marked by innovation and learning.
Through exploring various methods and understanding their trade-offs, we achieved a balance that significantly enhances the precision and efficiency of information retrieval. This journey highlights a significant step forward in search technology and its application in the business world.
CEO @ Aomni | Learning by shipping
1 年Love the eval driven approach, this is good work!
Nice ??