Context-loyalty-oriented retrieval enhancement generation method and device

By extracting and reconciling model parameterization knowledge and context conflicts, the problems of inaccurate model output and logical incoherence in existing methods are solved, more efficient question-answering effects are achieved, and the accuracy and consistency of the model in practical applications are ensured.

CN120654827APending Publication Date: 2025-09-16XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510754868.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing faithfulness retrieval enhanced generation methods are unable to dynamically adjust the differences between the model's parameterized knowledge and contextual knowledge when dealing with knowledge conflicts, resulting in inaccurate model output and logical incoherence, limiting the model's wide applicability in practical applications.

Method used

By extracting the parameterized knowledge of the model and converting it into fine-grained fact representation, identifying the conflicts between the retrieved context and self-facts, and reconciling the conflicts to generate the final response, the method includes obtaining the user input question, extracting abstract concepts and factual premises, generating coherent context, performing fact assertion collection and text block segmentation, embedding them into a shared semantic space to calculate semantic similarity, and dynamically integrating context information to generate answers.

Benefits of technology

It improves the question-answering effect, ensures the accuracy and logical consistency of the model output, and avoids the misunderstanding and performance degradation caused by the forced suppression of model knowledge in existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654827A_ABST
    Figure CN120654827A_ABST
Patent Text Reader

Abstract

The invention provides a context-loyalty-oriented retrieval enhancement generation method and device. The method comprises the following steps: acquiring a question input by a user; extracting abstract concepts and factual prerequisites required for answering the questions according to the questions so as to obtain a group of abstract advanced knowledge; generating a coherent context according to the question and the advanced knowledge, and performing fact extraction and decomposition on the context to obtain a fact assertion set; obtaining an original context related to a question retrieved from an external knowledge source, and performing text block segmentation on the original context according to a preset block size to obtain a text block set; embedding the fact assertion set and the text block set into a shared semantic space, calculating semantic similarity by using cosine similarity, and taking the text block set with high semantic similarity as an aligned context block set; generating an answer corresponding to the question input by the user according to the aligned context block set and the original context; therefore, the question-answering effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of question-answering large models, and in particular to a context-faithful retrieval enhancement generation method, a context-faithful retrieval enhancement generation device, a computer-readable storage medium, and a computer device. Background Art

[0002] With the rapid development of artificial intelligence (AI) technology, large-scale language models have demonstrated strong application potential in numerous fields. However, when handling knowledge-intensive tasks, these models often face a serious challenge: inconsistency. Specifically, when contextual information retrieved from external knowledge sources conflicts with the model's own parameterized knowledge, the model's generated output often ignores the retrieved contextual information or incorrectly integrates it with the model's parameterized knowledge. This problem is particularly prominent in knowledge conflict scenarios, seriously affecting the accuracy and reliability of the model's output.

[0003] While existing faithfulness-enhancing generation methods improve the model's adherence to context to some extent, they typically achieve strict adherence by forcibly suppressing the model's parameterized knowledge through carefully designed prompts or modified decoding strategies. However, this approach has a key limitation: it weakens the integrity of the model's internal knowledge structure and increases the risk of misinterpreting the context. Experimental results show that while these methods can reduce overconfidence errors by 6.65%, they also lead to an average increase in matching errors of 6.42%. This is primarily because these methods attempt to achieve faithfulness by forcibly suppressing the model's confidence in its parameterized knowledge, without properly understanding and analyzing the discrepancy between contextual information and the model's inherent knowledge. This suppression not only impairs the model's ability to critically assess conflicts but also leads to reduced comprehension, logical incoherence, and an increased likelihood of alignment with incorrect contextual information.

[0004] Furthermore, existing methods for faithful retrieval-enhanced generation often fail to dynamically adjust the discrepancy between the model's parameterized knowledge and contextual knowledge when dealing with knowledge conflicts. They either overly rely on the model's parameterized knowledge or blindly accept retrieved contextual information without sufficient verification and analysis. This single-minded approach not only fails to effectively resolve knowledge conflicts but can also lead to degraded model performance in non-conflicting scenarios, limiting the model's broad applicability in practical applications. Summary of the Invention

[0005] The present invention aims to at least partially address one of the technical problems in the aforementioned technologies. To this end, one objective of the present invention is to propose a context-faithful retrieval-enhanced generation method that extracts the model's parameterized knowledge and transforms it into a fine-grained fact representation, identifies conflicts between retrieved context and self-facts, and reconciles these conflicts to generate a final response, thereby improving question-answering effectiveness.

