Question answer analysis method and device based on logic enhancement, equipment and medium

By breaking down complex problems into atomic problems and generating logical dependency graphs, identifying their importance, processing and integrating the answers, the problem of insufficient accuracy and coherence in complex problems in existing technologies is solved, and more robust and reliable answer generation is achieved.

CN121860052APending Publication Date: 2026-04-14PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2026-01-06
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies struggle to identify the severity of complications and the interplay between treatments when dealing with complex, knowledge-intensive tasks, resulting in insufficient accuracy of the generated answers. Furthermore, they fail to meet the requirements for coherent reasoning in multi-step and multi-dimensional relational problems.

Method used

By obtaining the cognitive load index of the input question, it is broken down into multiple atomic questions, generating a logical dependency graph and identifying the importance of the edges. The atomic questions are processed in the order of response according to their importance, the logical termination conditions are monitored, the target answer is integrated, and a large language model is used to correct logical inconsistencies.

Benefits of technology

It improves the accuracy and coherence of answers, reduces illusions, enhances the robustness and credibility of reasoning, and aligns responses with human cognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860052A_ABST
    Figure CN121860052A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent decision making, can be applied to business system platforms of financial science and technology, medical health and the like, and discloses a logic enhancement-based question answer analysis method, device, equipment and medium, and the method comprises the steps of splitting an input question into a plurality of atomic questions according to a cognitive load index of the input question; generating a logic dependency graph according to the dependency relationship of the plurality of atomic problems; determining a response sequence of the plurality of atomic questions according to the importance degrees, processing the plurality of atomic questions based on the response sequence to obtain a target answer corresponding to each atomic question, and when a logic termination condition is monitored, integrating the target answers corresponding to all the atomic questions; if logic inconsistency exists, inputting the atomic question and a logic chain corresponding to the atomic question into a large language model, and generating a target response answer corresponding to the input question; and if the logic is consistent, taking the preliminary response as a target response answer corresponding to the input question. And the accuracy of question answer analysis is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent decision-making technology, and in particular to a method, apparatus, device, and medium for analyzing question answers based on logic enhancement. Background Technology

[0002] With the widespread application of artificial intelligence technology in knowledge-intensive tasks, large language models have demonstrated excellent performance in various conventional tasks due to their powerful natural language understanding and generation capabilities. However, knowledge-intensive tasks have extremely high requirements for the accuracy, logic, and reliability of the output results. Relying solely on the parameterized knowledge of the large language model itself is prone to generating erroneous information that does not conform to the facts due to untimely knowledge updates or internal knowledge representation biases.

[0003] In the field of healthcare, when dealing with complex issues such as which complication should be treated first for a patient with a disease who also has two complications, existing systems can only retrieve isolated knowledge related to the disease and complications. They cannot identify potential logical connections such as the severity of complications and the mutual influence of treatments. As a result, the retrieved content is often irrelevant to the core needs of the problem or is fragmented, leading to insufficient accuracy in the generated answers. In the fintech business, when dealing with a listed company's declining revenue and rising debt ratio, and whether its bond rating should be downgraded and how to adjust its holdings, the existing system cannot clearly define the logical order of revenue analysis → debt ratio analysis → rating judgment → holding recommendations. It can only process each sub-requirement in an unordered manner, which limits the system's coherent reasoning ability and is prone to problems such as broken reasoning logic or disordered order, resulting in insufficient accuracy of the generated answers. Existing retrieval-enhanced generation systems integrate external knowledge sources (such as domain knowledge bases and authoritative literature) to provide factual support for model generation, aiming to improve response accuracy. However, in practical applications, existing systems still struggle to meet the reasoning and response needs of complex problems (such as those involving multi-step reasoning and multi-dimensional correlations), and their technical shortcomings are becoming increasingly apparent, necessitating further optimization to adapt to more complex knowledge-intensive scenarios. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and medium for question-answer analysis based on logic enhancement, in order to solve the technical problem of low accuracy in question-answer analysis.

[0005] Firstly, a question-answer analysis method based on logic enhancement is provided, including: Obtain the input question from the target user, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index; Generate a logical dependency graph based on the dependencies of the multiple atomic problems, and identify the importance of each edge in the logical dependency graph; The response order of multiple atomic problems is determined according to their importance, and the multiple atomic problems are processed based on the response order to obtain the target answer corresponding to each atomic problem, while monitoring the logical termination conditions in the processing of atomic problems; When a logical termination condition is detected, the target answers corresponding to all atomic problems are integrated to obtain a preliminary response to the input problem; Determine whether there is any logical inconsistency in the target answer in the preliminary response; If a logical inconsistency exists, the atomic problem and the logical chain corresponding to the atomic problem are input into a preset large language model to generate the target response answer corresponding to the input problem. If the logic is consistent, the preliminary response will be taken as the target response answer corresponding to the input question.

[0006] Secondly, a logic-enhanced question-answer analysis device is provided, comprising: The input question decomposition module is used to obtain the input questions of the target user, analyze the cognitive load index of the input questions, and decompose the input questions into multiple atomic questions based on the cognitive load index; A logical dependency graph generation module is used to generate a logical dependency graph based on the dependencies of the multiple atomic problems, and to identify the importance of each edge in the logical dependency graph; An atomic problem processing module is used to determine the response order of multiple atomic problems according to the importance level, process multiple atomic problems based on the response order, obtain the target answer corresponding to each atomic problem, and monitor the logical termination conditions in the atomic problem processing. The target answer integration module is used to integrate the target answers corresponding to all atomic questions when a logical termination condition is detected, so as to obtain a preliminary response to the input question; The logic judgment module is used to determine whether there is any logical inconsistency in the target answer in the preliminary response; The response answer generation module is used to input the atomic problem and the logical chain corresponding to the atomic problem into a preset large language model if there is a logical inconsistency, and generate the target response answer corresponding to the input problem. The target response answer generation module is used to take the preliminary response as the target response answer corresponding to the input question if the logic is consistent.

[0007] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described logic-enhanced question answer analysis method.

[0008] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described logic-enhanced question answer analysis method.

[0009] In the above-described solution based on logic-enhanced question-answer analysis method, apparatus, device, and medium, the input question of the target user can be obtained through a client, the cognitive load index of the input question can be analyzed, and the input question can be broken down into multiple atomic questions based on the cognitive load index. A logical dependency graph can be generated based on the dependencies of the multiple atomic questions, and the importance of each edge in the logical dependency graph can be identified. The response order of the multiple atomic questions can be determined according to the importance, and the multiple atomic questions can be processed based on the response order to obtain the target answer corresponding to each atomic question. Logical termination conditions in the processing of atomic questions can be monitored. When a logical termination condition is detected, the target answers corresponding to all atomic questions are integrated to obtain a preliminary response to the input question. It is determined whether there is a logical inconsistency in the target answers in the preliminary response. If a logical inconsistency exists, the atomic questions and their corresponding logical chains are... The input is fed into a preset large language model, generating a target response answer corresponding to the input question. If the logic is consistent, the preliminary response is used as the target response answer corresponding to the input question, and the target response answer is fed back to the client. In this invention, the input question is decomposed by a cognitive load index, resulting in independently verifiable atomic questions, solving the problem of unscientific decomposition of complex questions. A logical dependency graph of the atomic question dependencies is generated, and the importance of the edges is identified, enabling parallel processing of dependency-free questions and planning of the reasoning order, improving reasoning efficiency and coherence, and solving the problem of disordered reasoning. When processing questions according to importance, external knowledge is retrieved in conjunction with previous answers to avoid fragmented retrieval, and a logical termination mechanism prevents invalid calculations and error propagation. The target answer is integrated to generate a preliminary response, avoiding the looseness of simply piecing together facts. Through logical consistency judgment, inconsistencies are corrected by the large language model, and consistency is directly output, balancing the rigor and efficiency of the answer. Overall, it reduces illusions, improves the robustness of reasoning, and the response conforms to human cognition, enhancing credibility and interpretability. Attached Figure Description To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a schematic diagram of an application environment for a logic-enhanced question-answer analysis method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a question-answer analysis method based on logic enhancement in one embodiment of the present invention; Figure 3 yes Figure 2 A flowchart illustrating a specific implementation method of step S3; Figure 4 yes Figure 2 A flowchart illustrating a specific implementation of step S5; Figure 5 This is a schematic diagram of a logic-enhanced question-answer analysis device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 7 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0011] 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, not all, of the embodiments of the present invention. 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.

