Computing systems and methods for automated self-evaluation of misinformation in a retrieval augmented generation system

The computing system automates the evaluation of RAG systems by using an evaluator LLM to assess response accuracy and retrain the LLM, addressing the challenge of misinformation and reducing human resource requirements.

US20260387501A1Pending Publication Date: 2026-12-03THE TORONTO DOMINION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/226380
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2026-12-03

AI Technical Summary

Technical Problem

Retrieval Augmented Generation (RAG) systems face challenges in producing accurate and reproducible results due to the retrieval of irrelevant documents, leading to misinformation and toxic responses, which are difficult to evaluate and require significant human expertise and resources.

Method used

A computing system that includes a primary large language model (LLM), a prompt analysis module, and an evaluator LLM to automatically evaluate responses for misinformation by comparing them with relevant documents, providing a misinformation score and, if necessary, retraining the LLM to improve accuracy.

Benefits of technology

Reduces the need for human expertise and resources by automating the evaluation of RAG systems, ensuring accurate and efficient generation of responses by identifying and correcting misinformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260387501A1-D00000_ABST
    Figure US20260387501A1-D00000_ABST
Patent Text Reader

Abstract

Systems and methods are provided for automated self-evaluation of misinformation in a Retrieval Augmented Generation (RAG) system. A computing system processes a query using a primary large language model (LLM) to generate the response; transmits the query to a prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query; inputs the response and the one or more relevant documents to an evaluator LLM, which outputs a misinformation value indicating an amount of false information present in the response that contravenes the relevant information; and, outputs and stores the query, the response, the one or more relevant documents, and the misinformation value.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The disclosed exemplary embodiments relate to computer-implemented systems and methods for automated self-evaluation of misinformation in a retrieval augmented generated system.BACKGROUND

[0002] A Retrieval Augmented Generation (RAG) system retrieves data from outside a foundation large language model (LLM) and augments prompts by adding the relevant retrieved data in context. In some cases, an augmented prompt leads to the foundation LLM providing a more accurate or a more detailed response, or both.

[0003] With a RAG system, the data can be retrieved from one or multiple data sources, include document repositories, databases, or application programming interfaces (APIs), or a combination thereof. In some cases, the data is processed into a compatible format with the RAG system, such as by converting the data to numerical representations using embedding language models. This conversion, also called embedding, provides a numerical representation of the data in a vector space. For example, text undergoes an embedding process to generate a multi-dimensional vector that represents the words in 30 dimensions. More generally, the numerical representations resulting from the embedding process are referred to as embeddings. In some cases, a collection of embeddings, which are in a vector space, representative of the data sources is called a knowledge library. The RAG system compares embeddings of a given query or prompt with vector(s) of the knowledge library, to obtain a relevant document (or portions thereof) from the knowledge library. The obtained portion of the relevant document (or the complete relevant document) and the given query or prompt are both processed by the foundation LLM as an augmented prompt. In many cases, RAG systems use extensive computational resources and time to train. In many cases, it is technically challenging to use a RAG system to produce accurate and reproducible results.SUMMARY

[0004] The following summary is intended to introduce the reader to various aspects of the detailed description, but not to define or delimit any invention.

[0005] In at least one broad aspect, a computing system is provided for processing a response. The computing system includes: a memory, a communication interface, and a processor operatively coupled to the memory and the communication interface. A primary large language model (LLM), a prompt analysis module, an evaluator LLM are stored in the memory and executable by the processor. The processor is configured to at least: process a query using the primary LLM to generate the response; transmit the query to the prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query; generate a prompt to request a misinformation value, and provide the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information; and, output and store the query, the response, the one or more relevant documents, and the misinformation value.

[0006] In some cases, the evaluator LLM is configured to at least search the one or more relevant documents for relevant information that answers the query, and subsequently identify the false information in the response that contravenes at least in part the relevant information.

[0007] In some cases, the evaluator LLM also outputs an explanation corresponding to the misinformation value, the explanation comprising the false information in the response, and contrasting information that comprises the relevant information.

[0008] In some cases, the misinformation value is a score selected from a range of predetermined values comprising: a top score indicating that at least a first predetermined amount of the false information is detected in the response, and a bottom score indicating that lower than a second predetermined amount of the false information is detected in the response.

[0009] In some cases, a retrieval system is stored in the memory; wherein the processor is configured to process the query using the primary LLM and the retrieval system to generate the response; wherein the retrieval system provides one or more retrieved documents to the primary LLM to generate the response; and, wherein at least the retrieval system and the primary LLM are part of a Retrieval-Augmented Generation (RAG) system.

[0010] In some cases, the one or more relevant documents are different from the one or more retrieved documents; and, wherein the retrieval system is trained to access the one or more relevant documents when receiving a later instance of the query.

[0011] In some cases, the processor is further configured to retrain the primary LLM using at least the query and the one or more relevant documents.

[0012] In some cases, when the misinformation value is above a threshold value, the processor retrains the primary LLM using at least the query and the one or more relevant documents.

[0013] In some cases, the prompt analysis module comprises a user interface that comprises a presentation component that displays the query and a receiving component that receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents.

[0014] In some cases, the prompt analysis module comprises a first LLM configured to identify a relevancy value of a given document based on the query, a second LLM configured to identify a completeness value of the given document, and a third LLM configured to a percentage of irrelevant information of the given document relative to the query; and the prompt analysis module uses the relevancy value, the completeness value, and the percentage of irrelevant information to determine that the given document is one of the one or more relevant documents.

