A question and answer method based on a knowledge graph and self-reflection

By constructing a dual-track knowledge graph and a self-reflection mechanism, the problems of persona constraints and error correction in digital human interaction systems are solved, and conflict resolution of user input and multi-dimensional verification of generated content are achieved, thereby improving the security and professionalism of the interaction.

CN122489716APending Publication Date: 2026-07-31CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2026-05-14
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies lack stable persona constraint mechanisms in digital human interaction systems, which can easily lead to illusions of fact in vertical domains and lack multi-dimensional error correction mechanisms, resulting in the output of incorrect information and insufficient resolution of conflicts in user input.

Method used

A dual-track knowledge graph is constructed, including a persona knowledge graph and a domain knowledge graph, to identify the intent of user input and detect conflicts. Answer data is generated through multi-dimensional verification and iterative optimization, and a self-reflection mechanism is used for multi-dimensional verification and self-correction.

Benefits of technology

It improves the security and compliance of digital human interaction, prevents character deviation and erroneous information output, and enhances the professionalism and credibility of content generation in vertical fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489716A_ABST
    Figure CN122489716A_ABST
Patent Text Reader

Abstract

A question-answering method based on knowledge graphs and self-reflection is disclosed. The method includes: acquiring user input data; performing intent recognition and conflict detection on the user input data; correcting the user input data based on the conflict detection results; retrieving matching persona constraint nodes and factual knowledge nodes from a dual-track knowledge graph based on the corrected data; inputting the persona constraint nodes, factual knowledge nodes, and corrected data into a large model to obtain initial answer data; performing multi-dimensional verification on the initial answer data using an evaluation model; if the verification fails, generating a corresponding error feedback instruction and inputting the error feedback instruction as a prompt word into the large model to generate new answer data, and re-performing multi-dimensional verification until the generated answer data passes all dimensions; if the verification still fails after reaching a preset maximum number of iterations, outputting a preset safety fallback statement as the final answer data. This invention, through pre-emptive input conflict resolution and a post-emptive multi-round self-reflection mechanism, enables the system to defend against misleading information and to self-correct generated content, breaking the limitations of traditional one-way generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and artificial intelligence, specifically to a question-answering method based on knowledge graphs and self-reflection. Background Technology

[0002] With the development of artificial intelligence technology, Large Language Models (LLMs) have been widely applied in interactive systems for digital humans and virtual anchors. However, based on the latest research literature in the field of natural language processing in recent years, existing technologies still have the following technical shortcomings in practical applications:

[0003] 1. Lack of stable character constraint mechanisms. Large language models are prone to deviating from preset system prompts when handling multi-turn long text interactions or facing adversarial prompts. Existing role-playing or virtual human generation technologies rely heavily on surface-level prompt engineering, making it difficult to fundamentally prevent the model from outputting personality traits, background identities, or even topics involving sensitive or taboo areas, lacking fine-grained, structured character knowledge constraints. 2. Prone to vertical domain-specific hallucinations, and existing self-reflection mechanisms lack external hard constraints. As Zhang et al. pointed out in their research on LLM hallucination mechanisms (LLM Hallucinations in Practical Code Generation, ISSTA 2025), due to the limitations and lag in updating the parameter knowledge of large models, factual knowledge conflicts are highly likely to occur. To alleviate this problem, Ji et al. proposed an iterative method based on model self-reflection in their paper (Towards Mitigating Hallucination in Large Language Models via Self-Reflection, EMNLP 2023). However, this existing technique mainly relies on the parameterized knowledge inside the model for reflection, lacking the hard constraints of external strong rules and structured knowledge (such as domain knowledge graphs). When generating content in vertical fields such as medical science popularization, finance, and e-commerce, simple internal self-reflection is still prone to outputting erroneous information that does not conform to objective facts, leading to serious misleading consequences. 3. Lack of pre-emptive resolution and multi-dimensional closed-loop error correction mechanisms for "input conflicts". Wu et al. clearly pointed out in their paper (Combating Multimodal LLMHallucination via Bottom-Up Holistic Reasoning, AAAI 2025) that user input itself may contain fallacies or conflicting premises, which can seriously mislead the model and trigger cascading illusions. However, most existing digital human generation systems adopt a one-way "input-generation-output" architecture. They neither resolve potential logical fallacies in user input (such as malicious leading questions or incorrect premises) upfront, nor do they employ a dual-track post-validation approach that combines "persona" with "facts." When the model is misled by incorrect input premises or generates erroneous content, it cannot perform internal interception or multi-dimensional self-correction, leading to a cascading amplification of errors. Summary of the Invention