[0012] The question-answer analysis method based on logic enhancement provided in this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain the target user's input question from the client, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index. It then generates a logical dependency graph based on the dependencies of the multiple atomic questions and identifies the importance of each edge in the graph. The server determines the response order of the multiple atomic questions according to their importance, processes the multiple atomic questions based on the response order, obtains the target answer corresponding to each atomic question, and monitors the logical termination conditions in the processing of atomic questions. When a logical termination condition is detected, the target answers corresponding to all atomic questions are integrated to obtain a preliminary response to the input question. The server determines whether there is a logical inconsistency in the target answers in the preliminary response. If a logical inconsistency exists, the atomic question and its corresponding logical chain are input into a preset large language model to generate the output. The system calculates the target response answer for each input question. If the logic is consistent, the preliminary response is used as the target response answer for the input question, and the target response answer is fed back to the client. In this invention, the input question is decomposed by a cognitive load index, resulting in independently verifiable atomic questions, thus solving the problem of unscientific decomposition of complex questions. A logical dependency graph of atomic question dependencies is generated, and the importance of edges is identified. This allows for parallel processing of dependency-free questions, planning the reasoning order, improving reasoning efficiency and coherence, and solving the problem of disordered reasoning. When processing questions by importance, external knowledge is retrieved in conjunction with previous answers to avoid fragmented retrieval. A logical termination mechanism prevents invalid calculations and error propagation. The target answer is integrated to generate a preliminary response, avoiding the looseness of simply piecing together facts. Logical consistency is judged; inconsistencies are corrected using a large language model, and consistency is directly output, balancing the rigor and efficiency of the answer. Overall, this reduces illusions, improves reasoning robustness, and ensures responses align with human cognition, enhancing credibility and interpretability. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The present invention will now be described in detail through specific embodiments.

[0013] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the logic-enhanced question-answer analysis method provided in this embodiment of the invention includes the following steps: S1. Obtain the input question from the target user, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index.

[0014] In this embodiment of the invention, the input question refers to a complex question raised by the target user based on the needs of actual application scenarios such as medical care and financial technology, which requires the system to perform multi-dimensional reasoning and accurate response. The question usually contains multiple related information points or requires multiple steps of logical deduction to solve.

[0015] In detail, the input questions of the target user can be obtained from a pre-stored storage area through computer statements with data scraping capabilities (such as Java statements, Python statements, etc.), where the storage area includes, but is not limited to, databases and blockchains.

[0016] Furthermore, in order to reflect the degree of demand for reasoning resources by complex problems, it is necessary to quantify the complexity of the input problem. The cognitive load index is used to quantify the problem. The cognitive load index is a comprehensive index used to quantify the complexity of the input problem, which integrates dimensions such as the semantic range, reasoning steps and ambiguity of the input problem. In this embodiment of the invention, the cognitive load index for analyzing the input question includes: The input question is semantically embedded to obtain a semantic embedding representation, and the semantic range index of the input question is determined by the variance of the semantic embedding representation. The reasoning steps of the input problem are analyzed to obtain reasoning step indices; The ambiguity index of the input problem is calculated using a preset entropy function; The semantic range index, the reasoning step index, and the ambiguity index are normalized. The cognitive load index is obtained by weighted summing of the normalized semantic range index, the reasoning step index, and the ambiguity index.

[0017] In detail, a pre-trained semantic encoding model is used to transform the textual information of the input question into a low-dimensional, high-density vector. This pre-trained semantic encoding model includes, but is not limited to, Sentence-BERT and BERT. This embodiment selects the Sentence-BERT model because it has higher efficiency and accuracy in semantic similarity calculation tasks. The determination of the semantic scope index needs to be based on the variance of the semantic embedding representation. The variance of the semantic embedding representation reflects the breadth of topics covered by the input question. The larger the variance, the wider the semantic domain involved in the input question and the more dispersed the topic coverage; the smaller the variance, the more focused the input question is on a single semantic domain.

[0018] Specifically, reasoning step analysis refers to the process of identifying the independent reasoning steps required to solve an input question using a logical parsing algorithm and counting the number of these steps. Utilizing a rule-based logical parsing algorithm, this algorithm pre-constructs reasoning rule bases for fields such as medicine and fintech (e.g., rules for symptom analysis → etiology determination → treatment plan selection in medicine, and rules for financial indicator analysis → risk assessment → decision-making recommendations in fintech). By matching the input question with the reasoning logic in the rule base, the required reasoning steps are decomposed.

[0019] For example, in a medical scenario, the input question is: A diabetic patient has poor blood sugar control after using insulin, and also has abnormal kidney function. Should the insulin dosage be adjusted or should the kidney function problem be treated first? The reasoning process is as follows: First, determine whether the poor blood sugar control is related to insulin (e.g., insufficient dosage, improper injection, etc.); second, determine whether the abnormal kidney function affects insulin metabolism (e.g., reduced clearance, accumulation risk, etc.); third, based on the results of the first two steps, determine the priority between adjusting the insulin dosage and treating the kidney function problem. There are a total of 3 reasoning steps, so the reasoning step index is 3. In a fintech scenario, the input question is: A listed company's revenue decreased by 10% in 2024, while its debt-to-asset ratio increased by 5%. Will its bond credit rating be downgraded, and how should investors adjust their holdings? The reasoning process is as follows: First, analyze the impact of the 10% revenue decrease on the company's profitability; second, analyze the impact of the 5% increase in the debt-to-asset ratio on the company's solvency; third, based on the results of the first two steps, assess whether the bond credit rating should be downgraded; fourth, based on the rating assessment results, provide investors' holdings adjustment suggestions. There are a total of 4 reasoning steps, so the reasoning step index is 4.