[0006] A second object of the present invention is to provide a computer-readable storage medium.

[0007] A third object of the present invention is to provide a computer device.

[0008] The fourth object of the present invention is to provide a context-faithful retrieval enhancement generation device.

[0009] To achieve the above-mentioned objectives, an embodiment of the first aspect of the present invention proposes a context-faithful retrieval enhancement generation method, which includes the following steps: obtaining a question input by a user; extracting abstract concepts and factual premises required to answer the question based on the question to obtain a set of abstract high-level knowledge; generating a coherent context based on the question and the high-level knowledge; extracting and decomposing facts from the context to obtain a set of fact assertions; obtaining the original context related to the question retrieved from an external knowledge source, and dividing the original context into text blocks according to a preset block size to obtain a set of text blocks; embedding the set of fact assertions and the set of text blocks into a shared semantic space, and calculating semantic similarity using cosine similarity to use a set of text blocks with high semantic similarity as a set of aligned context blocks; generating an answer corresponding to the question input by the user based on the aligned context block set and the original context; thereby, the parameterized knowledge of the model can be extracted and converted into a fine-grained fact representation, the conflict between the retrieved context and the self-facts can be identified, and the conflict can be reconciled to generate a final response, thereby improving the question-answering effect.

[0010] In addition, the context-faithful retrieval enhancement generation method proposed in the above embodiment of the present invention may also have the following additional technical features:

[0011] Optionally, generating an answer corresponding to the question input by the user based on the aligned context block set and the original context includes: comparing and merging the aligned context block set and the relevant information generated by the original context to generate an answer corresponding to the question input by the user.

[0012] Optionally, the aligned context block set and the related information generated by the original context are compared and merged to generate an answer corresponding to the question input by the user, including: generating an initial answer based on the aligned context block set; evaluating whether the initial answer is complete and reliable; if the initial answer is incomplete or unreliable, integrating relevant elements from the original context to generate a fused context; and generating a final answer corresponding to the question input by the user based on the fused context.

[0013] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present invention proposes a computer-readable storage medium, on which a context-faithful retrieval enhancement generation program is stored. When the context-faithful retrieval enhancement generation program is executed by a processor, it implements the context-faithful retrieval enhancement generation method as described above.

[0014] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the context-faithful retrieval enhancement generation method as described above is implemented.

[0015] To achieve the above-mentioned purpose, the fourth embodiment of the present invention proposes a context-faithful retrieval enhancement generation device, comprising: an acquisition module for acquiring a question input by a user; a self-knowledge extraction module for extracting abstract concepts and factual premises required to answer the question based on the question to obtain a set of abstract high-level knowledge; a self-context generation module for generating a coherent context based on the question and the high-level knowledge; a self-fact extraction module for extracting and decomposing facts from the context to obtain a set of fact assertions; a context block module for acquiring the original context related to the question retrieved from an external knowledge source, and block the context according to a preset block size. The original context is segmented into text blocks to obtain a text block set; a similarity matching module is used to embed the fact assertion set and the text block set into a shared semantic space, and use cosine similarity to calculate semantic similarity, so as to use the text block set with high semantic similarity as the aligned context block set; a self-thinking generation module is used to generate an answer corresponding to the question input by the user based on the aligned context block set and the original context; thereby, the parameterized knowledge of the model can be extracted and converted into a fine-grained fact representation, the conflict between the retrieved context and the self-facts can be identified, and the conflict can be reconciled to generate a final response, thereby improving the question-answering effect.

[0016] In addition, the context-faithful search enhancement generation device proposed in the above embodiment of the present invention may also have the following additional technical features:

[0017] Optionally, the self-thinking generation module is further configured to compare and merge the aligned context block set and the related information generated from the original context to generate an answer corresponding to the question input by the user.

[0018] Optionally, the self-thinking generation module is also used to generate an initial answer based on the aligned context block set; evaluate whether the initial answer is complete and reliable; if the initial answer is incomplete or unreliable, integrate relevant elements from the original context to generate a fused context; and generate a final answer corresponding to the question input by the user based on the fused context. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Schematic diagram of a process for context-faithful retrieval enhancement generation according to an embodiment of the present invention;

[0020] Figure 2 A network structure diagram corresponding to a context-faithful retrieval enhancement generation method according to an embodiment of the present invention;

[0021] Figure 3 Schematic diagram of a block diagram of a context-faithful retrieval enhancement generation device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0023] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0024] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.

