Intelligent dialogue method, system, device and medium based on large language model hallucination relief
By generating multiple rounds of reasoning results with a large language model and using a small language model for logical semantic detection, the hallucination problem of large language models in intelligent dialogues is solved, the reliability and accuracy of the results are achieved, and it is suitable for complex question-and-answer scenarios.
Patent Information
- Application Number
- CN202510759595.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-09
AI Technical Summary
Large language models are prone to hallucinations in intelligent dialogue scenarios, resulting in inaccurate output results. Existing methods find it difficult to objectively and comprehensively detect and correct hallucinations.
A large language model is used to generate multiple rounds of heuristic answers, stimulate thinking, and self-reflection results. Combined with a small language model, logical semantic relationship detection is performed to form a correct reasoning chain of logical semantic relationships, and the target answer is extracted from it.
It realizes the phased collaboration of large and small language models, accurately identifies and filters inaccurate information, ensures the reliability of generated results, and is suitable for complex question-answering scenarios that require multi-step logical reasoning.
Smart Images

Figure CN120258156B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intelligent dialogue method, system, device and medium based on large language model hallucination alleviation. Background Art
[0002] In recent years, large language models (LLMs) have demonstrated some capabilities in complex reasoning tasks. They utilize Chain of Thought (CoT) cues to perform multi-step reasoning and generate coherent and contextually relevant responses. However, LLMs have significant flaws and are prone to hallucinations, generating seemingly plausible but actually incorrect outputs, which severely impacts the accuracy of the results.
[0003] In contrast, small language models based on Bidirectional Encoder Representations from Transformers (BERT) and its variants, although more efficient in utilizing computing resources and able to provide accurate output for specific tasks, have a narrower reasoning scope and perform poorly when dealing with complex multi-step problems that require deep contextual understanding.
[0004] Existing methods for addressing LLM illusions, such as self-consistency checking, retrieval-enhanced generation, and confidence calibration, rely heavily on LLM self-reflection, making it difficult to objectively and comprehensively detect and correct illusions. LLMs' self-reflection capabilities are based on their existing knowledge and learning models, and therefore have inherent cognitive limitations. They cannot transcend their own training data and learning experience to uncover deeper errors or illusions, and can only inspect and adjust within a known framework. This can lead to inaccurate output in intelligent dialogue scenarios. Summary of the Invention
[0005] The present invention provides an intelligent dialogue method, system, device and medium based on large language model hallucination mitigation, which is used to solve the problem in the prior art that large language model hallucination may lead to inaccurate output results in intelligent dialogue scenarios.
[0006] In a first aspect, the present invention provides an intelligent dialogue method based on large language model hallucination mitigation, comprising:
[0007] Based on an input question, a large language model is used to output multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round heuristic answer result is generated based on the input question, the i-th round stimulated thinking result is generated based on the input question and the i-th round heuristic answer result, and the i-th round self-reflection result is generated based on the input question, the i-th round heuristic answer result, and the i-th round stimulated thinking result; i is a positive integer;
[0008] Generate corresponding reasoning chains based on the heuristic answer results, stimulated thinking results, and self-reflection results of the same round;
[0009] Through a small language model, the logical semantic relationship of each reasoning chain is detected to obtain multiple target reasoning chains with correct logical semantic relationships;
[0010] A target answer that answers the input question is extracted from the multiple target reasoning chains, and the target answer is output.
[0011] In one embodiment, the small language model is used to perform logical semantic relationship detection on each reasoning chain to obtain multiple target reasoning chains with correct logical semantic relationships, including:
[0012] Through a small language model, the logical semantic relationship of each reasoning chain is detected to obtain the logical semantic relationship detection results of each reasoning chain;
[0013] Scoring is performed based on the logical semantic relationship detection results of each reasoning chain to obtain a logical semantic relationship score for each reasoning chain; when the logical semantic relationship of the reasoning chain is wrong, the logical semantic relationship score of the reasoning chain is 0, and when the logical semantic relationship of the reasoning chain is correct, the logical semantic relationship score of the reasoning chain is 1;
[0014] The reasoning chain whose product of all logical semantic relationship scores is 1 is determined as the target reasoning chain with correct logical semantic relationships.
[0015] In one embodiment, the logical semantic relationship detection result includes a first logical semantic relationship detection result, a second logical semantic relationship detection result, and a third logical semantic relationship detection result;
[0016] When performing a logical semantic relationship test on each inference chain using a small language model and obtaining the logical semantic relationship test results for each inference chain, the following steps are performed for each inference chain:
[0017] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the input question and the heuristic answer results in the inference chain to obtain a first logical semantic relationship detection result between the input question and the heuristic answer results;
[0018] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the heuristic answer result and the stimulated thinking result in the inference chain to obtain a second logical semantic relationship detection result between the heuristic answer result and the stimulated thinking result;
[0019] Through a small language model and adopting natural language reasoning technology, a logical semantic relationship detection is performed on the stimulus thinking result and the self-reflection result in the reasoning chain to obtain a third logical semantic relationship detection result between the stimulus thinking result and the self-reflection result.
[0020] In one embodiment, when scoring based on the logical semantic relationship detection results of each reasoning chain to obtain the logical semantic relationship score of each reasoning chain, the following steps are performed for each reasoning chain:
[0021] If the first logical semantic relationship detection result is an implication relationship, the second logical semantic relationship detection result is an implication relationship, and the third logical semantic relationship detection result is an implication relationship, then determining the logical semantic relationship score of the reasoning chain to be 1;
[0022] If any one of the first logical semantic relationship detection result, the second logical semantic relationship detection result, and the third logical semantic relationship detection result is a neutral relationship or a contradictory relationship, the logical semantic relationship score of the reasoning chain is determined to be 0.
[0023] In one embodiment, extracting a target answer to the input question from the multiple target reasoning chains and outputting the target answer includes:
[0024] Using regular expressions, extract target information that answers the input question from each target reasoning chain;
[0025] If the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain;
[0026] If the target information is not successfully extracted in any target reasoning chain, the small language model fine-tuned by the task is used to generate the target information that answers the input question based on the target reasoning chain, and the format of the target information is standardized to obtain the initial answer corresponding to the target reasoning chain;
[0027] A consistency evaluation is performed based on each of the initial answers to obtain a target answer that answers the input question, and the target answer is output.
[0028] In one embodiment, if target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain an initial answer corresponding to the target reasoning chain, including:
[0029] If target information is successfully extracted in any target reasoning chain, the target information is format-standardized to obtain format-standardized information;
[0030] Verify the reliability of the format standardization information using a small language model fine-tuned for the task;
[0031] If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain;
[0032] If the verification fails, an initial answer corresponding to the target reasoning chain is generated based on the target reasoning chain using a small language model fine-tuned for the task.
[0033] In one embodiment, performing consistency evaluation based on the initial answers to obtain a target answer to the input question includes:
[0034] Determining the number of occurrences of the same answer in each of the initial answers;
[0035] If the highest number of occurrences is greater than or equal to a preset number of occurrences threshold, the answer corresponding to the highest number of occurrences is determined to be the target answer to the input question.
[0036] In a second aspect, the present invention further provides an intelligent dialogue system based on large language model hallucination mitigation, comprising:
[0037] A model reasoning module is configured to output, based on an input question and using a large language model, multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results, and the i-th round of stimulated thinking results;
[0038] The reasoning chain generation module is used to generate corresponding reasoning chains based on the heuristic answer results, stimulated thinking results and self-reflection results of the same round;
[0039] The logical semantic relationship detection module is used to perform logical semantic relationship detection on each reasoning chain through a small language model to obtain multiple target reasoning chains with correct logical semantic relationships;
[0040] The target answer output module is used to extract the target answer that answers the input question from the multiple target reasoning chains and output the target answer.
[0041] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the intelligent dialogue method based on large language model hallucination mitigation as described above are implemented.
[0042] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the intelligent dialogue method based on large language model hallucination relief as described above are implemented.
[0043] The intelligent dialogue method, system, device and medium based on large language model hallucination mitigation provided by the present invention utilize a large language model to first generate heuristic answer results to expand the response perspective, then stimulate deep reasoning, and finally perform self-reflection to correct potential problems, forming a progressively enhanced reasoning chain. The small language model is further utilized to analyze the large language model output from an independent perspective, and logical semantic detection is performed on each reasoning chain. Inaccurate information can be accurately identified and filtered out, realizing the phased collaboration of the large language model and the small language model, combining the reasoning depth of the large language model with the accuracy and efficiency of the small language model, overcoming the limitations of the large language model's self-reflection detection hallucination, ensuring the reliability of the generated results, and finally extracting the target answer from the target reasoning chain that conforms to the logical semantic relationship. The results can be output accurately and efficiently, and are particularly suitable for complex question-and-answer scenarios that require multi-step logical deduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 This is one of the flow charts of the intelligent dialogue method based on large language model hallucination relief provided by the present invention.
[0046] Figure 2 This is the second flow chart of the intelligent dialogue method based on large language model hallucination relief provided by the present invention.
[0047] Figure 3 This is a schematic diagram of the conversation accuracy ratios of different rounds of the MS-HM collaborative method provided by the present invention on Qwen-14BChat and GPT-3.5-turbo.
[0048] Figure 4 It is a schematic diagram of the qualitative results of the traditional reasoning method provided by the present invention in physical tasks.
[0049] Figure 5 This is a structural diagram of the intelligent dialogue system based on large language model hallucination relief provided by the present invention.
[0050] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0051] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0052] The terms "first," "second," and the like in the present invention are used to distinguish similar objects and are not used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention can be implemented in orders other than those illustrated or described herein.
[0053] The following combination Figures 1-6 The present invention describes the intelligent dialogue method, system, device and medium based on large language model hallucination relief.
[0054] It should be noted that the intelligent dialogue method based on large language model hallucination mitigation provided in the embodiments of the present invention is implemented based on an intelligent dialogue system for large language model hallucination mitigation. Through three key stages: large language model-guided reasoning, small language model hallucination detection, and response standardization, the intelligent dialogue method based on large language model hallucination mitigation provided in the embodiments of the present invention effectively mitigates the hallucination problem of large language models, improves reasoning efficiency and accuracy, and combines the reasoning depth of large language models with the precision and efficiency of small language models to achieve structured output, fully leveraging the synergistic advantages of large and small language models.
[0055] The embodiment of the present invention takes an intelligent dialogue system based on large language model hallucination mitigation as an execution subject and describes an intelligent dialogue method based on large language model hallucination mitigation.
[0056] Combine Figure 1 and Figure 2 , Figure 1 This is one of the flow charts of the intelligent dialogue method based on large language model hallucination relief provided by the present invention. Figure 2 This is the second flow chart of the intelligent dialogue method based on large language model hallucination relief provided by the present invention.
[0057] like Figure 1 As shown, the intelligent dialogue method based on large language model hallucination mitigation includes the following steps:
[0058] Step 101: Using a large language model, based on an input question, output multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results;
[0059] Step 102: Generate a corresponding reasoning chain based on the heuristic answer results, stimulated thinking results, and self-reflection results of the same round;
[0060] Step 103: Using a small language model, perform a logical semantic relationship test on each reasoning chain to obtain multiple target reasoning chains with correct logical semantic relationships.
[0061] Step 104: extract a target answer to the input question from the multiple target reasoning chains, and output the target answer.
[0062] Specifically, users enter questions through an interactive page. The input questions correspond to a specific task, which is not limited to specific tasks. Based on the input question Q, the language understanding and reasoning capabilities of the large language model are used to output the answer.
[0063] First, through the large language model, based on the input question Q, multiple rounds of heuristic answer results are output It's understandable that the large language model generates multiple independent responses to the input question Q, and each response is independent of the previous generation history. The heuristic answer is a step-by-step, multi-angle, and guided logical answer generated by the large language model based on the input question Q, not a direct final conclusion.
[0064] By modeling multiple rounds of heuristic answer results The generation process:
[0065] .
[0066] Then, through the large language model, based on multiple rounds of heuristic answer results Stimulate thinking with input question Q and generate multiple rounds of stimulating thinking results .
[0067] Stimulate thinking about outcomes through multiple rounds of modeling The generation process:
[0068] .
[0069] Finally, through the large language model, based on multiple rounds of stimulation thinking results , multiple rounds of heuristic answer results Perform self-reflection on the input question Q and generate multiple rounds of self-reflection results .
[0070] Through modeling multiple rounds of self-reflection results The generation process:
[0071] .
[0072] In practice, the number of rounds k can be adjusted based on the complexity of the task and computing resources. For example, for simple tasks, 2-3 rounds can be used; for complex tasks, k can be increased appropriately. The multi-round dialogue mechanism helps the model better understand contextual information and improve answer accuracy. Although the effect of increasing the number of rounds for some complex tasks requires further optimization, overall this method can adapt to the complexity of different tasks and provides a comprehensive, reliable, and flexible solution for complex reasoning tasks.
[0073] To simplify the calculation, we can assume that there is conditional independence in each step, that is, The generation of , The generation of and Q, The generation of 、 and Q. In this stage, the large language model breaks down complex tasks into manageable parts, generating initial reasoning steps and potential solutions.
[0074] Furthermore, the heuristic answer results, stimulated thinking results, and self-reflection results of the same round are spliced together to generate corresponding reasoning chains, resulting in k reasoning chains. That is:
[0075] .
[0076] The above process is Figure 2 The guided reasoning process based on a large language model.
[0077] Furthermore, using a small language model as the lead, Natural Language Inference (NLI) technology is used to perform logical semantic relationship detection on each inference chain, obtaining a logical semantic relationship detection result for each inference chain. Based on the logical semantic relationship detection results for each inference chain, inference chains with problematic logical semantic relationships are filtered out, retaining only those with normal logical semantic relationships as target inference chains, and obtaining j target inference chains. In other words, using a small language model to perform NLI tasks can remove erroneous or contradictory information from the content generated by the large language model and retain only the correct information from the content generated by the large language model, effectively alleviating the hallucination problem of the large language model.
[0078] The above process is Figure 2 Hallucination mitigation process based on small language models.
[0079] Furthermore, combining rule-based methods with a small language model, the target information answering the input question is extracted from multiple target reasoning chains and standardized to meet the requirements of downstream tasks. This standardized information is then evaluated for consistency, and the target answer that meets the consistency requirements is output for use in downstream tasks.
[0080] The above process is Figure 2 The normalization process of response results based on rule basis and small language model.
[0081] The intelligent dialogue method based on alleviating hallucinations of a large language model provided by the present invention utilizes a large language model to first generate heuristic answer results to expand the response perspective, then stimulates deep reasoning, and finally performs self-reflection to correct potential problems, forming a progressively enhanced reasoning chain. The small language model is further utilized to analyze the output of the large language model from an independent perspective, and logical semantic detection is performed on each reasoning chain. It can accurately identify and filter out inaccurate information therein, realizing the phased collaboration of the large language model and the small language model, combining the reasoning depth of the large language model with the accuracy and efficiency of the small language model, overcoming the limitations of the self-reflection detection hallucination of the large language model, ensuring the reliability of the generated results, and finally extracting the target answer from the target reasoning chain that conforms to the logical semantic relationship. The result can be output accurately and efficiently, and is particularly suitable for complex question-and-answer scenarios that require multi-step logical deduction.
[0082] In some embodiments, based on step 103, the small language model is used to perform logical semantic relationship detection on each reasoning chain to obtain multiple target reasoning chains with correct logical semantic relationships, including:
[0083] Through a small language model, the logical semantic relationship of each reasoning chain is detected to obtain the logical semantic relationship detection results of each reasoning chain;
[0084] Scoring is performed based on the logical semantic relationship detection results of each reasoning chain to obtain a logical semantic relationship score for each reasoning chain; when the logical semantic relationship of the reasoning chain is wrong, the logical semantic relationship score of the reasoning chain is 0, and when the logical semantic relationship of the reasoning chain is correct, the logical semantic relationship score of the reasoning chain is 1;
[0085] The reasoning chain whose product of all logical semantic relationship scores is 1 is determined as the target reasoning chain with correct logical semantic relationships.
[0086] Specifically, NLI aims to determine the logical and semantic relationship between two text fragments. Therefore, NLI technology can be implemented through a small language model to detect the logical and semantic relationship between the input question and the heuristic answer result, the logical and semantic relationship between the heuristic answer result and the stimulated thinking result, and the logical and semantic relationship between the stimulated thinking result and the self-reflection result in each reasoning chain.
[0087] Then, a comprehensive score is given based on the logical semantic relationship between the input question and the heuristic answer result, the logical semantic relationship between the heuristic answer result and the stimulated thinking result, and the logical semantic relationship between the stimulated thinking result and the self-reflection result. When one of the logical semantic relationships is wrong, the logical semantics of the entire reasoning chain is considered to be wrong, and its logical semantic relationship score is 0. When all logical semantic relationships are correct, the logical semantics of the entire reasoning chain is considered to be correct, and its logical semantic relationship score is 1.
[0088] After calculating the logical semantic relationship score of each reasoning chain, a filtering mechanism is applied to retain only the reasoning chains whose product of all chain scores is equal to 1. In other words, only the reasoning chains with a logical semantic relationship score of 1 are retained as the target reasoning chains with correct logical semantic relationships, namely:
[0089] .
[0090] Based on the above content, when performing logical semantic relationship detection on each reasoning chain using a small language model and obtaining the logical semantic relationship detection results of each reasoning chain, the following steps are performed for each reasoning chain:
[0091] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the input question and the heuristic answer results in the inference chain to obtain a first logical semantic relationship detection result between the input question and the heuristic answer results;
[0092] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the heuristic answer result and the stimulated thinking result in the inference chain to obtain a second logical semantic relationship detection result between the heuristic answer result and the stimulated thinking result;
[0093] Through a small language model and adopting natural language reasoning technology, a logical semantic relationship detection is performed on the stimulus thinking result and the self-reflection result in the reasoning chain to obtain a third logical semantic relationship detection result between the stimulus thinking result and the self-reflection result.
[0094] Specifically, small language models such as BERT can be applied to perform NLI tasks. When NLI judges the logical relationship between two text fragments, it is usually divided into three categories: entailment, contradiction, and neutrality.
[0095] Here, implication means that the "premise" text supports the "hypothesis" text. For example, the premise text is "The capacitance of the capacitor is 2 millifarads, the potential difference is 5 volts, and according to the formula Q=C×V, the charge on the positive plate is 0.01 coulomb.", and the hypothesis text is "The charge on the positive plate is proportional to the capacitance and voltage." Then, the calculation in the premise directly supports the conclusion of the hypothesis.
[0096] A contradiction refers to a conflict between the "premise" text and the "assumption" text. For example, the premise text is "The charge of a capacitor is determined only by the capacitance and has nothing to do with the voltage.", and the assumption text is "The charge Q needs to be calculated using the formula Q=C×V." Then, the premise denies the role of voltage, while the assumption explicitly requires the use of voltage for calculation, and the two are logically conflicting.
[0097] Neutral means that the premise text neither supports nor refutes the assumption text. For example, if the premise text is "The potential difference between the capacitor's plates is 5 volts," and the assumption text is "The capacitor is made of a ceramic dielectric," then the premise does not mention the dielectric material, and the assumption information is neither supported nor refuted.
[0098] When performing logical semantic relationship detection on each reasoning chain, NLI is used to check the consistency between different stages of the reasoning chain, that is, the input question Q is used as Starting from the premise (where is the assumption of Q), As Starting from the premise (where yes ), As Starting from the premise (where yes For the set premise and hypothesis, the logical semantic relationship between them is detected, and the first logical semantic relationship detection result between the input question and the heuristic answer result, the second logical semantic relationship detection result between the heuristic answer result and the stimulated thinking result, and the third logical semantic relationship detection result between the stimulated thinking result and the self-reflection result are obtained.
[0099] In practical applications, the detection efficiency can be improved through batch processing, where multiple reasoning chains are input into the NLI model for calculation at one time.
[0100] Furthermore, when scoring is performed based on the logical semantic relationship detection result of each reasoning chain to obtain the logical semantic relationship score of each reasoning chain, the following steps are performed for each reasoning chain:
[0101] If the first logical semantic relationship detection result is an implication relationship, the second logical semantic relationship detection result is an implication relationship, and the third logical semantic relationship detection result is an implication relationship, then determining the logical semantic relationship score of the reasoning chain to be 1;
[0102] If any one of the first logical semantic relationship detection result, the second logical semantic relationship detection result, and the third logical semantic relationship detection result is a neutral relationship or a contradictory relationship, the logical semantic relationship score of the reasoning chain is determined to be 0.
[0103] Specifically, if the first logical semantic relationship detection result is an entailment relationship, the second logical semantic relationship detection result is an entailment relationship, and the third logical semantic relationship detection result is an entailment relationship, then the logical semantic relationship score of the reasoning chain is determined to be 1.
[0104] If any one of the first logical semantic relationship detection result, the second logical semantic relationship detection result, and the third logical semantic relationship detection result is a neutral relationship or a contradictory relationship, the logical semantic relationship score of the reasoning chain is determined to be 0.
[0105] The scoring function is defined as follows:
[0106] .
[0107] The reasoning chains are filtered according to the scores, the reasoning chains that do not meet the requirements are removed, and the reliable reasoning chains are retained for subsequent processing.
[0108] The embodiment of the present invention implements an NLI-based hallucination detection mechanism through a small language model, using the small language model to analyze the output of the large language model from an independent perspective, thereby realizing the automated detection and scoring of multi-stage logical semantic relationships in the reasoning chain, screening out the target reasoning chain with complete logical coherence, overcoming the limitations of the large language model's self-reflective hallucination detection, ensuring the reliability of the generated results, and also ensuring the reliability of subsequent processing.
[0109] In some embodiments, based on step 104, extracting a target answer to the input question from the multiple target reasoning chains and outputting the target answer includes:
[0110] Using regular expressions, extract target information that answers the input question from each target reasoning chain;
[0111] If the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain;
[0112] If the target information is not successfully extracted in any target reasoning chain, the small language model fine-tuned by the task is used to generate the target information that answers the input question based on the target reasoning chain, and the format of the target information is standardized to obtain the initial answer corresponding to the target reasoning chain;
[0113] A consistency evaluation is performed based on each of the initial answers to obtain a target answer that answers the input question, and the target answer is output.
[0114] Specifically, regular expressions and keyword matching techniques are used for structured extraction to extract target information that answers input questions from the target reasoning chain detected by hallucination.
[0115] If the target information is successfully extracted in a target inference chain, the target information is standardized and the output template is enforced. For example, this involves following JSON fields for structured data representation or using a fixed list of options in classification tasks. This ensures that the result format is consistent and usable, and the initial answer corresponding to the target inference chain is obtained. For example, when processing text containing date information, a regular expression is used to match a specific date format, extract it, and output it according to the specified date format.
[0116] If the target information is not successfully extracted in a target reasoning chain, the small language model fine-tuned by the task is used to generate simplified target information to answer the input question based on the target reasoning chain, and the format of the generated simplified target information is standardized to obtain the initial answer corresponding to the target reasoning chain. If the small language model fine-tuned by the task is also unable to generate the corresponding answer, the target reasoning chain is marked as requiring further investigation or manual intervention (the marked answer is considered an incorrect answer in the experiment).
[0117] The task-fine-tuned small language model is a small language model that has been fine-tuned to suit the current task. Before engaging in hallucination mitigation conversations, the small language model is fine-tuned for different tasks. For example, in a classification task, the BERT classifier is trained to adapt to specific classification labels and text features, enabling the small language model to accurately perform the classification task.
[0118] Based on the above, if the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain, including:
[0119] If target information is successfully extracted in any target reasoning chain, the target information is format-standardized to obtain format-standardized information;
[0120] Verify the reliability of the format standardization information using a small language model fine-tuned for the task;
[0121] If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain;
[0122] If the verification fails, an initial answer corresponding to the target reasoning chain is generated based on the target reasoning chain using a small language model fine-tuned for the task.
[0123] Specifically, if the target information is successfully extracted in a target reasoning chain, it is formatted and standardized to obtain standardized information. The standardized information is then verified for reliability using a small language model fine-tuned for the task. The reliability of the extracted results is re-verified to confirm that the extracted classification labels or key information are consistent with the text content and the input question.
[0124] If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain.
[0125] If the verification fails, a small language model fine-tuned for the task is used to generate simplified target information to answer the input question based on the target reasoning chain. The generated simplified target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain.
[0126] Further, the consistency evaluation based on each of the initial answers to obtain the target answer for answering the input question includes:
[0127] Determine the occurrence times of the same answers in each of the initial answers;
[0128] If the highest occurrence times is greater than or equal to the preset occurrence times threshold, determine the answer corresponding to the highest occurrence times as the target answer for answering the input question.
[0129] Specifically, since the initial answers are format-standardized, there will be the same answers among multiple initial answers, and the occurrence times of the same answers in each initial answer are determined.
[0130] If the highest occurrence times is greater than or equal to the preset occurrence times threshold, that is, S ≥ T, accept the answer corresponding to the highest occurrence times and output it as the target answer for answering the input question Q.
[0131] If the highest occurrence times is less than the preset occurrence times threshold, that is, S < T, reject the answer corresponding to the highest occurrence times.
[0132] Among them, when setting the preset occurrence times threshold T, appropriate values can be determined through multiple experiments according to the characteristics of different tasks and the requirements for the reliability of the results. For example, in tasks with extremely high accuracy requirements, the value of T can be appropriately increased; in tasks with higher efficiency requirements and tolerable error rates, the value of T can be decreased.
[0133] The embodiment of the present invention adopts a hybrid standardization method that combines rule-based formatting and small language model-driven verification to efficiently extract or generate standardized answers from the logically and semantically correct target reasoning chains, which not only ensures the basic structure and consistency of the output, but also can be flexibly adjusted according to specific application requirements, enhancing the usability and consistency of the framework in diverse tasks.
[0134] The multi-stage hallucination mitigation synergy (MS-HM Synergy) method proposed by the present invention realizes the phased collaboration between LLMs and small models, combines the reasoning depth and creativity of LLMs with the precision and efficiency of small models, and in benchmark tests such as physics, chemistry, mathematics, and logic, the accuracy rate is significantly improved compared with traditional methods such as the standard prompting method and chain of thought (CoT). The following shows the quantitative result comparison between the MS-HM synergy method and the baseline method in language reasoning tasks.
[0135] Table 1 shows quantitative accuracy results on language reasoning tasks using the Qwen-14BChat large language model. This method significantly outperforms previous state-of-the-art methods, achieving absolute advantages of 0.63%, 8.08%, 6.89%, 12.59%, and 2.29% on logic benchmarks, physics, chemistry, mathematics, and classroom dialogue encoding classification, respectively. The Thinking Tree (ToT) and Socratic Questioning methods require specific pre-built data structures, the properties of which affect their results. Therefore, these methods were not directly compared with the MS-HM collaborative method when evaluated using the Qwen-14BChat model.
[0136] Table 1
[0137]
[0138] Table 2 shows quantitative accuracy results for language reasoning tasks using the GPT-3.5-turbo large language model. This method outperforms previous state-of-the-art methods in categories such as physics, chemistry, mathematics, and classroom dialogue encoding, with improvements of 1.28%, 0.48%, 41.66%, and 2.86%, respectively. This effectively highlights the advantages of this method. It is worth noting that the classroom dialogue dataset is in Chinese, while the Socratic questioning method is primarily targeted at English datasets. Therefore, applying the Socratic questioning method to different languages presents significant challenges and may not fully meet the method's original intention. Therefore, Table 2 does not provide experimental results for the Socratic questioning method on the classroom dialogue dataset.
[0139] Table 2
[0140]
[0141] As shown in Tables 1 and 2, when using the Qwen-14BChat large language model, compared with traditional methods, the results are 0.63%, 8.08%, 6.89%, 12.59%, and 2.29% higher in logic benchmarks, physics, chemistry, mathematics, and classroom dialogue encoding classification, respectively. When using the GPT-3.5-turbo large language model, the results are significantly improved by 1.28%, 0.48%, 41.66%, and 2.86% in physics, chemistry, mathematics, and classroom dialogue encoding, respectively.
[0142] In addition, the performance of the MS-HM collaborative method in different rounds of dialogue is analyzed in detail. Figure 3 Conduct analysis, Figure 3 This is a schematic diagram of the conversation accuracy ratio of different rounds of the MS-HM collaborative method provided by the present invention on Qwen-14BChat and GPT-3.5-turbo. Figure 3(a) shows the accuracy of Qwen-14BChat in different rounds of dialogue based on the MS-HM collaborative method. Figure 3 (b) shows the accuracy of GPT-3.5-turbo for different conversation rounds based on the MS-HM collaborative approach. Comparing the accuracy of two- and three-round conversations, we find that increasing the number of conversation rounds generally improves model performance. For example, in the Qwen-14BChat model, when the number of conversation rounds increases from two to three, the average accuracy increases from 53.84% to 55.40%. Similarly, in the GPT-3.5-turbo model, the average accuracy increases from 50.20% to 53.30%. These results indicate that multi-round conversations help the model better understand contextual information, thereby improving the accuracy of its responses. However, for some complex tasks, such as classroom conversations, increasing the number of conversation rounds does not lead to a significant performance improvement, and in some cases even results in a slight decrease. This may be attributed to the complexity of the conversational content in these tasks, which places higher demands on the model's contextual understanding and reasoning capabilities. Therefore, experimental results show that while increasing the number of conversation rounds generally improves model performance, for specific tasks, further optimization of the dialogue strategy and model design is still necessary to better adapt to complex conversational scenarios.
[0143] Next, we will show the qualitative comparison of the MS-HM collaborative method and the baseline method in physical tasks. Figure 4 As shown, Figure 4 This is a schematic diagram of the qualitative results of the traditional reasoning method provided by the present invention in a physical task. Traditional reasoning methods include standard prompting, chain thinking (CoT), thinking tree (ToT) and thinking map (GoT) methods. Figure 4 A diagram showing the qualitative results of standard prompts, chain thinking, mind tree and mind map methods in physics tasks. The correct answer in this example is B.
[0144] It can be seen that the MS-HM collaborative approach is able to effectively generate prompts that contain the information needed to solve the original problem. In the guided reasoning stage, large language models (LLMs) use their language understanding capabilities to decompose the problem and generate relevant prompts. Subsequently, in the hallucination detection stage, unreliable information in these prompts is identified and eliminated, ensuring the accuracy of the information used for reasoning. Finally, in the result standardization stage, the output is structured to make it coherent and easy to understand. By selectively utilizing these refined prompts, the MS-HM collaborative approach provides reasonable explanations through reflective reasoning and arrives at the correct final answer. In contrast, standard prompts, chain thinking (CoT), tree of thought (ToT) and map of thought (GoT) methods have poor reasoning paths, such as Figure 4As shown, the red portion represents the incorrect answer inferred by traditional methods, resulting in model hallucinations. The Tree of Thought (ToT) approach breaks problem solving into linear, structured steps. While it attempts to ensure thorough reasoning, it is overly rigid and inefficient for simple tasks like the capacitor problem. Its repetitive, step-by-step nature lacks the flexibility required to handle simple problems. While leveraging the comprehensive advantages of models is the overall goal of this invention, ToT does not adapt well to varying problem complexities and does not scale well to problems where direct solutions are faster. Furthermore, it lacks effective mechanisms to detect and correct potential hallucinations during reasoning. The Goal of Thought (GoT) approach organizes problem solving in a nonlinear manner, enabling flexible exploration of interconnected steps. While it may be effective for complex problems, it overcomplicates simple tasks by introducing unnecessary nodes, backtracking, and cognitive load. This makes it visually and procedurally inefficient for formula-based direct solutions. Similar to ToT, GoT also lacks methods to comprehensively address hallucinations and standardize its output in a manner that meets the requirements of downstream tasks. The MS-HM collaborative approach offers significant advantages in multi-step logical reasoning, overcoming the limitations of traditional chain-based approaches.
[0145] Key limitations of CoT techniques. Unlike sequential or predefined structured approaches, which are prone to error propagation and challenges in decomposing complex problems, the MS-HM collaborative approach combines the sophisticated reasoning capabilities of LLMs with the verification accuracy of small language models. By guiding reasoning, hallucination detection, and result normalization, it achieves more accurate and flexible problem solving. As shown in Table 3, the correct answer in this example is B.
[0146] Table 3
[0147]
[0148] The structure of the intelligent dialogue system based on large language model hallucination relief provided by the present invention is described below. The intelligent dialogue system based on large language model hallucination relief described below and the intelligent dialogue method based on large language model hallucination relief described above can refer to each other.
[0149] Reference Figure 5 , Figure 5 This is a structural diagram of the intelligent dialogue system based on large language model hallucination relief provided by the present invention.
[0150] The intelligent dialogue system based on large language model hallucination mitigation includes:
[0151] Model reasoning module 510 is configured to output, based on an input question and using a large language model, multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results, and the i-th round of stimulated thinking results;
[0152] The reasoning chain generation module 520 is used to generate a corresponding reasoning chain based on the heuristic answer results, stimulated thinking results and self-reflection results of the same round;
[0153] The logical semantic relationship detection module 530 is used to perform logical semantic relationship detection on each reasoning chain using a small language model to obtain multiple target reasoning chains with correct logical semantic relationships;
[0154] The target answer output module 540 is configured to extract a target answer that answers the input question from the multiple target reasoning chains and output the target answer.
[0155] The intelligent dialogue system based on large language model hallucination mitigation provided by the present invention utilizes a large language model to first generate heuristic answer results to expand the response perspective, then stimulates deep reasoning, and finally performs self-reflection to correct potential problems, forming a progressively enhanced reasoning chain. The small language model is further utilized to analyze the output of the large language model from an independent perspective, and logical semantic detection is performed on each reasoning chain. It can accurately identify and filter out inaccurate information therein, realizing the phased collaboration of the large language model and the small language model, combining the reasoning depth of the large language model with the accuracy and efficiency of the small language model, overcoming the limitations of the large language model's self-reflection detection hallucination, ensuring the reliability of the generated results, and finally extracting the target answer from the target reasoning chain that conforms to the logical semantic relationship. The system can output the results accurately and efficiently, and is particularly suitable for complex question-and-answer scenarios that require multi-step logical deduction.
[0156] Furthermore, the logical semantic relationship detection module 530 is further configured to:
[0157] Through a small language model, the logical semantic relationship of each reasoning chain is detected to obtain the logical semantic relationship detection results of each reasoning chain;
[0158] Scoring is performed based on the logical semantic relationship detection results of each reasoning chain to obtain a logical semantic relationship score for each reasoning chain; when the logical semantic relationship of the reasoning chain is wrong, the logical semantic relationship score of the reasoning chain is 0, and when the logical semantic relationship of the reasoning chain is correct, the logical semantic relationship score of the reasoning chain is 1;
[0159] The reasoning chain whose product of all logical semantic relationship scores is 1 is determined as the target reasoning chain with correct logical semantic relationships.
[0160] Furthermore, the logical semantic relationship detection module 530 is further configured to:
[0161] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the input question and the heuristic answer results in the inference chain to obtain a first logical semantic relationship detection result between the input question and the heuristic answer results;
[0162] Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the heuristic answer result and the stimulated thinking result in the inference chain to obtain a second logical semantic relationship detection result between the heuristic answer result and the stimulated thinking result;
[0163] Through a small language model and adopting natural language reasoning technology, a logical semantic relationship detection is performed on the stimulus thinking result and the self-reflection result in the reasoning chain to obtain a third logical semantic relationship detection result between the stimulus thinking result and the self-reflection result.
[0164] Furthermore, the logical semantic relationship detection module 530 is further configured to:
[0165] If the first logical semantic relationship detection result is an implication relationship, the second logical semantic relationship detection result is an implication relationship, and the third logical semantic relationship detection result is an implication relationship, then determining the logical semantic relationship score of the reasoning chain to be 1;
[0166] If any one of the first logical semantic relationship detection result, the second logical semantic relationship detection result, and the third logical semantic relationship detection result is a neutral relationship or a contradictory relationship, the logical semantic relationship score of the reasoning chain is determined to be 0.
[0167] Furthermore, the target answer output module 540 is further configured to:
[0168] Using regular expressions, extract target information that answers the input question from each target reasoning chain;
[0169] If the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain;
[0170] If the target information is not successfully extracted in any target reasoning chain, the small language model fine-tuned by the task is used to generate the target information that answers the input question based on the target reasoning chain, and the format of the target information is standardized to obtain the initial answer corresponding to the target reasoning chain;
[0171] A consistency evaluation is performed based on each of the initial answers to obtain a target answer that answers the input question, and the target answer is output.
[0172] Furthermore, the target answer output module 540 is further configured to:
[0173] If target information is successfully extracted in any target reasoning chain, the target information is format-standardized to obtain format-standardized information;
[0174] Verify the reliability of the format standardization information using a small language model fine-tuned for the task;
[0175] If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain;
[0176] If the verification fails, an initial answer corresponding to the target reasoning chain is generated based on the target reasoning chain using a small language model fine-tuned for the task.
[0177] Furthermore, the target answer output module 540 is further configured to:
[0178] Determining the number of occurrences of the same answer in each of the initial answers;
[0179] If the highest number of occurrences is greater than or equal to a preset number of occurrences threshold, the answer corresponding to the highest number of occurrences is determined to be the target answer to the input question.
[0180] It should be noted that the intelligent dialogue system based on large language model hallucination relief provided by the present invention can execute the intelligent dialogue method based on large language model hallucination relief described in any of the above embodiments during specific operation, which will not be described in detail in this embodiment.
[0181] Figure 6 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6As shown, the electronic device may include: a processor 610 , a communications interface 620 , a memory 630 and a communication bus 640 , wherein the processor 610 , the communications interface 620 and the memory 630 communicate with each other via the communication bus 640 . The processor 610 can call the logic instructions in the memory 630 to execute an intelligent dialogue method based on hallucination relief of a large language model, the method including: outputting multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results and multiple rounds of self-reflection results based on an input question through a large language model; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results and the i-th round of stimulated thinking results; i is a positive integer; based on the heuristic answer results, stimulated thinking results and self-reflection results of the same round, a corresponding reasoning chain is generated; through a small language model, a logical semantic relationship is detected for each reasoning chain to obtain multiple target reasoning chains with correct logical semantic relationships; extracting a target answer to the input question from the multiple target reasoning chains, and outputting the target answer.
[0182] Furthermore, the logic instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0183] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the intelligent dialogue method based on large language model hallucination relief provided by the above-mentioned embodiments, the method including: using a large language model, based on an input question, outputting multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results, and the i-th round of stimulated thinking results; i is a positive integer; based on the heuristic answer results, stimulated thinking results, and self-reflection results of the same round, a corresponding reasoning chain is generated; using a small language model, each reasoning chain is tested for logical semantic relationships to obtain multiple target reasoning chains with correct logical semantic relationships; extracting a target answer to the input question from the multiple target reasoning chains, and outputting the target answer.
[0184] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the intelligent dialogue method based on large language model hallucination relief provided by the above-mentioned embodiments, the method comprising: outputting multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results and multiple rounds of self-reflection results based on an input question through a large language model; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results and the i-th round of stimulated thinking results; i is a positive integer; based on the heuristic answer results, stimulated thinking results and self-reflection results of the same round, a corresponding reasoning chain is generated; through a small language model, a logical semantic relationship is detected for each reasoning chain to obtain multiple target reasoning chains with correct logical semantic relationships; extracting a target answer to the input question from the multiple target reasoning chains, and outputting the target answer.
[0185] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Those skilled in the art will be able to understand and implement the present invention without inventive effort.
[0186] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An intelligent dialogue method based on large language model hallucination mitigation, characterized in that: The intelligent dialogue method based on large language model hallucination mitigation includes: Based on an input question, a large language model is used to output multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round heuristic answer result is generated based on the input question, the i-th round stimulated thinking result is generated based on the input question and the i-th round heuristic answer result, and the i-th round self-reflection result is generated based on the input question, the i-th round heuristic answer result, and the i-th round stimulated thinking result; i is a positive integer; Generate corresponding reasoning chains based on the heuristic answer results, stimulated thinking results, and self-reflection results of the same round; Through a small language model, the logical semantic relationship of each reasoning chain is detected to obtain multiple target reasoning chains with correct logical semantic relationships; Extracting a target answer to the input question from the multiple target reasoning chains and outputting the target answer; The small language model is used to detect the logical and semantic relationship of each reasoning chain to obtain multiple target reasoning chains with correct logical and semantic relationships, including: Using a small language model, a logical semantic relationship detection is performed on each reasoning chain to obtain a logical semantic relationship detection result of each reasoning chain; the logical semantic relationship detection result of the reasoning chain includes a first logical semantic relationship detection result, a second logical semantic relationship detection result, and a third logical semantic relationship detection result; the first logical semantic relationship detection result is determined based on the input question and the heuristic answer result of the reasoning chain; the second logical semantic relationship detection result is determined based on the heuristic answer result and the stimulated thinking result of the reasoning chain; and the third logical semantic relationship detection result is determined based on the stimulated thinking result and the self-reflection result of the reasoning chain; Based on the logical semantic relationship detection results of each reasoning chain, multiple target reasoning chains with correct logical semantic relationships are determined; Extracting a target answer to the input question from the multiple target reasoning chains and outputting the target answer includes: Using regular expressions, extract target information that answers the input question from each target reasoning chain; If the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain; If the target information is not successfully extracted in any target reasoning chain, the small language model fine-tuned by the task is used to generate the target information that answers the input question based on the target reasoning chain, and the format of the target information is standardized to obtain the initial answer corresponding to the target reasoning chain; Performing consistency evaluation based on the initial answers to obtain a target answer to the input question, and outputting the target answer; If target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain an initial answer corresponding to the target reasoning chain, including: If target information is successfully extracted in any target reasoning chain, the target information is format-standardized to obtain format-standardized information; Verify the reliability of the format standardization information using a small language model fine-tuned for the task; If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain; If the verification fails, the small language model fine-tuned by the task is used to generate an initial answer corresponding to the target reasoning chain based on the target reasoning chain; The performing consistency evaluation based on the initial answers to obtain a target answer to the input question includes: Determining the number of occurrences of the same answer in each of the initial answers; If the highest number of occurrences is greater than or equal to a preset number of occurrences threshold, the answer corresponding to the highest number of occurrences is determined to be the target answer to the input question.
2. The intelligent dialogue method based on large language model hallucination mitigation according to claim 1, characterized in that: The method of determining multiple target reasoning chains with correct logical semantic relationships based on the logical semantic relationship detection results of each reasoning chain includes: Scoring is performed based on the logical semantic relationship detection results of each reasoning chain to obtain a logical semantic relationship score for each reasoning chain; when the logical semantic relationship of the reasoning chain is wrong, the logical semantic relationship score of the reasoning chain is 0, and when the logical semantic relationship of the reasoning chain is correct, the logical semantic relationship score of the reasoning chain is 1; The reasoning chain whose product of all logical semantic relationship scores is 1 is determined as the target reasoning chain with correct logical semantic relationships.
3. The intelligent dialogue method based on large language model hallucination mitigation according to claim 1, characterized in that: When performing a logical semantic relationship test on each inference chain using a small language model and obtaining the logical semantic relationship test results for each inference chain, the following steps are performed for each inference chain: Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the input question and the heuristic answer results in the inference chain to obtain a first logical semantic relationship detection result between the input question and the heuristic answer results; Using a small language model and natural language inference technology, a logical semantic relationship detection is performed on the heuristic answer result and the stimulated thinking result in the inference chain to obtain a second logical semantic relationship detection result between the heuristic answer result and the stimulated thinking result; Through a small language model and adopting natural language reasoning technology, a logical semantic relationship detection is performed on the stimulus thinking result and the self-reflection result in the reasoning chain to obtain a third logical semantic relationship detection result between the stimulus thinking result and the self-reflection result.
4. The intelligent dialogue method based on large language model hallucination mitigation according to claim 3, characterized in that: When scoring based on the logical semantic relationship detection results of each reasoning chain to obtain the logical semantic relationship score of each reasoning chain, the following steps are performed for each reasoning chain: If the first logical semantic relationship detection result is an implication relationship, the second logical semantic relationship detection result is an implication relationship, and the third logical semantic relationship detection result is an implication relationship, then determining the logical semantic relationship score of the reasoning chain to be 1; If any one of the first logical semantic relationship detection result, the second logical semantic relationship detection result, and the third logical semantic relationship detection result is a neutral relationship or a contradictory relationship, the logical semantic relationship score of the reasoning chain is determined to be 0.
5. An intelligent dialogue system based on large language model hallucination mitigation, characterized by: include: A model reasoning module is configured to output, based on an input question and using a large language model, multiple rounds of heuristic answer results, multiple rounds of stimulated thinking results, and multiple rounds of self-reflection results; wherein the i-th round of heuristic answer results is generated based on the input question, the i-th round of stimulated thinking results is generated based on the input question and the i-th round of heuristic answer results, and the i-th round of self-reflection results is generated based on the input question, the i-th round of heuristic answer results, and the i-th round of stimulated thinking results; The reasoning chain generation module is used to generate corresponding reasoning chains based on the heuristic answer results, stimulated thinking results and self-reflection results of the same round; The logical semantic relationship detection module is used to perform logical semantic relationship detection on each reasoning chain through a small language model to obtain multiple target reasoning chains with correct logical semantic relationships; a target answer output module, configured to extract a target answer that answers the input question from the plurality of target reasoning chains and output the target answer; The small language model is used to detect the logical and semantic relationship of each reasoning chain to obtain multiple target reasoning chains with correct logical and semantic relationships, including: Using a small language model, a logical semantic relationship detection is performed on each reasoning chain to obtain a logical semantic relationship detection result of each reasoning chain; the logical semantic relationship detection result of the reasoning chain includes a first logical semantic relationship detection result, a second logical semantic relationship detection result, and a third logical semantic relationship detection result; the first logical semantic relationship detection result is determined based on the input question and the heuristic answer result of the reasoning chain; the second logical semantic relationship detection result is determined based on the heuristic answer result and the stimulated thinking result of the reasoning chain; and the third logical semantic relationship detection result is determined based on the stimulated thinking result and the self-reflection result of the reasoning chain; Based on the logical semantic relationship detection results of each reasoning chain, multiple target reasoning chains with correct logical semantic relationships are determined; Extracting a target answer to the input question from the multiple target reasoning chains and outputting the target answer includes: Using regular expressions, extract target information that answers the input question from each target reasoning chain; If the target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain the initial answer corresponding to the target reasoning chain; If the target information is not successfully extracted in any target reasoning chain, the small language model fine-tuned by the task is used to generate the target information that answers the input question based on the target reasoning chain, and the format of the target information is standardized to obtain the initial answer corresponding to the target reasoning chain; Performing consistency evaluation based on the initial answers to obtain a target answer to the input question, and outputting the target answer; If target information is successfully extracted from any target reasoning chain, the target information is formatted and standardized to obtain an initial answer corresponding to the target reasoning chain, including: If target information is successfully extracted in any target reasoning chain, the target information is format-standardized to obtain format-standardized information; Verify the reliability of the format standardization information using a small language model fine-tuned for the task; If the verification is successful, the format standardization information is determined as the initial answer corresponding to the target reasoning chain; If the verification fails, the small language model fine-tuned by the task is used to generate an initial answer corresponding to the target reasoning chain based on the target reasoning chain; The performing consistency evaluation based on the initial answers to obtain a target answer to the input question includes: Determining the number of occurrences of the same answer in each of the initial answers; If the highest number of occurrences is greater than or equal to a preset number of occurrences threshold, the answer corresponding to the highest number of occurrences is determined to be the target answer to the input question.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the intelligent dialogue method based on large language model hallucination relief are implemented as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the intelligent dialogue method based on large language model hallucination relief are implemented as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Large model illusion problem relieving method and device, equipment and storage medium
CN119938857A