[0020] Furthermore, the entropy function is a mathematical function used to quantify the semantic uncertainty of the input question. A higher entropy value indicates more ambiguous information in the input question (such as undefined parameters or vague expressions); a lower entropy value indicates more explicit information in the input question. Based on the probability distribution of keywords in the text, the formula is: Ambiguity Index = -Σ(keyword probability × log2 keyword probability), where keyword probability refers to the proportion of importance of a keyword in the semantics of the input question, calculated using the TF-IDF algorithm. Normalization refers to the process of using the min-max normalization algorithm to uniformly map the values ​​of the three indicators to the 0-1 range, aiming to eliminate the influence of differences in the dimensions of different indicators on the subsequent weighted summation. The formula for the min-max normalization algorithm is: Normalized Index = (Original Index - Minimum Index) / (Maximum Index - Minimum Index), where the minimum and maximum index values ​​are obtained statistically based on historical question datasets. The historical maximum values ​​for the semantic range index are 0 and 1, the historical maximum values ​​for the reasoning step index are 1 and 5, and the historical maximum values ​​for the ambiguity index are 0 and 2. The cognitive load index is obtained by weighted summation of the normalized semantic scope index, reasoning step index, and ambiguity index. Weighted summation refers to the process of calculating the comprehensive cognitive load index based on the influence weights of the three indices on the problem complexity. Through domain expert experience and historical data verification, it was determined that the weights of the semantic scope index, reasoning step index, and ambiguity index are all 1 / 3 (i.e., equally important), thus obtaining the cognitive load index.

[0021] In this embodiment of the invention, the input problem is broken down into atomic problems based on the cognitive load index. An atomic problem is the smallest independently verifiable problem unit obtained after breaking down the input problem, and each atomic problem corresponds to a specific sub-requirement of the input problem. A preset threshold τ(t) that decays over time is used (initial value 0.6, decaying by 0.001 daily to ensure the system can adapt to different problem complexities). When the cognitive load index exceeds τ(t), the input problem is recursively broken down until the cognitive load index of all sub-problems is below τ(t), until they are simple enough to be verified individually, forming a set of independently verifiable atomic problems. For example, in the medical scenario, τ(t) = 0.6, and the cognitive load index is 0.63 > 0.6. The input problem is broken down into three atomic problems: whether poor blood sugar control in diabetic patients is related to insulin, whether abnormal kidney function affects insulin metabolism, and the priority of adjusting insulin dosage versus treating kidney function problems. The calculated cognitive load indices for each atomic problem are 0.45, 0.48, and 0.55, respectively, all below 0.6. In the fintech scenario, τ(t) = 0.6, and the cognitive load index is 0.75 > 0.6. The input problem is broken down into four atomic problems: the impact of a 10% decrease in listed company revenue on profitability, the impact of a 5% increase in a listed company's debt-to-asset ratio on its debt repayment ability, whether a listed company's bond credit rating will be downgraded, and how investors should adjust their holdings. The cognitive load index for each atomic problem is below 0.6.

[0022] Furthermore, by integrating cognitive load indicators from three dimensions, the scientific and rational nature of problem decomposition is achieved, ensuring that the decomposed atomic problems can be independently verified, thus laying the foundation for subsequent logical reasoning.

[0023] S2. Generate a logical dependency graph based on the dependencies of the multiple atomic problems, and identify the importance of each edge in the logical dependency graph.

[0024] In this embodiment of the invention, dependency refers to the logical premise relationship between multiple atomic problems, that is, the solution to one atomic problem requires the answers to other atomic problems as a basis. The former is called the dependent atomic problem, and the latter is called the premise atomic problem. A logical dependency graph is a graphical structure with atomic problems as nodes, the dependency relationships between atomic problems as directed edges, and each edge labeled with an importance score, which can intuitively reflect the reasoning order of atomic problems.

[0025] In this embodiment of the invention, generating a logical dependency graph based on the dependencies of the plurality of atomic problems includes: Analyze the logical premise relationships between each atomic problem, and determine the dependency direction of each atomic problem based on the logical premise relationships; Construct a directed graph structure corresponding to the atomic problem based on the dependency direction and the dependency relationship; The feature vector of each edge in the directed graph structure is extracted using a preset network model; Calculate the importance score of each edge based on the feature vector; Each edge is sorted according to its importance score, and the sorted edges are associated with the nodes corresponding to the atomic problems to obtain a logical dependency graph.

[0026] In detail, logical premise relationship analysis refers to the process of determining whether premise-dependency relationships exist between atomic problems through domain knowledge graphs and logical reasoning rules. For example, constructing knowledge graphs in the medical and fintech fields (e.g., the medical field includes the relationship between diabetes treatment, kidney function impact, and insulin adjustment; the fintech field includes the relationship between financial indicators, credit ratings, and investment advice), and combining this with the reasoning rule that if the answer to atomic problem A is a necessary basis for the solution to atomic problem B, then A is a premise of B, thus determining the dependency relationships.