[0025] refer to Figure 1 As shown, the context-faithful retrieval enhancement generation method according to an embodiment of the present invention includes the following steps:

[0026] S101, obtaining a question input by a user.

[0027] S102, extracting the abstract concepts and factual premises required to answer the question based on the question to obtain a set of abstract high-level knowledge.

[0028] That is, the question is input into the self-knowledge extraction module, which reveals the implicit logical structure of the large language model by identifying the knowledge domains and dependencies required to answer the question. Specifically, by prompting the large language model to identify the abstract concepts and factual premises required to answer the question, a set of abstract high-level knowledge is obtained:

[0029] K self (Q) = {k1, k2, ..., k n}

[0030] Among them, K self (Q) represents the extracted high-level knowledge, Q represents the question, k i Represents an abstract assertion.

[0031] It's important to note that abstract concepts are universal concepts that can be applied across a wide range of contexts and are not tied to specific instances or objects. Factual premises are concrete, verifiable pieces of information that form the foundation for constructing answers. The process of developing advanced knowledge from abstract concepts and factual premises involves integrating and deepening these concepts and premises to form a more comprehensive and structured knowledge system.

[0032] S103, generates a coherent context based on the question and high-level knowledge.

[0033] That is, the question and high-level knowledge are input into the self-context generation module, which converts abstract concepts into concrete narratives. Specifically, the model synthesizes abstract assertions into coherent narratives related to the target question and conditions the context generation into {k1, k2, ..., k n}, thereby generating a more coherent and logically consistent context. Formally, the self-context module is generated by generator G1:

[0034] C self (Q) = G1(Q, K self (Q)

[0035] S104: extract and decompose facts from the context to obtain a set of fact assertions.

[0036] That is, distill the context into concrete factual assertions, using a large language model as a fact extractor:

[0037] F self (C self 0={f1,f2,…,f m}

[0038] These self-facts serve as anchors aligned with the context while preserving logical constraints. By decoupling the model’s “what to know” and “how to organize knowledge,” the framework supports differentiated error diagnosis and targeted correction points.

[0039] It should be noted that in order to identify conflicts between the model's stored knowledge and the received contextual information, it is necessary to clearly represent the large language model's internal understanding of the current problem. This requires not only capturing the factual content mastered by the model, but also revealing the logical structure by which these facts are organized. Therefore, through the self-knowledge extraction module, the large language model is prompted to identify the abstract concepts and factual premises required to answer questions, and a set of abstract high-level knowledge is extracted; the self-context generation module transforms abstract self-knowledge into concrete narratives, providing a logically consistent context for subsequent fact extraction; the self-fact extraction module extracts specific factual assertions from the self-context as the basis for alignment with the retrieved context; through a hierarchical three-stage process (self-knowledge extraction, self-context generation, and self-fact extraction), the parameterized knowledge of the large language model is externalized into a fine-grained fact-level representation, providing a clear knowledge foundation for subsequent conflict identification and reconciliation.

[0040] S105 , obtaining the original context related to the question retrieved from the external knowledge source, and dividing the original context into text blocks according to a preset block size to obtain a text block set.

[0041] That is to say, a block size is preset, and the text blocks of the context are segmented according to the block size, thereby segmenting the complete context into text blocks of fixed length.

[0042] It should be noted that the original context usually refers to a longer textual information related to the user's query retrieved from an external knowledge source in the Retrieval-Augmented Generation (RAG) task. This textual information may contain multiple facts, descriptions, or explanations, and is intended to provide additional background information and knowledge to the generative model, helping to generate more accurate and richer answers.

[0043] S106 , embedding the fact assertion set and the text block set into a shared semantic space, and calculating semantic similarity using cosine similarity, so as to use the text block set with high semantic similarity as the aligned context block set.

[0044] That is, the set of text blocks after input segmentation and the set of fact assertions F decomposed by the previous fact decomposer are self (C self), use the embedding model to embed it into the shared semantic space, use cosine similarity to calculate the semantic similarity, traverse the text blocks, and select the top k context blocks that are highly semantically aligned with the fact assertion to obtain the aligned context block set.

[0045] It should be noted that in order to resolve knowledge conflicts while maintaining logical consistency, the model's fact assertions and the retrieved text blocks are aligned through a structured and explainable process. Specifically, the alignment process is as follows:

[0046] The original context C orig Divide into a set of blocks Smaller chunks allow for fine-grained comparisons with factual assertions, reducing the noise of irrelevant text fragments. Formally:

[0047]

[0048] First, the self-fact f is extracted from the large language model parameter knowledge i and the blocks C divided in the context j Embed them into a shared semantic space, and then use cosine similarity to measure the semantic distance between them:

[0049] Sim(f i , C j )=cos(f i , C j )

[0050] Then, block C is selected based on the similarity score aligend , where C aligend Represents blocks that are highly semantically aligned with self-facts extracted from the large language model parameter knowledge.

[0051] To this end, the original context is segmented into multiple small chunks for fine-grained comparison with the self-fact. Using similarity matching techniques, the self-fact and context chunks are embedded in a shared semantic space, and their semantic distance is calculated using cosine similarity, allowing selection of context chunks that are highly semantically aligned with the self-fact. This fine-grained alignment of context chunks with the self-fact allows precise identification of contextual information that conflicts with the model's parameterized knowledge, providing an accurate basis for subsequent conflict resolution.

[0052] S107 , generating an answer corresponding to the question input by the user according to the aligned context block set and the original context.

[0053] As an embodiment, generating an answer corresponding to the question input by the user based on the aligned context block set and the original context includes: comparing and merging the aligned context block set and the relevant information generated by the original context to generate the answer corresponding to the question input by the user.

[0054] Specifically, the aligned context block set and the relevant information generated by the original context are compared and merged to generate an answer corresponding to the question input by the user, including: generating an initial answer based on the aligned context block set; evaluating whether the initial answer is complete and reliable; if the initial answer is incomplete or unreliable, integrating relevant elements from the original context to generate a fused context; and generating a final answer corresponding to the question input by the user based on the fused context.

[0055] That is, the context block C aligned and the original context C orig The generative model is input and generates an initial answer through a predefined thought chain format. It then evaluates the reliability of the initial answer, checks whether the answer is complete and logically consistent, and finally regenerates the final answer through a step-by-step reasoning process.

[0056] It should be noted that in order to resolve knowledge conflicts while ensuring context fidelity, a self-thinking module is used to dynamically integrate insights from two sources: (1) self-aligned context block C aligned (Context fragments that conflict or align with parameter knowledge); (2) Original context C orig This iterative process ensures that the model critically assesses discrepancies, mitigates overconfidence, and transparently integrates evidence. This process is formalized as the cognitive function R STR , generates an answer by comparing and merging relevant information from two contexts:

[0057] Answer = R STR (C aligned , C orig )

[0058] Specifically, the process is divided into two parts: thinking and reasoning. In the thinking stage, the large language model first starts from C aligned Generate an initial answer, then evaluate the reliability of that answer and determine C aligned Is sufficient information provided? If the answer is unreliable or incomplete, the model selectively selects orig Integrate relevant elements to enrich the alignment context and generate the fusion context C fused , defined as:

[0059] C fused =G2(C aligned , C orig )

[0060] Among them, G2 represents the context fusion function. In the reasoning module, the final answer is obtained from C fused Regenerate, ensuring that the answer is both coherent and well-supported by evidence.

[0061] Therefore, a self-reflection module is designed to enable large language models to dynamically synthesize self-aligned context (context blocks aligned with self-facts) and original context before generating a response, resolving knowledge conflicts through an iterative reasoning process. In the self-reflection module, a thinking phase and a reasoning phase are introduced. In the thinking phase, the model first generates an initial answer based on the self-aligned context and evaluates its reliability. If the initial answer is unreliable or incomplete, relevant elements are selected from the original context and fused to generate a fused context. In the reasoning phase, the model regenerates the final answer based on the fused context, ensuring that the answer is both coherent and well-supported by evidence. The self-reflection module enables the model to dynamically reconcile the differences between parameterized knowledge and contextual evidence, avoiding the forced suppression of knowledge in existing methods, thereby improving the accuracy and logical consistency of knowledge while maintaining the fidelity of the model output.

[0062] It should be noted that, in specific use, the following functional components can be freely replaced. Among them, the fact decomposer model can choose a pre-trained atomic sentence decomposer model, or can choose to decompose through instruction prompts; the context chunking method can choose a fixed-size chunking strategy, or can use semantic chunking, recursive chunking and other strategies; the sentence embedding model can be freely replaced with the sentence embedding model to achieve semantic embedding of the sentence; the generation model can be replaced with any open source or closed source model. This method does not depend on the specific size and model of the base model and can be freely used as a plug-in.

[0063] As a specific embodiment, Figure 2 As shown, assuming the user input question is "Which country is Normandy located in?", the abstract concepts include geographic location, which refers to a region's specific location on the Earth. Administrative divisions, which refer to the country or administrative region to which a region belongs. Historical context, which may affect a region's current affiliation. Factual premises include: Normandy is a region of France. Historically, Normandy was an independent duchy but is now part of France. Normandy is located in northwest France. Based on the abstract concepts and factual premises, a set of high-level knowledge is derived from abstract assertions: Geographic location is crucial for determining the country to which a region belongs. Changes in administrative divisions may affect the geographical location's affiliation. Historical context provides information on the evolution of a region's affiliation.

[0064] Generate a coherent context: Normandy is a region in northwestern France that was historically an independent duchy but is now part of France. Normandy is best known for the D-Day landings during World War II, a crucial turning point for the Allied forces in Europe.

[0065] Facts are extracted and decomposed from the context to obtain a set of factual assertions: Factual assertion 1: Normandy is located in northwestern France. Factual assertion 2: Normandy is a region of France. Factual assertion 3: Normandy was historically an independent duchy. Factual assertion 4: Normandy is famous for the Normandy Landings during World War II.

[0066] The answer to the user's input question is generated based on the aligned set of context chunks and the original context. Assume that the retrieved original context contains information that may conflict with the model's knowledge, for example, "Normandy is located in northwest Spain." Through contextual knowledge alignment, the model identifies context chunks that are highly semantically aligned with self-facts (i.e., facts known to the model), such as "Normandy is located in northwest France." Combining these aligned context chunks with the original context, the model uses its self-reflection module to reason and integrate the conflicting facts. The resulting answer is: Normandy is located in France.

[0067] In summary, according to the context-faithful retrieval enhancement generation method of an embodiment of the present invention, first, a question input by the user is obtained; then, the abstract concepts and factual premises required to answer the question are extracted based on the question to obtain a set of abstract high-level knowledge; then, a coherent context is generated based on the question and the high-level knowledge, and facts are extracted and decomposed from the context to obtain a set of fact assertions; then, the original context related to the question retrieved from an external knowledge source is obtained, and the original context is segmented into text blocks according to a preset block size to obtain a set of text blocks; then, the set of fact assertions and the set of text blocks are embedded in a shared semantic space, and the semantic similarity is calculated using cosine similarity to use the text block sets with high semantic similarity as the aligned context block sets; finally, the answer corresponding to the question input by the user is generated based on the aligned context block sets and the original context; thereby, the parameterized knowledge of the model can be extracted and converted into a fine-grained fact representation, the conflict between the retrieved context and the self-facts can be identified, and the conflict can be reconciled to generate a final response, thereby improving the question-answering effect.

[0068] In addition, the present invention also proposes a computer-readable storage medium on which a context-faithful retrieval enhancement generation program is stored. When the context-faithful retrieval enhancement generation program is executed by a processor, the context-faithful retrieval enhancement generation method as described above is implemented.

[0069] In addition, an embodiment of the present invention also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned context-faithful retrieval enhancement generation method is implemented.

[0070] Figure 3FIG. 1 is a block diagram of a context-faithful retrieval enhancement generation device according to an embodiment of the present invention. Figure 3 As shown, the retrieval enhancement generation device includes: an acquisition module 10, a self-knowledge extraction module 20, a self-context generation module 30, a self-fact extraction module 40, a context segmentation module 50, a similarity matching module 60 and a self-thinking generation module 70;

[0071] Among them, the acquisition module 10 is used to obtain the question input by the user; the self-knowledge extraction module 20 is used to extract the abstract concepts and factual premises required to answer the question based on the question to obtain a set of abstract high-level knowledge; the self-context generation module 30 is used to generate a coherent context based on the question and high-level knowledge; the self-fact extraction module 40 is used to extract and decompose facts from the context to obtain a set of fact assertions; the context segmentation module 50 is used to obtain the original context related to the question retrieved from an external knowledge source, and divide the original context into text blocks according to a preset block size to obtain a text block set; the similarity matching module 60 is used to embed the fact assertion set and the text block set into a shared semantic space, and use cosine similarity to calculate the semantic similarity, so as to use the text block set with high semantic similarity as the aligned context block set; the self-thinking generation module 70 is used to generate the answer corresponding to the question input by the user based on the aligned context block set and the original context.

[0072] As an embodiment, the self-thinking generation module 70 is further configured to compare and merge the aligned context block set and the related information generated from the original context to generate an answer corresponding to the question input by the user.

[0073] As an embodiment, the self-thinking generation module 70 is also used to generate an initial answer based on the aligned context block set; evaluate whether the initial answer is complete and reliable; if the initial answer is incomplete or unreliable, integrate relevant elements from the original context to generate a fused context; and generate a final answer corresponding to the question input by the user based on the fused context.

[0074] It should be noted that the explanation of the embodiment of the context-faithful retrieval enhancement generation method described above is also applicable to the context-faithful retrieval enhancement generation device of this embodiment, and will not be repeated here.

[0075] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0076] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0077] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0079] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third etc. does not indicate any order. These words may be interpreted as names.