[0004] To address the problems existing in the prior art, this invention proposes a question-answering method based on knowledge graphs and self-reflection. This method includes: constructing a dual-track knowledge graph; acquiring user input data, performing intent recognition and conflict detection on the user input data, and correcting the user input data based on the conflict detection results; retrieving matching persona constraint nodes and factual knowledge nodes from the dual-track knowledge graph based on the corrected data; inputting the persona constraint nodes, factual knowledge nodes, and corrected data into a large model to obtain initial answer data; performing multi-dimensional validation on the initial answer data using an evaluation model; if the validation fails, generating a corresponding error feedback instruction and inputting the error feedback instruction as a prompt word into the large model to generate new answer data, and re-performing multi-dimensional validation until the generated answer data passes all dimensions of validation; if the validation still fails after reaching a preset maximum number of iterations, outputting a preset safety fallback statement as the final answer data.

[0005] The beneficial effects of this invention are:

[0006] This invention constructs an independent persona knowledge graph and introduces a persona consistency verification loop, fundamentally preventing persona deviation and prohibited topic output in complex dialogue scenarios, thus improving the security and compliance of digital human interaction. Combining domain knowledge graphs with fine-grained factual accuracy verification, this invention effectively intercepts and corrects false or erroneous information generated by large models, enhancing the professionalism and credibility of vertical domain content generation. Through pre-input conflict resolution and a post-input multi-round self-reflection mechanism, this invention enables the system to defend against misleading information and self-correct generated content, breaking the limitations of traditional one-way generation. Attached Figure Description

[0007] Figure 1 This is a schematic diagram of the overall process of the present invention;

[0008] Figure 2 This is a schematic diagram of the logical structure of the multi-dimensional self-reflection verification module of the present invention. Detailed Implementation

[0009] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0010] A question-answering method based on knowledge graphs and self-reflection, such as Figure 1As shown, the method includes: constructing a dual-track knowledge graph; acquiring user input data, performing intent recognition and conflict detection on the user input data, and correcting the user input data based on the conflict detection results; retrieving matching persona constraint nodes and fact knowledge nodes from the dual-track knowledge graph based on the corrected data; inputting the persona constraint nodes, fact knowledge nodes, and corrected data into a large model to obtain initial answer data; performing multi-dimensional verification on the initial answer data using an evaluation model; if the verification fails, generating a corresponding error feedback instruction and inputting the error feedback instruction as a prompt word into the large model to generate new answer data, and re-performing multi-dimensional verification until the generated answer data passes all dimensions of verification; if the verification still fails after reaching a preset maximum number of iterations, outputting a preset safety fallback statement as the final answer data.

[0011] In this embodiment, a method for preventing hallucinations based on knowledge graphs and self-reflection in digital personas is provided, including the following steps:

[0012] Step 1, construct a dual-track knowledge graph: construct a Persona Knowledge Graph (PKG) to represent the attributes of the digital human, and a Domain Knowledge Graph (DKG) to represent the objective facts of the vertical domain; the PKG includes identity background nodes, personality trait nodes, and taboo topic nodes;

[0013] Step 2, User Input Parsing and Conflict Resolution: Obtain user input data, perform intent recognition and input conflict detection; if the user input data contains conflicting premises that contradict objective facts or preset logic, then the user input data is corrected or marked to generate processed input data; if no conflicting premises are detected, then the user input data is directly used as the processed input data.

[0014] In this embodiment, intent recognition of user input data includes: segmenting, denoising, entity recognition, and keyword extraction of user input data; encoding the input semantics using a pre-trained language model or a large language model; identifying the intent category, entity slot, and confidence level corresponding to the user input; and using the intent category, entity slot, and confidence level as input for subsequent conflict detection and knowledge graph retrieval.

[0015] Conflict detection of user input data includes: if a conflicting premise is detected in the user input data that contradicts objective facts or preset logic, the user input data is corrected or marked to generate processed input data; if no conflicting premise is detected, the user input data is directly used as the processed input data.

