Introduction
Two months ago, we introduced a method to significantly enhance the performance of AI through the use of generative AI, the RAG technique, via the Insights. The Insight explored considerations and challenges in deploying RAG-based generative AI solutions in corporate environments and how Langcode addresses these issues.
This time, we aim to delve into the features of RAG not covered in the last Insight and the various methods Langcode CXP has introduced to improve the usability and accuracy of RAG.
Exploring the RAG Process
Retrieval-Augmented Generation (RAG) is an approach to using generative AI, which integrates the information retrieval phase with the generation phase to produce more accurate and detailed answers to specific questions or prompts. Because RAG leverages both retrieval and generation stages to utilize more information and context than traditional generative models, it is particularly useful for generating accurate responses to new, external knowledge-based questions not included in the model’s training. Consequently, it is actively used to implement AI chatbots that handle questions about documents or knowledge bases in corporate environments, which cannot be pre-learned.
Retrieval
Retrieval is arguably the most critical part of a RAG-based AI chatbot's answer accuracy because it provides context to specific questions or prompts. Its significance lies in being the sole conduit for linking new external knowledge and, furthermore, in providing incorrect knowledge that the generative model might use to create plausible but incorrect answers.
Generation
With a precise knowledge base obtained through retrieval, models like GPT and other LLMs create the final answer in the generation phase. In this stage, the language model must understand the context of the given information and generate accurate responses relevant to the user's questions or requests.
Prompt engineering is a means to control the language model to ensure it meets the overall design intent and required accuracy, with more details available in the previous Insight.
Considerations and Challenges for RAG
As mentioned in the retrieval phase, providing incorrect information at this stage can lead to the model delivering inaccurate answers or hallucinations, i.e., plausible but incorrect responses.
Common causes of incorrect answers during the retrieval phase include:
These issues are, in reality, prevalent in corporate environments, and generative AI solutions are expected to provide the necessary knowledge accurately under these circumstances.
Therefore, without modifying the original data or internal documents, methods to improve the accuracy of AI solutions are needed, and Langcode CXP addresses these challenges with the following approaches.
Improving RAG Accuracy in CXP
Knowledge Base Connection Management
Creating a knowledge base for each subject
Linking only the necessary knowledge bases
In CXP, knowledge bases exist as separate entities, each possibly containing various forms of documents or data, similar to folders holding data on similar topics. These knowledge bases can be connected to bots created by users at any time, applying the RAG structure from the moment of connection.
Thus, as illustrated, users can easily modify their bots, such as a labor law bot, to make more accurate searches by connecting or disconnecting specific knowledge bases based on legal or regulatory needs.
Feedback System
Collecting feedback data with Likes and Dislikes
Various types of negative feedback
The RAG technique itself does not allow for additional learning of the LLM in use. Therefore, if users fail to find the information they need or ask sufficiently specific questions, leading to inaccurate answers, they may need to review and modify documents or remove confusing ones, potentially lowering the solution's user experience.
CXP implements a feedback system that allows users to improve answer accuracy using common like/dislike buttons without modifying the original text. Feedback data left by users is treated as special data that can be used for feedback reinforcement learning. If a user's question is submitted, CXP checks whether similar feedback data has been collected before, identifies the type of feedback (positive, negative, mixed, or other), and applies a feedback rescoring algorithm if feedback data is present, thereby delivering the most accurate part of the knowledge base to the LLM in the generation phase.
Additional Features
Furthermore, CXP offers a user dictionary feature that allows for the registration of homonyms/synonyms, reducing the gap between terms in documents and the words users actually employ, facilitating more accurate knowledge base searches.
It also provides an automatic version control feature to ensure AI bots recognize the most recent documents first, ensuring the latest knowledge base is reflected in queries and answers.
Lastly, a question augmentation feature is soon to be supported. Administrators or users with knowledge base management rights can link specific questions to specific document sections, aiding the AI model in finding more accurate answers to those or similar questions.
Conclusion
The exploration and implementation of methods to utilize generative AI are ongoing and expected to continue actively. Langcode is researching and implementing various tests and techniques through its RAG-based solution CXP to use it more efficiently and safely in corporate environments. We plan to introduce more ways to intelligently utilize generative AI through the Insights in the future, so please stay tuned for more updates.