[0080] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0081] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

[0082] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0083] In the present invention, unless otherwise expressly specified or limited, terms such as "mounted," "connected," "connect," and "fixed" should be understood broadly. For example, they may refer to fixed or detachable connections, or integration; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0084] In the present invention, unless otherwise expressly specified or limited, when a first feature is "above" or "below" a second feature, it may mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediary. Furthermore, when a first feature is "above," "above," or "above" a second feature, it may mean that the first feature is directly above or diagonally above the second feature, or simply means that the first feature is at a higher level than the second feature. When a first feature is "below," "below," or "below" a second feature, it may mean that the first feature is directly below or diagonally below the second feature, or simply means that the first feature is at a lower level than the second feature.

[0085] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0086] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A context-faithful retrieval enhancement generation method, characterized in that: The following steps are involved: Questions to get user input; Extracting abstract concepts and factual premises required to answer the question based on the question to obtain a set of abstract high-level knowledge; generating a coherent context based on the problem and the high-level knowledge; Extracting and decomposing facts from the context to obtain a set of fact assertions; Obtaining original context related to the problem retrieved from an external knowledge source, and dividing the original context into text blocks according to a preset block size to obtain a text block set; Embedding the fact assertion set and the text block set into a shared semantic space, and calculating semantic similarity using cosine similarity, so as to use the text block set with high semantic similarity as the aligned context block set; An answer corresponding to the question input by the user is generated according to the aligned context block set and the original context.