[0016] The preset logic includes factual consistency logic, persona constraint logic, contextual consistency logic, business rule logic, and security compliance logic. Among them, the factual consistency logic is used to determine whether the user input conflicts with the factual knowledge in the domain knowledge graph; the persona constraint logic is used to determine whether the user input induces the digital human to violate the identity, personality, or taboo topic settings; the contextual consistency logic is used to determine whether the user input contradicts the content of the historical dialogue; and the business rule logic and security compliance logic are used to determine whether the input triggers preset industry rules or risk restrictions.

[0017] Correcting user input data includes: determining the conflict type based on conflict detection results; if it is a factual conflict, replacing or clarifying the erroneous premise by calling fact nodes in the domain knowledge graph; if it is a persona conflict or a security compliance conflict, deleting, blocking, or marking misleading content and generating corresponding prevention prompts; if it is a contextual conflict, rewriting the input based on historical dialogue content; and finally generating processed input data that retains the user's core intent and eliminates conflicting premises.

[0018] Step 3, Knowledge Retrieval and Initial Content Generation: Based on the processed input data, retrieve matching persona constraint nodes and factual knowledge nodes from the PKG and DKG respectively; merge the processed input data, persona constraint nodes, and factual knowledge nodes into structured prompt words, input them into the large language model, and generate initial answer data;

[0019] In this embodiment, retrieving matching persona constraint nodes and factual knowledge nodes from the dual-track knowledge graph includes: performing entity matching, relational path matching, and vector similarity retrieval in the persona knowledge graph and the domain knowledge graph respectively, based on the intent tags, keywords, and entity slots in the processed input data; obtaining persona constraint nodes, taboo topic nodes, factual knowledge nodes, and their related relationships related to the current input; sorting them according to similarity, node weight, and conflict priority, selecting nodes that meet a preset threshold as the retrieval results, and constructing structured prompt words together with the processed input data.

[0020] Step 4, Multi-dimensional self-reflection verification: The initial version of the response data is verified in multiple dimensions using an evaluation model. The multi-dimensional verification includes at least: PKG-based persona consistency verification, DKG-based factual accuracy verification, and context-based logical verification.

[0021] In this embodiment, the initial response data of the evaluation model undergoes multi-dimensional verification, including: persona consistency verification, factual accuracy verification, and contextual logic verification. Persona consistency verification compares the initial response data with the identity background, personality traits, and taboo topic nodes in the persona knowledge graph. Factual accuracy verification compares the factual statements in the initial response data with fact nodes in the domain knowledge graph. Contextual logic verification determines whether the initial response data is consistent with the processed input data and historical dialogue content. Each verification dimension outputs a verification score and a pass / fail result. If any dimension fails to reach a preset threshold, the initial response data is deemed to have failed verification.

[0022] Step 5, Iterative Optimization and Output: If the initial version of the answer data fails any of the multi-dimensional validations, a corresponding error feedback instruction is generated based on the failed validation dimension. The error feedback instruction is input as a prompt word into the large language model to trigger a self-reflection mechanism to regenerate the answer data, and the process returns to Step 4 until the generated answer data passes all dimensions of validation. If the validation still fails after reaching the preset maximum number of iterations, a preset safety fallback statement is output as the final answer data.

[0023] In this embodiment, generating corresponding error feedback instructions includes: determining the error type based on the failed verification dimensions, extracting the corresponding conflict nodes, conflict content, and correction targets; generating feedback instructions containing the error cause, conflict basis, and modification requirements according to a preset feedback template; when there are multiple failed dimensions, merging them according to the priority of security compliance, persona consistency, factual accuracy, and contextual logic to generate an error feedback instruction set, and inputting the error feedback instruction set into the large language model to guide it to regenerate the response data.

[0024] This embodiment takes the interactive scenario of a digital human in the field of medical science popularization as an example.

[0025] A question-answering method based on knowledge graphs and self-reflection, specifically including:

[0026] Step 1, System Initialization and Knowledge Graph Construction: The system preloads a pre-built dual-track knowledge graph. The Persona Knowledge Graph (PKG) is configured as a rigorous medical science popularization AI, with taboo topic nodes including "prohibiting the provision of specific prescription drug recommendations"; the Domain Knowledge Graph (DKG) is configured to include the pathology, symptoms, and common-sense coping strategies for common diseases.

