Intro
Artificial Intelligence (AI) was one of the most notable keywords in 2023, and among its various forms, generative AI rapidly became one of our most frequently used tools within a very short time. Many businesses are making efforts to integrate the performance of powerful generative AI without being limited to a specific field.
Recently, the Retrieval-Augmented Generation (RAG) technique, among various uses of generative AI, has been receiving significant attention. RAG enables question-answering and generation tasks about data not published on the internet, i.e., knowledge not learned by Large Language Models (LLMs). This approach to constructing LLM architectures is referred to as RAG. It is actively being applied in enterprise environments that handle internal documents and often-updated data.
While RAG is undoubtedly a good way to improve the performance of LLMs in general use, there are many technical considerations and variables in enterprise environments that want to use LLMs safely and efficiently through RAG.
In this insight, we aim to provide a brief introduction to RAG and discuss points to consider when applying RAG-based LLMs in a corporate environment.
What is RAG?
Langchain’s RAG architecture
RAG enables the use of the powerful generative capabilities of general LLMs, like GPT, without additional training processes such as fine-tuning, even for the latest data or data not publicly available that LLMs have not learned.
In other words, it's an architecture that enhances the functionality of LLMs by adding an information retrieval system that provides new knowledge data. The addition of the information retrieval system helps control the knowledge data when LLM generates responses. With the RAG architecture, generative AI can be limitedly used for various documents, images, audio, or video, which are internal content of a company.
Advantages of RAG
Through RAG's retrieval phase, the latest data or external model data becomes usable. Therefore, even unlearned knowledge can be transmitted to LLMs, offering a solution to the issue of hallucination in ChatGPT, which plausibly answers questions about specific knowledge it doesn't know.
Although fine-tuning can also solve this issue, it is quite inefficient cost-wise, as it requires obtaining a sufficient amount of high-quality, labeled data and additional training of the LLM. Especially, additional training on continuously changing internal corporate data becomes practically difficult.
Thus, the advantages of RAG seem to be the ultimate solution that not only addresses the chronic problems of LLMs but also resolves the time and cost issues of fine-tuning. But is it really easy for anyone to implement?
Challenges in Utilizing RAG within Corporations
While all the mentioned features are true, however, to properly implement them within a corporate environment, there are many considerations to be made, and below are some of the important elements that have been identified.
Data Preparation
Data preparation is the first step in the RAG structure. For instance, when using a new employee guide document from the HR department, we store vector embeddings in a Vector Database or index the document data using a search engine, which is usually connected to the retrieval.
It might seem that uploading the new employee guide document signifies the data preparation stage, but this process involves many technical requirements.
Corporate data, usually in documents, come in various forms like PDF, HWP, DOCX, XLSX, JPG, etc. Moreover, many documents often exist as image files, where text extraction is not easy, making it challenging to construct a knowledge base with standard text extraction techniques.
Chunking the entire text into smaller units also requires a strategy. To prepare a high-quality knowledge base, a strategy is needed to chunk the entire text or data in a way that preserves the context.
The quantity of documents also needs attention. If we assume the need to create a knowledge base from all internal regulation files, not just the new employee guide document, the number of files can easily exceed 100. Notably, OpenAI's RAG-based Assistant API has a limit of 20 files per Assistant, so introducing it in a corporate environment poses another problem to solve.
Security
In a corporate environment where strict security is required for internal
information, it's likely that access to this information is differentiated based on employee rank. Therefore, even though the RAG-connected knowledge base is the same for everyone, the answers generated by search-augmented generation should be differentiated based on access level. Thus, information related to permissions must always be verified in the RAG pipeline.
Personal information is another consideration. For the active use of generative AI, it's crucial to strictly limit the upload and querying of documents containing Personally Identifiable Information (PII) without regulation. The RAG pipeline should have PII filtering features at various stages to detect such information.
Persistent Hallucination Issues
Even with the correct knowledge base retrieved and fed to the LLM, there's always a chance of inaccurate responses. Often, these cases are influenced by hallucination, resulting in plausible but incorrect answers. This could be due to the LLM's performance, but usually, it's more likely due to vague and unclear prompts. Therefore, sophisticated prompt engineering that suits the nature of corporate documents and the purpose of using LLMs is essential, requiring considerable time and effort.
RAG Improvement from Langcode CXP
Despite these challenges, RAG is receiving a lot of attention as a method to overcome the limitations of traditional LLMs and fine-tuning. Langcode is also applying various technologies to their CXP, which follows the RAG architecture, to solve not only the limitations of LLMs but also the difficulties associated with implementing RAG.
Dealing with Various and Voluminous Documents
CXP can index documents in formats like PDF, TXT, DOCX, XLSX, HWP, and employs OCR-based technology to use key information from image files such as PNG, JPEG, JPG as a knowledge base.
Currently, CXP can be used without a limit on the number of indexed files, and each document is precisely chunked according to a strategy that prevents loss of context.
Moreover, many corporate documents contain table information. CXP ensures that if a table is detected in a document, it undergoes special table processing for indexing.
Enhanced Security
Within CXP, each document's usage always checks permission information, allowing the generative capabilities of LLMs to be adjusted based on the user's rank and permissions. Additionally, the use of AI bots created can be differentially applied according to the user's role and rank.
For sensitive personal information, CXP employs AI-based PII Detection, which is conducted in at least three stages: document upload, user query, and LLM generation. If detected, alerts are given, or administrators can manage them, ensuring strict control of personal identification information.
More Accurate Responses
To provide more accurate answers and generation results, CXP offers additional features at each stage.
In the search phase, if there are many documents on similar topics or different versions of the same document, users can assign priority between documents or choose the current file, enabling AI bots to specify a more user-customized knowledge base.
In the generation phase, while precisely tested prompts are basically provided, users can write their own custom prompts or create them through AI.
Conclusion
The integration of RAG architecture in the adoption of LLMs holds the potential to innovatively improve data usage and knowledge management within enterprises. RAG enables processing various types of data beyond the limitations of traditional LLMs and allows safer and more accurate access to information. Such advancements are expected to play a significant role in professionalizing and optimizing corporate AI usage strategies. However, there are still various challenges in integrating and applying this technology, necessitating continuous research and development.
The adoption of RAG architecture in the implementation of LLMs holds potential for innovatively improving data usage and knowledge management within enterprises. RAG enables the processing of various forms of data that surpass the limitations of conventional LLMs, facilitating more accurate and secure access to information. Such advancements are anticipated to play a significant role in professionalizing and optimizing the use of AI in corporate settings. For detailed inquiries about CXP, which is ready for RAG implementation in enterprise environments, please contact us here.