[0015] In another broad aspect, a method for processing a response is provided. The method is executed in a computing environment comprising one or more processors and memory, wherein a primary large language model (LLM), a prompt analysis module, an evaluator LLM are stored in the memory and executable by the one or more processors. The method comprises: processing a query using the primary LLM to generate the response; transmitting the query to the prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query; generating a prompt to request a misinformation value, and providing the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information; and, outputting and storing the query, the response, the one or more relevant documents, and the misinformation value.

[0016] In some cases, the evaluator LLM is configured to at least search the one or more relevant documents for relevant information that answers the query, and subsequently identify the false information in the response that contravenes at least in part the relevant information.

[0017] In some cases, the evaluator LLM also outputs an explanation corresponding to the misinformation value, the explanation comprising the false information in the response, and contrasting information that comprises the relevant information.

[0018] In some cases, the misinformation value is a score selected from a range of predetermined values comprising: a top score indicating that at least a first predetermined amount of the false information is detected in the response, and a bottom score indicating that lower than a second predetermined amount of the false information is detected in the response.

[0019] In some cases, a retrieval system is stored in the memory; and the method further comprises: processing the query using the primary LLM and the retrieval system to generate the response; the retrieval system providing one or more retrieved documents to the primary LLM to generate the response; and, wherein at least the retrieval system and the primary LLM are part of a Retrieval-Augmented Generation (RAG) system.

[0020] In some cases, the one or more relevant documents are different from the one or more retrieved documents; and, wherein the retrieval system is trained to access the one or more relevant documents when receiving a later instance of the query.

[0021] In some cases, the method further comprises retraining the primary LLM using at least the query and the one or more relevant documents.

[0022] In some cases, when the misinformation value is above a threshold value, the method comprises retraining the primary LLM using at least the query and the one or more relevant documents.

[0023] In some cases, the prompt analysis module comprises a user interface that comprises a presentation component that displays the query and a receiving component that receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents.

[0024] According to some aspects, the present disclosure provides a non-transitory computer-readable medium storing computer-executable instructions. The computer-executable instructions, when executed, configure a processor to perform any of the methods described herein. For example, a non-transitory computer readable medium is provided storing computer executable instructions which, when executed by at least one computer processor, cause the at least one computer processor to carry out one or more methods for machine learning as described herein.BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings included herewith are for illustrating various examples of articles, methods, and systems of the present specification and are not intended to limit the scope of what is taught in any way. In the drawings:

[0026] FIG. 1A is a schematic block diagram of a system for processing documents in accordance with at least some embodiments;

[0027] FIG. 1B is a schematic block diagram of a cloud-based computing cluster of FIG. 1A, including a computing system for automated self-evaluation of a retrieval-augmented generation system, in accordance with at least some embodiments;

[0028] FIG. 1C is an another embodiment of the cloud-based computing cluster of FIG. 1A, in accordance with at least some embodiments;

[0029] FIG. 2 is a block diagram of a computer in accordance with at least some embodiments;

[0030] FIG. 3 is a schematic block diagram of a prompt analysis module comprising a user interface, in accordance with at least some embodiments;

[0031] FIG. 4 is a schematic block diagram of a prompt analysis module comprising one or more LLMs, in accordance with at least some embodiments;

[0032] FIG. 5 is a flowchart diagram of an example method of processing a response of a primary LLM, in accordance with at least some embodiments;

[0033] FIG. 6 is a flowchart diagram of an example method of retraining the primary LLM, in accordance with at least some embodiments; and

[0034] FIG. 7 is a flowchart diagram of another example method of retraining the primary LLM, in accordance with at least some embodiments; andDETAILED DESCRIPTION

[0035] In some cases, developing a RAG system involves identifying appropriate data sources to form a knowledge library. During the development process, the performance of a RAG system is evaluated by knowledge experts to ensure that the responses outputted by the RAG system are accurate. In some cases, a given RAG system could be found to give incorrect responses. In some cases, the incorrect responses are related to the RAG system retrieving one or more irrelevant documents from a knowledge library, which are irrelevant to the prompt or query being provided. In some cases, when the RAG system retrieves a document that is not relevant to a given query, then the augmented prompt is augmented with contextually irrelevant data, which in turn leads to an incorrect response to the given query. In some cases, the RAG system outputs a response with misinformation, also called toxic information. In some cases, a response that includes misinformation is considered a toxic response. This could lead to negative outcomes when downstream computing systems rely on such a toxic response.

[0036] In some cases, it is desirable to have automated computing systems which can evaluate the RAG system that limits the involvement of the knowledge experts. In some cases, there are technical challenges that include implementing processes that automate well (e.g., it is hard to repurpose knowledge experts time), that are scalable, that can be reimplemented at a later time (e.g., a knowledge expert writing a prompt that is used may omit context that is necessary for broader use), and that can be calibrated relatively quickly (e.g., the evaluation system itself can be updated).

[0037] In some cases, a computing system is provided that self-evaluates a RAG system by leveraging knowledge expertise via obtaining a ground truth document (also herein called a relevant document) that is relevant to a given query. An evaluator LLM can be configured to receive a RAG based response and the relevant document, and processes both to determine a score for the response. In some cases, the evaluator LLM determines if the response adheres to the relevant document. In some cases, the evaluator LLM determines if the response is relevant to the given query. The relevancy of a response may be corrupted or negatively affected by the RAG system retrieving a document that includes false information, or misleading information.