[0027] Step 2, Multimodal Input Parsing and Conflict Resolution: Acquiring User Comment Input Data. The system performs intent recognition based on pre-trained natural language understanding models (such as BERT) or large language model prompt word engineering, extracting the intent of the user comment input data.

[0028] Step 3, Knowledge Retrieval and Initial Content Generation: Based on the extracted intent, the system uses vector similarity calculation or graph entity matching algorithms to retrieve constraints from the PKG and fact nodes representing the user's intent in the DKG. The large language model then generates an initial version of the response data based on the retrieved information.

[0029] Step 4, Multi-dimensional self-reflection and verification: The evaluation model performs parallel verification on the initial response data.

[0030] The factual accuracy verification unit compares the data with the DKG, determines that it matches the facts, and the verification passes.

[0031] The character consistency verification unit compared the PKG and determined that a taboo topic node was triggered, thus failing the verification.

[0032] Step 5, Iterative Optimization and Output: Due to the failure of the persona consistency check, the system generates an error feedback instruction: "Warning: The current answer violates the persona setting of prohibiting the recommendation of specific prescription drugs. Please modify the answer to guide the user to seek medical treatment." This instruction is re-entered into the large language model as a prompt. The large language model triggers a self-reflection mechanism and generates a second version of the answer data: "There are many common causes of headaches, such as fatigue or colds. The probability of a brain tumor is very low, so please do not panic excessively. However, as a science popularization broadcaster, I cannot provide you with specific prescription drug advice. If the headache persists, it is recommended to go to a regular hospital for treatment in time."

[0033] The second version of the answer data was verified again in step 4. All dimensions passed, and the system output it as the final answer data to the digital human driving module for broadcast.

[0034] This embodiment uses a scenario where a digital human engaged in product promotion responds to leading questions as an example.

[0035] Step 1: Obtain user input data.

[0036] Step 2: The system performs input conflict detection and determines that the user input contains unverified and malicious presuppositions (e.g., the battery is prone to explosion). The system marks the input data, generates processed input data, and adds preventative instructions.

[0037] Step 3: The large language model generates an initial version of the answer based on the processed input data.

[0038] Steps 4-5: The answer data undergoes multi-dimensional self-reflection and verification. If both factual accuracy and consistency with the user's persona are met, the system directly outputs the answer. This process effectively prevents the large language model from creating factual illusions by conforming to the user's incorrect premises, or from causing violations of persona rules.

[0039] In this embodiment, Figure 1This is a flowchart illustrating the overall process of a digital human anti-illusion method based on dual-graph and self-reflection. The flowchart records the complete closed-loop process from acquiring live-stream audience input data, through input conflict detection and resolution, dual-track knowledge graph retrieval, construction of structured prompt words, generation of an initial version of live-stream script by a large language model, and verification by a multi-dimensional self-reflection verification module. Based on the verification results, iterative optimization or output of the final script is performed. This demonstrates that the present invention, through pre-input conflict resolution and post-multi-dimensional self-reflection verification mechanisms, combined with dual-track knowledge graphs, can effectively prevent the large language model from generating factual illusions and character deviations when generating digital human interactive content, ensuring the safety, compliance, and accuracy of the output content.

[0040] In this embodiment, after the broadcast script enters the multi-dimensional verification engine, it is verified in parallel by the persona consistency verification unit comparing it with the persona knowledge graph (PKG), the factual accuracy verification unit comparing it with the domain knowledge graph (DKG), and the contextual logic verification unit comparing it with the processed input data. If any verification fails, a correction instruction for the corresponding dimension (compliance / persona correction instruction, factual correction instruction, logic correction instruction) is generated. Finally, the verification results are summarized to determine whether to allow the output or output a set of error feedback instructions. This shows that the verification module of the present invention can perform fine-grained control over the generated content from three independent dimensions: compliance, factual accuracy, and logical coherence, and can generate targeted feedback instructions to guide the large model to perform accurate self-correction.