[0027] For example, in a medical scenario, the atomic problems include A (whether poor blood sugar is related to insulin), B (whether abnormal kidney function affects insulin metabolism), and C (the priority of adjusting dosage and treating kidney function). Through the knowledge graph, it can be seen that determining the priority of C requires first clarifying the cause of poor blood sugar in A (e.g., whether it's an insulin dosage issue) and the impact of kidney function on insulin in B (e.g., whether there is a risk of accumulation). Therefore, A and B are prerequisite atomic problems for C, and C is a dependent atomic problem, with the dependency direction being A→C and B→C. A and B do not need to depend on each other (determining the relationship between blood sugar and insulin does not require kidney function information, and vice versa), and there is no dependency direction. In a fintech scenario, the atomic problems include D (the impact of declining revenue on profitability), E (the impact of rising debt ratio on solvency), F (whether credit rating should be downgraded), and G (recommendations for portfolio adjustments). According to the knowledge graph, to determine the rating result of F, it is necessary to first clarify the changes in profitability in D and the changes in solvency in E. Therefore, D and E are the premises of F, and the dependency direction is D→F and E→F. To determine the holding recommendation of G, it is necessary to first clarify the rating result of F. Therefore, F is the premise of G, and the dependency direction is F→G. There is no dependency direction between D and E, and F only has a one-way dependency with D and E.

[0028] Specifically, directed graph structure construction refers to the process of storing atomic problems and dependencies using a graph data structure. Nodes represent atomic problems, and directed edges represent dependency directions (from premise atomic problems to dependent atomic problems). An adjacency list is used to store the directed graph. Each node in the adjacency list corresponds to a record containing a node ID (e.g., in a medical scenario, A's ID is 1, B's is 2, and C's is 3), a node name (the text of the atomic problem), and a list of outgoing edges (pointing to the IDs of the dependent atomic problems). The pre-defined network model refers to a graph neural network model used to extract the semantic and structural features of edges from the directed graph. Graph Attention Networks (GATs) are used to capture the strength of associations between nodes through an attention mechanism, making them more suitable for extracting dependency features. The feature vector of an edge contains three dimensions: dependency type (e.g., double premise-single dependency, multi-level dependency), semantic similarity between the premise and dependent atomic problems (calculated using Sentence-BERT), and the difference in the number of reasoning steps for the premise atomic problems (e.g., the difference between the number of reasoning steps for the premise atomic problems and the number of reasoning steps for the dependent atomic problems).

[0029] Furthermore, the importance score calculation refers to the process of obtaining a quantitative value for the importance of each edge by using a weighted summation algorithm, combining the weights of each dimension of the feature vector. Through domain expert annotation and model training, the weights for dependency type, semantic similarity, and difference in the number of inference steps are determined to be 0.3, 0.6, and 0.1, respectively (semantic similarity has the greatest impact on dependency importance, while difference in the number of inference steps has the least impact). The calculation formula is: Importance Score = 0.3 × Quantitative Value of Dependency Type + 0.6 × Semantic Similarity + 0.1 × Difference in the Number of Inference Steps. Edge sorting refers to the process of arranging all directed edges according to their importance scores from high to low. After sorting, each edge is associated with its corresponding premise node and dependency node to form a complete logical dependency graph. The logical dependency graph needs to be labeled with nodes (atomic problem text), directed edges (dependency direction), and edge importance scores to facilitate the subsequent determination of the response order. Taking the medical scenario as an example, the edge sorting result is B→C (0.72) > A→C (0.69). Associating the sorted edges with nodes A, B, and C yields a logical dependency graph: node B (prerequisite) points to node C (dependency) via an edge with a score of 0.72, and node A (prerequisite) points to node C (dependency) via an edge with a score of 0.69. In the fintech scenario, the edge sorting result is F→G (0.72) > E→F (0.69) > D→F (0.66). Associating the nodes yields a logical dependency graph: node F (prerequisite) points to node G (dependency) via an edge with a score of 0.72, node E (prerequisite) points to node F (dependency) via an edge with a score of 0.69, and node D (prerequisite) points to node F (dependency) via an edge with a score of 0.66.

[0030] Furthermore, based on the decomposed atomic problems entering the logical chain reasoning stage, the system first analyzes the logical relationships of all atomic problems, generating a dependency graph. Each atomic problem is a node, and the connections between nodes indicate who depends on whom. A specialized network model is also used to calculate the importance of each connection. Thus, those sub-problems that do not depend on each other can be processed simultaneously. For example, "Who is the author of a certain book?" and "What are the tourist attractions in the author's birthplace?" These two sub-problems can be solved in parallel without waiting for one to be completed before proceeding to the other. The importance of each edge in the logical dependency graph is identified to arrange the order of solving atomic problems, processing those sub-problems that do not depend on other answers first, and then solving the more complex ones step by step.

[0031] S3. Determine the response order of multiple atomic problems according to their importance, process the multiple atomic problems based on the response order, obtain the target answer corresponding to each atomic problem, and monitor the logical termination conditions in the atomic problem processing.

[0032] In this embodiment of the invention, the response order refers to the order in which atomic problems are processed, determined based on the dependencies of atomic problems and the importance of edges, including parallel processing order and serial processing order.

[0033] In this embodiment of the invention, determining the response order of multiple atomic problems according to their importance includes: Based on the logical dependency graph, determine the first and second dependencies corresponding to the atomic problem; Take the atomic problem corresponding to the first dependency as the starting point for processing; The processing order of the atomic problems corresponding to the second dependency relationship is determined based on the degree of importance. Identify parallel processing atomic problems among multiple atomic problems, and determine the execution order of the parallel processing atomic problems according to their importance; The response order of multiple atomic problems is determined according to the starting point, the processing order, and the execution order.

[0034] In detail, the first dependency refers to the dependency that an atomic problem does not depend on any other atomic problems; these atomic problems are called "no-premise atomic problems" and can be processed first. The second dependency refers to the dependency that an atomic problem depends on at least one other atomic problem; these atomic problems are called "premise atomic problems" and must be processed after the prerequisite atomic problems are processed. The starting processing point is the first processing stage in the entire response sequence, consisting of no-premise atomic problems. These atomic problems do not need to wait for the answers to other atomic problems and can be started directly.

[0035] Specifically, the processing order of atomic problems with prerequisites needs to be determined based on the importance of their dependent edges: if an atomic problem with prerequisites depends on multiple atomic problems with prerequisites, the atomic problems with higher importance of their corresponding edges should be processed first; if there are multi-level atomic problems with prerequisites (such as those depending on other atomic problems with prerequisites), they should be processed in the order of prerequisite → dependency. Parallel processing of atomic problems refers to atomic problems in the same processing stage that have no mutual dependencies. These atomic problems can be processed simultaneously to improve efficiency; if the importance of the corresponding edges of parallel atomic problems differs, resources should be allocated to the atomic problems with higher importance in parallel processing. Taking a medical scenario as an example, A and B in stage 1 are atomic problems processed in parallel. The importance of their corresponding edges is B→C (0.72) > A→C (0.69). Therefore, in parallel processing, computing resources are allocated to B first (e.g., higher retrieval priority), and the execution order is stage 1: B (priority), A (parallel). In fintech scenarios, stages D and E are atomic problems processed in parallel. The importance of their corresponding edges is E→F (0.69) > D→F (0.66). Therefore, resources are allocated to E first during parallel processing, and the execution order is Stage 1: E (priority), D (parallel). The response order is the complete processing flow after integrating the starting processing point, the serial processing order, and the parallel execution order. It is necessary to clarify the atomic problems, processing methods (parallel / serial), and resource allocation priorities of each stage.

[0036] For example, in a medical scenario, the final response order is: Stage 1: Parallel processing B (priority), A → Stage 2: Serial processing C. In a fintech scenario, the final response order is: Stage 1: Parallel processing E (priority), D → Stage 2: Serial processing F → Stage 3: Serial processing G.

[0037] Furthermore, based on the response order, a clear and efficient processing flow can be formed, solving the problem of chaotic processing order and ensuring that the reasoning process is both efficient and accurate.

[0038] In this embodiment of the invention, the target answer refers to the answer obtained by retrieving knowledge from external domains and solving the atomic problem, which has been verified by facts.

[0039] In this embodiment of the invention, reference is made to Figure 3 As shown, the process of processing multiple atomic problems based on the response order to obtain the target answer for each atomic problem includes: S31. Process each atomic problem sequentially according to the response order, take the atomic problem being processed as the target atomic problem, and identify the preceding atomic problem corresponding to the target atomic problem; S32. Concatenate the answer to the preceding atomic question with the text of the target atomic question to form a query text; S33. Use a preset shared encoder to convert the query text into a query vector; S34. Based on the query vector, retrieve external knowledge to obtain the target answer to the target atomic problem.

[0040] In detail, sequential processing refers to processing atomic problems step by step according to the response order, with each stage proceeding to the next only after the previous stage is completed. The target atomic problem is the atomic problem being processed in the current stage. Preceding atomic problems are the prerequisite atomic problems for the target atomic problem, and their answers are used as the context for retrieving the target atomic problem. Query text concatenation refers to integrating the target answer of the preceding atomic problem with the text content of the target atomic problem into a coherent search statement. The purpose is to provide the search engine with richer context and improve search accuracy. The concatenation rule is: answer of preceding atomic problem 1 + answer of preceding atomic problem 2 + target atomic problem (if there is no preceding atomic problem, then directly use the text of the target atomic problem).

[0041] For example, in a medical scenario, in stage 1 when processing B, the query text is: Does abnormal kidney function in diabetic patients affect insulin metabolism? When processing A, the query text is: Is poor blood glucose control in diabetic patients related to insulin? In stage 2 when processing C, the answer to A is: Insufficient insulin dosage, improper injection site, or insulin resistance may lead to poor blood glucose control, requiring monitoring of blood glucose fluctuations and insulin injection. The answer to B is: Abnormal kidney function reduces insulin clearance, leading to insulin accumulation and increasing the risk of hypoglycemia, requiring adjustment of insulin type and dosage according to kidney function stage. Therefore, the query text is: Insufficient insulin dosage, improper injection site, or insulin resistance may lead to poor blood glucose control, requiring monitoring of blood glucose fluctuations and insulin injection; Abnormal kidney function reduces insulin clearance, leading to insulin accumulation and increasing the risk of hypoglycemia, requiring adjustment of insulin type and dosage according to kidney function stage; For diabetic patients with poor blood glucose control after insulin use and accompanied by abnormal kidney function, should the insulin dosage be adjusted or should the kidney function problem be treated first?

[0042] Specifically, the pre-defined shared encoder refers to the Sentence-BERT model. The purpose of using a shared encoder is to ensure that the vector representation of the query text and the semantic embedding representation of the input question are in the same vector space, improving retrieval relevance. The query text is input into the Sentence-BERT model, which outputs a 768-dimensional vector. External knowledge retrieval refers to using a vector database (such as Milvus) to store domain knowledge (e.g., in the medical field, this includes guidelines for the diagnosis and treatment of diabetes and clinical drug use guidelines; in the fintech field, it includes guidelines for corporate financial analysis and bond credit rating guidelines). By calculating the cosine similarity between the query vector and the knowledge vectors in the vector database, the top 5 knowledge items with the highest similarity are obtained, and the target answer is generated based on this knowledge. For example, in a fintech scenario, the query vector retrieval for stage 1, E, yields the knowledge of the relationship between debt-to-equity ratio and solvency: if the debt-to-equity ratio exceeds the industry average by more than 5%, the debt repayment pressure increases significantly, the interest coverage ratio decreases by 10%-15%, and the default risk increases, generating the target answer E: if the debt-to-equity ratio increases by 5% and exceeds the industry average (assuming the industry average is 60%, and the company's is currently 65%), the debt repayment pressure increases, the interest coverage ratio may decrease by 10%-15%, and the default risk increases.

[0043] Furthermore, by using vector retrieval based on preceding answers, external knowledge highly relevant to the target atomic problem can be obtained, generating accurate and complete target answers, thus solving the problem of irrelevant or fragmented retrieval content in existing technologies.

[0044] In this embodiment of the invention, the logical termination condition refers to the preset rule used to determine whether the processing of atomic problems should stop. It includes four dimensions: retrieval confidence, dependency, semantic saturation, and inference steps. The purpose is to avoid invalid reasoning and error propagation.

[0045] In this embodiment of the invention, the logical termination condition in the monitoring atomic problem processing includes: The retrieval confidence level in the atomic problem processing is monitored. When the semantic similarity between the retrieved content and the target atomic problem is lower than the confidence threshold of the retrieval confidence level, a logical termination condition is triggered. Monitor the dependencies in the atomic problem processing, determine the question-and-answer result corresponding to the atomic problem based on the dependencies, and trigger a logical termination condition when the question-and-answer result is a question-and-answer failure. The semantic saturation in the atomic problem processing is monitored, and the updated search content and historical search content corresponding to the atomic problem are identified. When the similarity between the updated search content and the historical search content exceeds the semantic saturation, a logical termination condition is triggered. The number of inference steps in the atomic problem processing is monitored, and a logical termination condition is triggered when the number of inference steps reaches a preset maximum number.

[0046] In detail, the retrieval confidence score refers to the average semantic similarity between the top 5 retrieved knowledge items and the target atomic question. The confidence threshold is preset to 0.3 (verified through historical data, knowledge items below this threshold have extremely low relevance to the question). Semantic similarity is calculated using the Sentence-BERT model to measure the vector similarity between the retrieved knowledge text and the target atomic question text.

[0047] Specifically, question answering failure refers to a situation where all preceding atomic questions of the target atomic question have been processed, but a clear answer still cannot be generated after retrieving external knowledge (e.g., there is no description of the corresponding scenario in the knowledge). Semantic saturation refers to the average semantic similarity between newly retrieved knowledge and previously retrieved historical knowledge (preceding knowledge retrieved for the same target atomic question). The saturation threshold is preset to 0.9 (exceeding this threshold indicates that the new knowledge does not add any new information). Reasoning steps refer to the number of stages in processing atomic questions, with a preset maximum of 5 steps (through domain validation, reasoning exceeding 5 steps is prone to error propagation).

[0048] Furthermore, the response order is determined based on the logical dependency graph to ensure orderly reasoning; simultaneously, the reasoning process is controlled by monitoring termination conditions to avoid erroneous and invalid reasoning. Therefore, the generated target answer forms the basis for integrating the initial response, while the triggering of termination conditions directly determines the scope of the integrated atomic problems. Thus, monitoring the processing results is crucial to the accuracy and completeness of the final response.

[0049] S4. When a logical termination condition is detected, integrate the target answers corresponding to all atomic problems to obtain a preliminary response to the input problem.

[0050] In this embodiment of the invention, the preliminary response refers to the initial answer formed by integrating the target answer of the processed atomic problem according to the logical structure of the original input problem (such as problem background → sub-problem solution → comprehensive conclusion). This answer has not yet been verified for logical consistency and may contain contradictions or omissions.

[0051] In detail, the initial response integration must follow the principle of matching the logic of the original question, that is, the integration order must be consistent with the expression order and semantic logic of the input question to avoid fragmented answers. The integration process includes three steps: First, extract the core needs of the original input question (such as adjusting insulin dosage or treating kidney function first in a medical scenario, or whether to downgrade the rating and adjust holdings in a fintech scenario); second, classify the target answers of the atomic questions according to the sub-dimensions of the core needs (such as blood glucose-insulin, kidney-insulin, and priority answers in a medical scenario, and revenue-profit, debt ratio-debt repayment, rating, and holdings answers in a fintech scenario); finally, organize the language according to the structure of question introduction → sub-dimension answers → comprehensive conclusion to form an initial response.

[0052] Furthermore, by integrating the target answers according to the logical structure of the original input questions, a coherent and logical preliminary response is formed, rather than a fragmented list of answers. If the termination condition is triggered, only the answers to the processed atomic questions are integrated to ensure the integrity of the preliminary response; if the termination condition is not triggered, all atomic question answers are integrated. Therefore, the results of termination condition monitoring directly affect the scope of the preliminary response.

[0053] S5. Determine whether there is any logical inconsistency in the target answer in the preliminary response.

[0054] In this embodiment of the invention, logical inconsistency refers to a contradiction between the target answers of different atomic problems in the initial response (e.g., in a medical scenario, there are both "prioritizing kidney treatment in CKD3 stage" and "prioritizing dosage adjustment in CKD3 stage"), or a conflict between the answer and common sense in the domain. If there is logical inconsistency, the logic terminator will retain a reliable logical chain, initiate an alternative solution, and input the sub-problems, reliable chains, and retrieved context into the large language model to ultimately generate a response that is both accurate and conforms to human reasoning habits, rather than simply piecing together facts. The logical chain refers to the reasoning chain composed of atomic problems, dependencies between atomic problems, and the target answer, reflecting the derivation process from atomic problems to the initial response. The target response answer refers to the final answer to the input question.

[0055] S6. If there is a logical inconsistency, input the atomic problem and the corresponding logic chain of the atomic problem into the preset large language model to generate the target response answer corresponding to the input problem.

[0056] In this embodiment of the invention, reference is made to Figure 4 As shown, the step of inputting the atomic problem and its corresponding logic chain into a preset large language model to generate the target response answer corresponding to the input problem includes: S41. Input the atomic problem and the corresponding logic chain into a preset large language model to generate the target response answer corresponding to the input problem, including: S42. Extract the problem set and context data corresponding to the atomic problem; S43. Input the set of atomic problems, the logical chain, and the context data into the large language model, and output the alternative response to the input problem; S44. Generate the initial response answer corresponding to the input question based on the alternative response; S45. Verify the logical consistency and semantic coherence of the initial response answer. If the verification is successful, output the initial response answer as the target response answer corresponding to the input question.

[0057] In detail, the problem set refers to the text set of all atomic problems obtained by decomposing them using the cognitive load index. This set must completely retain the original expression of each atomic problem to ensure that the subsequent model can accurately understand the boundaries of the sub-problems. Contextual data refers to the external domain knowledge text retrieved for each atomic problem, including the knowledge source (such as the "Guidelines for Diabetes Diagnosis and Treatment" in the medical context, and the "Corporate Financial Analysis Standards" in the fintech context), the original knowledge text, and the semantic similarity score with the atomic problem. The purpose is to provide factual verification for the large language model.

[0058] Specifically, when inconsistencies arise, the system does not reject all work outright. Instead, it performs the following steps: Backtracking: Tracing back the entire reasoning process. Filtering and Retention: Identifying and retaining sub-problems and their answers that did not trigger any logical termination signals during the reasoning process and are not contradictory. Forming Partial Results: These retained, self-consistent sub-problems and their dependencies constitute one or more reliable logical chains. While they are insufficient to directly synthesize the final answer, they are correct and valuable in themselves. A logical chain refers to a structured reasoning chain composed of atomic problems, dependencies between atomic problems, and corresponding target answers. Its expression must clearly define the relationship between premise atomic problems → dependent atomic problems and answer support. For example, in a medical scenario, the logical chain might be: Does abnormal kidney function affect insulin metabolism? (Answer: CKD stage 3 and above affects) → Priority of adjusting insulin dosage and treating kidney problems (Answer: CKD stage 3 prioritizes kidney treatment); Is poor blood sugar control related to insulin? (Answer: Possibly due to insufficient dosage) → Priority of adjusting insulin dosage and treating kidney problems (Answer: CKD stage 1-2 prioritizes dosage adjustment). Pre-defined large language models refer to large language models that have undergone domain-specific fine-tuning (such as GPT-4 fine-tuned for medical scenarios and Claude 3 fine-tuned for fintech scenarios), possessing logical reasoning capabilities based on domain knowledge. The input format follows the following: Question set: [Atomic Question 1, Atomic Question 2...]; Logical chain: [Premise → Dependency (Answer)...]; Context: [Knowledge 1 (Similarity), Knowledge 2 (Similarity)...]; Task: Correct logical contradictions based on facts and generate a coherent response.

[0059] Furthermore, the initial response is the result of format optimization and information supplementation of the alternative response. Optimization directions include: first, supplementing explanations of key domain parameters (such as CKD staging in the medical field, and the industry average debt-to-equity ratio in the fintech field) to ensure readability; second, adjusting the logical order of statements to conform to human cognitive habits (such as analyzing the causes of the problem first, then providing layered solutions); and third, retaining the knowledge source annotations in the contextual data to enhance the credibility of the response. Through supplementary explanations and logical optimization, the initial response maintains both professional accuracy and aligns with the user's cognitive level. Furthermore, logical consistency verification employs a domain knowledge graph comparison method. This involves constructing knowledge graphs for the medical (including nodes related to diabetes diagnosis and treatment, and kidney function staging) and fintech (including nodes related to financial indicators and credit rating) domains. Key conclusions in the initial response (e.g., prioritizing kidney treatment for CKD stage 3, reducing holdings by 50%-70% for AA-level patients) are compared with the node relationships in the knowledge graph. If all conclusions are consistent with the graph, the logical consistency verification passes. Semantic coherence verification uses a sentence connection scoring method. A pre-trained language coherence model (e.g., BERT-Coherence) scores the sentence coherence of the initial response, with a maximum score of 10 points and a preset passing threshold of 8 points. A score meeting the threshold indicates successful semantic coherence verification. If any verification fails (e.g., the initial response in logical verification indicates prioritizing dosage adjustment for CKD stage 3, contradicting the graph; or the semantic verification score is 7.5, below the threshold), the process returns to the sub-step, re-inputting the question set, logical chain, context, and reason for failure into the large language model to generate a new alternative response until verification passes. A dual verification mechanism ensures the logical correctness and semantic fluency of the target response, enhancing users' trust in the answer.

[0060] Furthermore, if the initial response logic is consistent, the target response answer is obtained directly; if inconsistent, a correction process is initiated. The extracted question set and context data provide the foundation for model input, the alternative responses provide material for the initial response answer, and the initial response answer provides the object for verification. These four sub-steps progress step by step, ultimately generating the target response answer. S7. If the logic is consistent, the preliminary response shall be taken as the target response answer corresponding to the input question.

[0061] In this embodiment of the invention, logical consistency means that in the generated preliminary response, there are no contradictions among the target answers to all atomic questions, and the answers completely match domain common sense and external search knowledge, requiring no further correction. At this point, the preliminary response already possesses accuracy, coherence, and interpretability, and can be directly output as the target response answer without initiating a correction process.

[0062] In detail, the logical consistency of the preliminary response is confirmed through a rapid consistency check. The check method involves extracting the core conclusions from the preliminary response (the key answers corresponding to each atomic question) and comparing them one by one with the retrieved context data. If all core conclusions can be directly supported by the context data and there are no conflicts between the conclusions, then the response is considered logically consistent. Subsequently, the logically consistent preliminary response undergoes format standardization processing, including unifying the expression of professional terminology (e.g., unifying CKD staging instead of kidney function staging in the medical context, and unifying asset-liability ratio instead of debt ratio in the fintech context), and supplementing the unit labeling of key data (e.g., labeling a 50%-70% reduction as a holding percentage, and adjusting 2-4 units as insulin dosage units), ensuring that the response format is standardized and the information is complete. Finally, the standardized preliminary response is directly output as the target response answer to the input question.

[0063] Furthermore, when the initial response logic is consistent, it is directly used as the target response answer, eliminating the need for model correction and verification processes and reducing computational resource consumption. On the other hand, through rapid consistency verification and format standardization, the output target response answer is ensured to retain the accuracy of the initial response while also having a standardized format and clear expression, avoiding quality degradation caused by omitting the correction process.

[0064] As can be seen, the above scheme, by decomposing the input problem using the cognitive load index, yields independently verifiable atomic problems, addressing the issue of unscientific decomposition of complex problems. Generating a logical dependency graph of atomic problem dependencies and identifying the importance of edges allows for parallel processing of dependency-free problems and planning of the reasoning order, improving reasoning efficiency and coherence, and resolving the problem of disordered reasoning. When processing problems according to importance, combining prior answers with external knowledge retrieval avoids fragmented retrieval, and the logical termination mechanism prevents invalid computation and error propagation. Integrating the target answer to generate an initial response avoids the looseness of simply piecing together facts. Through logical consistency judgment, inconsistencies are corrected using a large language model, while consistency is directly output, balancing the rigor and efficiency of the answer. Overall, this reduces illusions, improves reasoning robustness, aligns the response with human cognition, and enhances credibility and interpretability.

[0065] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0066] In one embodiment, a logic-enhanced question-answer analysis device is provided, which corresponds one-to-one with the logic-enhanced question-answer analysis method described in the above embodiments. For example... Figure 5As shown, the logic-enhanced question-answer analysis device includes an input question splitting module 101, a logic dependency graph generation module 102, an atomic question processing module 103, a target answer integration module 104, a logic judgment module 105, a response answer generation module 106, and a target response answer generation module 107. Detailed descriptions of each functional module are as follows: The input question splitting module 101 is used to obtain the input question of the target user, analyze the cognitive load index of the input question, and split the input question into multiple atomic questions according to the cognitive load index; The logical dependency graph generation module 102 is used to generate a logical dependency graph based on the dependency relationships of the multiple atomic problems, and to identify the importance of each edge in the logical dependency graph; The atomic problem processing module 103 is used to determine the response order of multiple atomic problems according to the importance, process multiple atomic problems based on the response order, obtain the target answer corresponding to each atomic problem, and monitor the logical termination condition in the atomic problem processing. The target answer integration module 104 is used to integrate the target answers corresponding to all atomic problems when a logical termination condition is detected, so as to obtain a preliminary response to the input problem. The logic judgment module 105 is used to determine whether there is a logical inconsistency in the target answer in the preliminary response; The response answer generation module 106 is used to input the atomic problem and the logic chain corresponding to the atomic problem into a preset large language model if there is a logical inconsistency, and generate the target response answer corresponding to the input problem. The target response answer generation module 107 is used to take the preliminary response as the target response answer corresponding to the input question if the logic is consistent.

[0067] In one embodiment, the input question splitting module 101, when performing cognitive load index analysis on the input questions, is used to: The input question is semantically embedded to obtain a semantic embedding representation, and the semantic range index of the input question is determined by the variance of the semantic embedding representation. The reasoning steps of the input problem are analyzed to obtain reasoning step indices; The ambiguity index of the input problem is calculated using a preset entropy function; The semantic range index, the reasoning step index, and the ambiguity index are normalized. The cognitive load index is obtained by weighted summing of the normalized semantic range index, the reasoning step index, and the ambiguity index.

[0068] In one embodiment, the logical dependency graph generation module 102, when generating a logical dependency graph based on the dependencies of the plurality of atomic problems, is configured to: Analyze the logical premise relationships between each atomic problem, and determine the dependency direction of each atomic problem based on the logical premise relationships; Construct a directed graph structure corresponding to the atomic problem based on the dependency direction and the dependency relationship; The feature vector of each edge in the directed graph structure is extracted using a preset network model; Calculate the importance score of each edge based on the feature vector; Each edge is sorted according to its importance score, and the sorted edges are associated with the nodes corresponding to the atomic problems to obtain a logical dependency graph.

[0069] In one embodiment, the atomic problem processing module 103, when performing the operation of determining the response order of multiple atomic problems according to the importance level, is configured to: Based on the logical dependency graph, determine the first and second dependencies corresponding to the atomic problem; Take the atomic problem corresponding to the first dependency as the starting point for processing; The processing order of the atomic problems corresponding to the second dependency relationship is determined based on the degree of importance. Identify parallel processing atomic problems among multiple atomic problems, and determine the execution order of the parallel processing atomic problems according to their importance; The response order of multiple atomic problems is determined according to the starting point, the processing order, and the execution order.

[0070] In one embodiment, the atomic problem processing module 103, when performing the processing of multiple atomic problems based on the response order to obtain the target answer corresponding to each atomic problem, is further configured to: Each atomic problem is processed sequentially according to the response order, the atomic problem being processed is taken as the target atomic problem, and the preceding atomic problem corresponding to the target atomic problem is identified; The answer to the preceding atomic question is concatenated with the text of the target atomic question to form the query text; The query text is converted into a query vector using a preset shared encoder; Based on the query vector, external knowledge is retrieved to obtain the target answer to the target atomic problem.

[0071] In one embodiment, the atomic problem processing module 103, when executing the logical termination condition for monitoring atomic problem processing, is further configured to: The retrieval confidence level in the atomic problem processing is monitored. When the semantic similarity between the retrieved content and the target atomic problem is lower than the confidence threshold of the retrieval confidence level, a logical termination condition is triggered. Monitor the dependencies in the atomic problem processing, determine the question-and-answer result corresponding to the atomic problem based on the dependencies, and trigger a logical termination condition when the question-and-answer result is a question-and-answer failure. The semantic saturation in the atomic problem processing is monitored, and the updated search content and historical search content corresponding to the atomic problem are identified. When the similarity between the updated search content and the historical search content exceeds the semantic saturation, a logical termination condition is triggered. The number of inference steps in the atomic problem processing is monitored, and a logical termination condition is triggered when the number of inference steps reaches a preset maximum number.

[0072] In one embodiment, the logic judgment module 106, when executing the process of inputting the atomic problem and the corresponding logic chain into a preset large language model to generate the target response answer corresponding to the input problem, is used to: The atomic problem and its corresponding logic chain are input into a preset large language model to generate the target response answer corresponding to the input problem, including: Extract the problem set and context data corresponding to the atomic problem; Input the set of atomic problems, the logical chain, and the context data into the large language model, and output the alternative response to the input problem; Generate an initial response answer corresponding to the input question based on the alternative response; The logical consistency and semantic coherence of the initial response answer are verified. If the verification is successful, the initial response answer is output as the target response answer corresponding to the input question.

[0073] This invention provides a logic-enhanced question-answer analysis device. By decomposing the input question using a cognitive load index, it obtains independently verifiable atomic questions, addressing the problem of unscientific decomposition of complex questions. It generates a logical dependency graph of atomic question dependencies and identifies the importance of edges, enabling parallel processing of dependency-free questions and planning the reasoning order, improving reasoning efficiency and coherence, and solving the problem of disordered reasoning. When processing questions according to importance, it combines previous answers with external knowledge retrieval to avoid fragmented retrieval, and a logical termination mechanism prevents invalid calculations and error propagation. It integrates the target answer to generate an initial response, avoiding the looseness of simply piecing together facts. Through logical consistency judgment, it corrects inconsistencies using a large language model and outputs directly when consistent, balancing the rigor and efficiency of the answer. Overall, it reduces illusions, improves reasoning robustness, and ensures responses align with human cognition, enhancing credibility and interpretability.

[0074] Specific limitations regarding the logic-enhanced question-answer analysis device can be found in the limitations of the logic-enhanced question-answer analysis method described above, and will not be repeated here. Each module in the aforementioned logic-enhanced question-answer analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0075] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements server-side functions or steps of a logic-enhanced question-answer analysis method.

[0076] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements client-side functions or steps of a logic-enhanced question-answer analysis method.

[0077] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Obtain the input question from the target user, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index; Generate a logical dependency graph based on the dependencies of the multiple atomic problems, and identify the importance of each edge in the logical dependency graph; The response order of multiple atomic problems is determined according to their importance, and the multiple atomic problems are processed based on the response order to obtain the target answer corresponding to each atomic problem, while monitoring the logical termination conditions in the processing of atomic problems; When a logical termination condition is detected, the target answers corresponding to all atomic problems are integrated to obtain a preliminary response to the input problem; Determine whether there is any logical inconsistency in the target answer in the preliminary response; If a logical inconsistency exists, the atomic problem and the logical chain corresponding to the atomic problem are input into a preset large language model to generate the target response answer corresponding to the input problem. If the logic is consistent, the preliminary response will be taken as the target response answer corresponding to the input question.

[0078] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Obtain the input question from the target user, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index; Generate a logical dependency graph based on the dependencies of the multiple atomic problems, and identify the importance of each edge in the logical dependency graph; The response order of multiple atomic problems is determined according to their importance, and the multiple atomic problems are processed based on the response order to obtain the target answer corresponding to each atomic problem, while monitoring the logical termination conditions in the processing of atomic problems; When a logical termination condition is detected, the target answers corresponding to all atomic problems are integrated to obtain a preliminary response to the input problem; Determine whether there is any logical inconsistency in the target answer in the preliminary response; If a logical inconsistency exists, the atomic problem and the logical chain corresponding to the atomic problem are input into a preset large language model to generate the target response answer corresponding to the input problem. If the logic is consistent, the preliminary response will be taken as the target response answer corresponding to the input question.

[0079] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0080] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0081] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0082] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.