2. The context-faithful retrieval enhancement generation method according to claim 1, characterized in that: Generating an answer corresponding to the question input by the user according to the aligned context block set and the original context, including: comparing and merging the aligned context block set and related information generated by the original context to generate an answer corresponding to the question input by the user.

3. The context-faithful retrieval enhancement generation method according to claim 2, characterized in that: Comparing and merging the aligned context block set and the relevant information generated by the original context to generate an answer corresponding to the question input by the user, including: generating an initial answer based on the aligned set of context blocks; Assess whether the initial answers are complete and reliable; If the initial answer is incomplete or unreliable, integrating relevant elements from the original context to generate a fused context; A final answer corresponding to the question input by the user is generated according to the fusion context.

4. A computer-readable storage medium, characterized in that A context-faithful retrieval enhancement generation program is stored thereon, and when the context-faithful retrieval enhancement generation program is executed by a processor, the context-faithful retrieval enhancement generation method according to any one of claims 1 to 3 is implemented.

5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the context-faithful retrieval enhancement generation method according to any one of claims 1 to 3 is implemented.

6. A context-faithful retrieval enhancement generation device, characterized in that: include: The acquisition module is used to obtain questions input by users; A self-knowledge extraction module is used to extract abstract concepts and factual premises required to answer the question based on the question, so as to obtain a set of abstract high-level knowledge; a self-context generation module for generating a coherent context based on the question and the high-level knowledge; A self-fact extraction module, configured to extract and decompose facts from the context to obtain a set of fact assertions; A context segmentation module is configured to obtain original context related to the question retrieved from an external knowledge source and segment the original context into text blocks according to a preset block size to obtain a set of text blocks; A similarity matching module is used to embed the fact assertion set and the text block set into a shared semantic space, and calculate the semantic similarity using cosine similarity to use the text block set with high semantic similarity as the aligned context block set; A self-thinking generation module is used to generate an answer corresponding to the question input by the user according to the aligned context block set and the original context.

7. The context-faithful search enhancement generation device according to claim 6, characterized in that: The self-thinking generation module is further configured to compare and merge the aligned context block set and the related information generated from the original context to generate an answer corresponding to the question input by the user.

8. The context-faithful search enhancement generation device according to claim 7, characterized in that: The self-thinking generation module is also used to generate an initial answer based on the aligned context block set; evaluate whether the initial answer is complete and reliable; if the initial answer is incomplete or unreliable, integrate relevant elements from the original context to generate a fused context; and generate a final answer corresponding to the question input by the user based on the fused context.