Large model inductive deductive reasoning method
By constructing a case retrieval and FOL rules based on fact reconstruction, and combining a self-reflective strategy with deep learning and semantic constraints, the problem of logical rigidity and generalization in complex cases of large models is solved, and refined logical induction and adaptive deduction are achieved, thereby improving the accuracy and adaptability of reasoning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing large-scale model reasoning techniques suffer from overgeneralization of surface semantics when faced with complex cases, lack the ability to make refined logical inductions of key factual differences between similar cases, and have rigid deductive processes that are difficult to adapt to exceptional circumstances and complex contexts.
By constructing a case retrieval mechanism based on fact reconstruction, utilizing FOL rules and deep learning models, and combining thought chain technology for logical reasoning, and introducing a self-reflective strategy with semantic constraints, refined logical induction and adaptive deduction are achieved.
It effectively eliminates logically contradictory noise samples, achieves accurate logical mapping of case factual features, and improves the model's adaptability and reasoning accuracy in complex scenarios.
Smart Images

Figure CN121809689A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large models, specifically a method for inductive and deductive reasoning in large models. Background Technology
[0002] In recent years, large language models (LLMs, hereinafter referred to as large models) have been widely applied in knowledge-intensive decision-making fields such as rock mechanics engineering, judicial decision prediction, and medical auxiliary diagnosis due to their powerful semantic understanding and text generation capabilities. In these fields, decision-making often relies on the guidance of historical experience, that is, by retrieving and analyzing similar historical cases to assist in solving current problems. Traditional processing methods mainly rely on manual analysis by domain experts, which is difficult to cope with the growth of massive amounts of data. Therefore, combining historical experience with large models to achieve intelligent reasoning has become a current research hotspot.
[0003] Currently, technical solutions utilizing large model inference can be mainly divided into the following three categories: The first category is context-based learning methods. These methods utilize vector databases and semantic retrieval techniques to find historical precedents that are textually similar to the target case and incorporate them as context into the prompt words input into the model. The core logic lies in leveraging the model's few-shot learning ability to generate answers through analogy and imitation. While this method can supplement external knowledge, it suffers from severe limitations in surface pattern matching. The model often merely replicates the textual patterns of historical cases, lacking the ability to delve into the deep causal logic within similar precedents. When faced with superficially similar cases that contradict each other in their underlying causal logic, it is highly susceptible to being misled by distracting examples, leading to biased inferences.
[0004] The second category is rule-based enhancement methods. These methods attempt to extract commonalities from multiple similar cases using large models to construct universal judgment rules or mechanistic interpretation logic. However, existing techniques tend to overgeneralize based on surface patterns during the inductive process, lacking the ability to perform refined logical induction on key factual differences between similar cases. This results in generated rules often lacking clear application boundaries, failing to establish a precise causal mapping between fine-grained factual features and judgment outcomes, and easily leading to incorrect rule matching or ambiguous reasoning conclusions.
[0005] The third category is based on structured deductive reasoning. This type of method constrains the model generation process by introducing explicit logical frameworks (such as syllogisms or predefined cue templates), attempting to ensure the rigor of reasoning by forcing the model to follow a specific path (such as "major premise-minor premise-conclusion"). However, this method faces the problem of deductive rigidity. Real-world cases (especially complex scenarios such as law and engineering) often contain uncertainties and exceptions, and predefined rigid logical structures cannot cover all situations. When faced with exceptions outside the rule system or specific contextual situations, this type of method lacks adaptive adjustment capabilities and is prone to erroneous reasoning results due to mechanically applying rules.
[0006] In summary, the existing technical solutions mainly have the following drawbacks: (1) Existing research usually focuses on a single level, or simply on retrieval enhancement, or rigid logical constraints, while a systematic framework that integrates refined induction and adaptive deduction is lacking.
[0007] (2) Context-based learning methods mainly rely on surface semantic similarity. The model is difficult to penetrate the data appearance and dig out the underlying mechanism. When faced with cases that are superficially similar but logically contradictory, it is easy to produce misleading reasoning.
[0008] (3) Existing inductive methods tend to overgeneralize based on surface patterns and lack the ability to make refined logical inductions on the key factual differences between similar cases, resulting in the generated rules lacking specificity and failing to cover complex and ever-changing actual working conditions or case details.
[0009] (4) Existing deductive methods mostly use fixed logical templates. When applying rules, they lack the ability to perceive specific contexts and cannot flexibly handle exceptions outside the rule system, resulting in a mechanical and rigid reasoning process and poor reasoning effect. Summary of the Invention
[0010] To address the shortcomings of existing technologies, the present invention aims to propose a large-scale inductive-deductive reasoning method, comprising: Received target case for reasoning and a historical case database, which contains multiple unstructured historical cases. The historical cases mentioned are historical legal precedents, covering all unstructured historical cases. By performing fact-based retrieval and filtering, a carefully selected set of precedents with semantic similarity and consistent categories is obtained. ; The FOL rules are constructed and iterated from a carefully selected set of precedents using the Mind Chain technique, and then filtered through positive and negative feedback and confidence levels to obtain the FOL rule set. The target cases are processed by a pre-trained deep learning model to obtain a semantic candidate pool. Logical solutions are determined based on the FOL rule set, and consistency checks are performed with the semantic candidate pool to determine conflict information. Then, the weights of the logical solutions are calculated. Based on the logical solution, the weight of the logical solution, and the semantic candidate pool, the legal judgment result corresponding to the target case is determined.
[0011] Optionally, the target case to be inferred is received. and a historical case database, which contains multiple unstructured historical cases. The historical cases mentioned are historical legal precedents, covering all unstructured historical cases. By performing fact-based retrieval and filtering, a carefully selected set of precedents with semantic similarity and consistent categories is obtained. ,include: Receive all unstructured historical cases A prompt summarizing the contextual logic of historical cases is constructed. This prompt is then input into the large model to obtain a structured textual description. The structured text description This includes the subject, the object, the criminal act, the criminal motive, the post-crime behavior, and the objective consequences; Upon receiving the target case to be reasoned about, based on the target case, all unstructured historical cases are processed. By conducting searches and filtering, a carefully selected set of precedents was obtained. .
[0012] Optionally, upon receiving the target case to be reasoned about, based on the target case, all unstructured historical cases are processed. By conducting searches and filtering, a carefully selected set of precedents was obtained. ,include: Upon receiving the target case to be reasoned about, calculate the original facts of the target case and their relationship with each historical case. The text semantic similarity is obtained by sorting all the text semantic similarity from high to low, and the historical cases corresponding to the top N text semantic similarity are obtained to form a coarse candidate pool. By inputting the target case into a pre-trained domain classification model, multiple candidate legal judgments for the target case are obtained. The multiple candidate legal judgments include legal provisions, legal provisions and charges, and legal provisions and sentences; Obtain the legal judgment results corresponding to historical cases in the coarse candidate pool. Remove historical cases whose historical legal judgment results are inconsistent with the predicted candidate legal judgment results, leaving only the coarse candidate pool with consistent legal judgment results. Sort the textual semantic similarity of these consistent historical cases from high to low, and select the top K cases to form a selected precedent set. .
[0013] Optionally, FOL rules can be constructed and iterated from a selected set of precedents using the mind chain technique, and filtered through positive and negative feedback and confidence levels to inductively derive a set of FOL rules, including: Construct a FOL hint template, which includes the definition of the FOL notation system. The FOL notation system includes variables, predicate symbols, and quantifiers. Variables are defined as entity objects in historical cases. Predicate symbols are used to describe the attributes, states, or actions of entities. Quantifiers include universal quantifiers and existential quantifiers. The structured description of historical cases from a selected set of precedents is then used. Input the large model, and use the FOL prompt template to guide the large model to perform formal reasoning and generate FOL symbols corresponding to historical cases; From the selected set of historical cases, the historical case with the highest textual semantic similarity to the target case is selected and used as the starting seed case. The FOL rule for the starting seed case is constructed as follows: Where A represents the rule premise, which is formed by connecting the variables, predicate symbols, and quantifiers of the initial seed case through logical connectors; and C represents the historical legal judgment result of the initial seed case. Set the confidence level of the initial seed case, which includes the number of times the rule correctly predicted the outcome. The number of errors in rule prediction The confidence state of the initial seed case is initialized as follows: ; The historical cases excluding the initial seed case in the selected precedent set are taken as candidate cases. According to the text semantic similarity from high to low, the first candidate case is taken as the current historical case, the FOL rule of the initial seed case is taken as the current rule, and the confidence state of the initial seed case is taken as the current confidence state. Construct a feedback-driven rule evolution thinking chain, and guide the large model to logically deduce the legal judgment results of the current historical cases through the rule evolution thinking chain; If the legal judgment in a current historical case is consistent with the legal judgment under the current rules, the current confidence level will be... Add 1, Remaining unchanged, we obtain the confidence state after the rule update. Guided by the rule evolution thought chain, the large model optimizes the semantic representation of the rule preconditions in the current rule. The optimized rule preconditions and the legal judgment result in the current rule form a new FOL rule. The confidence state of the new FOL rule is set as follows: The new FOL rule is used as the current rule. Based on the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution. The rule evolution thinking chain guides the large model to logically deduce the current historical case until all candidate cases have been traversed. In cases where the legal judgments of current historical cases differ from those under current rules, the current confidence level will be... remain unchanged. Increment by one to obtain the confidence level of the updated rule; combine the rule preconditions of the current rule with the current historical cases. Input the large model to obtain the key difference element D, and construct conservative rules and specialized rules; Conservative rules are expressed as: ;in, No, indicating a key differentiator. Indicates A absorption Set the confidence level of the conservative rule as follows: ; Specialized rules are represented as follows: ;in, For the new legal judgment outcome; the confidence state of the specialized rule is set as follows: ; Based on preset prompts, the large model is driven to select one of conservative and specialized rules using a thought chain, and then select it as the current rule. According to the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution: the large model is guided to logically deduce the current historical case through the rule evolution thought chain until all candidate cases have been traversed. For each rule, a confidence score is calculated based on the rule's confidence level, specifically using the following formula: ; in, For smoothing coefficients; The FOL rule set is composed of multiple rules with a confidence score of 1.
[0014] Optionally, a pre-trained deep learning model is used to process the target cases to obtain a semantic candidate pool. Logical solutions are determined based on the FOL rule set, and consistency checks are performed with the semantic candidate pool to identify conflict information. Finally, the weights of the logical solutions are calculated, including: The target cases are input into the semantic awareness model to obtain a semantic candidate pool. Specifically, the target cases are processed through word-level encoding Bi-GRU and an attention mechanism to generate sentence vectors. ; Transform sentence vectors After sentence-level encoding using Bi-GRU and an attention mechanism, a factual context vector containing the global semantics of the case is obtained. ; Fact Context Vector Cross-attention calculation is performed with external domain knowledge vectors to generate a fused feature vector that aligns with the facts and knowledge of the target case. The external domain knowledge vectors include legal definitions, crime definitions, and common sentencing opinions. This fused feature vector is input into a fully connected layer and processed by a Softmax function to predict the probability distribution vector of the target judgment result. This probability distribution vector contains the probability values of all legal judgment result categories, specifically implemented through the following formula: ; in, This is the probability distribution vector of all categories for the target decision result. and These are the trainable weight matrix and bias vector of the fully connected layer, respectively. For activation function, Represents an external domain knowledge vector. This is the scaling factor in the attention mechanism. Used to adjust the magnitude of the dot product. A semantic relevance score matrix representing the relationship between facts and knowledge; Based on the probability distribution vector of the target judgment result, the probability values of all legal judgment result categories are arranged in descending order to obtain the top A legal judgment result categories and their corresponding probability values, forming a semantic candidate pool. Input the FOL rule set and target cases into the large model to obtain the logical solution; obtain the ranking position and corresponding probability of the logical solution in the semantic candidate pool, and obtain the maximum probability in the semantic candidate pool; The confidence gap is obtained by calculating the difference between the probability of the logical solution and the maximum probability in the semantic candidate pool; based on the ranking position of the logical solution in the semantic candidate pool and the confidence gap, conflict information is determined. When the sort position is greater than 3 or the confidence gap is greater than 0.5, the conflict information is a serious conflict; when the sort position is 2 or 3, the conflict information is a tolerable conflict; and when the sort position is 1, the conflict information is a non-conflict. Based on the logical solution, semantic candidate pool, and conflict information, a reflective attribution Prompt is constructed to drive the large model to generate logical solution weights through reflection.
[0015] Optionally, based on the logical solution, semantic candidate pool, and conflict information, a reflective attribution prompt is constructed to drive the large model to generate logical solution weights through reflection, including: Construct an information buffer package, which includes a factual description of the target case, a logical solution, a semantic candidate pool, and conflict information. Construct a reflection attribution prompt template, which includes role and task definition, assessment data, reflection attribution thought chain reasoning, and weight output; The defined roles and tasks define the large model's role as a logical arbitrator and its task as reflection and attribution. The assessment data is used to make the conflicting intelligence in the information buffer explicit, forming a complete chain of evidence. The reflection and attribution thought chain reasoning guides the large model to perform the four-step reasoning process of analysis, comparison, attribution, and strategy. The weight output outputs a quantified logical solution weight. ; Add the information buffer package to the assessment data of the reflection attribution prompt template, input the added reflection attribution prompt template into the large model, and obtain the logical solution weights.
[0016] Optionally, based on the logical solution, the weight of the logical solution, and the semantic candidate pool, the legal judgment result corresponding to the target case is determined, including: Transform the logical solution into a logical probability distribution Based on the logical solution weights of the logical probability distribution The final decision probability distribution is obtained by weighted fusion with the semantic candidate pool. Specifically, this is achieved through the following formula: ; in, Indicates the weights of the logical solutions; In decision probability distribution Obtain the maximum probability and the corresponding legal judgment, and use it as the legal judgment of the target case.
[0017] An electronic device includes: one or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the large model inductive-deductive reasoning method.
[0018] A computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform the large-model inductive-deductive reasoning method.
[0019] A computer program product includes a computer program or instructions that, when executed by a processor, implement the large-model inductive-deductive reasoning method described above.
[0020] The beneficial effects of adopting the above technical solution are as follows: This invention effectively eliminates noisy samples with similar but logically contradictory case descriptions through the dual constraints of factual restructuring and category limitation, providing high-quality precedents for the induction module.
[0021] This invention constructs a definitive logical representation through FOL symbolization and, combined with a feedback-driven abductive reasoning mechanism, achieves refined logical induction of the factual characteristics of a case. It effectively addresses the inherent flaw of large models that tend to overgeneralize based on surface semantics, captures and internalizes the factual characteristics that lead to differences in conclusions, and establishes a precise logical mapping from key facts to decision conclusions.
[0022] This invention establishes a dynamic balance mechanism between pure logical reasoning and situational intuition by introducing a self-reflective strategy based on semantic constraints. This breaks through the rigid limitations of traditional deductive reasoning that mechanically applies rules and improves the model's adaptability to exceptional situations and complex contexts.
[0023] This invention innovatively integrates bottom-up rule induction with top-down deductive application, establishing a unified reasoning paradigm. This organic coupling mechanism effectively compensates for the inherent defects of single induction (lacking case-specific deduction power) and single deduction (lacking effective major premises in rule-scarce scenarios), endowing large models with a complete, human-like cognitive reasoning ability to first construct rules and then apply them precisely. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a large-scale inductive-deductive reasoning method in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another large-model inductive-deductive reasoning method in an embodiment of the present invention. Figure 3 This is a schematic diagram of a hypothetical iterative FOL rule refining technique in an embodiment of the present invention; Figure 4 This is a schematic diagram of a semantic constraint logic self-reflection strategy in an embodiment of the present invention. Detailed Implementation
[0025] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0026] To address the technical problems in existing large-scale model inference techniques, such as the tendency of the inductive process to rely on surface semantic patterns for coarse-grained induction, neglecting key factual differences between similar cases that lead to conclusion bias, and the difficulty of the deductive process adapting to exceptional circumstances and complex contexts due to rigid pre-set rules, resulting in poor robustness and low logical credibility, this invention provides a large-scale model inductive-deductive reasoning method, which may include: A case retrieval mechanism based on semantic similarity and category limitation is constructed. First, LLM (Limited Ledger Modeling) is used to summarize the contextual logic of factual descriptions in historical cases, extracting key causal factors leading to legal judgments. This allows for factual reorganization of the historical case set, optimizing the efficiency of semantic representation. Preliminary screening is performed by calculating the textual semantic similarity between the original facts of the current case and the reorganized historical facts. Matching is then restricted using candidate legal judgments predicted by the model, ultimately selecting the Top-K cases to construct a similar case set. The aim is to lay a data foundation for the subsequent rule induction module by enhancing highly relevant precedents. A hypothesis-based iterative first-order logic (FOL) rule refinement technique is constructed. The most similar case in the similar case set is selected as the seed sample, and an initial first-order logic rule hypothesis is constructed using a large model. A rule evolution mechanism is established, and positive and negative feedback mechanisms are used to drive the rules to perform semantic optimization or correction during the traversal of the remaining precedents in the similar case set, thereby generating a refined set of first-order logic rules.
[0027] A logical self-reflection strategy based on semantic constraints is constructed. A semantic awareness model integrating domain knowledge is pre-trained, and a dual-path conflict perception mechanism is used to compare the logical solutions obtained by the logic executor (LLM+FOL) with the situational intuition provided by the semantic awareness model in real time. When a conflict occurs, the metacognitive reflection of the LLM is dynamically stimulated, and a calibrated dynamic logical weight is output based on the conflict information. This endows the model with the ability to autonomously judge the applicability of rules, realizing a paradigm shift from mechanically applying rules to situation-adaptive deductive reasoning.
[0028] Perform semantic-logical weighted fusion adaptive deductive reasoning. First, the logical solution is transformed into a One-Hot form logical probability distribution to align with the semantic candidate pool dimension. Then, using the dynamic logical weights output by the reflexive strategy, a weighted fusion is performed on the logical probability distribution and the semantic probability distribution to obtain the final decision probability distribution. Finally, the label with the highest confidence level is selected as the final decision conclusion.
[0029] Based on this, combined Figure 1 and Figure 2 The present invention provides a large-scale model inductive-deductive reasoning method, which may include the following steps: Step 1: Receive the target case to be inferred. and a historical case database, which contains multiple unstructured historical cases. The historical cases mentioned are historical legal precedents, covering all unstructured historical cases. By performing fact-based retrieval and filtering, a carefully selected set of precedents with semantic similarity and consistent categories is obtained. ; Step 1.1: Receive all unstructured historical cases Construct a contextual logic summary prompt for historical cases, and input this prompt into a large model (such as GPT-4) to obtain a structured text description. The structured text description This includes the subject, the object, the criminal act, the criminal motive, the post-crime behavior, and the objective consequences; A prompting engineering strategy is used to build a large input model (such as GPT-4), which guides the large model to logically sort out and summarize complex case scenarios, identify and extract six key causal elements: subject, object, criminal behavior, criminal motive, post-crime behavior and objective consequences, and finally transform historical cases into structured text descriptions (Shist). Step 1.2: Receive the target case to be reasoned about. Based on the target case, process all unstructured historical cases. By conducting searches and filtering, a carefully selected set of precedents was obtained. Specifically, a "breadth-to-depth recall - precision filtering" strategy is adopted to construct a carefully selected set of precedents; Step 1.2.1: Receive the target case to be reasoned, and calculate the original facts of the target case and the facts of each historical case. The text semantic similarity is obtained by calculating multiple text semantic similarities. In this invention, the text semantic similarity adopts cosine similarity. Without considering the legal judgment result, all text semantic similarities are sorted from high to low, and the historical cases corresponding to the top N text semantic similarities are obtained. ,For example This creates a preliminary candidate pool; this step aims to ensure that all cases with similar descriptions are captured, without overlooking potentially highly relevant samples.
[0030] Step 1.2.2: Input the target case into a pre-trained domain classification model (such as a classifier fine-tuned based on RoBERTa) to obtain multiple candidate legal judgments for the target case. The multiple candidate legal judgments include legal provisions, legal provisions and charges, and legal provisions and sentences. Step 1.2.3: Obtain the legal judgment results corresponding to historical cases in the coarse candidate pool. Remove historical cases whose historical legal judgment results in the coarse candidate pool are inconsistent with the predicted multiple candidate legal judgment results (i.e., remove those cases that seem similar but belong to completely different judgment categories as interference noise). This will result in multiple historical cases with consistent legal judgment results in the coarse candidate pool. Sort the textual semantic similarity of the multiple historical cases with consistent legal judgment results from high to low, and obtain the top K historical cases to form a selected precedent set. Wherein, K can be selected according to the actual situation; in this invention, K=5.
[0031] Step 2: Using the chain of thought technique, construct and iterate FOL rules from a carefully selected set of precedents, filtering them through positive and negative feedback and confidence levels to inductively derive the FOL rule set; see [link to relevant documentation]. Figure 3 This invention proposes a first-order logic (FOL) rule refinement technique based on hypothesis iteration. Building upon the high-quality precedent set selected in step 1, a dynamic logical induction loop is constructed to inductively derive a refined set of logical rules from historical precedents that covers key factual differences between similar cases.
[0032] Step 2.1: Construct a FOL hint template. The FOL hint template includes the definition of the FOL notation system, which includes variables, predicate symbols, and quantifiers. Variables are defined as entity objects in historical cases. Predicate symbols are used to describe the attributes, states, or actions of entities. Quantifiers include universal quantifiers (∀) and existential quantifiers (∃), which respectively represent the universality or specificity of the rule. The structured description of historical cases from the selected precedent set is then used. Input the large model, and use the FOL prompt template to guide the large model to perform formal reasoning and generate FOL symbols corresponding to historical cases; The goal of this step is to establish a logical relationship between the scenario logic summarized in step 1.1 and the legal judgment outcome of the case. To this end, a large model (such as GPT-4) is used to define causal factors as FOL atoms composed of variables, predicate symbols, and quantifiers.
[0033] Step 2.2: From the selected set of historical cases, identify the historical case with the highest semantic similarity to the target case and use it as the starting seed case. Construct the FOL rule for the starting seed case, expressed as: Where A represents the rule premise, which is formed by connecting the variables, predicate symbols, and quantifiers of the starting seed case using logical connectors (∧, ∨, ¬); C represents the legal judgment result of the starting seed case; the FOL rule of the starting seed case is encapsulated as the root node of the optimization tree. ; The purpose of this step is to assemble discrete symbols into standardized reasoning chains for subsequent hypothesis iteration and correction.
[0034] Step 2.3: Set the confidence level of the initial seed case. The confidence level includes the number of times the rule correctly predicted the target. The number of errors in rule prediction The confidence state of the initial seed case is initialized as follows: ; Confidence state S and FOL rule for the initial seed case The rule nodes are composed of the following data structure: ; Step 2.4 Select historical cases from the selected precedent set, excluding the initial seed case, as candidate cases. According to the semantic similarity of the text, from high to low, select the first candidate case as the current historical case, the FOL rule of the initial seed case as the current rule, and the confidence state of the initial seed case as the current confidence state. Step 2.5: Construct a feedback-driven rule evolution thought chain. This chain guides the large model to logically deduce the legal judgment of the current historical case. If the legal judgment of the current historical case matches the legal judgment in the current rule, the logical condition is deemed valid. A tree inheritance operation is then performed to maintain the rule's logical structure. The large model optimizes the rule's semantic expression to expand its generality, while increasing the hit count of that node. Specifically, step 2.6 is executed. If the legal judgment of the current historical case does not match the legal judgment in the current rule, the current rule is deemed too broad or contains logical loopholes. The large model is then used to compare the rule's premise A with the facts of the current case (a structured textual description composed of causal factors). The key difference element D that leads to the difference in legal judgment results is derived through logical causal reasoning. The current node is split into conservative child nodes and specialized child nodes. The conservative rule is used to maintain the stability of the original rule. The interference of new cases is eliminated by introducing negative constraints. The specific execution steps are 2.7. Step 2.6: Set the current confidence state... Add 1, Keeping the current rule unchanged, we obtain the confidence state after the rule update. The large model is guided by a rule evolution thought chain to optimize the semantic representation of the rule preconditions in the current rule. The optimized rule preconditions and the legal judgment results in the current rule constitute a new FOL rule. The confidence state of the new FOL rule is set as follows: The new FOL rule is used as the current rule. Based on the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution. The rule evolution thinking chain guides the large model to logically deduce the current historical case until all candidate cases have been traversed. Step 2.7: Set the current confidence state... remain unchanged. Increment by one to obtain the confidence level after the rule update; Combine the current rule's preconditions with current historical cases. Input the large model to obtain the key difference element D, and construct conservative rules and specialized rules; Conservative rules are expressed as: ;in, No, indicating a key differentiator. Indicates A absorption Set the confidence level of the conservative rule as follows: ; Specialized rules are represented as follows: ;in, For the new legal judgment outcome; the confidence state of the specialized rule is set as follows: ; Based on preset prompts, the large model is driven to select one of conservative and specialized rules using a thought chain, and then select it as the current rule. According to the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution: the large model is guided to logically deduce the current historical case through the rule evolution thought chain until all candidate cases have been traversed. Step 2.8: For each rule, calculate the confidence score based on its confidence status. This score objectively reflects the accuracy and robustness of the rule in interpreting historical precedents, and is achieved through the following formula: ; in, For smoothing coefficients; The FOL rule set is composed of multiple rules with a confidence score of 1. Step 3: Process the target cases using a pre-trained deep learning model to obtain a semantic candidate pool. Determine the logical solution based on the FOL rule set, perform consistency verification with the semantic candidate pool to identify conflict information, and then calculate the weight of the logical solution; see [link to relevant documentation]. Figure 4This invention proposes a logical self-reflection strategy based on semantic constraints. Based on the refined logical rule set generated in step 2, it aims to introduce semantic intuition as a dynamic error-correcting reference for logical reasoning. Addressing the problem of rigid deduction that may occur in complex contexts, it dynamically triggers a metacognitive reflection mechanism by monitoring the conflict between logical deduction and situational intuition, outputting calibrated logical confidence weights to determine the validity of logical reasoning paths.
[0035] Step 3.1: Input the target case into the semantic awareness model to obtain the semantic candidate pool; The target case is processed by word-level encoding using Bi-GRU and the attention mechanism (Attention). Generate sentence vectors. ; Transform sentence vectors After sentence-level encoding Bi-GRU and attention mechanism Attention This yields a factual context vector containing the global semantics of the case. ; Fact Context Vector Cross-attention calculation is performed with external domain knowledge vectors to generate a fused feature vector that aligns with the facts and knowledge of the target case. The external domain knowledge vectors include legal definitions, crime definitions, and common sentencing opinions. This fused feature vector is input into a fully connected layer and processed by a Softmax function to predict the probability distribution vector of the target judgment result. This probability distribution vector contains the probability values of all legal judgment result categories, specifically implemented through the following formula: ; in, This is the probability distribution vector of all categories for the target decision result. and These are the trainable weight matrix and bias vector of the fully connected layer, respectively. For activation function, Represents an external domain knowledge vector. This is the scaling factor in the attention mechanism. Used to adjust the magnitude of the dot product. A semantic relevance score matrix representing the relationship between facts and knowledge; Based on the probability distribution vector of the target judgment result, the probability values of all legal judgment result categories are arranged in descending order to obtain the top A legal judgment result categories and their corresponding probability values, forming a semantic candidate pool. The parameters in the semantic perception model are obtained through pre-training. Historical cases are used as input, and the real vectors constructed from the legal judgments corresponding to the historical cases are used as output. The parameters of the semantic perception model are then trained iteratively multiple times to determine the final parameters of the semantic perception model.
[0036] Step 3.2: Input the FOL rule set and target cases into the large model to obtain the logical solution; obtain the ranking position and corresponding probability of the logical solution in the semantic candidate pool, and obtain the maximum probability in the semantic candidate pool; The confidence gap is calculated by subtracting the probability of the logical solution from the maximum probability in the semantic candidate pool. This difference is expressed by the following formula: ; in, This indicates a confidence gap. This represents the maximum probability in the semantic candidate pool. Represents the probability of a logical solution; Based on the ranking position of the logical solution in the semantic candidate pool and the confidence gap, conflict information is determined; When the ranking position is greater than 3 or the confidence gap is greater than 0.5, it means that the logical conclusion is extremely abnormal from the perspective of experience and intuition, and there is a high probability that there are exceptions not covered by the rules. The conflict information is a serious conflict. When the ranking position is 2 or 3, it means that the case is in a gray area. Although the logical solution is not the most probable, it is reasonable and requires careful consideration. The conflict information is a tolerable conflict. When the ranking position is 1, it means that the normative logic is highly consistent with experience and intuition. The conflict information is no conflict. Dual-path perception and conflict detection are designed to provide precise reflexive entry points for large model (LLM). First, logical conclusions and semantic intuitions are obtained through dual-path approaches, and an information buffer is built in memory. Semantic intuitions are then used to verify the consistency of logical reasoning.
[0037] Step 3.3: Based on the logical solution, semantic candidate pool and conflict information, construct the reflective attribution Prompt to drive the large model to generate logical solution weights through reflection; Step 3.3.1: Construct an information buffer package, which includes a factual description of the target case, a logical solution, a semantic candidate pool, and conflict information; Step 3.3.2: Construct a reflective attribution prompt template to drive the large model to switch from rule execution mode to evaluation arbitration mode. By analyzing the root causes of conflict, output calibrated logical confidence weights. The reflective attribution prompt template includes role and task definitions, assessment data, reflective attribution thought chain reasoning, and weight output. The defined roles and tasks define the large model's role as a logical arbitrator and its task as reflection and attribution. The assessment data is used to make the conflicting intelligence in the information buffer explicit, forming a complete chain of evidence. The reflection and attribution thought chain reasoning guides the large model to perform the four-step reasoning process of analysis, comparison, attribution, and strategy. The weight output outputs a quantified logical solution weight. This weight represents the model's final level of confidence in the current logical reasoning result.
[0038] Step 3.3.3: Add the information buffer package to the assessment data of the reflection attribution prompt template, input the added reflection attribution prompt template into the large model, and obtain the logical solution weights; Step 4: Determine the legal judgment result corresponding to the target case based on the logical solution, the weight of the logical solution, and the semantic candidate pool; Transform the logical solution into a logical probability distribution Based on the logical solution weights of the logical probability distribution The final decision probability distribution is obtained by weighted fusion with the semantic candidate pool. Specifically, this is achieved through the following formula: ; in, Indicates the weights of the logical solutions; In decision probability distribution Obtain the maximum probability and the corresponding legal judgment, and use it as the legal judgment of the target case; This embodiment proposes an electronic device, including: one or more processors, and a memory, wherein the memory is used to store instructions, and when the instructions are executed by the one or more processors, the one or more processors execute the large model inductive-deductive reasoning method described above.
[0039] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements a large-model inductive-deductive reasoning method as described in the embodiments. It is understood that the electronic device may also include input / output (I / O) interfaces and communication components.
[0040] The processor is used to execute all or part of the steps in the large model inductive-deductive reasoning method described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
[0041] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the large model inductive-deductive reasoning method described in the above embodiments.
[0042] This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0043] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the large model inductive-deductive reasoning method described in the various embodiments of this application.
[0044] The aforementioned storage media include: flash memory, hard disks, multimedia cards, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory), random access memory (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, disks, optical discs, servers, APP (Application) application stores, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the aforementioned large-model inductive-deductive reasoning method.
[0045] This embodiment proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the aforementioned large-model inductive-deductive reasoning method.
[0046] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a computer program product.
[0047] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0048] In particular, the patent announcement document with patent number CN118982075B discloses a "method for enhanced large-scale model reasoning based on knowledge graphs," whose reasoning ability is limited by the static structure of a predefined knowledge graph. Once the knowledge graph is updated late or relationships are missing, it is difficult to construct effective causal logic. The patent announcement document with patent number CN117892818B discloses a "method for generating reasoning content based on implicit thought chains in large language models," which reduces computational overhead but black-boxes the reasoning process, losing crucial traceability of evidence. In contrast, this invention, through dynamically inductive FOL rules and a self-reflective deductive mechanism, ensures the transparency and traceability of the reasoning process while giving the system the flexibility to dynamically handle exceptions outside the rules, achieving a dual breakthrough in logical rigor and scenario adaptability.
[0049] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A large-scale model inductive-deductive reasoning method, characterized in that, include: Received target case for reasoning and a historical case database, which contains multiple unstructured historical cases. The historical cases mentioned are historical legal precedents, covering all unstructured historical cases. By performing fact-based retrieval and filtering, a carefully selected set of precedents with semantic similarity and consistent categories is obtained. ; The FOL rules are constructed and iterated from a carefully selected set of precedents using the Mind Chain technique, and then filtered through positive and negative feedback and confidence levels to obtain the FOL rule set. The target cases are processed by a pre-trained deep learning model to obtain a semantic candidate pool. Logical solutions are determined based on the FOL rule set, and consistency checks are performed with the semantic candidate pool to determine conflict information. Then, the weights of the logical solutions are calculated. Based on the logical solution, the weight of the logical solution, and the semantic candidate pool, the legal judgment result corresponding to the target case is determined.
2. The large-scale inductive-deductive reasoning method according to claim 1, characterized in that, Received target case for reasoning and a historical case database, which contains multiple unstructured historical cases. The historical cases mentioned are historical legal precedents, covering all unstructured historical cases. By performing fact-based retrieval and filtering, a carefully selected set of precedents with semantic similarity and consistent categories is obtained. ,include: Receive all unstructured historical cases A prompt summarizing the contextual logic of historical cases is constructed. This prompt is then input into the large model to obtain a structured textual description. The structured text description This includes the subject, the object, the criminal act, the criminal motive, the post-crime behavior, and the objective consequences; Upon receiving the target case to be reasoned about, based on the target case, all unstructured historical cases are processed. By conducting searches and filtering, a carefully selected set of precedents was obtained. .
3. The large-scale inductive-deductive reasoning method according to claim 2, characterized in that, Upon receiving the target case to be reasoned about, based on the target case, all unstructured historical cases are processed. By conducting searches and filtering, a carefully selected set of precedents was obtained. ,include: Upon receiving the target case to be reasoned about, calculate the original facts of the target case and their relationship with each historical case. The text semantic similarity is obtained by sorting all the text semantic similarity from high to low, and the historical cases corresponding to the top N text semantic similarity are obtained to form a coarse candidate pool. By inputting the target case into a pre-trained domain classification model, multiple candidate legal judgments for the target case are obtained. The multiple candidate legal judgments include legal provisions, legal provisions and charges, and legal provisions and sentences; Obtain the legal judgment results corresponding to historical cases in the coarse candidate pool. Remove historical cases whose historical legal judgment results are inconsistent with the predicted candidate legal judgment results, leaving only the coarse candidate pool with consistent legal judgment results. Sort the textual semantic similarity of these consistent historical cases from high to low, and select the top K cases to form a selected precedent set. .
4. The large-scale inductive-deductive reasoning method according to claim 1, characterized in that, The FOL rule set is constructed and iterated from a carefully selected set of precedents using the Mind Chain technique. Through positive and negative feedback and confidence level filtering, a set of FOL rules is derived, including: Construct a FOL hint template, which includes the definition of the FOL notation system. The FOL notation system includes variables, predicate symbols, and quantifiers. Variables are defined as entity objects in historical cases. Predicate symbols are used to describe the attributes, states, or actions of entities. Quantifiers include universal quantifiers and existential quantifiers. The structured description of historical cases from a selected set of precedents is then used. Input the large model, and use the FOL prompt template to guide the large model to perform formal reasoning and generate FOL symbols corresponding to historical cases; From the selected set of historical cases, the historical case with the highest textual semantic similarity to the target case is selected and used as the starting seed case. The FOL rule for the starting seed case is constructed as follows: Where A represents the rule premise, which is formed by connecting the variables, predicate symbols, and quantifiers of the initial seed case through logical connectors; and C represents the historical legal judgment result of the initial seed case. Set the confidence level of the initial seed case, which includes the number of times the rule correctly predicted the outcome. The number of errors in rule prediction The confidence state of the initial seed case is initialized as follows: ; The historical cases excluding the initial seed case in the selected precedent set are taken as candidate cases. According to the text semantic similarity from high to low, the first candidate case is taken as the current historical case, the FOL rule of the initial seed case is taken as the current rule, and the confidence state of the initial seed case is taken as the current confidence state. Construct a feedback-driven rule evolution thinking chain, and guide the large model to logically deduce the legal judgment results of the current historical cases through the rule evolution thinking chain; If the legal judgment in a current historical case is consistent with the legal judgment under the current rules, the current confidence level will be... Add 1, Remaining unchanged, we obtain the confidence state after the rule update. Guided by the rule evolution thought chain, the large model optimizes the semantic representation of the rule preconditions in the current rule. The optimized rule preconditions and the legal judgment result in the current rule form a new FOL rule. The confidence state of the new FOL rule is set as follows: The new FOL rule is used as the current rule. Based on the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution. The rule evolution thinking chain guides the large model to logically deduce the current historical case until all candidate cases have been traversed. In cases where the legal judgments of current historical cases differ from those under current rules, the current confidence level will be... remain unchanged. Increment by one to obtain the confidence level of the updated rule; combine the rule preconditions of the current rule with the current historical cases. Input the large model to obtain the key difference element D, and construct conservative rules and specialized rules; Conservative rules are expressed as: ;in, No, indicating a key differentiator. Indicates A absorption Set the confidence level of the conservative rule as follows: ; Specialized rules are represented as follows: ;in, For the new legal judgment outcome; the confidence state of the specialized rule is set as follows: ; Based on preset prompts, the large model is driven to select one of conservative and specialized rules using a thought chain, and then select it as the current rule. According to the semantic similarity of the text from high to low, the next candidate case is obtained as the current historical case, and the process is returned to execution: the large model is guided to logically deduce the current historical case through the rule evolution thought chain until all candidate cases have been traversed. For each rule, a confidence score is calculated based on the rule's confidence level, specifically using the following formula: ; in, For smoothing coefficients; The FOL rule set is composed of multiple rules with a confidence score of 1.
5. The large-scale inductive-deductive reasoning method according to claim 1, characterized in that, The target cases are processed using a pre-trained deep learning model to obtain a semantic candidate pool. Logical solutions are determined based on the FOL rule set, and consistency checks are performed with the semantic candidate pool to identify conflict information. Finally, the weights of the logical solutions are calculated, including: The target cases are input into the semantic awareness model to obtain a semantic candidate pool. Specifically, the target cases are processed through word-level encoding Bi-GRU and an attention mechanism to generate sentence vectors. ; Transform sentence vectors After sentence-level encoding using Bi-GRU and an attention mechanism, a factual context vector containing the global semantics of the case is obtained. ; Fact Context Vector Cross-attention calculation is performed with external domain knowledge vectors to generate a fused feature vector that aligns with the facts and knowledge of the target case. The external domain knowledge vectors include legal definitions, crime definitions, and common sentencing opinions. This fused feature vector is input into a fully connected layer and processed by a Softmax function to predict the probability distribution vector of the target judgment result. This probability distribution vector contains the probability values of all legal judgment result categories, specifically implemented through the following formula: ; in, This is the probability distribution vector of all categories for the target decision result. and These are the trainable weight matrix and bias vector of the fully connected layer, respectively. For activation function, Represents an external domain knowledge vector. This is the scaling factor in the attention mechanism. Used to adjust the magnitude of the dot product. A semantic relevance score matrix representing the relationship between facts and knowledge; Based on the probability distribution vector of the target judgment result, the probability values of all legal judgment result categories are arranged in descending order to obtain the top A legal judgment result categories and their corresponding probability values, forming a semantic candidate pool. Input the FOL rule set and target cases into the large model to obtain the logical solution; obtain the ranking position and corresponding probability of the logical solution in the semantic candidate pool, and obtain the maximum probability in the semantic candidate pool; The confidence gap is obtained by calculating the difference between the probability of the logical solution and the maximum probability in the semantic candidate pool; based on the ranking position of the logical solution in the semantic candidate pool and the confidence gap, conflict information is determined. When the sort position is greater than 3 or the confidence gap is greater than 0.5, the conflict information is a serious conflict; when the sort position is 2 or 3, the conflict information is a tolerable conflict; and when the sort position is 1, the conflict information is a non-conflict. Based on the logical solution, semantic candidate pool, and conflict information, a reflective attribution Prompt is constructed to drive the large model to generate logical solution weights through reflection.
6. The large-scale inductive-deductive reasoning method according to claim 5, characterized in that, Based on the logical solution, semantic candidate pool, and conflict information, a reflective attribution prompt is constructed to drive the large model to generate logical solution weights through reflection, including: Construct an information buffer package, which includes a factual description of the target case, a logical solution, a semantic candidate pool, and conflict information. Construct a reflection attribution prompt template, which includes role and task definition, assessment data, reflection attribution thought chain reasoning, and weight output; The defined roles and tasks define the large model's role as a logical arbitrator and its task as reflection and attribution. The assessment data is used to make the conflicting intelligence in the information buffer explicit, forming a complete chain of evidence. The reflection and attribution thought chain reasoning guides the large model to perform the four-step reasoning process of analysis, comparison, attribution, and strategy. The weight output outputs a quantified logical solution weight. ; Add the information buffer package to the assessment data of the reflection attribution prompt template, input the added reflection attribution prompt template into the large model, and obtain the logical solution weights.
7. The large-scale inductive-deductive reasoning method according to claim 1, characterized in that, Based on the logical solution, the weight of the logical solution, and the semantic candidate pool, the legal judgment result corresponding to the target case is determined, including: Transform the logical solution into a logical probability distribution Based on the logical solution weights of the logical probability distribution The final decision probability distribution is obtained by weighted fusion with the semantic candidate pool. Specifically, this is achieved through the following formula: ; in, Indicates the weights of the logical solutions; In decision probability distribution Obtain the maximum probability and the corresponding legal judgment, and use it as the legal judgment of the target case.
8. An electronic device, characterized in that, include: One or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the large model inductive-deductive reasoning method.
9. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed, cause the processor to perform the large model inductive-deductive reasoning method.
10. A computer program product, characterized in that, This includes computer programs or instructions that, when executed by a processor, implement the aforementioned large-model inductive-deductive reasoning method.
Citation Information
Patent Citations
A method for generating content based on large language model reasoning based on implicit thought chain
CN117892818B
A method, device and equipment for enhancing large model reasoning based on knowledge graph
CN118982075B