[0083] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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, and should all be included within the protection scope of the present invention.

Claims

1. A question-answer analysis method based on logic enhancement, characterized in that, include: Obtain the input question from the target user, analyze the cognitive load index of the input question, and break down the input question into multiple atomic questions based on the cognitive load index; Generate a logical dependency graph based on the dependencies of the multiple atomic problems, and identify the importance of each edge in the logical dependency graph; The response order of multiple atomic problems is determined according to their importance, and the multiple atomic problems are processed based on the response order to obtain the target answer corresponding to each atomic problem, while monitoring the logical termination conditions in the processing of atomic problems; When a logical termination condition is detected, the target answers corresponding to all atomic problems are integrated to obtain a preliminary response to the input problem; Determine whether there is any logical inconsistency in the target answer in the preliminary response; If a logical inconsistency exists, the atomic problem and the logical chain corresponding to the atomic problem are input into a preset large language model to generate the target response answer corresponding to the input problem. If the logic is consistent, the preliminary response will be taken as the target response answer corresponding to the input question.

2. The question-answer analysis method based on logic enhancement as described in claim 1, characterized in that, The cognitive load indicators for analyzing the input question include: The input question is semantically embedded to obtain a semantic embedding representation, and the semantic range index of the input question is determined by the variance of the semantic embedding representation. The reasoning steps of the input problem are analyzed to obtain reasoning step indices; The ambiguity index of the input problem is calculated using a preset entropy function; The semantic range index, the reasoning step index, and the ambiguity index are normalized. The cognitive load index is obtained by weighted summing of the normalized semantic range index, the reasoning step index, and the ambiguity index.