[0038] In some cases, the computing system processes a query using the primary LLM to generate the response; transmits the query to the prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query; inputs the response and the one or more relevant documents to the evaluator LLM, which outputs a misinformation value indicating an amount of false information present in the response that contravenes the relevant information; and, outputs and stores the query, the response, the one or more relevant documents, and the misinformation value.

[0039] In some cases, the evaluator LLM searches the one or more relevant documents for relevant information that answers the query, and subsequently identifies the false information in the response that contravenes the relevant information from the one or more relevant documents.

[0040] In some cases, the evaluator LLM also outputs an explanation corresponding to the misinformation value, the explanation comprising the false information in the response, and contrasting information that comprises the relevant information. In some cases, the misinformation value is a score selected from a range of predetermined values comprising: a top score indicating that at least a first predetermined amount of the toxic information is detected in the response, and a bottom score indicating that lower than a second predetermined amount of the toxic information is detected in the response.

[0041] In some cases, the computing system processes the query using the primary LLM and a retrieval system to generate the response. The retrieval system provides one or more retrieved documents to the primary LLM to generate the response. The retrieval system and the primary LLM are part of a Retrieval-Augmented Generation (RAG) system.

[0042] In some cases, a plurality of queries and a plurality of responses are evaluated to generate a plurality of scores. The plurality of scores is processed by the computing system to generate a score of the RAG system. In some cases, if the score of the RAG system is below a threshold, then the RAG system is assigned a flag (or some other label) for retraining or redevelopment, or both.

[0043] Not only can the proposed computing system reduce the knowledge expert use, the proposed computing system can also reduce the amount of human resourcing generally required to evaluate an LLM. Automated processes can, for example, be implemented based on a designated folder(s) of relevant document(s) and a designated RAG system, reducing the amount of coordination and programmer time required.

[0044] In some cases, a prompt analysis module provides the relevant document. In some cases, the prompt analysis module includes a user interface that is operable by a person to input the relevant document. In some other cases, the prompt analysis module includes an automated system that obtains the relevant document automatically. In some other cases, the prompt analysis module includes an automated system that provides suggestions and filters to a user interface, which is operable by a person, to identify and obtain the relevant document semi-automatically.

[0045] In some cases, the computing system rapidly evaluates a given RAG system for repeated development and optimization. In some cases, the computing system performs repeated semi-automatic or fully automatic monitoring for production.

[0046] In some cases, the computing system is used to quickly evaluate performance of a RAG system during development. In some cases, the evaluation does not occur in realtime while the RAG system is in production, but instead occurs with a set of queries for evaluation.

[0047] Referring now to FIG. 1A, there is illustrated a block diagram of an example computing system, in accordance with at least some embodiments. Computing system 100 has a source database system 110, an enterprise data provisioning platform (EDPP) 120 operatively coupled to the source database system 110, and a cloud-based computing cluster 130 that is operatively coupled to the EDPP 120. In some cases. this computing system 100 is provided for automated data processing of large data sets, including identify relevant documents to automatically generate responses in relation to a given query. In some cases, the documents are files that include text. In some cases, different data formats of documents or files (or both), and which include text, can be used in the computing system described herein.

[0048] Source database system 110 has one or more databases, of which three are shown for illustrative purposes: database 112a, database 112b and database 112c. One or more the databases of the source database system 110 may contain confidential information that is subject to restrictions on export. One or more export modules 114a, 114b, 114c may periodically (e.g., daily, weekly, monthly, etc.) export data from the databases 112a, 112b, 112c to EDPP 120. In some instances, the data is exported on an ad hoc basis.

[0049] EDPP 120 receives source data exported by the export modules 114 of source database system 110, processes it and exports the processed data to an application database within the cloud-based computing cluster 130. For example, a parsing module 122 of EDPP 120 may perform extract, transform and load (ETL) operations on the received source data.

[0050] In many environments, access to the EDPP may be restricted to relatively few users, such as administrative users. However, with appropriate access permissions, data relevant to a document or group of documents (e.g., a client document) may be exported via reporting and analysis module 124 or an export module 126. In particular, parsed data can then be processed and transmitted to the cloud-based computing cluster 130 by a reporting and analysis module124. Alternatively, one or more export modules 126a, 126b, 126c can export the parsed data to the cloud-based computing cluster 130.

[0051] In some cases, there may be confidentiality and privacy restrictions imposed by governmental, regulatory, or other entities on the use or distribution of the source data. These restrictions may prohibit confidential data from being transmitted to computing systems that are not “on-premises” or within the exclusive control of an organization, for example, or that are shared among multiple organizations, as is common in a cloud-based environment. In particular, such privacy restrictions may prohibit the confidential data from being transmitted to distributed or cloud-based computing systems, where it can be processed by machine learning systems, without appropriate anonymization or obfuscation of personal identifiable information (PII) in the confidential data. Moreover, such “on-premises” systems typically are designed with access controls to limit access to the data, and thus may not be resourced or otherwise suitable for use in broader dissemination of the data. In some cases, to comply with such restrictions, one or more module of EDPP 120 may “de-risk” data tables that contain confidential data prior to transmission to cloud-based computing cluster 130. In some cases, this de-risking process may obfuscate or mask elements of confidential data, or may exclude certain elements, depending on the specific restrictions applicable to the confidential data. The specific type of obfuscation, masking or other processing is referred to as a “data treatment.”

[0052] The cloud-based computing cluster 130 includes an interface 104, which facilitates data communication with one or more client devices 106.

[0053] In some environments, the EDPP may be omitted.

[0054] Referring now to FIG. 1B, there is illustrated a block diagram of the cloud-based computing cluster 130, showing greater detail of the elements of the cloud-based computing cluster, which may be implemented by computing nodes of the cluster that are operatively coupled.