[0041] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A question-answering method based on knowledge graphs and self-reflection, characterized in that, include: Constructing a dual-track knowledge graph; Acquire user input data, perform intent recognition and conflict detection on the user input data, and correct the user input data based on the conflict detection results; Based on the corrected data, matching persona constraint nodes and factual knowledge nodes are retrieved from the dual-track knowledge graph. The persona constraint nodes, factual knowledge nodes, and corrected data are input into the large model to obtain initial response data. The initial response data is then evaluated using an evaluation model for multi-dimensional verification. If the verification fails, a corresponding error feedback instruction is generated and input as a prompt word into the large model to generate new response data. Multi-dimensional verification is then performed again until the generated response data passes all dimensions. If the verification still fails after reaching the preset maximum number of iterations, a preset safety fallback statement is output as the final response data.

2. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, The dual-track knowledge graph includes a persona knowledge graph and a domain knowledge graph; The character knowledge graph includes identity background nodes, personality trait nodes, and taboo topic nodes, which are used to represent the attributes of the digital human; the domain knowledge graph is used to represent objective facts in the vertical domain.

3. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, Intent recognition of user input data includes: segmenting, denoising, entity recognition, and keyword extraction of user input data; encoding the input semantics using a pre-trained language model or a large language model; identifying the intent category, entity slot, and confidence level corresponding to the user input; and using the intent category, entity slot, and confidence level as input for subsequent conflict detection and knowledge graph retrieval.

4. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, Conflict detection of user input data includes: if a conflicting premise is detected in the user input data that contradicts objective facts or preset logic, the user input data is corrected or marked to generate processed input data; if no conflicting premise is detected, the user input data is directly used as the processed input data.

5. The question-answering method based on knowledge graphs and self-reflection according to claim 4, characterized in that, The preset logic includes factual consistency logic, persona constraint logic, contextual consistency logic, business rule logic, and security compliance logic. Among them, the factual consistency logic is used to determine whether the user input conflicts with the factual knowledge in the domain knowledge graph; the persona constraint logic is used to determine whether the user input induces the digital human to violate the identity, personality, or taboo topic settings; the contextual consistency logic is used to determine whether the user input contradicts the content of the historical dialogue; and the business rule logic and security compliance logic are used to determine whether the input triggers preset industry rules or risk restrictions.

6. The question-answering method based on knowledge graphs and self-reflection according to claim 4, characterized in that, Correcting user input data includes: determining the conflict type based on conflict detection results; if it is a factual conflict, replacing or clarifying the erroneous premise by calling fact nodes in the domain knowledge graph; if it is a persona conflict or a security compliance conflict, deleting, blocking, or marking misleading content and generating corresponding prevention prompts; if it is a contextual conflict, rewriting the input based on historical dialogue content; and finally generating processed input data that retains the user's core intent and eliminates conflicting premises.

7. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, Retrieving matching persona constraint nodes and factual knowledge nodes from a dual-track knowledge graph involves: performing entity matching, relational path matching, and vector similarity retrieval in the persona knowledge graph and the domain knowledge graph respectively, based on intent tags, keywords, and entity slots in the processed input data; obtaining persona constraint nodes, taboo topic nodes, factual knowledge nodes, and their relationships related to the current input; sorting them according to similarity, node weight, and conflict priority, selecting nodes that meet preset thresholds as search results, and constructing structured prompt words together with the processed input data.

8. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, The initial response data is used for multi-dimensional validation, including: persona consistency validation, factual accuracy validation, and contextual logic validation. Persona consistency validation compares the initial response data with identity background, personality traits, and taboo topic nodes in the persona knowledge graph. Factual accuracy validation compares the factual statements in the initial response data with fact nodes in the domain knowledge graph. Contextual logic validation determines whether the initial response data is consistent with the processed input data and historical dialogue content. Each validation dimension outputs a validation score and a pass / fail result. If any dimension fails to reach a preset threshold, the initial response data is deemed to have failed validation.

9. The question-answering method based on knowledge graphs and self-reflection according to claim 1, characterized in that, The process of generating corresponding error feedback instructions includes: determining the error type based on the failed validation dimensions, extracting the corresponding conflict nodes, conflict content, and correction targets; generating feedback instructions containing the error cause, conflict basis, and modification requirements according to a preset feedback template; and when there are multiple failed dimensions, merging them into a set of error feedback instructions based on the priorities of security compliance, persona consistency, factual accuracy, and contextual logic, and inputting this set of error feedback instructions into the large language model to guide it to regenerate the response data.