3. The question-answer analysis method based on logic enhancement as described in claim 1, characterized in that, The step of generating a logical dependency graph based on the dependencies of the multiple atomic problems includes: Analyze the logical premise relationships between each atomic problem, and determine the dependency direction of each atomic problem based on the logical premise relationships; Construct a directed graph structure corresponding to the atomic problem based on the dependency direction and the dependency relationship; The feature vector of each edge in the directed graph structure is extracted using a preset network model; Calculate the importance score of each edge based on the feature vector; Each edge is sorted according to its importance score, and the sorted edges are associated with the nodes corresponding to the atomic problems to obtain a logical dependency graph.

4. The question-answer analysis method based on logic enhancement as described in claim 3, characterized in that, Determining the response order of multiple atomic problems according to their importance includes: Based on the logical dependency graph, determine the first and second dependencies corresponding to the atomic problem; Take the atomic problem corresponding to the first dependency as the starting point for processing; The processing order of the atomic problems corresponding to the second dependency relationship is determined based on the degree of importance. Identify parallel processing atomic problems among multiple atomic problems, and determine the execution order of the parallel processing atomic problems according to their importance; The response order of multiple atomic problems is determined according to the starting point, the processing order, and the execution order.

5. The question-answer analysis method based on logic enhancement as described in claim 1, characterized in that, The process of processing multiple atomic problems based on the response order to obtain the target answer for each atomic problem includes: Each atomic problem is processed sequentially according to the response order, the atomic problem being processed is taken as the target atomic problem, and the preceding atomic problem corresponding to the target atomic problem is identified; The answer to the preceding atomic question is concatenated with the text of the target atomic question to form the query text; The query text is converted into a query vector using a preset shared encoder; Based on the query vector, external knowledge is retrieved to obtain the target answer to the target atomic problem.