[0055] The components of the cloud-based computing cluster 130 include a prompt system 134, a database environment 142, a prompt analysis module 150, an evaluator LLM 154, and a data ingestor 160. In some cases, the components also include a user interface (UI) 140. In some cases, these components are configured to operate on a single computing node and, in some other cases, the components operate on multiple computing nodes. In some cases, the one or more computing nodes are herein referred to as a computing system.

[0056] In some cases, the prompt system 134 includes a primary LLM 136. In some cases, the prompt system 134 also includes a retrieval system 138. The prompt system 134 communicates with a database environment 142. In some cases, the database environment 142 includes a document repository 144, or one or more databases 146, or both. In some cases, the data ingestor 160 obtains data or documents, or both, which are stored in the database environment 142. In some cases, one or more export modules 126a, 126b, 126c provide the data or the documents, or both, to the data ingestor 160. In some cases, the data or the documents, or both are obtained by the data ingestor 160 from one or more other data sources.

[0057] In some cases, the prompt system 134 and the database environment 142 form a retrieval-augmented generation (RAG) system.

[0058] In some cases, the RAG system receives a query 132 in the prompt system 134. The query is used by the retrieval system 138 to retrieve a document (also called a retrieved document 147) from the database environment 142, which is also herein called a knowledge library. The retrieved document 147 and the query 132 are used to generate an augmented prompt, which is processed by the primary LLM 136 to generate a response 148.

[0059] In some cases, the one or more relevant documents 152 outputted by the prompt analysis module 150 are different from the one or more retrieved documents 147 obtained by the retrieval system 138. This could lead to failing score of the response. For example, the one or more retrieved documents include false information or contravening information (or both) compared to relevant information in the one or more relevant documents. This is indicated with a high misinformation value, which may be a failing score.

[0060] In some other cases, the one or more relevant documents outputted by the prompt analysis module 150 are the same as the one or more retrieved documents 147 obtained by the retrieval system 138. This could lead to passing score or an acceptable score of the response.

[0061] In an operationalized RAG system, the query 132 may be received via the UI 140, such as via a chatbot interface.

[0062] During a development process or an evaluation process, multiple queries provided by another source (e.g., a document of queries, or database of queries, etc.) may be analyzed to evaluate the RAG system.

[0063] In some cases, the prompt analysis module 150 also obtains the query 132. The prompt analysis module 150 communicates with the database environment 142 to output a relevant document 152 that is relevant to the query 132. The relevant document 152, is also herein called a ground truth document.

[0064] In some cases, the evaluator LLM 154 processes the response 148 and the relevant document 152 to output a score 156 that evaluates the response in comparison with the relevant document.

[0065] In some cases, the evaluator LLM 154 processes the response 148, the query 132, and the relevant document 152 to output a score 156 that evaluates the response in comparison with the relevant document, and the response in comparison with the query.

[0066] In some cases, the evaluator LLM 154 processes the response 148, the query 132, the relevant document 152, and the retrieved document 147 to output a score 156 that evaluates the response in comparison with the relevant document, the response in comparison with the query, and the retrieved document in comparison with the relevant document. In some cases, the computing system generates a prompt to request a misinformation value, and provides the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part relevant information in the relevant document. In some cases, the evaluator LLM generates the prompt to request the misinformation value. In some other cases, the prompt analysis module generates the prompt to request the misinformation value. In some other cases, the prompt system generates the prompt to request the misinformation value. In some other cases, another module (not shown) in the cloud-based computing cluster 130 generates the prompt to request the misinformation value.

[0067] In some cases, the score 156 includes the misinformation value indicating an amount of false information compared to the one or more relevant documents that is present in the response. For example, the evaluator LLM detects statements A, B, C, D and E in a relevant document 152 that are relevant to the query 132, and the evaluator LLM also detects contravening statements A′, B′, C′, D′ and E′ in the response 148. In this example, statement A′ contravenes statement A, statement B′ contravenes statement B, statement C′ contravenes statement C, and so forth. The evaluator LLM uses this determination of the amount of false information to output a misinformation value. In this example, if all the statements in the response contravene the statements (which are relevant to the query) in the relevant document, then the misinformation value is high (e.g., 5 out of 5 on a 1 to 5 scale, or 0.99 on a range of 0 to 1, or a failure value in a pass / fail labeled system, or a red value in a red-yellow-green labeled system, etc.). In some cases, the evaluator LLM outputs an explanation identifying the contravening statements in the response in contrast to the statements in the one or more relevant documents.

[0068] In another example, the evaluator LLM detects statements A, B, C, D and E in a relevant document 152 that are relevant to the query 132, and the evaluator LLM also detects there are statements A, B, C, D and E′ in the response 148. The statements A, B, C, and D in the response match with the statements in the relevant document, and only the statement E′ in the response contravenes statement E in the relevant document. The evaluator LLM uses this determination of the amount of false information to output a misinformation value. In this example, most of the statements in the response are congruent or match the statements (which are relevant to the query) in the relevant document, then the misinformation value is low (e.g., 1 out of 5 on a 1 to 5 scale, or 0.2 on a range of 0 to 1, or a pass value in a pass / fail labeled system, or a yellow value in a red-yellow-green labeled system, etc.). In some cases, the evaluator LLM outputs an explanation identifying the contravening statements in the response in contrast to the statements in the one or more relevant documents.

