Big language model illusion elimination method and device, equipment and storage medium
By combining semantic analysis and probability statistics, a target noun association network in a large language model is constructed and the entropy difference value is calculated to optimize the text, the shortcomings of the illusion problem in the large language model are solved, and the generalization ability and reliability are improved.
Patent Information
- Application Number
- CN202510337458.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-21
AI Technical Summary
Existing large language models have hallucinations problems in text generation and analysis, such as factual errors, logical contradictions, semantic biases, and non-fidelity, and hallucination detection methods that rely on external knowledge bases are unreliable and have weak generalization capabilities.
By combining semantic analysis with probability statistics, a correlation network between target nouns is constructed, entropy difference values are calculated to determine the type of hallucination risk, and the text is optimized using corresponding optimization strategies to eliminate hallucinations.
It realizes the generalization ability and reliability of hallucination processing methods without relying on external knowledge base, and fundamentally eliminates the hallucination risks in the analysis results of large language models.
Smart Images

Figure CN119849509A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a large language model hallucination elimination method, device, equipment and storage medium. Background Art
[0002] Large language models perform well in tasks such as text generation, question answering, summarization, and code generation, but there are still some hallucination problems, including factual errors (the generated content does not match the real-world facts), logical contradictions (the information inside the text is inconsistent), semantic deviations (the generated text fails to accurately express the user's intentions), and infidelity (in summary or translation tasks, the generated content does not match the source text).
[0003] At present, hallucination detection methods mainly rely on external knowledge base comparison. This method has the problems of unreliable hallucination detection process, limited coverage of the knowledge base, and weak generalization ability. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a large language model hallucination elimination method, device, equipment and storage medium, which can combine semantic analysis with probability statistics, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby ensuring the generalization ability and reliability of the hallucination processing method. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a large language model hallucination elimination method, comprising:
[0006] Analyze the initial text to be analyzed to obtain target nouns, and encode the feature graphs corresponding to the target nouns into target vectors; the feature graphs include noun concepts, semantic labels and context information corresponding to the target nouns;
[0007] According to the association relationship between the target nouns determined based on the target vector, an association network between the target nouns is constructed, and an association path corresponding to each target noun is obtained according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes;
[0008] Determine a reference path from each of the associated paths, and obtain an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy represents the uncertainty of activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of path selection from the path starting point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of distribution of output results generated by a preset large language model based on the associated path;
[0009] The hallucination risk type corresponding to the initial text to be analyzed is determined based on the entropy difference value, and the initial text to be analyzed is optimized using an optimization strategy corresponding to the hallucination risk type, so as to eliminate hallucinations in the analysis result after the preset large language model analyzes the initial text to be analyzed.
[0010] Optionally, analyzing the initial text to be analyzed to obtain the target noun includes:
[0011] Using a preset grammar analysis technology to identify the initial text to be analyzed to obtain first initial nouns in the initial text to be analyzed, and performing semantic importance evaluation on the first initial nouns to determine second initial nouns from each of the first initial nouns;
[0012] determining whether the second initial noun is a complete noun, and if the second initial noun is a complete noun, determining the second initial noun as a target noun;
[0013] If the second initial noun is not a complete noun, each of the second initial nouns is merged to obtain a merged noun, and the merged noun is determined as a target noun.
[0014] Optionally, before encoding the feature graphs corresponding to the target nouns into target vectors, the method further includes:
[0015] Inputting different text segments including the same target noun into the preset large language model, so that the preset large language model generates different first output results according to the different text segments;
[0016] Obtain each of the first output results and obtain a first output change of the preset large language model according to each of the first output results;
[0017] Modify any target noun in the initial text to be analyzed, and input the corresponding modified text into the preset large language model to obtain a second output result output by the preset large language model, and obtain a second output change according to the second output result;
[0018] Inputting a text segment including the same target noun in the context into the preset large language model, and according to a third output result of the preset large language model;
[0019] The degree of understanding of each of the target nouns by the preset large language model is obtained according to the first output change, the second output change and the third output result, and the feature graphs corresponding to each of the target nouns are generated according to the degree of understanding.
[0020] Optionally, the large language model hallucination elimination method further includes: obtaining any two mutually related target nouns according to the association network, and obtaining the association strength between any two related target nouns according to the feature overlap, context distance and co-occurrence frequency between the any two target nouns; wherein the feature overlap is the quotient of a target difference and the total number of features of any two target nouns, and the target difference is the difference between a first number of common features and a second number of mutually exclusive features between any two target nouns.
[0021] Optionally, the hallucination risk types include direct conflict, indirect conflict, context conflict and weight imbalance. The direct conflict indicates that the feature overlap between any two directly associated target nouns is a negative value. The indirect conflict indicates that there is a contradiction in the semantics of any two target nouns connected by the same intermediate node. The context conflict indicates that the difference in weight values between edges formed at different positions of the same target noun in the association network is greater than a preset weight value difference threshold. The weight imbalance indicates that the weight value of the edge corresponding to the preset secondary noun is higher than the weight value of the edge corresponding to the preset primary noun.
[0022] Optionally, optimizing the initial text to be analyzed by using an optimization strategy corresponding to the hallucination risk type includes:
[0023] If the hallucination risk type is the context conflict, increasing the number of times the first target noun is used in the initial text to be analyzed, and increasing the association between the first target noun and the corresponding context; wherein the first target noun is the target noun corresponding to the context conflict;
[0024] If the hallucination risk type is the direct conflict, a target modifier is added before the third target noun; wherein the third target noun is the target noun corresponding to the direct conflict, and the target modifier is a modifier that limits the third target noun;
[0025] If the hallucination risk type is the indirect conflict, adjusting the position of the third target noun in the initial text to be analyzed, and adding transition text between each of the third target nouns; wherein the third target noun is the target noun corresponding to the indirect conflict;
[0026] If the hallucination risk type is the weight imbalance, the first representation strength of the preset secondary noun in the initial text to be analyzed is weakened, and the second representation strength of the preset primary noun in the initial text to be analyzed is strengthened.
[0027] Optionally, after optimizing the initial text to be analyzed by using the optimization strategy corresponding to the hallucination risk type, the method further includes:
[0028] The optimized text to be analyzed is input into the preset large language model, an optimization effect corresponding to the optimized text to be analyzed is obtained according to a fourth output result of the preset large language model, and optimization parameters corresponding to the optimization strategy are adjusted according to the optimization effect.
[0029] In a second aspect, the present application provides a large language model hallucination elimination device, comprising:
[0030] A feature map acquisition module is used to analyze the initial text to be analyzed to obtain target nouns, and encode the feature maps corresponding to each target noun into a target vector; the feature maps include noun concepts, semantic labels and context information corresponding to each target noun;
[0031] an association path acquisition module, configured to construct an association network between the target nouns according to the association relationship between the target nouns determined based on the target vector, and acquire an association path corresponding to each target noun according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes;
[0032] An entropy difference acquisition module is used to determine a reference path from each of the associated paths, and obtain an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy represents the uncertainty of the activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of the path selection from the path start point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of the distribution of the output result generated by the preset large language model based on the associated path;
[0033] A text optimization module is used to determine the hallucination risk type corresponding to the initial text to be analyzed based on the entropy difference value, and optimize the initial text to be analyzed using an optimization strategy corresponding to the hallucination risk type, so as to eliminate hallucinations in the analysis result after the preset large language model analyzes the initial text to be analyzed.
[0034] In a third aspect, the present application provides an electronic device, including:
[0035] Memory, used to store computer programs;
[0036] A processor is used to execute the computer program to implement the aforementioned large language model hallucination elimination method.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned large language model hallucination elimination method.
[0038] In the present application, the initial text to be analyzed is first analyzed to obtain target nouns, and the feature maps corresponding to each target noun are encoded into target vectors; the feature maps include noun concepts, semantic labels and context information corresponding to each target noun, and then, according to the association relationship between each target noun determined based on the target vector, an association network between each target noun is constructed, and the association path corresponding to each target noun is obtained according to the association network; the nodes in the association network represent each target noun, the directed edges between each node represent the association relationship between each target noun, and the weight of each directed edge represents the association strength between the nodes, and then a reference path is determined from each association path, and the first target entropy corresponding to each association path and the reference entropy are obtained. The target entropy includes feature activation entropy, path selection entropy and output distribution entropy, wherein the feature activation entropy represents the uncertainty of activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of path selection from the path starting point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of distribution of output results generated by the preset large language model based on the associated path. Finally, based on the entropy difference value, the hallucination risk type corresponding to the initial text to be analyzed is determined, and the initial text to be analyzed is optimized using the optimization strategy corresponding to the hallucination risk type, so as to eliminate the hallucination in the analysis result after the preset large language model analyzes the initial text to be analyzed. It can be seen that the present application can obtain the association network corresponding to the nouns in the text by performing semantic analysis on the text to be analyzed, and can obtain the types of hallucination risks of the large language model by analyzing the association network between nouns, and optimize the text to be analyzed using the corresponding processing method, thereby fundamentally eliminating the risk of hallucinations in the analysis results of the text by the large language model, and ensuring the reliability of the hallucination processing process; by combining semantic analysis with probability statistics, the hallucination risk type in the text is determined, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby improving the generalization ability of the hallucination processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] 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.
[0040] Figure 1 A flow chart of a large language model hallucination elimination method disclosed in this application;
[0041] Figure 2A schematic diagram of a specific large language model hallucination elimination method disclosed in this application;
[0042] Figure 3 A flow chart of a method for obtaining entropy difference value disclosed in this application;
[0043] Figure 4 This is a schematic diagram of the structure of a large language model hallucination elimination device disclosed in this application;
[0044] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0045] 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.
[0046] At present, the hallucination detection method mainly relies on the comparison of external knowledge base. This method has the problem that the hallucination detection process is unreliable and the generalization ability is weak due to the limited coverage of the knowledge base. To this end, the present application provides a large language model hallucination elimination method, which combines semantic analysis with probability statistics, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby ensuring the generalization ability and reliability of the hallucination processing method.
[0047] See also Figure 1 As shown, the embodiment of the present invention discloses a large language model hallucination elimination method, comprising:
[0048] Step S11, analyzing the initial text to be analyzed to obtain target nouns, and encoding the feature graphs corresponding to the target nouns into target vectors; the feature graphs include noun concepts, semantic labels and context information corresponding to the target nouns.
[0049] In this embodiment, the main process of the large language model hallucination elimination method is as follows: Figure 2As shown, first obtain the association path between each noun in the text to be analyzed, and quantify the association path by entropy difference calculation to evaluate the hallucination risk distribution of the original text; select the most suitable optimization strategy combination according to the risk type; gradually apply the selected strategy, and re-evaluate after each application; verify and optimize the effect through small-scale sampling test; adjust the optimization parameters according to the verification results; and finally apply the best parameter configuration to complete the optimization. In addition, the system also creates an optimization strategy library, and continuously updates the strategy effectiveness score according to the historical application effect to achieve self-optimization of strategy selection. It should be noted that the system for detecting and eliminating the hallucination of the large language model in this embodiment mainly includes a noun feature mapper, a feature path analyzer, an entropy difference calculator and a noun optimization engine; therefore, the main process of the above-mentioned large language model hallucination elimination method is: using a noun feature mapper to identify and analyze the core nouns in the input text (i.e., the initial text to be analyzed), wherein the noun feature mapper is mainly responsible for identifying the key semantic units (i.e., the target nouns) in the input text, and establishing a mapping relationship between the key semantic units and the internal representation of the model; using a feature path analyzer to construct an association network between noun phrases. The feature path analyzer mainly builds a higher-level association network and performs structural and semantic analysis on the network; uses the entropy difference calculator to calculate the uncertainty difference of each path, providing an accurate mathematical quantitative basis; uses the noun optimization engine to optimize the structure of the input text to eliminate the risk of hallucinations from the root. Finally, the optimized hallucination-free text is output.
[0050] It should be noted that the noun feature mapper is based on the following key discovery: during the training process of a large language model, its internal neurons will self-organize into functional units that process specific concepts. These functional units are mainly formed around noun concepts, rather than other parts of speech such as verbs or adjectives. For example, when the model processes nouns such as "computer" and "Einstein", it will activate specific clusters of neurons that represent knowledge and associations related to these concepts.
[0051] The noun feature mapper is a basic component of the present invention, which is responsible for identifying key nouns in the input text and establishing a mapping relationship between them and the internal representation of the model. The core function of the mapper is to understand the concept network that is activated internally by the large language model when processing specific nouns, so as to provide basic data for subsequent hallucination detection; accordingly, the above-mentioned process of analyzing the initial text to be analyzed to obtain the target noun can specifically include: using a preset grammatical analysis technology to identify the initial text to be analyzed to obtain the first initial noun in the initial text to be analyzed, and performing a semantic importance assessment on the first initial noun to determine the second initial noun from each first initial noun; judging whether the second initial noun is a complete noun, if the second initial noun is a complete noun, then determining the second initial noun as the target noun; if the second initial noun is not a complete noun, then determining each second initial noun as the target noun; The initial nouns are merged to obtain the merged nouns, and the merged nouns are determined as the target nouns; specifically, the noun feature mapper first needs to identify key nouns from the input text, and the system adopts multi-level analysis: including basic grammatical analysis (using grammatical analysis technology to identify the noun components in the text, that is, obtaining the first initial noun in the initial text to be analyzed), semantic importance evaluation (determining which nouns have core semantic value in the current context, that is, determining the second initial noun with core semantic value) and concept integration (integrating related nouns into complete semantic units, such as "artificial intelligence" instead of separate "artificial" and "intelligence", that is, merging semantically incomplete second initial nouns).
[0052] In this embodiment, each recognized noun is assigned a multi-dimensional label (i.e., a semantic label) to form a rich semantic description: including entity type (person, place, organization, time, etc.), degree of abstraction (a continuous spectrum from concrete entities to completely abstract concepts), professional field (the knowledge field to which it belongs, such as general, scientific, medical, etc.) and information density (the amount of information required to express the noun). A noun usually has multiple labels at the same time. For example, "artificial intelligence" may be labeled as "technology" (entity type), "semi-abstract concept" (degree of abstraction), "computer science" (professional field) and "high information content" (information density). The noun feature mapper uses a non-invasive mapping method to observe the model's response to the input to infer its internal processing mechanism, just like psychologists infer the thinking process by observing behavior. Accordingly, before encoding the feature maps corresponding to each target noun into a target vector, it also includes: inputting different text fragments including the same target noun into the preset large language model, so that the preset large language model generates different first output results according to different text fragments; obtaining each first output result and obtaining the first output change of the preset large language model according to each first output result; modifying any target noun in the initial text to be analyzed, and inputting the corresponding modified text into the preset large language model to obtain the second output result output by the preset large language model, and obtaining the second output change according to the second output result; inputting the text fragment including the same target noun in the context into the preset large language model, and according to the third output result of the preset large language model; obtaining the preset large language model's understanding of the target noun according to the first output change, the second output change and the third output result, and generating each feature map corresponding to each target noun according to the understanding degree; specifically, the above process of obtaining the understanding degree of each noun by the large language model includes:
[0053] Differential input test: The system provides the model with multiple variant texts containing the target noun and observes the changes in the output. For example, it provides "Einstein invented the theory of relativity" and "Einstein likes violin" and analyzes the different outputs caused by the two inputs (i.e., the changes in the first output).
[0054] Noun replacement analysis: By replacing, deleting or modifying the target noun, measure the degree of change in the output. For example, replace "Einstein" with "Newton" and observe the degree of change in the model output (i.e. the change in the second output), thereby inferring the degree to which the model distinguishes between the two concepts.
[0055] Context sensitivity test: Use the same noun in different contexts and analyze how the model adjusts its understanding of the noun based on the context based on the model output (i.e., the third output result).
[0056] Through these analyses, the system generates a feature activation map for each noun, which mainly records the concept set, semantic labels and contextual information associated with the noun. Finally, the content contained in the above map is encoded into a high-dimensional vector and stored in a vector database to support efficient similarity search and semantic matching. By inputting different texts and observing the output changes of the large language model, it is possible to more accurately understand the large language model's understanding of each noun, thereby ensuring the correctness of the generated feature image and the reliability of the subsequently generated association path.
[0057] Step S12: construct an association network between the target nouns according to the association relationship between the target nouns determined based on the target vector, and obtain the association path corresponding to each target noun according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes.
[0058] The feature path analyzer is the second core component of the system, responsible for analyzing the semantic association paths (i.e., association networks) between nouns and identifying potential inconsistencies. The analyzer builds a higher-level association network based on the basic data generated by the noun feature mapper and performs structural and semantic analysis on the network.
[0059] The feature path analyzer treats the noun concepts in the input text as nodes in the feature activation map and constructs the association paths between them. The system represents each noun as a node, and the association relationship between nouns is represented as a directed weighted edge (a line connecting two nodes, which has a direction and a weight value. The directionality indicates that the relationship points from one node to another, and the weight value indicates the strength or importance of the relationship). The attributes of the node include the concept set, semantic label and context information obtained from the noun feature mapper (these are all obtained from the noun feature mapper), and the edge weight is calculated based on the feature set similarity, context distance and historical co-occurrence frequency (the calculation uses context information, which measures the frequency of two nouns appearing together in similar contexts. During the calculation, the system analyzes previously processed text samples and records the noun pairs that co-occur in the same or similar contexts. The number of times the two nouns appear together, this calculation may also refer to the professional field information in the semantic tag of the noun, and give a higher weight to the co-occurrence in the same field); specifically, any two target nouns that are related to each other are obtained according to the association network, and the strength of the association between any two related target nouns is obtained according to the feature overlap, context distance and co-occurrence frequency between the two target nouns; wherein the feature overlap is the quotient of the target difference and the total number of features of any two target nouns, and the target difference is the difference between the first number of common features and the second number of mutually exclusive features between any two target nouns, that is, when the system uses the path analysis algorithm to calculate the weight of the edge, it uses three main factors: feature overlap ((number of common features - number of mutually exclusive features) / total number of features, where the number of mutually exclusive features is summarized by the system, such as "vegetarianism" and "meat consumption"), context distance and co-occurrence frequency. These weights directly reflect the strength of the association between the two nouns. This calculation method can efficiently evaluate the connection between nouns. Not only can the "strongest path" (i.e., reference path) with the highest weight and the highest value be found, but also the suboptimal paths can be identified and their weight differences can be compared. When the difference in weight between the strongest path and the second-best path is large, it indicates that the association is more reliable; when the weights of multiple paths are similar, it indicates that there is semantic ambiguity.
[0060] It should be noted that conflict detection is the core function of the path analyzer. The system can preliminarily identify four typical conflicts included in the illusion risk type:
[0061] Direct conflict: When calculating the edge weight between two directly connected nouns, if the system detects that their feature overlap is negative (mutual exclusivity), it will be initially marked as a direct conflict. For example, the feature set comparison of "vegetarian" and "eating steak" will produce a negative overlap.
[0062] Indirect conflict: When analyzing multiple paths, the system detects that paths connected by different intermediate nodes produce contradictory results. For example, the time characteristics of the path "Mozart" → "Historical background" conflict with the time characteristics of the path "Historical background" → "Electronic synthesizer" (some nouns contain time characteristics).
[0063] Context conflict: When the edges formed by the same noun at different positions in the text have significantly different weight values, the system will initially identify it as a context conflict. For example, the edge weight of "apple" connected to food-related nouns is in contrast to the edge weight connected to technology-related nouns.
[0064] Strength imbalance: When calculating paths between nodes, the system detects emphasis shift if the edge weight of the secondary noun is abnormally higher than the edge weight of the subject noun. For example, the edge weight of "Einstein" → "Patent Office Clerk" exceeds the edge weight of "Einstein" → "Physicist".
[0065] That is, the types of hallucination risks in this embodiment include direct conflict, indirect conflict, context conflict and weight imbalance. Direct conflict indicates that the feature overlap between any two directly related target nouns is negative. Indirect conflict indicates that there is a contradiction in the semantics of any two target nouns connected by the same intermediate node. Context conflict indicates that the difference in weight values between edges formed at different positions of the same target noun in the association network is greater than a preset weight value difference threshold. Weight imbalance indicates that the weight value of the edge corresponding to the preset secondary noun is higher than the weight value of the edge corresponding to the preset primary noun.
[0066] Step S13, determining a reference path from each of the associated paths, and obtaining an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy characterizing the uncertainty of activation distribution of features corresponding to the target noun in the associated path, the path selection entropy characterizing the uncertainty of path selection from the path starting point to the path end point in the associated path, and the output distribution entropy characterizing the uncertainty of distribution of output results generated by a preset large language model based on the associated path.
[0067] The entropy difference calculator is used to quantify the uncertainty differences of different noun paths, providing a mathematical basis for hallucination risk assessment. It should be noted that in this embodiment, the path analyzer can only preliminarily identify the above four typical conflicts, and the specific conflict type needs to be finally determined based on the results of the entropy difference calculator.
[0068] For each identified association path, the system calculates three types of entropy: feature activation entropy, path selection entropy, and output distribution entropy. Among them, feature activation entropy represents the uncertainty of the activation distribution of the features corresponding to the target noun in the association path, path selection entropy represents the uncertainty of the path selection from the path starting point to the path end point in the association path, and output distribution entropy represents the uncertainty of the distribution of the output results generated by the preset large language model based on the association path.
[0069] Step S14: determining the hallucination risk type corresponding to the initial text to be analyzed based on the entropy difference value, and optimizing the initial text to be analyzed using an optimization strategy corresponding to the hallucination risk type, so as to eliminate hallucinations in the analysis result after the preset large language model analyzes the initial text to be analyzed.
[0070] In this embodiment, the process of optimizing the initial text to be analyzed using the optimization strategy corresponding to the hallucination risk type may specifically include: if the hallucination risk type is the context conflict, then increasing the number of times the first target noun is used in the initial text to be analyzed, and increasing the association between the first target noun and the corresponding context; wherein the first target noun is the target noun corresponding to the context conflict; if the hallucination risk type is direct conflict, then adding a target modifier before the third target noun; wherein the third target noun is the target noun corresponding to the direct conflict, and the target modifier is a modifier that limits the third target noun; if the hallucination risk type is indirect conflict, then adjusting the position of the third target noun in the initial text to be analyzed, and adding transition text between each third target noun; wherein the third target noun is the target noun corresponding to the indirect conflict; if the hallucination risk type is weight imbalance, then weakening the first representation strength of the preset secondary noun in the initial text to be analyzed, and strengthening the second representation strength of the preset main noun in the initial text to be analyzed. Specifically, the system adopts five optimization strategies, which are dynamically selected according to the hallucination type:
[0071] 1. Noun strengthening: Enhance the representation strength of key nouns in the text, mainly to solve the context conflict in the third part. Methods include: repeating key nouns, adding modifying descriptions and increasing contextual associations.
[0072] 2. Noun Precision: Improve the semantic precision of nouns, mainly to resolve direct conflicts in the third part. Methods include: replacing vague nouns with specific expressions, adding restrictive modifiers, and decomposing complex concepts into basic components.
[0073] 3. Conflict path isolation: Reduce the mutual interference between conflicting nouns, mainly solving the indirect conflict in the third part. The methods include: adjusting the order of noun appearance, adding transitional expressions and marking different contexts (here it means separating the unclear contexts, and adding some descriptive words to reduce noun conflicts).
[0074] 4. Feature balance adjustment: balance the representation strength of different nouns, mainly to solve the imbalance of strength in the third part. The methods include: weakening secondary nouns and strengthening primary nouns. For example, in the original text: "Turing designed computers and developed artificial intelligence systems", here computers are the primary nouns (because this is Turing's main contribution), and artificial intelligence systems are secondary nouns. It was eventually changed to Turing proposed the theoretical basis of general-purpose computers (Turing machines) in 1936. In 1950, he published a thought experiment on machine intelligence, which provided an early conceptual framework for the field of artificial intelligence.
[0075] 5. Entropy stabilization optimization: Reduce the uncertainty of high entropy paths, applicable to all situations, including: adding redundant information, providing auxiliary context and enhancing path connection strength.
[0076] In this embodiment, after optimizing the initial text to be analyzed using the optimization strategy corresponding to the hallucination risk type, it also includes: inputting the optimized text to be analyzed into a preset large language model, obtaining the optimization effect corresponding to the optimized text to be analyzed according to the fourth output result of the preset large language model, and adjusting the optimization parameters corresponding to the optimization strategy according to the optimization effect, that is, applying the selected strategy and re-evaluating after each application; verifying and optimizing the effect through small-scale sampling tests; adjusting the optimization parameters according to the verification results; and finally applying the best parameter configuration to complete the optimization. By optimizing the text according to the optimization strategy corresponding to the hallucination risk type, the pertinence and reliability of the optimization process are guaranteed.
[0077] It can be seen that the present application can obtain the association network corresponding to the nouns in the text by performing semantic analysis on the text to be analyzed, and can obtain the types of hallucination risks of the large language model by analyzing the association network between nouns, and optimize the text to be analyzed using the corresponding processing method, thereby fundamentally eliminating the risk of hallucinations in the analysis results of the text by the large language model, and ensuring the reliability of the hallucination processing process; by combining semantic analysis with probability statistics, the hallucination risk type in the text is determined, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby improving the generalization ability of the hallucination processing method.
[0078] Based on the above embodiments, this application describes a process for detecting and eliminating large language model hallucinations. To make the technical solution in this application more complete, this application will describe in detail how to select a reference path and how to calculate the entropy difference value. Figure 3 As shown, the embodiment of the present invention discloses a process for calculating an entropy difference value, including:
[0079] Step S21, calculating the target entropy of each associated path to obtain a target calculation result; wherein the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy represents the uncertainty of the activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of the path selection from the path starting point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of the distribution of the output result generated by the preset large language model based on the associated path.
[0080] In this embodiment, it is necessary to calculate the feature activation entropy, path selection entropy and output distribution entropy corresponding to each of the associated paths respectively.
[0081] 1. Feature activation entropy: It is used to quantify the uncertainty of feature activation distribution on the path. Its calculation process is as follows:
[0082] First, we need to calculate the activation strength of the feature corresponding to the target noun. The formula is as follows:
[0083] ;
[0084] in, represents the activation strength of feature i, is the weight of feature i on noun n. The feature weight indicates the importance of a feature to the concept of the noun. It is usually extracted from the knowledge base or pre-trained. is the activation frequency of feature i, which indicates the frequency of feature i being activated in the current context, obtained after model training. Then normalization is required, and the calculation formula is as follows:
[0085] ;
[0086] in, is the probability distribution corresponding to the above feature activation intensity, is the activation intensity of feature j, and finally the feature activation entropy is calculated by probability. The calculation formula is as follows:
[0087] ;
[0088] in, That is the above-mentioned feature activation entropy.
[0089] 2. Path selection entropy: It is used to quantify the uncertainty of possible path selection from the starting point to the end point. The calculation process is as follows:
[0090] First, we need to calculate the weight of the edge in the path. The calculation formula is as follows:
[0091] ;
[0092] in, represents the weight value of the kth edge in path j. The weight value is calculated based on the feature overlap, context distance, and co-occurrence frequency between different nouns on the path. and They represent different nouns. Represents the feature overlap between nouns, represents the contextual distance between nouns (number of tokens between words), represents the co-occurrence frequency of two nouns (from the preset corpus statistics), , , is the weight coefficient, which is trained by the data in the corpus and satisfies .
[0093] Then we need to calculate the comprehensive strength of path j , which is obtained by multiplying the weight value of each edge in the path. The calculation formula is as follows:
[0094] ;
[0095] Use the Softmax function to normalize all path strengths to get the probability distribution , and its calculation formula is as follows:
[0096] ;
[0097] in, is the comprehensive strength of path m.
[0098] Finally, the path selection entropy is calculated by probability , and its calculation formula is as follows:
[0099] ;
[0100] 3. Output distribution entropy: used to quantify the uncertainty of the output distribution that may be generated based on the current path.
[0101] First, we need to calculate the probability distribution corresponding to the frequency of the model generating output k , and its calculation formula is as follows:
[0102] ;
[0103] in, The frequency with which the model generates output k based on historical data (which can be based on training data statistics), is the frequency with which the model generates output m based on historical data.
[0104] Finally, the output distribution entropy is calculated , and its calculation formula is as follows:
[0105] ;
[0106] Step S22: determining a reference path from each of the associated paths according to the target calculation result, obtaining a first target entropy corresponding to the reference path and a second target entropy corresponding to each of the associated paths, and calculating an entropy difference value between the first target entropy and the second target entropy.
[0107] In this embodiment, by calculating the feature activation entropy, path selection entropy and output distribution entropy for each path, and analyzing the path according to the target calculation results, the system selects the most reliable path as the reference path. , and then calculate the entropy difference between other candidate paths and the reference path The specific calculation formula is as follows:
[0108] ;
[0109] in, , , It is a weight coefficient that is dynamically adjusted according to the specific scenario. At this point, the entropy difference calculator can be used to calculate four types of conflicts. Among them, direct conflict: the feature activation entropy is abnormally high, indicating that the feature distribution uncertainty is large; indirect conflict: the path selection entropy is abnormally high, indicating contradictions between multiple paths; context conflict: the feature activation entropy of the same noun in different paths is significantly different; intensity imbalance: the entropy difference between the reference path and the candidate path exceeds the threshold. In addition, the entropy difference calculator is used for risk assessment. Set the entropy difference threshold ,when When the path is marked as a high-risk path, the system can reduce the weight of the path in the final reasoning, or require the model to provide alternative explanations or evidence, or mark the relevant content as "low confidence" information in the output. This method of integrating path analysis and entropy difference calculation enables the system to efficiently identify potential hallucination risk points while providing precise mathematical quantitative basis. By calculating the three types of entropy corresponding to each associated path, the system can combine semantic analysis with probability statistics to obtain the hallucination risk type in the text, and then optimize the text, fundamentally eliminating the hallucination risk.
[0110] It can be seen that the present application can obtain the association network corresponding to the nouns in the text by performing semantic analysis on the text to be analyzed, and can obtain the types of hallucination risks of the large language model by analyzing the association network between nouns, and optimize the text to be analyzed using the corresponding processing method, thereby fundamentally eliminating the risk of hallucinations in the analysis results of the text by the large language model, and ensuring the reliability of the hallucination processing process; by combining semantic analysis with probability statistics, the hallucination risk type in the text is determined, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby improving the generalization ability of the hallucination processing method.
[0111] See also Figure 4 As shown, the embodiment of the present invention discloses a large language model hallucination elimination device, comprising:
[0112] The feature graph acquisition module 11 is used to analyze the initial text to be analyzed to obtain target nouns, and encode the feature graphs corresponding to each target noun into a target vector; the feature graphs include the noun concept, semantic label and context information corresponding to each target noun;
[0113] The association path acquisition module 12 is used to construct an association network between the target nouns according to the association relationship between the target nouns determined based on the target vector, and acquire the association path corresponding to each target noun according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes;
[0114] The entropy difference acquisition module 13 is used to determine a reference path from each of the associated paths, and obtain an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, wherein the feature activation entropy represents the uncertainty of the activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of the path selection from the path start point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of the distribution of the output result generated by the preset large language model based on the associated path;
[0115] The text optimization module 14 is used to determine the hallucination risk type corresponding to the initial text to be analyzed based on the entropy difference value, and optimize the initial text to be analyzed using an optimization strategy corresponding to the hallucination risk type, so as to eliminate the hallucination in the analysis result after the preset large language model analyzes the initial text to be analyzed.
[0116] It can be seen that the present application can obtain the association network corresponding to the nouns in the text by performing semantic analysis on the text to be analyzed, and can obtain the types of hallucination risks of the large language model by analyzing the association network between nouns, and optimize the text to be analyzed using the corresponding processing method, thereby fundamentally eliminating the risk of hallucinations in the analysis results of the text by the large language model, and ensuring the reliability of the hallucination processing process; by combining semantic analysis with probability statistics, the hallucination risk type in the text is determined, so that there is no need to rely on an external knowledge base in the hallucination analysis process, thereby improving the generalization ability of the hallucination processing method.
[0117] In some specific embodiments, the characteristic spectrum acquisition module 11 may specifically include:
[0118] a text recognition unit, configured to recognize the initial text to be analyzed by using a preset grammar analysis technology to obtain first initial nouns in the initial text to be analyzed, and to perform semantic importance evaluation on the first initial nouns to determine second initial nouns from each of the first initial nouns;
[0119] a noun determination unit, configured to determine whether the second initial noun is a complete noun, and if the second initial noun is a complete noun, determine the second initial noun as a target noun;
[0120] The noun merging unit is used for merging the second initial nouns to obtain a merged noun if the second initial noun is not a complete noun, and determining the merged noun as a target noun.
[0121] In some specific embodiments, the characteristic spectrum acquisition module 11 may further include:
[0122] A text input unit, used for inputting different text segments including the same target noun into the preset large language model, so that the preset large language model generates different first output results according to different text segments;
[0123] A first output result obtaining unit, used to obtain each of the first output results and obtain a first output change of the preset large language model according to each of the first output results;
[0124] A second output result obtaining unit, configured to modify any target noun in the initial text to be analyzed, and input the corresponding modified text into the preset large language model to obtain a second output result output by the preset large language model, and obtain a second output change according to the second output result;
[0125] A third output result obtaining unit, configured to input a text segment including the same target noun in the context into the preset large language model, and obtain a third output result of the preset large language model;
[0126] A feature graph generating unit is used to obtain the degree of understanding of each of the target nouns by the preset large language model according to the first output change, the second output change and the third output result, and to generate each of the feature graphs corresponding to each of the target nouns according to the degree of understanding.
[0127] In some specific embodiments, the large language model hallucination elimination device further includes:
[0128] An association strength acquisition module is used to acquire any two mutually associated target nouns according to the association network, and acquire the association strength between any two associated target nouns according to the feature overlap, context distance and co-occurrence frequency between the any two target nouns; wherein the feature overlap is the quotient of the target difference and the total number of features of any two target nouns, and the target difference is the difference between the first number of common features and the second number of mutually exclusive features between any two target nouns.
[0129] In some specific embodiments, the text optimization module 14 may specifically include:
[0130] an association adding unit, configured to increase the number of times a first target noun is used in the initial text to be analyzed, and increase the association between the first target noun and the corresponding context if the hallucination risk type is the context conflict; wherein the first target noun is the target noun corresponding to the context conflict;
[0131] a modifier adding unit, configured to add a target modifier before the third target noun if the hallucination risk type is the direct conflict; wherein the third target noun is the target noun corresponding to the direct conflict, and the target modifier is a modifier that limits the third target noun;
[0132] A position adjustment unit, configured to adjust the position of the third target noun in the initial text to be analyzed and add transition text between each of the third target nouns if the hallucination risk type is the indirect conflict; wherein the third target noun is the target noun corresponding to the indirect conflict;
[0133] A representation strength adjustment unit is used to weaken the first representation strength of the preset secondary noun in the initial text to be analyzed and to strengthen the second representation strength of the preset primary noun in the initial text to be analyzed if the hallucination risk type is the weight imbalance.
[0134] In some specific embodiments, the text optimization module 14 may further include:
[0135] A parameter adjustment unit is used to input the optimized text to be analyzed into the preset large language model, obtain the optimization effect corresponding to the optimized text to be analyzed according to the fourth output result of the preset large language model, and adjust the optimization parameters corresponding to the optimization strategy according to the optimization effect.
[0136] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0137] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present 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 / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the large language model hallucination elimination method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0138] 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.
[0139] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0140] 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 language model hallucination elimination 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.
[0141] 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 large language model hallucination elimination method disclosed above is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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 large language model hallucination elimination method, characterized in that: include: Analyze the initial text to be analyzed to obtain target nouns, and encode the feature graphs corresponding to each target noun into a target vector; The feature graph includes noun concepts, semantic labels and context information corresponding to each of the target nouns; According to the association relationship between the target nouns determined based on the target vector, an association network between the target nouns is constructed, and an association path corresponding to each target noun is obtained according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes; Determine a reference path from each of the associated paths, and obtain an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy represents the uncertainty of activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of path selection from the path starting point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of distribution of output results generated by a preset large language model based on the associated path; The hallucination risk type corresponding to the initial text to be analyzed is determined based on the entropy difference value, and the initial text to be analyzed is optimized using an optimization strategy corresponding to the hallucination risk type, so as to eliminate hallucinations in the analysis result after the preset large language model analyzes the initial text to be analyzed.
2. The large language model hallucination elimination method according to claim 1, characterized in that: The step of analyzing the initial text to be analyzed to obtain the target noun includes: Using a preset grammar analysis technology to identify the initial text to be analyzed to obtain first initial nouns in the initial text to be analyzed, and performing semantic importance evaluation on the first initial nouns to determine second initial nouns from each of the first initial nouns; determining whether the second initial noun is a complete noun, and if the second initial noun is a complete noun, determining the second initial noun as a target noun; If the second initial noun is not a complete noun, each of the second initial nouns is merged to obtain a merged noun, and the merged noun is determined as a target noun.
3. The large language model hallucination elimination method according to claim 1, characterized in that: Before encoding the feature graphs corresponding to the target nouns into target vectors, the method further includes: Inputting different text segments including the same target noun into the preset large language model, so that the preset large language model generates different first output results according to the different text segments; Obtain each of the first output results and obtain a first output change of the preset large language model according to each of the first output results; Modify any target noun in the initial text to be analyzed, and input the corresponding modified text into the preset large language model to obtain a second output result output by the preset large language model, and obtain a second output change according to the second output result; Inputting a text segment including the same target noun in the context into the preset large language model, and according to a third output result of the preset large language model; The degree of understanding of each of the target nouns by the preset large language model is obtained according to the first output change, the second output change and the third output result, and the feature graphs corresponding to each of the target nouns are generated according to the degree of understanding.
4. The large language model hallucination elimination method according to claim 1, characterized in that: Also includes: According to the association network, any two target nouns that are associated with each other are obtained, and according to the feature overlap, context distance and co-occurrence frequency between the any two target nouns, the association strength between any two associated target nouns is obtained; wherein the feature overlap is the quotient of the target difference and the total number of features of any two target nouns, and the target difference is the difference between the first number of common features and the second number of mutually exclusive features between any two target nouns.
5. The large language model hallucination elimination method according to claim 4, characterized in that: The hallucination risk types include direct conflict, indirect conflict, context conflict and weight imbalance. The direct conflict indicates that the feature overlap between any two directly associated target nouns is a negative value. The indirect conflict indicates that there is a contradiction in the semantics of any two target nouns connected by the same intermediate node. The context conflict indicates that the difference in weight values between the edges formed at different positions of the same target noun in the association network is greater than a preset weight value difference threshold. The weight imbalance indicates that the weight value of the edge corresponding to the preset secondary noun is higher than the weight value of the edge corresponding to the preset primary noun.
6. The large language model hallucination elimination method according to claim 5, characterized in that: The optimizing the initial text to be analyzed by using the optimization strategy corresponding to the hallucination risk type includes: If the hallucination risk type is the context conflict, increasing the number of times the first target noun is used in the initial text to be analyzed, and increasing the association between the first target noun and the corresponding context; wherein the first target noun is the target noun corresponding to the context conflict; If the hallucination risk type is the direct conflict, a target modifier is added before the third target noun; wherein the third target noun is the target noun corresponding to the direct conflict, and the target modifier is a modifier that limits the third target noun; If the hallucination risk type is the indirect conflict, adjusting the position of the third target noun in the initial text to be analyzed, and adding transition text between each of the third target nouns; wherein the third target noun is the target noun corresponding to the indirect conflict; If the hallucination risk type is the weight imbalance, the first representation strength of the preset secondary noun in the initial text to be analyzed is weakened, and the second representation strength of the preset primary noun in the initial text to be analyzed is strengthened.
7. The large language model hallucination elimination method according to claim 1, characterized in that: After optimizing the initial text to be analyzed by using the optimization strategy corresponding to the hallucination risk type, the method further includes: The optimized text to be analyzed is input into the preset large language model, an optimization effect corresponding to the optimized text to be analyzed is obtained according to a fourth output result of the preset large language model, and optimization parameters corresponding to the optimization strategy are adjusted according to the optimization effect.
8. A large language model hallucination elimination device, characterized in that: include: A feature map acquisition module is used to analyze the initial text to be analyzed to obtain target nouns, and encode the feature maps corresponding to each target noun into a target vector; the feature maps include noun concepts, semantic labels and context information corresponding to each target noun; an association path acquisition module, configured to construct an association network between the target nouns according to the association relationship between the target nouns determined based on the target vector, and acquire an association path corresponding to each target noun according to the association network; the nodes in the association network represent the target nouns, the directed edges between the nodes represent the association relationship between the target nouns, and the weight of each directed edge represents the association strength between the nodes; An entropy difference acquisition module is used to determine a reference path from each of the associated paths, and obtain an entropy difference value between a first target entropy corresponding to each of the associated paths and a second target entropy corresponding to the reference path; the target entropy includes feature activation entropy, path selection entropy and output distribution entropy, the feature activation entropy represents the uncertainty of the activation distribution of the feature corresponding to the target noun in the associated path, the path selection entropy represents the uncertainty of the path selection from the path start point to the path end point in the associated path, and the output distribution entropy represents the uncertainty of the distribution of the output result generated by the preset large language model based on the associated path; A text optimization module is used to determine the hallucination risk type corresponding to the initial text to be analyzed based on the entropy difference value, and optimize the initial text to be analyzed using an optimization strategy corresponding to the hallucination risk type, so as to eliminate hallucinations in the analysis result after the preset large language model analyzes the initial text to be analyzed.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the large language model hallucination elimination method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the large language model hallucination elimination method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
High and new technology enterprise evaluation method and system, computer equipment and storage medium
CN112766788A
Large model illusion relieving method and device, equipment and storage medium
CN118964583A
Model illusion detection method and device, electronic equipment and storage medium
CN119416786A
Knowledge boundary identification method based on interpretability of large language model and related device
CN119599136A
Producing training sets for machine learning methods by performing deep semantic analysis of natural language texts
US20180113856A1
Cited By
Method and system for accurately blocking illusion path of large language model
CN122333487A
Large language model illusion path accurate blocking method and system
CN122333487B