6. The question-answer analysis method based on logic enhancement as described in claim 1, characterized in that, The logical termination conditions in the monitoring atomic problem processing include: The retrieval confidence level in the atomic problem processing is monitored. When the semantic similarity between the retrieved content and the target atomic problem is lower than the confidence threshold of the retrieval confidence level, a logical termination condition is triggered. Monitor the dependencies in the atomic problem processing, determine the question-and-answer result corresponding to the atomic problem based on the dependencies, and trigger a logical termination condition when the question-and-answer result is a question-and-answer failure. The semantic saturation in the atomic problem processing is monitored, and the updated search content and historical search content corresponding to the atomic problem are identified. When the similarity between the updated search content and the historical search content exceeds the semantic saturation, a logical termination condition is triggered. The number of inference steps in the atomic problem processing is monitored, and a logical termination condition is triggered when the number of inference steps reaches a preset maximum number.

7. The question-answer analysis method based on logic enhancement as described in claim 1, characterized in that, The step of inputting the atomic problem and its corresponding logic chain into a preset large language model to generate the target response answer corresponding to the input problem includes: The atomic problem and its corresponding logic chain are input into a preset large language model to generate the target response answer corresponding to the input problem, including: Extract the problem set and context data corresponding to the atomic problem; Input the set of atomic problems, the logical chain, and the context data into the large language model, and output the alternative response to the input problem; Generate an initial response answer corresponding to the input question based on the alternative response; The logical consistency and semantic coherence of the initial response answer are verified. If the verification is successful, the initial response answer is output as the target response answer corresponding to the input question.

8. A question-answer analysis device based on logic enhancement, characterized in that, include: The input question decomposition module is used to obtain the input questions of the target user, analyze the cognitive load index of the input questions, and decompose the input questions into multiple atomic questions based on the cognitive load index; A logical dependency graph generation module is used to generate a logical dependency graph based on the dependencies of the multiple atomic problems, and to identify the importance of each edge in the logical dependency graph; An atomic problem processing module is used to determine the response order of multiple atomic problems according to the importance level, process multiple atomic problems based on the response order, obtain the target answer corresponding to each atomic problem, and monitor the logical termination conditions in the atomic problem processing. The target answer integration module is used to integrate the target answers corresponding to all atomic questions when a logical termination condition is detected, so as to obtain a preliminary response to the input question; The logic judgment module is used to determine whether there is any logical inconsistency in the target answer in the preliminary response; The response answer generation module is used to input the atomic problem and the logical chain corresponding to the atomic problem into a preset large language model if there is a logical inconsistency, and generate the target response answer corresponding to the input problem. The target response answer generation module is used to take the preliminary response as the target response answer corresponding to the input question if the logic is consistent.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the logic-enhanced question answer analysis method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the logic-enhanced question answer analysis method as described in any one of claims 1 to 7.