[0069] In some cases, the misinformation value is selected from a set of numeric values (e.g., 1, 2, 3, 4, 5), where 1 is the lowest misinformation value and 5 is the highest misinformation value. In some cases, a threshold value is 3, and when the misinformation value is 2 or higher, the response is considered to ‘fail’. Conversely, when the relevancy value is lower than 2, the response is considered to ‘pass’. In some other cases, the threshold value is different, such as 1. For example, no amount of misinformation in the response is considered acceptable.

[0070] In some cases, the evaluator LLM outputs an explanation regarding the misinformation value assigned to the response. In some cases, the explanation includes information about a discrepancy of information between a retrieved document obtained by the retrieval system and a relevant document obtained by the prompt analysis module.

[0071] In some cases, the evaluator LLM outputs and stores the query 132, the response 148, the relevant document 152 and the score 156, which includes called the misinformation value of the response.

[0072] In some cases, the terms relevant document and retrieved document are more generally refer respectively to relevant data and retrieved data. In other words, the data could be in a document format, or may be in another data format (e.g., data from a database). In some cases, the relevant data or the retrieved data, or both, include natural language. In some cases, the relevant data or the retrieved data, or both, include structured data. In some cases, the relevant data or the retrieved data, or both, include structured data and unstructured data, including natural language.

[0073] In some cases, the data in the database environment 142 are stored as embeddings.

[0074] In some cases, the components shown in FIG. 1B form an evaluation data pipeline for a RAG system.

[0075] Referring to FIG. 1C, in some cases, the score 156 is fed back to the prompt system 134, or to an intermediary module, to initiate retraining of the primary LLM 136 or the retrieval system 138, or both.

[0076] The system in FIG. 1C shows another embodiment that further includes the components of a score repository 170 and a trainer module 172. The score repository 170 stores evaluation data associated with a given version of a RAG system (e.g., the prompt system 134 and the database environment 142). In some cases, the evaluation data includes the query, the response, the misinformation value of the response, and the one or more relevant documents that have been stored in association with each other.

[0077] In some cases, the trainer module 172 determines that, when the one or more relevant documents are different from the one or more retrieved documents, the trainer module automatically initiates training the retrieval system 138 to access the one or more relevant documents when receiving a later instance of the query.

[0078] In some cases, the trainer module 172 retrains the primary LLM 136 using the query, the response, the misinformation value of the response, and the one or more relevant documents.

[0079] In some cases, retraining the primary LLM includes fine-tuning the primary LLM to associate a given query with the one or more relevant documents. In some cases, retraining the primary LLM includes fine-tuning the primary LLM to avoid including false information in a future response associated with the given query.

[0080] In some cases, the fine-tuning is a parameter efficient-fine tuning (PEFT) process, which updates a subset of parameters in the primary LLM without altering a core of the primary LLM's structure. Some examples of a PEFT process include: low-rank adaptation (LoRA), which include using low-rank decomposition matrices to learn task-specific information; adapters, which include using lightweight modules to learn task-specific information; prompt tuning, which fine-tunes soft prompts; and inference-aware adaptation (IA3), which dynamically adapts the primary LLM based on input data during inference.

[0081] In some cases, other types of RAG retraining processes are used for retraining the RAG system or the primary LLM.

[0082] In some cases, the computing system processes multiple queries and multiple corresponding responses to respectively generate multiple sets of scores, which are stored in the score repository 170. The trainer module 172 uses the multiple sets of scores to compute a collective misinformation score of the RAG system. In some cases, when the collective misinformation score is above a threshold, or is not within an expected value range, the trainer module initiates retraining the RAG system. For example, the collective misinformation score is considered above an acceptable threshold, indicating the RAG system is characterized as outputting misinformation across multiple responses and, in response, the computing system automatically initiates retraining. In some cases, retraining the RAG system includes retraining the primary LLM or the retrieval system, or both.

[0083] In some cases, retraining the RAG system includes using the multiple queries, the multiple corresponding responses, the corresponding multiple sets of scores, and the corresponding multiple sets of one or more relevant documents.

[0084] In some cases, the components shown in FIG. 1C form an evaluation and retraining data pipeline for a RAG system. A different version of a RAG system is evaluated by updating the prompt system 134 or the documents and / or data in the database environment 142, or both, then processing one or more queries using the different version of the RAG system and generating a new set of one or more scores corresponding to the one or more queries.

[0085] In some cases, components described in FIGS. 1B and 1C, including the UI 140, the prompt system 134, the prompt analysis module 150, the evaluator LLM 154, the database environment 142, the score repository 170, the trainer module 172, and the data ingestor 160, are implemented as one or more processing nodes 181 in the cloud-based computing cluster. In some cases, these components are implemented as virtual computing machines within the cloud-based computing cluster.

[0086] Referring now to FIG. 2, there is illustrated a simplified block diagram of a computer 200 in accordance with at least some embodiments. The computer 200 is also herein interchangeably called a computing system. Computer 200 is an example implementation of a computer such as source database system 110, EDPP 120, processing node 181 of FIGS. 1A, 1B and 1C. Computer 200 has at least one processor 210 operatively coupled to at least one memory 220, at least one communications interface 230 (also herein called a network interface), and at least one input / output device 240.

[0087] The at least one memory 220 includes a volatile memory that stores instructions executed or executable by processor 210, and input and output data used or generated during execution of the instructions. Memory 220 may also include non-volatile memory used to store input and / or output data-e.g., within a database-along with program code containing executable instructions.

[0088] Processor 210 may transmit or receive data via communications interface 230, and may also transmit or receive data via any additional input / output device 240 as appropriate.

