Large model illusion problem relieving method and device, equipment and storage medium
By analyzing the language data input by the user and generating candidate content in parallel with different types of large models, and using semantic similarity and neural language models for multi-level evaluation and correction, the hallucination problem in the generated content of large language models is solved, and the diversity and accuracy of generated content is improved.
Patent Information
- Application Number
- CN202510091128.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to fully solve the hallucination problems in content generated by large language models, including factual errors, logical errors, semantic biases and insufficient domain knowledge, resulting in poor user experience and may cause serious consequences in high-risk scenarios.
By analyzing the language data entered by the user, the user's intentions are identified, and candidate content is generated in parallel using different types of preset models. Then, a multi-level credibility assessment is performed using the semantic similarity model and the neural language model, and the scores are compared with the thresholds and the candidates with the highest comprehensive score are finally selected as the output.
It effectively improves the diversity and accuracy of generated content, reduces the occurrence of hallucinations, ensures high accuracy and compliance of output results, and is transparent and interpretable.
Smart Images

Figure CN119938857A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and storage medium for alleviating large model hallucination problems. Background Art
[0002] The hallucination problem is a key challenge in generating content using large language models, which is usually manifested as factual errors (generated content does not match real-world knowledge, such as fictional non-existent events or incorrectly cited data), logical errors (generated content is inconsistent or has causal errors), semantic bias (generated content reflects bias or noise in training data), and insufficient domain knowledge (generated content is unprofessional or misleading in specific fields such as medicine and law). These problems not only affect user experience, but can also lead to serious consequences in high-risk scenarios.
[0003] Existing technologies to alleviate the hallucination problem mainly include data optimization, model improvement, and post-processing verification, but they have significant limitations and challenges. Data-driven methods are limited by the cost of labeling high-quality data and insufficient coverage, model optimization methods require a lot of computing resources and have limited generalization capabilities, and post-processing verification relies on external knowledge bases and is difficult to handle complex unstructured generated content. In addition, the dynamic nature of generated content, lack of domain knowledge, insufficient logical evaluation capabilities, and lack of adaptive correction mechanisms make it difficult for current technologies to fully solve the hallucination problem.
[0004] From the above, it can be seen that how to improve the diversity of generated content to reduce the occurrence of hallucination problems is an urgent problem to be solved. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for alleviating the large model hallucination problem, which can improve the diversity of generated content to reduce the occurrence of hallucination problems. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a method for alleviating the large model hallucination problem, comprising:
[0007] Parsing the language data input by the user end to obtain the user's intention, then generating candidate contents in parallel based on the language data and the user's intention using different types of preset large models, and performing multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain evaluation results; the preset large model includes an isomorphic or heterogeneous large language model;
[0008] By comparing each level score in each of the evaluation results with the corresponding preset level thresholds, the candidate content corresponding to the target level score in the comparison result that does not exceed the corresponding preset level threshold is corrected, and the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model is jumped to, until each level score in the evaluation result exceeds the corresponding preset level threshold;
[0009] The corresponding comprehensive score is determined based on the hierarchical scores of the candidate contents, and the target candidate content with the highest comprehensive score is used as the output result to alleviate the large model hallucination problem.
[0010] Optionally, the parsing of the language data input by the user terminal to obtain the user intent, and then generating candidate contents in parallel based on the language data and the user intent and using different types of preset large models, includes:
[0011] Acquire language data input by the user, and split the language data to obtain each word segment;
[0012] Perform part-of-speech tagging on each of the segmented words to obtain a corresponding tagging result, and perform user intent recognition based on the tagging result and using a pre-trained language model to obtain the user intent;
[0013] The candidate contents are generated in parallel based on the language data and the user intention and by using different types of homogeneous or heterogeneous large language models.
[0014] Optionally, the semantic similarity model and the neural language model are used to perform a multi-level credibility evaluation on the candidate content to obtain various evaluation results, including:
[0015] Calculating the semantic similarity between the candidate contents using a semantic similarity model, and determining the calculated consistency evaluation score as a first-level score;
[0016] Acquire knowledge content related to the candidate content from an external knowledge base through a search enhancement generation mechanism, calculate the semantic similarity between the knowledge content and the candidate content, and determine the calculated factual evaluation score as a second-level score;
[0017] Two adjacent sentences in the candidate content are combined to obtain sentence pairs, and the logical relationship between the sentence pairs is judged using a neural language model, so as to determine a logic evaluation score corresponding to the logical relationship based on the judgment result, and the logic evaluation score is determined as the third-level score.
[0018] Optionally, the using of a neural language model to judge the logical relationship of each of the sentence pairs, to determine a logic evaluation score corresponding to the logical relationship based on the judgment result, and to determine the logic evaluation score as a third-level score, comprises:
[0019] Using a neural language model to determine the logical relationship between the sentence pairs;
[0020] If the logical relationship of the sentence pair is logically consistent, then the third level score of the candidate content corresponding to the sentence pair is increased;
[0021] If the logical relationship of the sentence pair is logically opposite, the third level score of the candidate content corresponding to the sentence pair is reduced.
[0022] Optionally, by comparing each level score in each evaluation result with each corresponding preset level threshold, the candidate content corresponding to the target level score in the comparison result that does not exceed the corresponding preset level threshold is corrected, and the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model is jumped to, until each level score in the evaluation result exceeds each corresponding preset level threshold, including:
[0023] Obtaining a first comparison result by comparing the first level score with a corresponding first preset level threshold;
[0024] Comparing the second level score with the corresponding second preset level threshold to obtain a second comparison result;
[0025] Obtaining a third comparison result by comparing the third level score with the corresponding third preset level threshold;
[0026] The candidate contents corresponding to the target level scores in the first comparison result, the second comparison result and the third comparison result that do not exceed the corresponding preset level thresholds are corrected, and the process jumps to the step of performing a multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model until the scores at each level in the evaluation results exceed the corresponding preset level thresholds.
[0027] Optionally, the step of correcting the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the first comparison result, the second comparison result, and the third comparison result, and jumping to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until each level score in the evaluation result exceeds each corresponding preset level threshold, includes:
[0028] Obtaining a target level score that does not exceed the corresponding preset level threshold using the first comparison result, the second comparison result, and the third comparison result;
[0029] Generate a corresponding correction prompt based on the target level corresponding to the target level score, so as to correct the corresponding candidate content through the correction prompt, and jump to the step of performing a multi-level credibility evaluation on the candidate content using a semantic similarity model and a neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds.
[0030] Optionally, determining a corresponding comprehensive score based on each of the hierarchical scores of the candidate content, and taking the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem, includes:
[0031] Obtaining a comprehensive score corresponding to the candidate content by using a preset ratio and the scores of each level of the candidate content;
[0032] The comprehensive scores are sorted in descending order to obtain target candidate content corresponding to the highest comprehensive score, and the target candidate content is used as an output result to alleviate the large model hallucination problem.
[0033] In a second aspect, the present application provides a large model hallucination problem mitigation device, comprising:
[0034] A credibility evaluation module is used to parse the language data input by the user end to obtain the user's intention, and then generate candidate contents in parallel based on the language data and the user's intention using different types of preset large models, and perform multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain various evaluation results; the preset large model includes an isomorphic or heterogeneous large language model;
[0035] A hierarchical score comparison module is used to compare each hierarchical score in each evaluation result with each corresponding preset hierarchical threshold, to modify the candidate content corresponding to the target hierarchical score in the comparison result that does not exceed the corresponding preset hierarchical threshold, and to jump to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model, until each hierarchical score in the evaluation result exceeds each corresponding preset hierarchical threshold;
[0036] The comprehensive score determination module is used to determine the corresponding comprehensive score based on the hierarchical scores of the candidate content, and output the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem.
[0037] In a third aspect, the present application provides an electronic device, including:
[0038] Memory, used to store computer programs;
[0039] A processor is used to execute the computer program to implement the aforementioned large model hallucination problem mitigation method.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned large model hallucination problem mitigation method.
[0041] The present application parses the language data input by the user end to obtain the user intention, then generates candidate contents in parallel based on the language data and the user intention and using different types of preset large models, and uses a semantic similarity model and a neural language model to perform multi-level credibility evaluation on the candidate contents to obtain each evaluation result; the preset large model includes an isomorphic or heterogeneous large language model; by comparing each level score in each evaluation result with the corresponding preset level threshold, the candidate content corresponding to the target level score in the comparison result that does not exceed the corresponding preset level threshold is corrected, and jumps to the step of performing multi-level credibility evaluation on the candidate content using a semantic similarity model and a neural language model until each level score in the evaluation result exceeds the corresponding preset level threshold; the corresponding comprehensive score is determined based on each level score of the candidate content, and the target candidate content with the highest comprehensive score is used as the output result to alleviate the large model hallucination problem.
[0042] As can be seen from the above, the present application obtains the user intent by parsing the language data input by the user end, generates candidate content that is highly matched with the user intent based on different types of preset large models, and uses the semantic similarity model and the neural language model to perform a multi-level credibility assessment on the candidate content. By comparing the scores of each level in each evaluation result with the corresponding preset level thresholds, the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold is corrected, and jumps to the step of performing a multi-level credibility assessment on the candidate content using the semantic similarity model and the neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds, and the candidate content can be continuously optimized and corrected. In this way, a comprehensive score is obtained through the scores of each level, and the candidate content with the highest comprehensive score is selected as the output result, ensuring the high accuracy and conformity of the output result, effectively alleviating the large model hallucination problem, and at the same time having transparency and explainability. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A flow chart of a method for alleviating large model hallucination problems disclosed in this application;
[0045] Figure 2 This is a schematic diagram of the structure of a large-model illusion problem alleviation device disclosed in this application;
[0046] Figure 3 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] At present, data-driven methods for alleviating hallucination problems are limited by the cost of labeling high-quality data and insufficient coverage. Model optimization methods require a lot of computing resources and have limited generalization capabilities. Relying on external knowledge bases makes it difficult to handle complex unstructured generated content. Moreover, the dynamic nature of generated content, lack of domain knowledge, insufficient logical evaluation capabilities, and lack of adaptive correction mechanisms make it difficult to fully solve the hallucination problem. To this end, the present application provides a large model hallucination problem mitigation method, which obtains a comprehensive score through scores at each level, selects the candidate content with the highest comprehensive score as the output result, ensures the high accuracy and conformity of the output result, effectively alleviates the large model hallucination problem, and is transparent and explainable.
[0049] See also Figure 1 As shown, an embodiment of the present invention discloses a method for alleviating the large model hallucination problem, comprising:
[0050] Step S11, parsing the language data input by the user end to obtain the user intention, then generating candidate contents in parallel based on the language data and the user intention using different types of preset large models, and performing multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain evaluation results; the preset large model includes an isomorphic or heterogeneous large language model.
[0051] In this embodiment, the language data input by the user end is split to obtain each word segment, and then the natural language processing tool is used to perform part-of-speech tagging on each word segment, based on the obtained tagging results and using the trained language model, the language data is used to identify the user intent to obtain the user intent, and based on the user intent and the language data, different types of isomorphic or heterogeneous large models are used to generate each candidate content in parallel. Specifically, the language data input by the user end is parsed to obtain the user intent, and then based on the language data and the user intent, different types of preset large models are used to generate each candidate content in parallel, including: obtaining the language data input by the user end, and splitting the language data to obtain each word segment; performing part-of-speech tagging on each word segment to obtain the corresponding tagging results, based on the tagging results and using the pre-trained language model to identify the user intent to obtain the user intent; based on the language data and the user intent, different types of isomorphic or heterogeneous large language models are used to generate each candidate content in parallel.
[0052] It can be understood that the language data input by the user end is split into basic word units to obtain each segmented word, and then SpaCy (i.e., a natural language processing library) or Stanza (i.e., a natural language processing toolkit) can be used to perform part-of-speech tagging on each segmented word. For example, if the language data input by the user end is: What are the treatments for hypertension? The segmented words obtained after the above language data is split are: hypertension / noun, of / particle, treatment / noun, method / noun, what / question word. The BERT (Bidirectional Encoder Representationsfrom Transformers) model can be used to identify the user intent of the language data. For example, the user intent recognition result of "What are the treatments for hypertension?" is "Query treatment methods". Then, based on the user intent and the language data, multiple isomorphic or heterogeneous large language models are called to generate candidate contents in parallel, so as to make full use of the diversity characteristics between models, improve the coverage and quality of the generated content, and provide rich candidate results for the subsequent screening module.
[0053] Furthermore, the user intention and the language data can be combined to form an enhanced input prompt, and the enhanced input prompt can be input into multiple isomorphic or heterogeneous large language models. The heterogeneous large language model can use GPT-4 (Generative Pre-trained Transformer 4), Claude (an artificial intelligence language model), Qwen2.5 (a large-scale visual language model), etc.; the isomorphic large language model is based on the Qwen2.5 instruction model by adjusting the temperature parameters, and combining Top-k sampling (selecting the top k words with the highest probability) and Top-p sampling (i.e., core sampling) to increase the diversity and rationality of the generated candidate content. All large language models generate candidate content in parallel to form a candidate result set. , where n is the number of large language models. Each large language model runs independently and generates candidate content based on its unique semantic understanding and generation mechanism.
[0054] In this embodiment, after obtaining each candidate content, the semantic similarity between each candidate content is calculated using the Sentence-BERT (SBERT, a pre-trained model based on BERT) model to determine the first-level score; the knowledge content related to the candidate content is retrieved from the external knowledge base through the retrieval enhancement mechanism, and the semantic similarity between the knowledge content and the candidate content is calculated to determine the second-level score; two adjacent sentences in the candidate content are combined into sentence pairs, and the logical relationship between the sentence pairs is judged by the DeBERTa model (Decoding-enhanced BERT with disentangledattention, a neural language model), and the third-level score is determined based on the judgment result.
[0055] Specifically, the method uses a semantic similarity model and a neural language model to perform a multi-level credibility evaluation on the candidate content to obtain various evaluation results, including: using a semantic similarity model to calculate the semantic similarity between each candidate content, and determining the calculated consistency evaluation score as the first level score; obtaining knowledge content related to the candidate content from an external knowledge base through a retrieval enhancement generation mechanism, and calculating the semantic similarity between the knowledge content and the candidate content, and determining the calculated factual evaluation score as the second level score; combining two adjacent sentences in the candidate content to obtain each sentence pair, and using a neural language model to judge the logical relationship between each sentence pair, so as to determine a logical evaluation score corresponding to the logical relationship based on the judgment result, and determining the logical evaluation score as the third level score.
[0056] It can be understood that the semantic similarity between the candidate contents is calculated using the semantic similarity model, and the calculated consistency evaluation score is determined as the first-level score. The calculation formula is as follows:
[0057] ;
[0058] Where n is the total number of candidate contents generated by different large language models; Indicates generated content and The first-level score is a score that reflects the consistency between the candidate contents. The higher the first-level score, the higher the consensus between the candidate contents. The knowledge content related to the candidate content is obtained from the external knowledge base through the retrieval enhancement generation mechanism, and the semantic similarity between the knowledge content and the candidate content is calculated. The calculated factual evaluation score is determined as the second-level score. The calculation formula is as follows:
[0059] ;
[0060] Wherein, m is the number of knowledge contents retrieved from the external knowledge base, Indicates that the semantic similarity between the candidate content and the kth knowledge content is calculated by the Sentence-BERT model. The second-level score is a score reflecting the feasibility of the candidate content. The higher the second-level score, the more the candidate content conforms to the facts and the higher the credibility.
[0061] In this embodiment, when calculating the third-level score, a neural language model is used to determine the logical relationship between each of the sentence pairs; if the logical relationship between the sentence pairs is logically consistent, then the logical relationship between the sentence pairs is characterized as not contradictory, and the third-level score of the candidate content corresponding to the sentence pair is increased; if the logical relationship between the sentence pairs is logically opposite, then the logical relationship between the sentence pairs is characterized as contradictory, and the third-level score of the candidate content corresponding to the sentence pair is reduced.
[0062] Specifically, the method of using a neural language model to judge the logical relationship of each of the sentence pairs, to determine a logic evaluation score corresponding to the logical relationship based on the judgment result, and to determine the logic evaluation score as a third-level score, includes: using a neural language model to judge the logical relationship of each of the sentence pairs; if the logical relationship of the sentence pairs is logically consistent, then increasing the third-level score of the candidate content corresponding to the sentence pair; if the logical relationship of the sentence pairs is logically opposite, then reducing the third-level score of the candidate content corresponding to the sentence pair.
[0063] In a specific implementation, the logical relationship can be divided into implication, contradiction and neutrality, that is, the two sentences in the sentence pair are in an implication relationship, the two sentences in the sentence pair are mutually contradictory, and the two sentences in the sentence pair are neither in an implication relationship nor in a contradiction relationship. The calculation formula of the third level score is:
[0064] ;
[0065] in, Indicates the candidate content The number of sentence pairs in which the logical relationship corresponds to contradictions; The third level score is a score that can reflect the logic between the candidate contents. The higher the third level score is, the more reasonable the logic of the candidate contents is.
[0066] Step S12: by comparing each level score in each of the evaluation results with the corresponding preset level thresholds, the candidate content corresponding to the target level score in the comparison result that does not exceed the corresponding preset level threshold is corrected, and the process jumps to the step of performing a multi-level credibility evaluation on the candidate content using a semantic similarity model and a neural language model, until each level score in the evaluation result exceeds the corresponding preset level threshold.
[0067] In this embodiment, after obtaining the scores of each level, each of the level scores is compared with the corresponding preset level thresholds, that is, the first level score is compared with the corresponding first preset level threshold, the second level score is compared with the corresponding second preset level threshold, and the third level score is compared with the corresponding third preset level threshold, and the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the comparison result is corrected, and the process jumps to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until each of the level scores exceeds the corresponding preset level thresholds.
[0068] Specifically, by comparing each level score in each evaluation result with the corresponding preset level threshold, the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the comparison result is corrected, and the step of using the semantic similarity model and the neural language model to perform multi-level credibility evaluation on the candidate content is jumped to, until each level score in the evaluation result exceeds the corresponding preset level threshold, including: obtaining a first comparison result by comparing the first level score with the corresponding first preset level threshold; obtaining a second comparison result by comparing the second level score with the corresponding second preset level threshold; obtaining a third comparison result by comparing the third level score with the corresponding third preset level threshold; correcting the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the first comparison result, the second comparison result, and the third comparison result, and jumping to the step of using the semantic similarity model and the neural language model to perform multi-level credibility evaluation on the candidate content, until each level score in the evaluation result exceeds the corresponding preset level threshold. It is worth mentioning that each preset level threshold can be set according to actual conditions, which will not be described one by one here.
[0069] In this embodiment, the level score that does not exceed the corresponding preset level threshold is used as the target level score, and a correction prompt is generated based on the target level corresponding to the target level score to guide the large model to use the correction prompt to iteratively correct the candidate content corresponding to the target level, that is, the model will make preliminary modifications based on the correction prompt, and then evaluate the modified content again. If there are still level scores that do not reach the threshold, new correction prompts will continue to be generated and corrected until the scores of all levels exceed the corresponding preset level threshold. Specifically, the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the first comparison result, the second comparison result, and the third comparison result is corrected, and the step of using the semantic similarity model and the neural language model to perform multi-level credibility evaluation on the candidate content is jumped to until each level score in the evaluation result exceeds the corresponding preset level threshold, including: using the first comparison result, the second comparison result, and the third comparison result to obtain a target level score that does not exceed the corresponding preset level threshold; generating a corresponding correction prompt based on the target level corresponding to the target level score, so as to correct the corresponding candidate content through the correction prompt, and jumping to the step of using the semantic similarity model and the neural language model to perform multi-level credibility evaluation on the candidate content until each level score in the evaluation result exceeds the corresponding preset level threshold.
[0070] It is understandable that if the first-level score does not meet the corresponding first-preset-level threshold, then the consistency score of the corresponding candidate content is low, and a correction prompt can be generated, such as "the generated content has poor consensus with other models in semantic expression, and it is recommended to restate this part of the content to make it closer to the consensus"; if the second-level score does not meet the corresponding second-preset-level threshold, then the factual score of the corresponding candidate content is low, and a correction prompt is generated, such as "some information may lack factual basis, and it is recommended to supplement reliable factual basis or regenerate content based on knowledge verification"; if the third-level score does not meet the corresponding third-preset-level threshold, then the logic score of the corresponding candidate content is low, and a correction prompt is generated, such as "the logical relationship between sentences is confusing, and it is recommended to correct it to ensure the rationality of semantic logic". Then the correction prompt is directly embedded in the input prompt of the model, clarifying the problem and correction target to guide the large model to generate new candidate content.
[0071] Step S13: determine the corresponding comprehensive score based on the hierarchical scores of the candidate contents, and use the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem.
[0072] In this embodiment, the comprehensive score of each candidate content is determined based on a preset ratio and the scores of each level corresponding to the candidate content, the comprehensive scores are sorted in order from high to low, and the target candidate content with the highest comprehensive score is used as the large model output result. Specifically, the corresponding comprehensive score is determined based on the scores of each level of the candidate content, and the target candidate content with the highest comprehensive score is used as the output result to alleviate the large model hallucination problem, including: using a preset ratio and obtaining the comprehensive score corresponding to the candidate content through the scores of each level of the candidate content; sorting each comprehensive score in order from high to low to obtain the target candidate content corresponding to the highest comprehensive score, and using the target candidate content as the output result to alleviate the large model hallucination problem.
[0073] It can be understood that the comprehensive score of each candidate content is determined based on the preset ratio and the scores of each level corresponding to the candidate content. The calculation formula of the comprehensive score is:
[0074] ;
[0075] in, For the first level score, For the second level score, It is worth mentioning that the proportion of each level score to the comprehensive score can be adjusted according to actual conditions.
[0076] As can be seen from the above, the present application obtains the user intent by parsing the language data input by the user end, generates candidate content that is highly matched with the user intent based on different types of preset large models, and uses the semantic similarity model and the neural language model to perform a multi-level credibility assessment on the candidate content. By comparing the scores of each level in each evaluation result with the corresponding preset level thresholds, the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold is corrected, and jumps to the step of performing a multi-level credibility assessment on the candidate content using the semantic similarity model and the neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds, and the candidate content can be continuously optimized and corrected. In this way, a comprehensive score is obtained through the scores of each level, and the candidate content with the highest comprehensive score is selected as the output result, ensuring the high accuracy and conformity of the output result, effectively alleviating the large model hallucination problem, and at the same time having transparency and explainability.
[0077] Accordingly, see Figure 2 As shown, the present application also provides a large model illusion problem mitigation device, comprising:
[0078] The credibility evaluation module 11 is used to parse the language data input by the user terminal to obtain the user's intention, and then generate candidate contents in parallel based on the language data and the user's intention using different types of preset large models, and perform multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain various evaluation results; the preset large model includes an isomorphic or heterogeneous large language model;
[0079] The hierarchical score comparison module 12 is used to compare the hierarchical scores in the evaluation results with the corresponding preset hierarchical thresholds, to modify the candidate content corresponding to the target hierarchical score in the comparison result that does not exceed the corresponding preset hierarchical threshold, and to jump to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until the hierarchical scores in the evaluation results exceed the corresponding preset hierarchical thresholds;
[0080] The comprehensive score determination module 13 is used to determine the corresponding comprehensive score based on the hierarchical scores of the candidate contents, and output the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem.
[0081] As can be seen from the above, the present application obtains the user intent by parsing the language data input by the user end, generates candidate content that is highly matched with the user intent based on different types of preset large models, and uses the semantic similarity model and the neural language model to perform a multi-level credibility assessment on the candidate content. By comparing the scores of each level in each evaluation result with the corresponding preset level thresholds, the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold is corrected, and jumps to the step of performing a multi-level credibility assessment on the candidate content using the semantic similarity model and the neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds, and the candidate content can be continuously optimized and corrected. In this way, a comprehensive score is obtained through the scores of each level, and the candidate content with the highest comprehensive score is selected as the output result, ensuring the high accuracy and conformity of the output result, effectively alleviating the large model hallucination problem, and at the same time having transparency and explainability.
[0082] In some specific implementations, the credibility evaluation module 11 may specifically include:
[0083] A language data splitting unit, used to obtain language data input by a user terminal, and split the language data to obtain each word segment;
[0084] A user intention recognition unit is used to perform part-of-speech tagging on each of the segmented words to obtain a corresponding tagging result, and perform user intention recognition based on the tagging result and using a pre-trained language model to obtain the user intention;
[0085] The candidate content generating unit is used to generate candidate contents in parallel based on the language data and the user intention and using different types of isomorphic or heterogeneous large language models.
[0086] In some specific implementations, the credibility evaluation module 11 may specifically include:
[0087] A first score determination unit, configured to calculate the semantic similarity between the candidate contents using a semantic similarity model, and determine the calculated consistency evaluation score as a first level score;
[0088] A second score determination unit is used to obtain knowledge content related to the candidate content from an external knowledge base through a search enhancement generation mechanism, calculate the semantic similarity between the knowledge content and the candidate content, and determine the calculated factual evaluation score as a second-level score;
[0089] The third score determination unit is used to combine two adjacent sentences in the candidate content to obtain sentence pairs, and use a neural language model to determine the logical relationship between each sentence pair, so as to determine a logic evaluation score corresponding to the logical relationship based on the judgment result, and determine the logic evaluation score as the third level score.
[0090] In some specific implementations, the credibility evaluation module 11 may specifically include:
[0091] A logical relationship judgment unit, used to judge the logical relationship between each of the sentence pairs using a neural language model;
[0092] A third score increasing unit, configured to increase the third level score of the candidate content corresponding to the sentence pair if the logical relationship of the sentence pair is logically consistent;
[0093] The third score reducing unit is used to reduce the third level score of the candidate content corresponding to the sentence pair if the logical relationship of the sentence pair is logically opposite.
[0094] In some specific implementations, the hierarchical score comparison module 12 may specifically include:
[0095] A first result determination unit, configured to obtain a first comparison result by comparing the first level score with a corresponding first preset level threshold;
[0096] A second result determination unit, configured to compare the second level score with a corresponding second preset level threshold to obtain a second comparison result;
[0097] A third result determination unit, configured to obtain a third comparison result by comparing the third level score with a corresponding third preset level threshold;
[0098] The candidate content correction unit is used to correct the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the first comparison result, the second comparison result and the third comparison result, and jump to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until the scores of each level in the evaluation result exceed the corresponding preset level threshold.
[0099] In some specific implementations, the hierarchical score comparison module 12 may specifically include:
[0100] a target score determination unit, configured to obtain a target level score that does not exceed the corresponding preset level threshold by using the first comparison result, the second comparison result, and the third comparison result;
[0101] A correction prompt generating unit is used to generate a corresponding correction prompt based on the target level corresponding to the target level score, so as to correct the corresponding candidate content through the correction prompt, and jump to the step of performing a multi-level credibility evaluation on the candidate content using a semantic similarity model and a neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds.
[0102] In some specific implementations, the comprehensive score determination module 13 may specifically include:
[0103] A comprehensive score calculation unit, configured to obtain a comprehensive score corresponding to the candidate content by using a preset ratio and the scores of each level of the candidate content;
[0104] The comprehensive score sorting unit is used to sort the comprehensive scores in descending order to obtain the target candidate content corresponding to the highest comprehensive score, and use the target candidate content as the output result to alleviate the large model hallucination problem.
[0105] Furthermore, the present application also discloses an electronic device. Figure 3 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the large model hallucination problem mitigation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment can specifically be an electronic computer.
[0106] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0107] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0108] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the large model illusion problem mitigation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0109] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned large model hallucination problem mitigation method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0110] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0111] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0112] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0113] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0114] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for alleviating the large model hallucination problem, characterized in that: include: Parsing the language data input by the user end to obtain the user's intention, then generating candidate contents in parallel based on the language data and the user's intention using different types of preset large models, and performing multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain evaluation results; the preset large model includes an isomorphic or heterogeneous large language model; By comparing each level score in each of the evaluation results with the corresponding preset level thresholds, the candidate content corresponding to the target level score in the comparison result that does not exceed the corresponding preset level threshold is corrected, and the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model is jumped to, until each level score in the evaluation result exceeds the corresponding preset level threshold; The corresponding comprehensive score is determined based on the hierarchical scores of the candidate contents, and the target candidate content with the highest comprehensive score is used as the output result to alleviate the large model hallucination problem.
2. The method for alleviating the large model hallucination problem according to claim 1, characterized in that: The language data input by the user terminal is parsed to obtain the user intention, and then candidate contents are generated in parallel based on the language data and the user intention and using different types of preset large models, including: Acquire language data input by the user, and split the language data to obtain each word segment; Perform part-of-speech tagging on each of the segmented words to obtain a corresponding tagging result, and perform user intent recognition based on the tagging result and using a pre-trained language model to obtain the user intent; The candidate contents are generated in parallel based on the language data and the user intention and by using different types of homogeneous or heterogeneous large language models.
3. The method for alleviating the large model hallucination problem according to claim 1, characterized in that: The semantic similarity model and the neural language model are used to perform multi-level credibility evaluation on the candidate content to obtain various evaluation results, including: Calculating the semantic similarity between the candidate contents using a semantic similarity model, and determining the calculated consistency evaluation score as a first-level score; Acquire knowledge content related to the candidate content from an external knowledge base through a search enhancement generation mechanism, calculate the semantic similarity between the knowledge content and the candidate content, and determine the calculated factual evaluation score as a second-level score; Two adjacent sentences in the candidate content are combined to obtain sentence pairs, and the logical relationship between the sentence pairs is judged using a neural language model, so as to determine a logic evaluation score corresponding to the logical relationship based on the judgment result, and the logic evaluation score is determined as the third-level score.
4. The method for alleviating the large model hallucination problem according to claim 3, characterized in that: The step of using the neural language model to judge the logical relationship of each of the sentence pairs, determining a logic evaluation score corresponding to the logical relationship based on the judgment result, and determining the logic evaluation score as a third-level score includes: Using a neural language model to determine the logical relationship between the sentence pairs; If the logical relationship of the sentence pair is logically consistent, then the third level score of the candidate content corresponding to the sentence pair is increased; If the logical relationship of the sentence pair is logically opposite, the third level score of the candidate content corresponding to the sentence pair is reduced.
5. The method for alleviating the large model hallucination problem according to claim 3, characterized in that: The step of comparing the scores of each level in each evaluation result with the corresponding preset level thresholds, revising the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the comparison result, and jumping to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until the scores of each level in the evaluation result exceed the corresponding preset level thresholds, includes: Obtaining a first comparison result by comparing the first level score with a corresponding first preset level threshold; Comparing the second level score with the corresponding second preset level threshold to obtain a second comparison result; Obtaining a third comparison result by comparing the third level score with the corresponding third preset level threshold; The candidate contents corresponding to the target level scores in the first comparison result, the second comparison result and the third comparison result that do not exceed the corresponding preset level thresholds are corrected, and the process jumps to the step of performing a multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model until the scores at each level in the evaluation results exceed the corresponding preset level thresholds.
6. The method for alleviating the large model hallucination problem according to claim 5, characterized in that: The step of correcting the candidate content corresponding to the target level score that does not exceed the corresponding preset level threshold in the first comparison result, the second comparison result, and the third comparison result, and jumping to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model until each level score in the evaluation result exceeds each corresponding preset level threshold, includes: Obtaining a target level score that does not exceed the corresponding preset level threshold using the first comparison result, the second comparison result, and the third comparison result; Generate a corresponding correction prompt based on the target level corresponding to the target level score, so as to correct the corresponding candidate content through the correction prompt, and jump to the step of performing a multi-level credibility evaluation on the candidate content using a semantic similarity model and a neural language model, until the scores of each level in the evaluation result exceed the corresponding preset level thresholds.
7. The method for alleviating the large model hallucination problem according to any one of claims 1 to 6, characterized in that: The step of determining a corresponding comprehensive score based on each of the hierarchical scores of the candidate content, and taking the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem, includes: Obtaining a comprehensive score corresponding to the candidate content by using a preset ratio and the scores of each level of the candidate content; The comprehensive scores are sorted in descending order to obtain target candidate content corresponding to the highest comprehensive score, and the target candidate content is used as an output result to alleviate the large model hallucination problem.
8. A device for alleviating large model hallucination problems, characterized in that: include: A credibility evaluation module is used to parse the language data input by the user end to obtain the user's intention, and then generate candidate contents in parallel based on the language data and the user's intention using different types of preset large models, and perform multi-level credibility evaluation on the candidate contents using a semantic similarity model and a neural language model to obtain various evaluation results; the preset large model includes an isomorphic or heterogeneous large language model; A hierarchical score comparison module is used to compare each hierarchical score in each evaluation result with each corresponding preset hierarchical threshold, to modify the candidate content corresponding to the target hierarchical score in the comparison result that does not exceed the corresponding preset hierarchical threshold, and to jump to the step of performing multi-level credibility evaluation on the candidate content using the semantic similarity model and the neural language model, until each hierarchical score in the evaluation result exceeds each corresponding preset hierarchical threshold; The comprehensive score determination module is used to determine the corresponding comprehensive score based on the hierarchical scores of the candidate content, and output the target candidate content with the highest comprehensive score as the output result to alleviate the large model hallucination problem.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the large model hallucination problem mitigation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method for alleviating the large model hallucination problem as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Intelligent dialogue method, system and device based on big language model illusion relief and medium
CN120258156A
Intelligent dialogue method, system, device and medium based on large language model hallucination relief
CN120258156B
Bridge industry big language model illusion reduction method, device and equipment
CN121188144A
Method, device and equipment for reducing hallucination of large language model applied to bridge industry
CN121188144B