Interaction method and system based on memory enhancement and knowledge trace
Patent Information
- Application Number
- CN202610818734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-09-29
AI Technical Summary
[0005]本发明提供一种基于记忆增强与知识追溯的交互方法及系统,用以解决现有技术中历史约束易丢失,且结论依据不可核验的问题
[0016]本发明提供的基于记忆增强与知识追溯的交互方法及系统,通过在交互过程中引入长期记忆集合,将用户偏好和历史约束与外部知识检索深度融合,有效解决了现有交互系统在多轮交互中易出现的历史约束丢失、跨轮次事实不一致的问题,保障了交互的连续性和稳定性,极大地提升了长期交互场景下的应答一致性与个性化适配能力;同时,通过将候选答案拆分为细粒度的答案单元,并构建答案单元与证据片段之间的片段级追溯关系来决策最终输出,使得交互系统应答不再停留于粗粒度引用,而是能够精准定位到支撑具体结论的细粒度来源,从而有效抑制了生成模型的无依据扩写风险,大幅提升了交互系统输出结果的可复查性、可核验性和责任追溯能力。
Smart Images

Figure CN122838643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of retrieval enhancement generation technology, and in particular to an interactive method and system based on memory enhancement and knowledge tracing. Background Technology
[0002] Retrieval-enhanced generation technology has become an important implementation route for current intelligent interactive systems. It compensates for the problems of lagging knowledge updates and unclear factual boundaries in the generation model by retrieving external knowledge bases.
[0003] However, most existing retrieval-enhanced generative systems organize retrieval around the current round's input, relying on vector similarity to select knowledge fragments, then concatenating them with the current question before handing them over to the generative model to complete the answer. In single-round question answering or short-term tasks, this approach can meet general information retrieval needs. However, in application scenarios involving multi-round interactions, long-term task collaboration, and continuous personalized services, this approach can lead to problems such as loss of historical constraints, response style drift, and inconsistencies in facts across rounds.
[0004] Furthermore, while existing interactive systems can attach document links, the search results only provide contextual support for the generative model. This coarse-grained basis cannot support users in verifying the specific evidence or historical records on which the output conclusions are based, and it is difficult to meet the requirements of interpretability of output conclusions in professional scenarios such as enterprise Q&A and R&D services. Summary of the Invention
[0005] This invention provides an interactive method and system based on memory enhancement and knowledge tracing to solve the problems of historical constraints being easily lost and the basis of conclusions being unverifiable in the prior art.
[0006] This invention provides an interactive method based on memory enhancement and knowledge tracing, comprising: Determine the current interaction problem, and from the long-term memory set generated by the previous round of interaction, determine the current round activated memory that matches the current interaction problem; Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain the set of valid evidence for the current round; A candidate answer set is generated based on the current round activated memory and the current round valid evidence set, and each candidate answer in the candidate answer set is divided into multiple answer units; For each candidate answer, a tracing relationship is constructed between each answer unit and the evidence fragments in the current round of valid evidence set, and based on the tracing relationship, the target answer corresponding to the current interactive question is determined from the candidate answer set.
[0007] According to an interactive method based on memory enhancement and knowledge tracing provided by the present invention, the step of constructing a tracing relationship between each answer unit and the evidence fragments in the current round of valid evidence set includes: Based on the current interaction question, the current round activated memory, and the evidence fragments in the current round's valid evidence set, multiple nodes are constructed; the nodes include question nodes, memory nodes, and evidence nodes. Based on each node, and the semantic relationships, factual support relationships, and temporal consistency relationships between the nodes, a pre-generation tracing graph is constructed. Based on the answer units and the pre-generation traceability graph, determine the post-generation traceability graph; Based on the generated traceability graph, the attribution probability of each answer unit for the evidence fragments in the current round of valid evidence set is determined, and based on the attribution probability, the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set is constructed.
[0008] According to an interactive method based on memory enhancement and knowledge tracing provided by the present invention, the method further includes, after constructing and generating a pre-tracing graph: Based on the current set of valid evidence, the current interaction question, and the pre-generation traceability graph, an uncertainty score is determined; If the uncertainty score is greater than the clarification threshold, a target clarification slot is selected from a preset set of candidate clarification slots; the target clarification slot is determined based on the expected information gain of each candidate clarification slot in the set of candidate clarification slots for reducing the uncertainty score. Based on the target clarification slot, generate clarification questions; Obtain supplementary input based on the feedback from the clarification question, and update the current interaction question and the current round activation memory based on the supplementary input.
[0009] According to an interaction method based on memory enhancement and knowledge tracing provided by the present invention, the step of determining an uncertainty score based on the current round's valid evidence set, the current interaction question, and the pre-generation tracing graph includes: Determine the degree of evidence scarcity in the current round of valid evidence set, and the degree of evidence conflict among the evidence fragments in the current round of valid evidence set; Determine the ambiguity of the current interaction question, and the constraint missingness of key constraints in the current round activation memory or the business context corresponding to the current interaction question; Based on the support status between the problem nodes, memory nodes, and evidence nodes in the pre-generation traceability graph, the pre-traceability sufficiency is determined. The uncertainty score is determined based on the degree of evidence scarcity, the degree of evidence conflict, the degree of constraint absence, the degree of problem ambiguity, and the degree of pre-tracing sufficiency.
[0010] According to an interaction method based on memory enhancement and knowledge tracing provided by the present invention, determining the target answer corresponding to the current interaction question from the candidate answer set based on the tracing relationship includes: Based on the tracing relationship, the tracing coverage of each candidate answer is determined, and based on the attribution probability and the tracing coverage, the tracing support score of each candidate answer is determined. Determine the risk penalty score for each candidate answer, and the generation probability score for each candidate answer under the preset generation model; The target answer is determined from the candidate answers based on the risk penalty score, the generation probability score, and the traceability support score. The risk penalty score is determined based on the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty of each answer unit; the expansion conflict penalty, the evidence conflict penalty, the timeliness conflict penalty, and the memory conflict penalty are determined based on the current round activated memory and the current round valid evidence set.
[0011] According to an interaction method based on memory enhancement and knowledge tracing provided by the present invention, the step of performing knowledge retrieval based on the current interaction question and the current round activated memory to obtain a set of valid evidence for the current round includes: Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain multiple candidate evidence fragments; Based on the memory consistency score between each candidate evidence fragment and the currently activated memory, the comprehensive retrieval score of each candidate evidence fragment is determined; Based on the comprehensive retrieval score and the conflict score between each candidate evidence fragment and other candidate evidence fragments, the reordering score of each candidate evidence fragment is determined. Based on the reordering score, the set of valid evidence for the current round is determined from each candidate evidence fragment.
[0012] According to an interaction method based on memory enhancement and knowledge tracing provided by the present invention, the step of determining the target answer corresponding to the current interaction question from the candidate answer set based on the tracing relationship further includes: Obtain interactive feedback for the target answer, and add the corresponding information to be written to the long-term memory set according to the interactive feedback; Based on the interactive feedback, the memory reliability of the long-term memory set is updated, and the next round of interaction is carried out based on the updated long-term memory set; The process of obtaining interactive feedback for the target answer further includes: Based on the interactive feedback, a positive sample evidence set and a negative sample evidence set are constructed, and the feedback loss is determined based on the positive sample evidence set and the negative sample evidence set; Based on the feedback loss, the weight parameters in the knowledge retrieval process are dynamically updated.
[0013] This invention also provides an interactive system based on memory enhancement and knowledge tracing, comprising: The determining unit is used to determine the current interaction problem and determine the current round activated memory that matches the current interaction problem from the long-term memory set generated in the previous round of interaction; The retrieval unit is used to perform knowledge retrieval based on the current interaction question and the current round activated memory to obtain the set of valid evidence for the current round; The generation unit is used to generate a candidate answer set based on the current round activated memory and the current round valid evidence set, and to divide each candidate answer in the candidate answer set into multiple answer units; The filtering unit is used to construct a traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set for each candidate answer, and to determine the target answer corresponding to the current interactive question from the candidate answer set based on the traceability relationship.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the interaction method based on memory enhancement and knowledge tracing as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the interactive method based on memory enhancement and knowledge tracing as described above.
[0016] The interactive method and system based on memory enhancement and knowledge tracing provided by this invention introduces a long-term memory set into the interaction process, deeply integrating user preferences and historical constraints with external knowledge retrieval. This effectively solves the problems of historical constraint loss and cross-round factual inconsistency that easily occur in existing interactive systems during multi-round interactions, ensuring the continuity and stability of the interaction and greatly improving the consistency of responses and personalized adaptation capabilities in long-term interaction scenarios. At the same time, by splitting candidate answers into fine-grained answer units and constructing fragment-level tracing relationships between answer units and evidence fragments to determine the final output, the interactive system's response no longer stops at coarse-grained citations, but can accurately locate the fine-grained sources supporting specific conclusions. This effectively suppresses the risk of unfounded expansion of the generative model and significantly improves the reproducibility, verifiability, and accountability of the interactive system's output results. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the interactive method based on memory enhancement and knowledge tracing provided by the present invention. Figure 2 This is the overall architecture diagram of the interactive method based on memory enhancement and knowledge tracing provided by the present invention; Figure 3 This is a schematic diagram of the structure of the interactive system based on memory enhancement and knowledge tracing provided by the present invention; Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0020] With the continued application of large language models in scenarios such as question answering, office assistance, operation and maintenance support, and industry consulting, Retrieval-augmented Generation (RAG) technology has become an important implementation route for current interactive systems. These systems typically first receive user input, then retrieve relevant information from an external knowledge base, and finally generate an answer based on the search results. This approach can, to some extent, compensate for the problems of lagging knowledge updates and unclear factual boundaries in pure generative models. Therefore, it has high application value in scenarios that require combining proprietary knowledge to generate responses.
[0021] Most existing retrieval augmentation (RAG) systems organize the retrieval process around the current round's input, primarily relying on vector similarity to select knowledge fragments from external corpora. These fragments are then concatenated with the current question before being fed into a generative model to complete the answer. In single-round question answering or short-term tasks, this approach can meet general information retrieval needs. However, in application scenarios involving multi-round interactions, long-term task collaboration, and continuous personalized services, in addition to utilizing external knowledge, it is also necessary to stably access long-term information such as user constraints, historical decisions, preference settings, error correction records, and task context. Existing RAG systems mostly only concatenate historical conversations as short-term context, lacking sustainably updated structured memory units. This makes it difficult to stably preserve user preferences, business facts, and task states, leading to problems such as lost historical constraints, drifting response styles, and inconsistencies in facts across rounds during multi-round interactions.
[0022] Furthermore, in practical deployments, interactive systems must not only provide answers but also the sources of evidence and reasoning behind those answers. This is especially crucial in scenarios such as enterprise knowledge quizzes, government services, R&D support, and professional consulting. Users often need to know exactly which document or historical record corresponds to a particular conclusion for verification, accountability, and subsequent modifications. However, existing interactive systems primarily provide contextual support for generative models, lacking a fine-grained knowledge traceability mechanism for interpretability. While existing systems can append document links or coarse-grained citations to the answers, they mostly only provide document-level or page-level sources, making it difficult to link specific statements in the answer to fine-grained fragments. This makes it difficult for users to verify the system's source of evidence and fails to meet the knowledge traceability requirements of interpretable interactive systems.
[0023] To address this, the present invention provides an interaction method based on memory enhancement and knowledge tracing, which aims to improve the consistency of responses in continuous interaction scenarios and enable the system output results to have verifiable, locatable, and reviewable explanatory capabilities. This effectively overcomes the current problems of easy failure of historical constraints and low accuracy of source tracing.
[0024] Figure 1 This is a flowchart illustrating the interactive method based on memory enhancement and knowledge tracing provided by the present invention. This method can be applied to interactive systems or corresponding electronic devices. Figure 1 As shown, the method includes: Step 110: Determine the current interaction problem, and from the long-term memory set generated in the previous round of interaction, determine the current round activated memory that matches the current interaction problem; Step 120: Based on the current interaction question and the current round of activated memories, perform knowledge retrieval to obtain the set of valid evidence for the current round; Step 130: Generate a candidate answer set based on the current round's activated memories and the current round's valid evidence set, and divide each candidate answer in the candidate answer set into multiple answer units; Step 140: For each candidate answer, construct a traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set, and based on the traceability relationship, determine the target answer corresponding to the current interactive question from the candidate answer set.
[0025] Specifically, in actual multi-round human-computer interaction, the first step is to determine the user input, i.e., the user's interaction question in the current round, or the current interaction question. This question is typically a natural language question, a task instruction, or an information query request. After determining the current interaction question, the interaction system does not process it independently, but rather places it within a decision-making process that incorporates long-term memory states, thereby constructing the current round's interaction state.
[0026] Here, the current round of interaction state Specifically, it can be expressed as: in, Indicates the current interaction problem. This represents a summary of the conversation history up to the current round. This represents the business context of the current round provided by the business system or task process. This represents the set of long-term memories generated from the previous round of interaction. This refers to the set of valid evidence that was confirmed or used in the previous round. This indicates the feedback from the previous round of interaction.
[0027] Within this state framework, when an interactive system enters the current round of interaction, it not only possesses the current interaction question but also the long-term memory set generated from the previous round of interaction. This long-term memory set is a structured data unit that is continuously accumulated by the interactive system during ongoing interactions, encompassing information such as user preferences, confirmed facts, error correction records, and task constraints.
[0028] In order to access the vast collection of long-term memories In order to accurately locate the background constraints required at present, in this embodiment of the invention, each long-term memory item in the long-term memory set can be used. Represented as ,in For memory keys, For memory value, For source identification, Indicates the time when the memory is written. This indicates the reliability of the memory entry. Indicates memory type, Conflict markers are used to indicate whether a memory item is inconsistent with interactive feedback, evidence fragments, or other memory items. Memory types include at least user preferences, confirmed facts, task constraints, historical decisions, and error correction records; conflict markers are used to identify whether the memory item is inconsistent with interactive feedback, evidence fragments, or other memory items.
[0029] Based on this data structure, in this embodiment of the invention, the matching degree between each long-term memory item and the current interactive question, i.e. the memory activation score, can be calculated to determine the current round activated memory that matches the current interactive question.
[0030] Here, memory activation score It can be calculated using the following formula: in, This indicates the semantic similarity between the current interaction question and the memory keys and values. Indicates the reliability of a memory item. Indicate the importance of the memory item, This represents the time interval penalty between the current moment and the moment the memory is written. This indicates the penalty for having conflict markers in memory entries. , , , and These are the corresponding weighting coefficients.
[0031] Specifically, the long-term memory set can be sorted according to memory activation scores, such as in ascending or descending order, and the sequence of long-term memories with the highest memory activation scores can be selected from the sorted long-term memory set. One long-term memory item is used as the memory to be activated in the current round. This provides accurate personalized constraints and a stable factual background for answering current interactive problems.
[0032] After obtaining the current round's activation memory, to compensate for the timeliness and boundary issues of the generative model's inherent knowledge, this embodiment of the invention also requires knowledge retrieval from an external knowledge base or business document library to recall external knowledge. Specifically, the knowledge retrieval process here no longer relies solely on the current interaction question, but combines the current interaction question with the current round's activation memory to jointly guide the retrieval process. During this process, the interaction system will recall multiple candidate evidence fragments. Each candidate evidence fragment may contain fine-grained information such as fragment text, document identifier, its position in the document, time tag, fragment type, and the credibility of its source.
[0033] Furthermore, in recalling multiple candidate evidence fragments, this embodiment of the invention can also use the user's long-term preferences and historical facts in the current round of active memory as consistency constraints for retrieval, screen, merge and sort the retrieved candidate evidence fragments, and finally retain candidate evidence fragments that are highly relevant and consistent with the user's existing state, while eliminating conflicting or expired texts, thereby obtaining the current round of valid evidence set.
[0034] Following this, the current round's activated memory, representing the user's long-term stable state, and the current round's valid evidence set, representing accurate external information, can be combined. A generative model is then used to generate response content, resulting in multiple possible answers and forming a candidate answer set. To overcome the limitation of traditional interactive systems that only provide coarse-grained document references and to achieve verifiable knowledge traceability, this embodiment of the invention does not process candidate answers as a whole after generation. Instead, each candidate answer is broken down into multiple finer-grained answer units. Each answer unit represents a factual statement that can be independently verified, a specific suggested conclusion, an operational step, or a judgment result. Through this fine-grained breakdown, the originally continuous long text is transformed into nodes that facilitate verification of its authenticity.
[0035] Furthermore, in demanding scenarios such as real-world professional consultations and corporate Q&A sessions, users often need to know the specific source of a conclusion. Therefore, after fine-grained breakdown of each candidate answer, it is necessary to analyze whether each answer unit is supported by solid evidence. That is, the interactive system can establish a mapping and association between each answer unit and the corresponding evidence fragment in the current round of valid evidence set through calculation and matching, i.e., a traceability relationship. This traceability relationship can indicate a specific answer unit, such as which document and which evidence fragment a certain data indicator is derived from.
[0036] After establishing the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set, the embodiments of the present invention can comprehensively evaluate the overall reliability of each candidate answer based on this, thereby eliminating answers in the candidate answer set that lack evidence support, have incomplete traceability paths, or belong to generative model illusions, and selecting the answer with the highest credibility and optimal evidence coverage from the remaining candidate answers as the target answer corresponding to the current interactive question, that is, this answer is fed back to the user as the final output of the current round of interaction.
[0037] The interaction method based on memory enhancement and knowledge tracing provided by this invention introduces a long-term memory set into the interaction process, deeply integrating user preferences and historical constraints with external knowledge retrieval. This effectively solves the problems of historical constraint loss and cross-round factual inconsistency that easily occur in existing interaction systems during multi-round interactions, ensuring the continuity and stability of the interaction and greatly improving the consistency of responses and personalized adaptation capabilities in long-term interaction scenarios. At the same time, by splitting candidate answers into fine-grained answer units and constructing fragment-level tracing relationships between answer units and evidence fragments to determine the final output, the interaction system's response no longer stops at coarse-grained citations, but can accurately locate the fine-grained sources supporting specific conclusions. This effectively suppresses the risk of unfounded expansion of the generative model and significantly improves the reproducibility, verifiability, and accountability of the interaction system's output results.
[0038] Based on the above embodiments, the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set is constructed, including: Based on the current interaction question, the current round of activated memories, and the evidence fragments in the current round's valid evidence set, multiple nodes are constructed; the nodes include question nodes, memory nodes, and evidence nodes. Based on each node, as well as the semantic relationships, factual support relationships, and temporal consistency relationships between nodes, a pre-generation traceability graph is constructed. Based on each answer unit and the pre-generation traceability graph, determine the post-generation traceability graph; Based on the generated traceability graph, the attribution probability of each answer unit for the evidence fragments in the current round of valid evidence set is determined, and based on the attribution probability, the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set is constructed.
[0039] Specifically, the process of constructing the above-mentioned traceability relationship includes the following steps: First, extract the current interaction question, the current round's activated memory set, and the various evidence fragments from the current round's valid evidence set, and abstract them as entities in a graph data structure, i.e., nodes. These nodes constitute the pre-generation node set. It includes at least a problem node representing the intent of the current problem. Memory nodes representing existing facts or preferences of the user And evidence nodes representing externally recalled knowledge fragments .
[0040] Subsequently, a pre-generative tracing graph can be constructed using the nodes and the semantic relationships, factual support relationships, and temporal consistency relationships between them. In this process, a pre-generative set is established through the relationships between the nodes. Each edge describes the relationship between two corresponding nodes. Furthermore, based on the set of nodes and edges before generation, a traceback graph before generation can be constructed. , .
[0041] For any two nodes in the pre-generation traceback graph, the edge weight between them can be calculated to assess the strength of their association. The edge weight can be calculated using the following formula: in, Represents a node and nodes The boundary weights between them; express and The semantic relationship between them, i.e., semantic similarity; express right The relationship of factual support, i.e., the strength of factual support; express and The temporal consistency relationship between them, that is, the degree of consistency between them in terms of time tags; express and The consistency between the two in terms of source credibility; , , and These are the corresponding weighting coefficients.
[0042] when Greater than or equal to the edge weight threshold At that time, retain the node and nodes If an edge is found between two points, it is removed; otherwise, the edge is deleted, thus forming a compact pre-generative tracing graph.
[0043] Next, a set of candidate answers is generated, and each candidate answer is... Divided into multiple answer units ( After that, for each candidate answer, the divided answer units can be used as answer nodes, and these answer nodes can be added to the pre-generation traceability graph, thus obtaining the post-generation traceability graph.
[0044] Here, a post-generation traceability graph is generated. Specifically, it can be expressed as: in, For answer unit The corresponding answer node, Is This is obtained by adding support edges from question nodes to answer nodes, memory nodes to answer nodes, and evidence nodes to answer nodes on the basis of the previous one.
[0045] Finally, the generated traceability graph can be used to determine the attribution probability between each answer unit and the evidence fragment in the current round of valid evidence set, and the traceability relationship between each answer unit and each evidence fragment can be constructed accordingly.
[0046] Here, the attribution probability can be calculated using the following formula: in, Representing the answer unit With evidence fragments Attribution probabilities between them; This indicates evidence fragments. With answer unit The combined result of text matching strength, semantic implication strength, and factual consistency strength between the two texts; This represents the set of valid evidence in the current round; This indicates evidence fragments. With answer unit The combined result of text matching strength, semantic implication strength, and factual consistency strength.
[0047] when Greater than or equal to the attribution threshold At that time, evidence fragments can be used. Bind as answer unit The main basis, and then construct such as (Simultaneously supported by long-term memory and external evidence) or The specific tracing path (supported only by external evidence) thus realizes the recording of the tracing path, evidence fragment identifier, memory item identifier, and attribution probability corresponding to each answer unit in the output results, thereby enabling users to locate the specific memory, specific document fragment, and specific tracing path on which each answer unit is based.
[0048] In this embodiment of the invention, a two-stage graph structure modeling is used to integrate scattered questions, long-term memories, external evidence fragments, and answer units into a computable network. Attribution probability is used to assess the support strength, enabling the output of the interactive system to break free from the limitations of traditional coarse-grained document citations and achieve fine-grained fact-level and fragment-level knowledge attribution. This not only effectively demonstrates the intermediate reasoning and decision-making connections in the interactive system's response but also ensures that each statement in the output has a verifiable and locatable evidentiary basis, thereby greatly enhancing the interpretability and trustworthiness of the interactive system.
[0049] Based on the above embodiments, a pre-generation traceability graph is constructed, which then includes: Based on the current set of valid evidence, the current interaction question, and the pre-generation traceability graph, an uncertainty score is determined; If the uncertainty score is greater than the clarification threshold, a target clarification slot is selected from a preset set of candidate clarification slots; the target clarification slot is determined based on the expected information gain of each candidate clarification slot in the set of candidate clarification slots for reducing the uncertainty score. Generate clarification questions based on the target clarification slot; Obtain supplementary input based on the feedback from the clarifying question, and update the current interaction question and the current round activation memory based on the supplementary input.
[0050] Specifically, in actual interaction processes, user input often suffers from unclear timeframes, ambiguous object referencing, missing constraints, and incomplete expression of intent; simultaneously, retrieved external evidence may be insufficient or contradictory. In such cases, if the interaction system directly generates answers, it is highly likely to produce unconstrained responses. Therefore, this embodiment of the invention introduces a clarification inquiry mechanism based on uncertainty scoring. Specifically, after constructing the pre-generation traceability graph, the method further includes the following process: First, the reliability of the current state can be assessed by calculating an uncertainty score based on the current set of valid evidence, the current interaction question, and the pre-generation traceability graph. This score measures the risk of generating an answer directly in the current situation. The higher the score, the less sufficient the current evidence or the more ambiguous the question, and the greater the risk of answering directly.
[0051] Next, a conditional judgment is performed. If the uncertainty score is greater than the clarification threshold, a target clarification slot is selected from a preset set of candidate clarification slots. Specifically, in this embodiment of the invention, a clarification threshold is preset. When uncertainty scoring Exceed If the current state is insufficient to directly generate a reliable answer, then the system switches to clarification query mode. This mode is configured with a set of candidate clarification slots covering various possible missing information. This includes factors such as time range, object entity, business scope, sorting rules, result format, evidence source, and constraints. To achieve efficient querying, this embodiment of the invention will filter according to the information gain criterion to select the candidate clarification slot with the highest expected information gain from the candidate clarification slots in the candidate clarification slot set as the target clarification slot.
[0052] Here, the target clarifies the slot. The selection criteria can be expressed as: in, Indicates the surrounding candidate clarification slots After initiating the inquiry, score the reduction of uncertainty. The expected information gain from reducing conflict of evidence and improving the score of traceability support.
[0053] Subsequently, the selected target clarification slots can be used to generate clarification questions. That is, the abstract target clarification slots are transformed into user-friendly natural language questions, proactively initiating supplementary inquiries to guide users to provide missing key constraints or eliminate ambiguity in reference.
[0054] Finally, supplementary input from users based on their feedback regarding clarifying the inquiry can be obtained. Based on this, supplementary input is provided to update the current interactive question. The business context of the current round And the current round of activated memories That is, supplementary input can be added back to the current state.
[0055] The update process can be specifically represented by the following formula: in, This addresses the current interaction issues following the update. This is a problem fusion function used to combine... and Merge into a new problem with more clearly defined constraints; For the updated business context; A context update function used to update the context. Write ; Activate the memory for the updated current round; To activate the memory update function, used to determine the timeline based on the memory update function. Correct the current round's active memory or supplement temporary constraints.
[0056] After the update is completed, in this embodiment of the invention, the knowledge retrieval, answer generation, and relationship construction processes can be re-executed based on the new questions and new activated memories with more explicit constraints after the update.
[0057] Furthermore, it should be noted that, to avoid an infinite loop in the clarification inquiry process, an upper limit on the number of clarification rounds is set in this embodiment of the invention. And the downgraded output rules. Specifically, after a clarification is completed, the uncertainty score is recalculated. .like Less than or equal to the clarification threshold If so, the system exits the clarification state and enters the answer generation process; if And the number of clarifications did not reach the required number. If the number of clarifications reaches a certain threshold, then continue to query the candidate clarification slot with the highest expected information gain; If the user fails to provide valid supplementary information, a limited response will be output. A limited response includes conclusions already supported by evidence fragments, missing constraints that cannot be confirmed at present, conflicting sources of evidence, and key information that the user is advised to supplement. Conclusions lacking supporting evidence or whose tracing paths do not meet the requirements will not be output as definitive conclusions.
[0058] In this embodiment of the invention, by using a clarification inquiry mechanism based on uncertainty scoring, when faced with high-risk states such as ambiguous user questions, missing key constraints, and conflicting evidence, unreliable direct generation behavior can be automatically intercepted, and the system can proactively ask the user precise questions to supplement key constraints. This effectively avoids outputting inappropriate answers that appear complete but lack sufficient basis under conditions of insufficient evidence or unclear intent, thereby greatly improving the rigor, reliability, and controllability of the output results in complex interaction scenarios.
[0059] Based on the above embodiments, based on the current round's valid evidence set, the current interaction question, and the pre-generation retrospective graph, an uncertainty score is determined, including: Determine the degree of scarcity of evidence in the current round of valid evidence set, and the degree of conflict of evidence among the evidence fragments in the current round of valid evidence set; Determine the ambiguity of the current interaction question, and the degree of constraint absence of key constraints in the current round of activated memory or the business context corresponding to the current interaction question; Based on the support status between problem nodes, memory nodes, and evidence nodes in the pre-generation traceability graph, the pre-traceability sufficiency is determined. An uncertainty score is determined based on the degree of evidence scarcity, degree of evidence conflict, degree of constraint deficiency, degree of issue ambiguity, and degree of pre-tracing sufficiency.
[0060] Specifically, the process of calculating the uncertainty score based on the current set of valid evidence, the current interaction question, and the pre-generation retrospective graph can include: When faced with external evidence of recall, the highest reordering score in the current round of valid evidence can be determined. The higher the score, the more substantial the evidence supporting the answer; therefore, it can be used... This indicates the degree of insufficiency of evidence in the current situation, i.e., the degree of evidence scarcity. Simultaneously, the factual consistency between different pieces of evidence can be compared to assess whether there are contradictions or conflicting points, thereby calculating the degree of evidence conflict. .
[0061] When faced with user input and the business environment, it is necessary to determine the ambiguity of the current interaction question and the degree of constraint absence in the current round of activation memory or the business context corresponding to the current interaction question. In this process, semantic analysis can be used to detect whether the current interaction question has unclear object referencing, ambiguous intent, or other issues, thereby determining the question ambiguity. It can check whether necessary conditions such as time range and object entity are missing in the current round of activation memory or business context, and calculate the constraint missing degree of key constraints accordingly. .
[0062] Furthermore, in this embodiment of the invention, the pre-tracing sufficiency can also be determined based on the support status between the problem nodes, memory nodes, and evidence nodes in the pre-generation tracing graph. That is, using the constructed pre-generation tracing graph, it is examined whether high-weight closed-loop support edges are formed between the problem, memory, and evidence, thereby evaluating the connectivity and support strength of the tracing graph and determining the pre-tracing sufficiency. The higher this value, the more robust the factual support network before generation.
[0063] Finally, the uncertainty score can be calculated by combining the above-mentioned evidence scarcity, evidence conflict, lack of constraints, ambiguity of issues, and pre-tracing sufficiency through a weighted approach.
[0064] Here, uncertainty score It can be calculated using the following formula: in, , , , and These are the corresponding weighting coefficients. The higher the value, the greater the risk of directly generating an answer in the current state.
[0065] In this embodiment of the invention, by deeply analyzing the current state from multiple dimensions, an uncertainty score is obtained by comprehensively evaluating retrieval quality, input clarity, memory integrity, and traceability logic connectivity. This enables the system to accurately identify abnormal interaction states with high risks of illusion and exaggeration, providing scientific data decision support for the proactive clarification inquiry mechanism and ensuring the rigor and reliability of the interactive system when facing complex and incomplete information.
[0066] Based on the above embodiments, determining the target answer corresponding to the current interactive question from the candidate answer set based on the tracing relationship includes: Based on the tracing relationship, the tracing coverage of each candidate answer is determined, and based on the attribution probability and tracing coverage, the tracing support score of each candidate answer is determined. Determine the risk penalty score for each candidate answer, as well as the generation probability score for each candidate answer under the preset generation model; the risk penalty score is determined based on the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty for each answer unit; the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty are determined based on the activated memory of the current round and the set of valid evidence in the current round. The target answer is determined from the candidate answers based on the risk penalty score, the generation probability score, and the traceability support score.
[0067] Specifically, the process of determining the target answer for the current interactive question from the candidate answer set based on the tracing relationship includes the following steps: First, regarding the set of candidate answers Each candidate answer The constructed traceability relationship can be used to verify whether each answer unit, which is broken down, has a complete and connected traceability path, i.e., a valid traceability path, such as a traceability path from the question node to the evidence node and then to the answer node. By statistically analyzing the proportion of answer units with valid traceability paths to the total number of answer units in the corresponding candidate answers, the traceability coverage of the corresponding candidate answers in the overall facts can be evaluated.
[0068] Next, the traceability support score for each candidate answer can be determined based on attribution probability and traceability coverage. This process considers not only the comprehensiveness of the evidence path but also the strength of the evidence support. Specifically, for each candidate answer, the maximum attribution probability obtained by each answer unit in the current round of valid evidence set is combined with the traceability coverage to calculate the traceability support score for each candidate answer. The higher the score, the more solid and compelling external evidence is available for the corresponding candidate answers.
[0069] At the same time, the risk penalty score for each candidate answer can be determined. And the generation probability score of each candidate answer under the preset generation model. Here, the generation probability score reflects the natural language fluency and generation confidence of the candidate answer under the conditions of the current interactive question, the current round of activated memory, and the current round of valid evidence set; the risk penalty score is used to eliminate generated content with logical or factual flaws.
[0070] Here, the risk penalty score is determined based on the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty for each answer unit. The expansion conflict penalty, also known as the penalty for unfounded expansion, is used to penalize answer units for which no traceable path can be found in the current round's valid evidence set or the current round's activated memory set. The evidence conflict penalty is used to penalize situations where different pieces of evidence give contradictory or conflicting conclusions about the same answer unit. The timeliness conflict penalty is used to penalize answer units for citing outdated evidence or ignoring updated evidence. The memory conflict penalty is used to penalize situations where there is inconsistency between the candidate answer and the current round's activated memory. By combining these four types of penalties based on memory and evidentiary facts, the risk penalty score can be calculated.
[0071] Finally, the target answer can be determined from the candidate answers by combining the scores of the risk penalty items, the generation probability score, and the traceability support score.
[0072] Here, the target answer The process of determining can be represented by the following formula: in, This indicates the final answer to be output in the current round; and To adjust the parameters.
[0073] By solving the maximization objective function, the candidate answer with the highest score can be selected from the candidate answer set as the final target answer.
[0074] Furthermore, it should be noted that only answer units that meet the attribution requirement can be output as deterministic statements in the final output. For those that do not meet the attribution requirement, i.e., whose attribution probability is below the attribution threshold... Answer units with incomplete tracing paths or unresolved conflicts among evidence are marked as uncertain content, or users are prompted in restricted answers to supplement relevant constraints or evidence.
[0075] In this embodiment of the invention, by deeply integrating the generation probability score, the traceability support score, and the multidimensional risk penalty item to construct the objective function, the drawback of traditional generative models that only pursue the fluency of language expression is changed. This makes the answer generation process subject to the cross constraints of source integrity, evidence consistency, timeliness consistency, and user long-term memory, effectively curbing the unfounded expansion and illusion phenomena of traditional generative models and ensuring the factual accuracy of the output results.
[0076] Based on the above embodiments, step 120 includes: Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain multiple candidate evidence fragments; Based on the memory consistency score between each candidate evidence fragment and the currently activated memory, the comprehensive retrieval score of each candidate evidence fragment is determined. Based on the comprehensive retrieval score and the conflict score between each candidate evidence fragment and other candidate evidence fragments, the reordering score of each candidate evidence fragment is determined. Based on the reordering score, the set of valid evidence for the current round is determined from each candidate evidence fragment.
[0077] Specifically, considering that existing retrieval results mainly provide simple contextual support for generative models and rely solely on similarity for coarse-grained matching, they are prone to introducing knowledge that contradicts or conflicts with users' long-term preferences. To ensure the accuracy and personalization of external knowledge at the retrieval source, this embodiment of the invention divides the knowledge retrieval process into two stages.
[0078] In detail, firstly, using the current interactive question and the currently activated memory as joint query conditions, multiple candidate evidence fragments are retrieved from the external knowledge base, forming a set of candidate evidence fragments. , Each candidate evidence fragment It can be represented as: in, Represents a fragment of text. Indicates document identifier, Indicates the location of the candidate evidence fragment in the document. Indicates the time label corresponding to the candidate evidence fragment. Indicates the fragment type, This indicates the credibility of the source to which the candidate evidence fragment belongs.
[0079] Next, we move into the first stage. This involves determining the overall retrieval score for each candidate evidence fragment based on the memory consistency score between each candidate evidence fragment and the currently activated memory. In this stage, we break away from the limitations of traditional methods that rely solely on vector similarity, employing a hybrid scoring mechanism under memory constraints to determine the overall retrieval score.
[0080] Here, the overall search score is considered. It can be calculated using the following formula: in, Indicates candidate evidence fragments Current interaction issues Vector semantic similarity score between them; express and Keyword matching score between them; Indicates based on The structure matching score is determined by the heading level, chapter position, table field, and document structure position. express and Memory consistency score between; express Credibility score of the source; , , , and These are the corresponding weight parameters.
[0081] Here, the introduction of memory consistency score can constrain candidate evidence fragments by leveraging users' long-term preferences, historical facts, and task constraints during the external knowledge retrieval stage, thereby reducing the probability of evidence fragments inconsistent with the user's confirmed state entering the generation stage.
[0082] The second stage then begins. Based on the comprehensive retrieval score and the conflict score between each candidate evidence segment and other candidate evidence segments, a re-ranking score is determined for each candidate evidence segment. Specifically, this involves introducing more complex contextual features and conflict metrics on top of the comprehensive retrieval score to calculate the re-ranking score.
[0083] Here, the score is reordered. It can be calculated using the following formula: in, express and and Consistency between them; express Timeliness; express The ability to predict the formation of effective traceability edges between problem nodes and memory nodes; express and The degree of conflict between other candidate pieces of evidence; , , , to These are the corresponding weight parameters.
[0084] Finally, the candidate evidence fragments can be sorted in descending order according to their reordering scores, and the highest-scoring fragments can be selected from the sorted candidate evidence fragment selection sequence. 10 candidate evidence fragments, construct the set of valid evidence for the current round. .
[0085] In this embodiment of the invention, memory consistency assessment and evidence conflict penalty are integrated into a two-stage process, breaking the bottleneck of traditional interactive systems that only consider semantic relevance and ignore factual conflicts. It can effectively intercept inferior knowledge that contradicts, conflicts with, or is outdated in the early stages of knowledge retrieval, greatly improving the purity and personalized matching of external evidence, thus laying the foundation for the generation of high-quality answers.
[0086] Based on the above embodiments, and based on the tracing relationship, the target answer corresponding to the current interactive question is determined from the candidate answer set, and then the process further includes: Obtain interactive feedback for the target answer, and add the corresponding information to be written to the long-term memory set based on the interactive feedback; Based on interactive feedback, update the memory credibility of the long-term memory set, and conduct the next round of interaction based on the updated long-term memory set; Obtain interactive feedback for the target answer, which also includes: Construct positive and negative sample evidence sets based on interactive feedback, and determine the feedback loss based on the positive and negative sample evidence sets. Based on feedback loss, the weight parameters in the knowledge retrieval process are dynamically updated.
[0087] Specifically, traditional interactive systems often only superficially correct user feedback, failing to convert user confirmations, revisions, and negations into reusable long-term memories. To enable interactive systems to achieve stable self-correction and experience accumulation during continuous use, this invention proposes an active learning and closed-loop update mechanism.
[0088] In detail, Figure 2This is a diagram illustrating the overall architecture of the interactive method based on memory enhancement and knowledge tracing provided by this invention. Figure 2 As shown, after outputting the target answer to the user, feedback from the user regarding the target answer can also be obtained, i.e., interactive feedback. And categorize it into confirmation feedback Correction feedback and negative feedback Three categories.
[0089] Next, this feedback, especially the corrected and supplemented facts, preferences, task constraints, etc., can be used as information to be written. The data is written to the long-term memory set. However, to avoid indiscriminately writing all interactive content to the long-term memory set during the interaction process, a write score calculation is performed in this embodiment of the invention.
[0090] Here, memories are written into the rating. It can be calculated using the following formula: in, express and The degree of task relevance between them; express Compared to Novelty; express Whether it belongs to stable preferences, stable facts, or long-term constraints; express Whether the user explicitly confirms, corrects, or authorizes the writing; Indicates a time decay or temporary penalty; , , , and These are the corresponding weighting coefficients.
[0091] When the memory write score is greater than or equal to the write threshold At that time, it can be Convert to new long-term memory item It is then written to the long-term memory set; otherwise, it is only used as a temporary context for the current round. Here, the update of the long-term memory set can be represented by the following formula: in, This represents the long-term memory set generated in the current round of interactions. This is a memory update function used to perform memory writes, deduplication and merging, confidence adjustment and conflict marker updates.
[0092] Next, based on the interactive feedback, the memory reliability of the long-term memory set can be updated, and the next round of interaction can be conducted based on the updated long-term memory set. During this process, the interactive system can adjust existing long-term memory items based on the user's feedback. The credibility will be updated.
[0093] Here, the process of updating memory reliability can be represented as: in, Representing memory items Credibility before the update; Representing memory items In terms of updated credibility; Indicator variables that provide feedback confirmation of the memory item or its supporting content; Indicator variables that indicate feedback negation of the memory item or its supporting content; An indicator variable that suggests a conflict between the memory entry and user-modified content or external evidence; This indicates that the user's modified content is related to the memory item and can form a new memory; , , and The step size parameter is updated for the corresponding confidence level; The function is used to limit the confidence level to Within the range, avoid a single feedback that could abnormally amplify or reduce the credibility of the memory item.
[0094] Once the update is complete, a more accurate set of long-term memories will serve as input for the next round of interaction.
[0095] After receiving interactive feedback, in this embodiment of the invention, the feedback results can also be used to optimize the underlying retrieval model. That is, a positive sample evidence set and a negative sample evidence set can be constructed based on the interactive feedback, and the feedback loss can be determined based on the positive sample evidence set and the negative sample evidence set.
[0096] Specifically, evidence fragments that users confirm as valid or supporting the correct answer can be included in the positive sample evidence set. Evidence fragments that are negatively received by the user, conflict with the user's revised content, or lead to an incorrect answer are categorized into the negative sample evidence set. Based on the predefined positive and negative sample evidence sets, calculate the feedback loss for the current round.
[0097] Here, the feedback loss function It can be calculated using the following formula: in, and These represent fragments of evidence. and evidence fragments The combined score of the first and second stages in the knowledge retrieval process; This indicates penalties for source conflicts, memory conflicts, and timeliness conflicts confirmed by user feedback. The penalty weight is used. This loss function quantifies the deviation between the current retrieval ranking strategy and the user's true expectations.
[0098] Finally, the feedback loss can be used to dynamically update the weight parameters during the knowledge retrieval process. That is, optimization algorithms such as gradient descent can be used to update the weight parameters during the knowledge retrieval process based on the feedback loss.
[0099] Here, weight parameters The update process can be represented as: in, The updated weight parameters; The learning rate; This indicates that the gradient direction is adjusted based on the weights determined by the feedback loss; This is a normalization function used to keep the updated weight parameters within a reasonable range.
[0100] If the user confirms the validity of the current answer, the weight parameters of the evidence fragments in the positive sample evidence set are increased; if the user denies the current answer or points out an error in the source, the weight parameters of the evidence fragments in the negative sample evidence set are decreased; if the user provides a partial correction, the weight parameters of the relevant memory items and evidence fragments are readjusted according to the correction. Thus, the interactive system can simultaneously correct the quality of long-term memory, the evidence ranking strategy, and the constraints on answer generation during continuous interaction.
[0101] In this embodiment of the invention, by constructing a complete write-back closed loop from front-end interactive feedback to back-end memory credibility and retrieval weight updates, the limitation of traditional interactive systems being unable to grow and evolve with the progress of interaction is changed. This allows the interactive system to continuously accumulate correct business facts and personalized experiences during long-term use, while eliminating unreliable knowledge sources, thereby achieving stable and continuous self-correction. This greatly improves the response quality, personalized matching ability, and overall robustness of the interactive system in multi-round interactions.
[0102] The interactive system based on memory enhancement and knowledge tracing provided by this invention will be described below. The interactive system based on memory enhancement and knowledge tracing described below can be referred to in correspondence with the interactive method based on memory enhancement and knowledge tracing described above.
[0103] Figure 3This is a schematic diagram of the structure of the interactive system based on memory enhancement and knowledge tracing provided by the present invention, as shown below. Figure 3 As shown, the system includes: The determining unit 310 is used to determine the current interaction problem and determine the current round activated memory that matches the current interaction problem from the long-term memory set generated in the previous round of interaction; The retrieval unit 320 is used to perform knowledge retrieval based on the current interaction question and the current round activated memory to obtain the set of valid evidence for the current round; The generation unit 330 is used to generate a candidate answer set based on the current round activated memory and the current round valid evidence set, and to divide each candidate answer in the candidate answer set into multiple answer units; The filtering unit 340 is used to construct a traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set for each candidate answer, and to determine the target answer corresponding to the current interactive question from the candidate answer set based on the traceability relationship.
[0104] The interactive system based on memory enhancement and knowledge tracing provided by this invention introduces a long-term memory set into the interaction process, deeply integrating user preferences and historical constraints with external knowledge retrieval. This effectively solves the problems of historical constraint loss and cross-round factual inconsistency that easily occur in existing interactive systems during multi-round interactions, ensuring the continuity and stability of the interaction and greatly improving the consistency of responses and personalized adaptation capabilities in long-term interaction scenarios. At the same time, by splitting candidate answers into fine-grained answer units and constructing fragment-level tracing relationships between answer units and evidence fragments to determine the final output, the interactive system's response no longer stops at coarse-grained citations, but can accurately locate the fine-grained sources supporting specific conclusions. This effectively suppresses the risk of unfounded expansion of the generative model and significantly improves the reproducibility, verifiability, and accountability of the interactive system's output results.
[0105] Based on the above embodiments, the filtering unit 340 is used for: Based on the current interaction question, the current round activated memory, and the evidence fragments in the current round's valid evidence set, multiple nodes are constructed; the nodes include question nodes, memory nodes, and evidence nodes. Based on each node, and the semantic relationships, factual support relationships, and temporal consistency relationships between the nodes, a pre-generation tracing graph is constructed. Based on the answer units and the pre-generation traceability graph, determine the post-generation traceability graph; Based on the generated traceability graph, the attribution probability of each answer unit for the evidence fragments in the current round of valid evidence set is determined, and based on the attribution probability, the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set is constructed.
[0106] Based on the above embodiments, the system further includes a clarification unit, used for: Based on the current set of valid evidence, the current interaction question, and the pre-generation traceability graph, an uncertainty score is determined; If the uncertainty score is greater than the clarification threshold, a target clarification slot is selected from a preset set of candidate clarification slots; the target clarification slot is determined based on the expected information gain of each candidate clarification slot in the set of candidate clarification slots for reducing the uncertainty score. Based on the target clarification slot, generate clarification questions; Obtain supplementary input based on the feedback from the clarification question, and update the current interaction question and the current round activation memory based on the supplementary input.
[0107] Based on the above embodiments, the clarification unit is used for: Determine the degree of evidence scarcity in the current round of valid evidence set, and the degree of evidence conflict among the evidence fragments in the current round of valid evidence set; Determine the ambiguity of the current interaction question, and the constraint missingness of key constraints in the current round activation memory or the business context corresponding to the current interaction question; Based on the support status between the problem nodes, memory nodes, and evidence nodes in the pre-generation traceability graph, the pre-traceability sufficiency is determined. The uncertainty score is determined based on the degree of evidence scarcity, the degree of evidence conflict, the degree of constraint absence, the degree of problem ambiguity, and the degree of pre-tracing sufficiency.
[0108] Based on the above embodiments, the filtering unit 340 is used for: Based on the tracing relationship, the tracing coverage of each candidate answer is determined, and based on the attribution probability and the tracing coverage, the tracing support score of each candidate answer is determined. Determine the risk penalty score for each candidate answer, and the generation probability score for each candidate answer under the preset generation model; The target answer is determined from the candidate answers based on the risk penalty score, the generation probability score, and the traceability support score. The risk penalty score is determined based on the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty of each answer unit; the expansion conflict penalty, the evidence conflict penalty, the timeliness conflict penalty, and the memory conflict penalty are determined based on the current round activated memory and the current round valid evidence set.
[0109] Based on the above embodiments, the retrieval unit 320 is used for: Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain multiple candidate evidence fragments; Based on the memory consistency score between each candidate evidence fragment and the currently activated memory, the comprehensive retrieval score of each candidate evidence fragment is determined; Based on the comprehensive retrieval score and the conflict score between each candidate evidence fragment and other candidate evidence fragments, the reordering score of each candidate evidence fragment is determined. Based on the reordering score, the set of valid evidence for the current round is determined from each candidate evidence fragment.
[0110] Based on the above embodiments, the system further includes a feedback update unit, used for: Obtain interactive feedback for the target answer, and add the corresponding information to be written to the long-term memory set according to the interactive feedback; Based on the interactive feedback, the memory reliability of the long-term memory set is updated, and the next round of interaction is carried out based on the updated long-term memory set; The process of obtaining interactive feedback for the target answer further includes: Based on the interactive feedback, a positive sample evidence set and a negative sample evidence set are constructed, and the feedback loss is determined based on the positive sample evidence set and the negative sample evidence set; Based on the feedback loss, the weight parameters in the knowledge retrieval process are dynamically updated.
[0111] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can invoke logical instructions in the memory 430 to execute an interaction method based on memory enhancement and knowledge tracing. This method includes: determining the current interaction question and identifying the current round activated memory matching the current interaction question from the long-term memory set generated from the previous round of interaction; performing knowledge retrieval based on the current interaction question and the current round activated memory to obtain a set of valid evidence for the current round; generating a set of candidate answers based on the current round activated memory and the set of valid evidence for the current round, dividing each candidate answer in the set of candidate answers into multiple answer units; for each candidate answer, constructing a tracing relationship between each answer unit and the evidence fragments in the set of valid evidence for the current round, and determining the target answer corresponding to the current interaction question from the set of candidate answers based on the tracing relationship.
[0112] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the interaction method based on memory enhancement and knowledge tracing provided by the above methods, the method comprising: determining the current interaction question, and determining the current round activated memory matching the current interaction question from the long-term memory set generated from the previous round of interaction; performing knowledge retrieval based on the current interaction question and the current round activated memory to obtain the current round valid evidence set; generating a candidate answer set based on the current round activated memory and the current round valid evidence set, and dividing each candidate answer in the candidate answer set into multiple answer units; for each candidate answer, constructing a tracing relationship between each answer unit and the evidence fragment in the current round valid evidence set, and determining the target answer corresponding to the current interaction question from the candidate answer set based on the tracing relationship.
[0114] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the interaction method based on memory enhancement and knowledge tracing provided by the above methods. The method includes: determining the current interaction question and determining the current round activated memory matching the current interaction question from the long-term memory set generated from the previous round of interaction; performing knowledge retrieval based on the current interaction question and the current round activated memory to obtain a current round valid evidence set; generating a candidate answer set based on the current round activated memory and the current round valid evidence set, and dividing each candidate answer in the candidate answer set into multiple answer units; for each candidate answer, constructing a tracing relationship between each answer unit and the evidence fragment in the current round valid evidence set, and determining the target answer corresponding to the current interaction question from the candidate answer set based on the tracing relationship.
[0115] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An interactive method based on memory enhancement and knowledge tracing, characterized in that, include: Determine the current interaction problem, and from the long-term memory set generated by the previous round of interaction, determine the current round activated memory that matches the current interaction problem; Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain the set of valid evidence for the current round; A candidate answer set is generated based on the current round activated memory and the current round valid evidence set, and each candidate answer in the candidate answer set is divided into multiple answer units; For each candidate answer, a tracing relationship is constructed between each answer unit and the evidence fragments in the current round of valid evidence set, and based on the tracing relationship, the target answer corresponding to the current interactive question is determined from the candidate answer set.
2. The interactive method based on memory enhancement and knowledge tracing according to claim 1, characterized in that, The process of constructing a tracing relationship between each answer unit and the evidence fragments in the current round of valid evidence set includes: Based on the current interaction question, the current round activated memory, and the evidence fragments in the current round's valid evidence set, multiple nodes are constructed; the nodes include question nodes, memory nodes, and evidence nodes. Based on each node, as well as the semantic relationships, factual support relationships, and temporal consistency relationships between the nodes, a pre-generation tracing graph is constructed. Based on the answer units and the pre-generation traceability graph, determine the post-generation traceability graph; Based on the generated traceability graph, the attribution probability of each answer unit for the evidence fragments in the current round of valid evidence set is determined, and based on the attribution probability, the traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set is constructed.
3. The interactive method based on memory enhancement and knowledge tracing according to claim 2, characterized in that, The process of constructing the pre-generation traceability graph also includes: Based on the current set of valid evidence, the current interaction question, and the pre-generation traceability graph, an uncertainty score is determined; If the uncertainty score is greater than the clarification threshold, a target clarification slot is selected from a preset set of candidate clarification slots; the target clarification slot is determined based on the expected information gain of each candidate clarification slot in the set of candidate clarification slots for reducing the uncertainty score. Based on the target clarification slot, generate clarification questions; Obtain supplementary input based on the feedback from the clarification question, and update the current interaction question and the current round activation memory based on the supplementary input.
4. The interactive method based on memory enhancement and knowledge tracing according to claim 3, characterized in that, The determination of the uncertainty score based on the current round's valid evidence set, the current interaction question, and the pre-generation retrospective graph includes: Determine the degree of evidence scarcity in the current round of valid evidence set, and the degree of evidence conflict among the evidence fragments in the current round of valid evidence set; Determine the ambiguity of the current interaction question, and the constraint missingness of key constraints in the current round activation memory or the business context corresponding to the current interaction question; Based on the support status between the problem nodes, memory nodes, and evidence nodes in the pre-generation traceability graph, the pre-traceability sufficiency is determined; The uncertainty score is determined based on the degree of evidence scarcity, the degree of evidence conflict, the degree of constraint absence, the degree of problem ambiguity, and the degree of pre-tracing sufficiency.
5. The interactive method based on memory enhancement and knowledge tracing according to any one of claims 2 to 4, characterized in that, The step of determining the target answer corresponding to the current interactive question from the candidate answer set based on the tracing relationship includes: Based on the tracing relationship, the tracing coverage of each candidate answer is determined, and based on the attribution probability and the tracing coverage, the tracing support score of each candidate answer is determined. Determine the risk penalty score for each candidate answer, and the generation probability score for each candidate answer under the preset generation model; The target answer is determined from the candidate answers based on the risk penalty score, the generation probability score, and the traceability support score. The risk penalty score is determined based on the expansion conflict penalty, evidence conflict penalty, timeliness conflict penalty, and memory conflict penalty of each answer unit; the expansion conflict penalty, the evidence conflict penalty, the timeliness conflict penalty, and the memory conflict penalty are determined based on the current round activated memory and the current round valid evidence set.
6. The interactive method based on memory enhancement and knowledge tracing according to any one of claims 1 to 4, characterized in that, The knowledge retrieval based on the current interaction question and the current round of activated memory yields a set of valid evidence for the current round, including: Based on the current interaction question and the current round of activated memory, knowledge retrieval is performed to obtain multiple candidate evidence fragments; Based on the memory consistency score between each candidate evidence fragment and the currently activated memory, the comprehensive retrieval score of each candidate evidence fragment is determined; Based on the comprehensive retrieval score and the conflict score between each candidate evidence fragment and other candidate evidence fragments, the reordering score of each candidate evidence fragment is determined. Based on the reordering score, the set of valid evidence for the current round is determined from each candidate evidence fragment.
7. The interactive method based on memory enhancement and knowledge tracing according to any one of claims 1 to 4, characterized in that, Based on the tracing relationship, determining the target answer corresponding to the current interactive question from the candidate answer set further includes: Obtain interactive feedback for the target answer, and add the corresponding information to be written to the long-term memory set according to the interactive feedback; Based on the interactive feedback, the memory reliability of the long-term memory set is updated, and the next round of interaction is carried out based on the updated long-term memory set; The process of obtaining interactive feedback for the target answer further includes: Based on the interactive feedback, a positive sample evidence set and a negative sample evidence set are constructed, and the feedback loss is determined based on the positive sample evidence set and the negative sample evidence set; Based on the feedback loss, the weight parameters in the knowledge retrieval process are dynamically updated.
8. An interactive system based on memory enhancement and knowledge tracing, characterized in that, include: The determining unit is used to determine the current interaction problem and determine the current round activated memory that matches the current interaction problem from the long-term memory set generated in the previous round of interaction; The retrieval unit is used to perform knowledge retrieval based on the current interaction question and the current round activated memory to obtain the set of valid evidence for the current round; The generation unit is used to generate a candidate answer set based on the current round activated memory and the current round valid evidence set, and to divide each candidate answer in the candidate answer set into multiple answer units; The filtering unit is used to construct a traceability relationship between each answer unit and the evidence fragments in the current round of valid evidence set for each candidate answer, and to determine the target answer corresponding to the current interactive question from the candidate answer set based on the traceability relationship.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the interactive method based on memory enhancement and knowledge tracing as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the interactive method based on memory enhancement and knowledge tracing as described in any one of claims 1 to 7.