[0089] In some cases, the processor 210 includes a system of central processing units (CPUs) 212. In some other cases, the processor includes a system of one or more CPUs and one or more Graphical Processing Units (GPUs) 214 that are coupled together. For example, a large language model executes neural network computations on CPU and GPU hardware, such as the system of CPUs 212 and GPUs 214.

[0090] Referring now to FIG. 3, an example embodiment of a prompt analysis module 150 is provided. In some cases, the prompt analysis module 150 includes an analysis user interface 302, which includes a presentation component 304 that displays the query and a receiving component 306 that receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents.

[0091] For example, a data account 308 is associated with the analysis user interface 302, or with a session of operating the analysis user interface 302. A client device 106A with a web browser or app 107A can access the analysis user interface 302 via the data account 308. The presentation component 304 displays the query. Based on input at the client device 106A, the receiving component 306 receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents. When one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents are received by the receiving component, the analysis user interface 302 uses the one or more identifiers or the one or more data links to obtain the one or more relevant documents. In this way, the prompt analysis module 150 is configured to conveniently and efficiently obtain the one or more relevant documents that are relevant to the query.

[0092] In some cases, the analysis user interface 302 is configured to access one or more relevant documents that are external to the database environment 142. In this way, external documents that are considered a relevant document can be introduced and stored in the database environment, to become part of the knowledge library. In some cases, newly introduced documents, which are considered a relevant document, undergo an embedding process to be stored in a vector space. In some cases, the analysis user interface is configured to access one or more relevant documents that are from the database environment 142.

[0093] Referring now to FIG. 4, in some other cases, the prompt analysis module 150 uses one or more LLMs to automatically identify a relevant document that is relevant to the query, and then output the relevant document. For example, a LLM sub-system 402 includes the one or more LLMs used to automatically identify the relevant document.

[0094] In some cases, each LLM in the LLM sub-system 402 evaluates a different feature. In some cases, the prompt analysis module 150 includes a first LLM 404 configured to identify a relevancy value of a given document, a second LLM 406 configured to identify a completeness value of the given document, and a third LLM 408 configured to identify a misinformation value of the given document. One or a combination of these values are used by the prompt analysis module to automatically determine if the given document is a relevant document that is relevant to the query. In some cases, the relevancy value, the completeness value, and the misinformation value are all used to compute a score of the given document, and the score is used to determine if the given document is a relevant document.

[0095] In some other cases, the prompt analysis module 150 includes a LLM sub-system 402 and an analysis user interface 302. The LLM sub-system 402 provides suggested relevant documents via the analysis user interface 302, and receives input via the analysis user interface to select one or more the suggested relevant documents, which are then outputted as the one or more relevant documents 152 sent to the evaluator LLM 154.

[0096] Referring to FIG. 5, a method 500 is provided for processing a response. The method is executed by a computing system that includes a primary large language model (LLM), a prompt analysis module, and an evaluator LLM. In some cases, the method includes the following operations.

[0097] Block 502: Process a query using the primary LLM to generate the response. In some cases, the primary LLM is part of a RAG system.

[0098] Block 504: Transmit the query to the prompt analysis module, which outputs one or more relevant documents.

[0099] Block 506: Generate a prompt to request a misinformation value, and provide the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information.

[0100] Block 508: Output and store the query, the response, the one or more relevant documents and the misinformation value of the response. In some cases, this information is stored in association with each other.

[0101] In some other cases, the computing system outputs the response, the one or more relevant documents and the relevancy value.

[0102] In some cases, when the one or more relevant documents are different from the one or more retrieved documents, the retrieval system is trained to access the one or more relevant documents when receiving a later instance of the query. In this way, the retrieval system (or the prompt system 134) is modified to access the one or more relevant documents to prepare a better augmented prompt for the primary LLM, which results in a better response.

[0103] In some cases, the method further includes the evaluator LLM computing a relevancy value based on: (i) a first intermediate value corresponding to the response adhering to the one or more relevant documents, wherein the first intermediate value is derived from the misinformation value; and (ii) a second intermediate value corresponding to the response being relevant to the query.

[0104] In some cases, the relevancy value includes a pass value or a failure value. In some cases. When the relevancy value includes the failure value, the evaluator LLM outputs an explanation for the failure value, and the explanation includes:

[0105] (i) missing information from the response, (ii) irrelevant information in the response, (iii) misinformation in the response, or (iv) the response comprises hallucinated information, or a combination thereof.

[0106] Referring now to FIG. 6, a method 600 is provided, which is executable by the computing system. In some cases, the method 600 is executed after the misinformation value (which is part of the score) has been computed for a given response. For example, the method 600 is executed after the method 500.

[0107] Block 602: Determine if the misinformation value is below a threshold.

[0108] Block 604: If the misinformation value is below the threshold, then the computing system retrains the primary LLM (or in some cases the retrieval system, or both) using the query, the response, the misinformation value, and the one or more documents.

[0109] Block 606: Otherwise, in some cases, no action is taken.

[0110] Referring now to FIG. 7, a method 700 is provided, which is executable by the computing system. In some cases, the method 700 is executed after the misinformation value (which is part of the score) has been computed for a given response. For example, the method 700 is executed after the method 500.

[0111] Block 702: Determine if the one or more relevant documents different from the one or more retrieved documents.

[0112] Block 704: If so, then the computing system retrains the primary LLM (or in some cases the retrieval system, or both) using the query, the response, the misinformation value, and the one or more relevant documents.

[0113] Block 706: Otherwise, in some cases, no action is taken.

