TC-RAG:Turing-Complete RAG's Case study on Medical LLM Systems

Xinke Jiang,Yue Fang,Rihong Qiu,Haoyu Zhang,Yongxin Xu,Hao Chen,Wentao Zhang,Ruizhe Zhang,Yuchen Fang,Xu Chu,Junfeng Zhao,Yasha Wang
2024-08-17
Abstract:In the pursuit of enhancing domain-specific Large Language Models (LLMs), Retrieval-Augmented Generation (RAG) emerges as a promising solution to mitigate issues such as hallucinations, outdated knowledge, and limited expertise in highly specialized queries. However, existing approaches to RAG fall short by neglecting system state variables, which are crucial for ensuring adaptive control, retrieval halting, and system convergence. In this paper, we introduce the TC-RAG through rigorous proof, a novel framework that addresses these challenges by incorporating a Turing Complete System to manage state variables, thereby enabling more efficient and accurate knowledge retrieval. By leveraging a memory stack system with adaptive retrieval, reasoning, and planning capabilities, TC-RAG not only ensures the controlled halting of retrieval processes but also mitigates the accumulation of erroneous knowledge via Push and Pop actions. In the case study of the medical domain, our extensive experiments on real-world healthcare datasets demonstrate the superiority of TC-RAG over existing methods in accuracy by over 7.20\%. Our dataset and code have been available at https://https://github.com/Artessay/SAMA.git.
Information Retrieval
What problem does this paper attempt to address?
The main problems that this paper attempts to solve are several key challenges existing in the current Retrieval - Augmented Generation (RAG) methods when dealing with large - scale language models (LLMs) in specific domains (such as the medical field): 1. **Lack of system state variables**: Existing RAG methods overlook the management of system state variables, which leads to deficiencies in adaptive control, retrieval termination, and system convergence. These state variables are crucial for ensuring the adaptive control of the system, stopping the retrieval process in a timely manner, and finally making the system converge to a reliable conclusion. 2. **Non - Turing - completeness**: Current RAG methods are not Turing - complete, which means they lack the ability to dynamically manage and monitor the retrieval process and cannot guarantee that the system can finally converge to a reliable conclusion. In complex medical scenarios, decision - making often requires multi - step reasoning and adaptive responses. The lack of Turing - completeness significantly limits the effectiveness and reliability of the system. 3. **Accumulation of invalid or redundant information**: The traditional RAG retrieval process is usually driven by query keywords rather than according to the specific needs of the model. This may lead to the introduction of a large amount of irrelevant or noisy information. As the retrieval and reasoning processes progress, wrong knowledge will keep accumulating, wasting token resources, accumulating invalid memories, and may encounter the "lost in the middle" problem. To address these challenges, the author proposes Turing - Complete RAG (TC - RAG), which solves the above problems in the following ways: - **Designing a Turing - complete RAG system**: A system with a memory stack is introduced to monitor intermediate states and ensure that the retrieval process reliably converges to the optimal conclusion. - **Enhancing the model's reasoning and planning abilities**: Through large - scale pre - training and task - specific prompting strategies, the understanding and reasoning abilities of medical LLMs are improved, enabling them to adaptively decide whether to retrieve and what to retrieve. - **Timely correcting errors and compressing redundant knowledge**: Through backtracking and summarizing operations in the memory stack system, wrong information is removed in a timely manner, redundant knowledge is compressed, and the accumulation of invalid information is reduced. Through these innovations, TC - RAG not only improves the accuracy and reliability of medical LLMs but also demonstrates its superior performance on multiple real - world datasets.