[0114] Various systems or processes have been described to provide examples of embodiments of the claimed subject matter. No such example embodiment described limits any claim and any claim may cover processes or systems that differ from those described. The claims are not limited to systems or processes having all the features of any one system or process described above or to features common to multiple or all the systems or processes described above. It is possible that a system or process described above is not an embodiment of any exclusive right granted by issuance of this patent application. Any subject matter described above and for which an exclusive right is not granted by issuance of this patent application may be the subject matter of another protective instrument, for example, a continuing patent application, and the applicants, inventors or owners do not intend to abandon, disclaim or dedicate to the public any such subject matter by its disclosure in this document.

[0115] For simplicity and clarity of illustration, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth to provide a thorough understanding of the subject matter described herein. However, it will be understood by those of ordinary skill in the art that the subject matter described herein may be practiced without these specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the subject matter described herein.

[0116] The terms “coupled” or “coupling” as used herein can have several different meanings depending in the context in which these terms are used. For example, the terms coupled or coupling can have a mechanical, electrical or communicative connotation. For example, as used herein, the terms coupled or coupling can indicate that two elements or devices are directly connected to one another or connected to one another through one or more intermediate elements or devices via an electrical element, electrical signal, or a mechanical element depending on the particular context. Furthermore, the term “operatively coupled” may be used to indicate that an element or device can electrically, optically, or wirelessly send data to another element or device as well as receive data from another element or device.

[0117] As used herein, the wording “and / or” is intended to represent an inclusive-or. That is, “X and / or Y” is intended to mean X or Y or both, for example. As a further example, “X, Y, and / or Z” is intended to mean X or Y or Z or any combination thereof.

[0118] Terms of degree such as “substantially”, “about”, and “approximately” as used herein mean a reasonable amount of deviation of the modified term such that the result is not significantly changed. These terms of degree may also be construed as including a deviation of the modified term if this deviation would not negate the meaning of the term it modifies.

[0119] Any recitation of numerical ranges by endpoints herein includes all numbers and fractions subsumed within that range (e.g., 1 to 5 includes 1, 1.5, 2, 2.75, 3, 3.90, 4, and 5). It is also to be understood that all numbers and fractions thereof are presumed to be modified by the term “about” which means a variation of up to a certain amount of the number to which reference is being made if the result is not significantly changed.

[0120] Some elements herein may be identified by a part number, which is composed of a base number followed by an alphabetical or subscript-numerical suffix (e.g., 112a, or 112b). All elements with a common base number may be referred to collectively or generically using the base number without a suffix (e.g., 112).

[0121] The systems and methods described herein may be implemented as a combination of hardware or software. In some cases, the systems and methods described herein may be implemented, at least in part, by using one or more computer programs, executing on one or more programmable devices including at least one processing element, and a data storage element (including volatile and non-volatile memory and / or storage elements). These systems may also have at least one input device (e.g. a pushbutton keyboard, mouse, a touchscreen, and the like), and at least one output device (e.g. a display screen, a printer, a wireless radio, and the like) depending on the nature of the device. Further, in some examples, one or more of the systems and methods described herein may be implemented in or as part of a distributed or cloud-based computing system having multiple computing components distributed across a computing network. For example, the distributed or cloud-based computing system may correspond to a private distributed or cloud-based computing cluster that is associated with an organization. Additionally, or alternatively, the distributed or cloud-based computing system be a publicly accessible, distributed or cloud-based computing cluster, such as a computing cluster maintained by Microsoft Azure™, Amazon Web Services™, Google Cloud™, or another third-party provider. In some instances, the distributed computing components of the distributed or cloud-based computing system may be configured to implement one or more parallelized, fault-tolerant distributed computing and analytical processes, such as processes provisioned by an Apache Spark™ distributed, cluster-computing framework or a Databricks™ analytical platform. Further, and in addition to the CPUs described herein, the distributed computing components may also include one or more graphics processing units (GPUs) capable of processing thousands of operations (e.g., vector operations) in a single clock cycle, and additionally, or alternatively, one or more tensor processing units (TPUs) capable of processing hundreds of thousands of operations (e.g., matrix operations) in a single clock cycle.

[0122] Some elements that are used to implement at least part of the systems, methods, and devices described herein may be implemented via software that is written in a high-level procedural language such as object-oriented programming language. Accordingly, the program code may be written in any suitable programming language such as Python or Java, for example. Alternatively, or in addition thereto, some of these elements implemented via software may be written in assembly language, machine language or firmware as needed. In either case, the language may be a compiled or interpreted language.

[0123] At least some of these software programs may be stored on a storage media (e.g., a computer readable medium such as, but not limited to, read-only memory, magnetic disk, optical disc) or a device that is readable by a general or special purpose programmable device. The software program code, when read by the programmable device, configures the programmable device to operate in a new, specific, and predefined manner to perform at least one of the methods described herein.

[0124] Furthermore, at least some of the programs associated with the systems and methods described herein may be capable of being distributed in a computer program product including a computer readable medium that bears computer usable instructions for one or more processors. The medium may be provided in various forms, including non-transitory forms such as, but not limited to, one or more diskettes, compact disks, tapes, chips, and magnetic and electronic storage. Alternatively, the medium may be transitory in nature such as, but not limited to, wire-line transmissions, satellite transmissions, internet transmissions (e.g., downloads), media, digital and analog signals, and the like. The computer usable instructions may also be in various formats, including compiled and non-compiled code.

[0125] While the above description provides examples of one or more processes or systems, it will be appreciated that other processes or systems may be within the scope of the accompanying claims.

[0126] To the extent any amendments, characterizations, or other assertions previously made (in this or in any related patent applications or patents, including any parent, sibling, or child) with respect to any art, prior or otherwise, could be construed as a disclaimer of any subject matter supported by the present disclosure of this application, Applicant hereby rescinds and retracts such disclaimer. Applicant also respectfully submits that any prior art previously considered in any related patent applications or patents, including any parent, sibling, or child, may need to be revisited.

Claims

1. A computing system for processing a response, the computing system comprising:a memory, a communication interface, and a processor operatively coupled to the memory and the communication interface;a primary large language model (LLM), a prompt analysis module, an evaluator LLM are stored in the memory and executable by the processor;the processor configured to:process a query using the primary LLM to generate the response;transmit the query to the prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query;after generating the response, generate a prompt to request a misinformation value, and provide the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information; and,output and store the query, the response, the one or more relevant documents, and the misinformation value.

2. The computing system of claim 1, wherein the evaluator LLM is configured to search the one or more relevant documents for relevant information that answers the query, and subsequently identify the false information in the response that contravenes at least in part the relevant information.

3. The computing system of claim 2, wherein the evaluator LLM also outputs an explanation corresponding to the misinformation value, the explanation comprising the false information in the response, and contrasting information that comprises the relevant information.

4. The computing system of claim 1, wherein the misinformation value is a score selected from a range of predetermined values comprising: a top score indicating that at least a first predetermined amount of the false information is detected in the response, and a bottom score indicating that lower than a second predetermined amount of the false information is detected in the response.

5. The computing system of claim 1, wherein a retrieval system is stored in the memory; wherein the processor is configured to process the query using the primary LLM and the retrieval system to generate the response; wherein the retrieval system provides one or more retrieved documents to the primary LLM to generate the response; and, wherein at least the retrieval system and the primary LLM are part of a Retrieval-Augmented Generation (RAG) system.

6. The computing system of claim 5, wherein the one or more relevant documents are different from the one or more retrieved documents; and, wherein the retrieval system is trained to access the one or more relevant documents when receiving a later instance of the query.

7. The computing system of claim 1, wherein the processor is further configured to retrain the primary LLM using at least the query and the one or more relevant documents.

8. The computing system of claim 7, wherein, when the misinformation value is above a threshold value, the processor retrains the primary LLM using at least the query and the one or more relevant documents.

9. The computing system of claim 1, wherein the prompt analysis module comprises a user interface that comprises a presentation component that displays the query and a receiving component that receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents.

10. The computing system of claim 1, wherein the prompt analysis module comprises a first LLM configured to identify a relevancy value of a given document based on the query, a second LLM configured to identify a completeness value of the given document, and a third LLM configured to identify a percentage of irrelevant information of the given document relative to the query; and the prompt analysis module uses the relevancy value, the completeness value, and the percentage of the irrelevant information to determine that the given document is one of the one or more relevant documents.

11. A method for processing a response, the method executed in a computing environment comprising a primary large language model (LLM), a prompt analysis module, and an evaluator LLM, the method comprising:processing a query using the primary LLM to generate the response;transmitting the query to the prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query;after generating the response, generating a prompt to request a misinformation value, and providing the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information; and,outputting and storing the query, the response, the one or more relevant documents, and the misinformation value.

12. The method of claim 11, wherein the evaluator LLM is configured to at least search the one or more relevant documents for relevant information that answers the query, and subsequently identify the false information in the response that contravenes the relevant information.

13. The method of claim 12, wherein the evaluator LLM also outputs an explanation corresponding to the misinformation value, the explanation comprising the false information in the response, and contrasting information that comprises the relevant information.

14. The method of claim 11, wherein the misinformation value is a score selected from a range of predetermined values comprising: a top score indicating that at least a first predetermined amount of the false information is detected in the response, and a bottom score indicating that lower than a second predetermined amount of the false information is detected in the response.

15. The method of claim 11, wherein a retrieval system is stored in the memory; and the method further comprises: processing the query using the primary LLM and the retrieval system to generate the response; the retrieval system providing one or more retrieved documents to the primary LLM to generate the response; and, wherein at least the retrieval system and the primary LLM are part of a Retrieval-Augmented Generation (RAG) system.

16. The method of claim 15, wherein the one or more relevant documents are different from the one or more retrieved documents; and, wherein the retrieval system is trained to access the one or more relevant documents when receiving a later instance of the query.

17. The method of claim 11, further comprising retraining the primary LLM using at least the query and the one or more relevant documents.

18. The method of claim 17, wherein, when the misinformation value is above a threshold value, the method comprises retraining the primary LLM using at least the query and the one or more relevant documents.

19. The method of claim 11, wherein the prompt analysis module comprises a user interface that comprises a presentation component that displays the query and a receiving component that receives the one or more relevant documents, or one or more identifiers of the one or more relevant documents, or one or more data links to the one or more relevant documents.

20. A non-transitory computer readable medium storing computer executable instructions which, when executed by at least one computer processor, cause the at least one computer processor to carry out a method for processing a response, the method comprising:processing a query using a primary large language model (LLM) to generate the response;transmitting the query to a prompt analysis module, which outputs one or more relevant documents comprising relevant information to the query;after generating the response, generating a prompt to request a misinformation value, and providing the response and the one or more relevant documents with the prompt to the evaluator LLM, which outputs the misinformation value indicating an amount of false information present in the response that contravenes at least in part the relevant information; and,outputting and storing the query, the response, the one or more relevant documents, and the misinformation value.