Method, device, equipment, storage medium and program product for alleviating hallucination text

By obtaining the hallucination text generated by the large language model, using basic corrections and evaluators for correction and evaluation, combining text evaluation information and historical memory information adjustment strategies, the problem of high cost and invasiveness in the existing technology is solved, and an efficient and credible hallucination mitigation effect is achieved.

CN119378692BActive Publication Date: 2025-04-29INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411945230.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-29
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The ways to eliminate hallucinations in the prior art are expensive, invasive and cannot completely eliminate hallucinations.

Method used

By obtaining the first hallucination text generated by the large language model, modifying it using the basic corrector, obtaining the second hallucination text, and evaluating its quality through the evaluator. If the quality meets the requirements, the text is output; otherwise, the correction strategy is adjusted based on the text evaluation information and historical memory information and iteratively processed.

Benefits of technology

Effectively alleviate the illusion problem of large language model output, improve the credibility of model output, and avoid the high cost and intrusion caused by improving the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378692B_ABST
    Figure CN119378692B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment, storage medium and program product for alleviating hallucination text, which are applied to the field of natural language processing technology. The method comprises: obtaining a first hallucination text generated by a large language model; correcting the first hallucination text by a basic corrector to obtain a second hallucination text; evaluating the second hallucination text by an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, using the second hallucination text as an output text; when the quality score does not exceed the preset threshold, determining a mitigation strategy by a reflector based on the text evaluation information; adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method, device, equipment, storage medium and program product for alleviating hallucination text. Background Art

[0002] Large language models may produce hallucinations during text generation, that is, the generated text is reasonable but deviates from objective facts. This phenomenon poses potential risks in key fields such as law, medicine, and robotics, and limits the application of large language models in actual scenarios. In order to improve the reliability of large language models, these hallucinations need to be mitigated.

[0003] In the existing technology, some research is devoted to reducing hallucinations in the pre-training stage or through reinforcement learning with human feedback, but these methods are costly and invasive. In addition, given the generative nature of large language models, it is impossible to completely eliminate hallucinations. Summary of the invention

[0004] The present invention provides a method, device, equipment, storage medium and program product for alleviating hallucination text, so as to solve the problem that the method for eliminating hallucination in the prior art is not only costly and invasive but also unable to completely eliminate the hallucination.

[0005] The present invention provides a method for alleviating hallucination text, comprising: obtaining a first hallucination text generated by a large language model; correcting the first hallucination text by a basic corrector to obtain a second hallucination text; evaluating the second hallucination text by an evaluator to obtain text evaluation information and a quality score of this correction process; when the quality score exceeds a preset threshold, using the second hallucination text as an output text; when the quality score does not exceed the preset threshold, determining a mitigation strategy by a reflector based on the text evaluation information; adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector.

[0006] According to a method for alleviating hallucination text provided by the present invention, the first hallucination text is corrected by a basic corrector to obtain a second hallucination text, including: performing error detection on the content of the first hallucination text based on the evidence set carried by the basic corrector to generate a correction strategy; and correcting the first hallucination text according to the correction strategy to obtain the second hallucination text.

[0007] According to a method for alleviating hallucination text provided by the present invention, the second hallucination text is evaluated by an evaluator to obtain text evaluation information and a quality score of the correction process, including: analyzing the consistency of the second hallucination text with the first hallucination text and the evidence set to determine the degree to which the second hallucination text satisfies accuracy and relevance; and generating the quality score according to the degree to which the second hallucination text satisfies accuracy and relevance.

[0008] According to a method for alleviating hallucinated text provided by the present invention, the second hallucinated text is evaluated by an evaluator to obtain text evaluation information and a quality score of the correction process, including: analyzing the consistency of the second hallucinated text with the first hallucinated text and the evidence set to determine credible information and uncredible information in the second hallucinated text; generating text evaluation information based on the credible information and the uncredible information; wherein the credible information refers to information that meets accuracy and relevance, and the uncredible information refers to information that does not meet accuracy or relevance.

[0009] According to a method for alleviating hallucination text provided by the present invention, after the first hallucination text is corrected by a basic corrector to obtain a second hallucination text, the method further includes: storing the second hallucination text by a memory unit to obtain historical memory information; and determining a mitigation strategy by a reflector based on the text evaluation information, including: generating the mitigation strategy based on the text evaluation information and the historical memory information.

[0010] The present invention also provides a device for alleviating hallucination text, comprising the following modules: an acquisition module and a processing module; the acquisition module is used to acquire a first hallucination text generated by a large language model; the processing module is used to correct the first hallucination text through a basic corrector to obtain a second hallucination text; the second hallucination text is evaluated by an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, the second hallucination text is used as an output text; when the quality score does not exceed the preset threshold, a mitigation strategy is determined by a reflector based on the text evaluation information; the correction strategy of the basic corrector is adjusted according to the mitigation strategy, and the second hallucination text is re-input into the adjusted basic corrector.

[0011] According to a hallucination text mitigation device provided by the present invention, the processing module is used to perform error detection on the content of the first hallucination text based on the evidence set carried by the basic corrector to generate a correction strategy; and correct the first hallucination text according to the correction strategy to obtain the second hallucination text.

[0012] According to a hallucination text mitigation device provided by the present invention, the processing module is used to analyze the consistency of the second hallucination text with the first hallucination text and the evidence set to determine the degree to which the second hallucination text satisfies accuracy and relevance; and generate the quality score according to the degree to which the second hallucination text satisfies accuracy and relevance.

[0013] According to a hallucination text mitigation device provided by the present invention, the processing module is used to analyze the consistency between the second hallucination text and the first hallucination text and the evidence set to determine the credible information and uncredible information in the second hallucination text; generate text evaluation information based on the credible information and the uncredible information; wherein the credible information refers to information that meets the accuracy and relevance, and the uncredible information refers to information that does not meet the accuracy or relevance.

[0014] According to a device for alleviating hallucination text provided by the present invention, the processing module is further used to store the second hallucination text through a memory unit to obtain historical memory information; the processing module is used to generate the mitigation strategy based on the text evaluation information and the historical memory information.

[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the above-mentioned methods for alleviating hallucination text is implemented.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for alleviating hallucination text as described above is implemented.

[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for alleviating hallucination text as described above is implemented.

[0018] The method, device, equipment, storage medium and program product for alleviating hallucination text provided by the present invention can first correct the hallucination content in the first hallucination text through a basic corrector, and then adjust the correction strategy of the basic corrector through a reflector when the text does not meet the quality requirements, and iteratively process the text. In this way, not only can the hallucination problem of the large language model output be alleviated and the credibility of the model output be improved, but also the problem of high cost, invasiveness and inability to completely eliminate hallucinations caused by improving the large language model can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 It is a flow chart of the method for alleviating hallucination text provided by the present invention;

[0021] Figure 2 It is a structural schematic diagram of the device for alleviating hallucination text provided by the present invention;

[0022] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0025] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes 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 one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0026] In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution.

[0027] The embodiments of the present application describe some exemplary embodiments for the purpose of explanation. It should be understood that the present application can be implemented in other ways that are not specifically shown in the drawings.

[0028] When large language models generate text, they often generate text that seems reasonable but actually deviates from the real facts. For example, the hallucinated text is “Bruno Tonioli is an American choreographer. He appeared in the TV show in season 12, which featured an actor from the movie Vertigo. The text mentions Bruno Tonioli is an American choreographer, and there are references to television shows and movies he has been in. However, this information contains errors, such as his nationality and the names of the movies.

[0029] In order to correct these errors, we need to perform multi-hop reasoning and collect multiple pieces of evidence. For example, we need to verify that Bruno Tonioli is an Italian choreographer who has appeared on the TV show "Dancing with the Stars" and has confirmed that Ralph George" was also involved in the same TV show, and then it was necessary to verify that "Ralph George” participated in the film “Lost Cat Corona”. Only after collecting these evidences and understanding the relationship between them can all factual errors in the text be corrected. This process involves multi-hop reasoning because multiple information points need to be processed and verified, not just a single piece of evidence. This shows that in real-world scenarios, the generated text is often complex and long, and multi-hop reasoning is needed to alleviate hallucinations.

[0030] However, in the real world, not all acquired knowledge is relevant due to the limitations of retrieval systems. Moreover, some knowledge sources may even contradict other knowledge sources, perhaps because they fail to keep up with the evolving world knowledge or because the Internet contains widely spread rumors or misinformation. For example, part of the knowledge in the illustration is relevant to the text generated by the model, while other parts are not, such as the description of “Bruno Marini" instead of "Bruno" mentioned in the text Tonioli". Some of this knowledge conflicts with facts, such as incorrectly describing the TV show "Dancing with the Stars" as a movie. This inaccurate or misleading information interferes with the hallucination mitigation process and makes the task more difficult. Therefore, managing non-authoritative knowledge sources and distinguishing which information is credible and which is not is crucial to effectively mitigate hallucinations.

[0031] Based on the above problems, this application is committed to exploring and developing methods that can properly handle complex situations such as multi-hop hallucinations and cope with interference from non-authoritative knowledge sources. It can use non-authoritative knowledge sources to alleviate the hallucination problem of large language model outputs and improve the credibility of model outputs.

[0032] like Figure 1 As shown, the embodiment of the present application provides a method for alleviating hallucination text, which can be applied to a hallucination text alleviating device. The method for alleviating hallucination text may include S101-S106:

[0033] S101. A hallucination text mitigation device obtains a first hallucination text generated by a large language model.

[0034] For example, the First Illusion text could be "Bruno Tonioli is an American choreographer. He appeared on the TV show in season 12, which featured an actor from the movie Vertigo.

[0035] S102: The hallucination text mitigation device corrects the first hallucination text through a basic corrector to obtain a second hallucination text.

[0036] Optionally, the hallucination text mitigation device can perform error detection on the content of the first hallucination text based on the evidence set carried by the basic corrector to generate a correction strategy; and correct the first hallucination text according to the correction strategy to obtain the second hallucination text.

[0037] Specifically, the hallucination text mitigation device can call the basic corrector to correct the hallucination errors that appear in the first hallucination text. When the basic corrector is called, it can rely on the corresponding "evidence set" to carry out error correction. The "evidence set" can be a collection of accurate, objective and relevant factual evidences to the text topic. The basic corrector can use these evidences to compare the first hallucination text, find the hallucination errors therein, and generate a correction strategy. Then, based on the correction strategy, the errors are corrected to generate a second hallucination text. In this process, the basic corrector needs to understand the context of the first hallucination text, evaluate the relevance of the evidence, and perform logical reasoning to determine the best correction strategy.

[0038] It should be noted that at this initial stage, the entire error correction process of the basic corrector has no previous strategies to learn from or follow, and it is necessary to rely entirely on the basic corrector's own capabilities to complete the judgment and correction of errors.

[0039] For example, the first hallucination text appeared like "Bruno Tonioli" is incorrectly written as the United States, the basic modifier will search for "Bruno Tonioli" nationality, and then use this accurate information to correct the wrong nationality description in the first illusion text, generating a text containing "Bruno Tonioli is an Italian choreographer” content of the second hallucination text.

[0040] S103: The hallucination text mitigation device evaluates the second hallucination text through an evaluator to obtain text evaluation information and a quality score of this correction process.

[0041] Optionally, the hallucination text mitigation device can analyze the consistency of the second hallucination text with the first hallucination text and the evidence set to determine the degree to which the second hallucination text satisfies accuracy and relevance; and generate the quality score according to the degree to which the second hallucination text satisfies accuracy and relevance. The hallucination text mitigation device can also analyze the consistency of the second hallucination text with the first hallucination text and the evidence set to determine credible information and uncredible information in the second hallucination text; and generate text evaluation information according to the credible information and the uncredible information; wherein the credible information refers to information that satisfies accuracy and relevance, and the uncredible information refers to information that does not satisfy accuracy or relevance.

[0042] Specifically, the evaluator plays a key role in judging the entire text error correction process. It is mainly used to evaluate the quality of the correction strategy and the corrected text. The evaluator includes two feedback signals: one is text evaluation information, that is, verbal criticism, which points out the specific problems, deficiencies or non-compliance with the requirements in the correction strategy in the form of text description; the other is the quality score, that is, the scalar overall score, which is a quantifiable scoring method that is reflected in specific values ​​to comprehensively measure the overall quality of the correction strategy.

[0043] It should be noted that when the evaluator analyzes the second hallucination text generated by the basic corrector, it needs to focus on its consistency with the first hallucination text and external evidence. Specifically, it is to see whether the corrected text is consistent with objective facts (consistent with external evidence) in terms of accuracy, and whether it is consistent with the context and expression intention of the original text in terms of relevance, so as to determine whether the solution can meet the actual quality requirements.

[0044] For example, if the second illusion text is "Bruno Tonioli is an Italian choreographer. He appeared in the 12th season of a TV show with an actor. The actor starred in the movie Vertigo", then the text evaluation information generated by the evaluator can be "The text correctly changed "America" ​​to "Italy", but the actor did not star in the movie Vertigo", and the generated quality score can be "40 points".

[0045] S104: When the quality score exceeds a preset threshold, the hallucination text mitigation device uses the second hallucination text as output text.

[0046] Specifically, when the quality score given by the evaluator exceeds the preset threshold, it means that from the perspective of overall quality, the correction strategy generated by the basic corrector is satisfactory and meets the expected standards, and the hallucination text mitigation device can directly output the second hallucination text; conversely, if the quality score does not exceed the preset threshold, it means that the correction strategy still has certain problems and needs further improvement.

[0047] For example, if the base modifier changes Bruno The evaluator will find this problem when analyzing and evaluating the revised text, and then point out through verbal criticism that the movie name is still wrong, and the overall score given will not exceed the preset threshold, indicating that this correction solution needs to be improved.

[0048] S105: When the quality score does not exceed the preset threshold, the hallucination text mitigation device determines a mitigation strategy through a reflector based on the text evaluation information.

[0049] Optionally, after correcting the first hallucination text through a basic corrector to obtain a second hallucination text, the hallucination text mitigation device can store the second hallucination text through a memory unit to obtain historical memory information; when the quality score does not exceed the preset threshold, the hallucination text mitigation device can generate the mitigation strategy based on the text evaluation information and the historical memory information.

[0050] Specifically, the memory unit can store all texts generated by the basic corrector, that is, the historical memory information includes the hallucination text generated after each iteration of the basic corrector. When the quality score does not exceed the preset threshold, the hallucination text mitigation device can analyze the key information from two aspects. On the one hand, it is the text evaluation information given by the evaluator, that is, pointing out the existing problems, deficiencies, etc.; on the other hand, it is the memory retained from the previous attempt process, that is, the relevant historical data of the past iterations. Through in-depth analysis of these contents, we can accurately find out where the errors or imperfections occurred in the correction process. Based on the above analysis, the reflector will generate a specific mitigation strategy, and its core purpose is to guide the basic corrector on how to adjust and improve it in the future, so that it can better correct various problems such as hallucination errors in the next attempt.

[0051] For example, the mitigation strategy could be "I need to change the movie title "Vertigo" to "The Lost Cat Corona" and keep the rest of the text the same."

[0052] S106. The hallucination text mitigation device adjusts the correction strategy of the basic corrector according to the mitigation strategy, and re-inputs the second hallucination text into the adjusted basic corrector.

[0053] For example, after re-inputting the second hallucination text into the adjusted base modifier, the base modifier may generate a new text, which may be "Bruno Tonioli is an Italian choreographer. He appeared in the 12th season of the TV show with an actor. The actor starred in the movie "The Lost Cat Corona".

[0054] In an embodiment of the present application, the hallucination content in the first hallucination text can be corrected by a basic corrector, and then when the text does not meet the quality requirements, the correction strategy of the basic corrector can be adjusted by a reflector, and the text can be iteratively processed. In this way, not only can the hallucination problem of the large language model output be alleviated and the credibility of the model output be improved, but also the problem of high cost, invasiveness and inability to completely eliminate hallucinations caused by improving the large language model can be avoided.

[0055] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0056] The method for alleviating hallucination text provided in the embodiment of the present application may be executed by a device for alleviating hallucination text or a control module for alleviating hallucination text in the device for alleviating hallucination text. In the embodiment of the present application, the device for alleviating hallucination text provided in the embodiment of the present application is described by taking the device for alleviating hallucination text executing the method for alleviating hallucination text as an example.

[0057] It should be noted that the embodiment of the present application can divide the functional modules of the hallucination text mitigation device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0058] like Figure 2 As shown, an embodiment of the present application provides a device 200 for alleviating hallucination text. The device 200 for alleviating hallucination text includes: an acquisition module 201 and a processing module 202. The acquisition module 201 can be used to acquire a first hallucination text generated by a large language model; the processing module 202 is used to correct the first hallucination text through a basic corrector to obtain a second hallucination text; the second hallucination text is evaluated by an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, the second hallucination text is used as the output text; when the quality score does not exceed the preset threshold, a mitigation strategy is determined by a reflector based on the text evaluation information; the correction strategy of the basic corrector is adjusted according to the mitigation strategy, and the second hallucination text is re-input into the adjusted basic corrector.

[0059] Optionally, the processing module 202 is used to perform error detection on the content of the first hallucination text based on the evidence set carried by the basic corrector to generate a correction strategy; and correct the first hallucination text according to the correction strategy to obtain the second hallucination text.

[0060] Optionally, the processing module 202 is used to analyze the consistency between the second hallucination text, the first hallucination text and the evidence set to determine the degree to which the second hallucination text satisfies accuracy and relevance; and generate the quality score according to the degree to which the second hallucination text satisfies accuracy and relevance.

[0061] Optionally, the processing module 202 is used to analyze the consistency between the second hallucination text and the first hallucination text and the evidence set to determine the credible information and uncredible information in the second hallucination text; generate text evaluation information based on the credible information and the uncredible information; wherein the credible information refers to information that meets the accuracy and relevance, and the uncredible information refers to information that does not meet the accuracy or relevance.

[0062] Optionally, the processing module 202 is further used to store the second hallucination text through a memory unit to obtain historical memory information; the processing module 202 is used to generate the mitigation strategy based on the text evaluation information and the historical memory information.

[0063] In an embodiment of the present application, the hallucination content in the first hallucination text can be corrected by a basic corrector, and then when the text does not meet the quality requirements, the correction strategy of the basic corrector can be adjusted by a reflector, and the text can be iteratively processed. In this way, not only can the hallucination problem of the large language model output be alleviated and the credibility of the model output be improved, but also the problem of high cost, invasiveness and inability to completely eliminate hallucinations caused by improving the large language model can be avoided.

[0064] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the hallucination text mitigation method, which includes: obtaining a first hallucination text generated by a large language model; correcting the first hallucination text by a basic corrector to obtain a second hallucination text; evaluating the second hallucination text by an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, the second hallucination text is used as an output text; when the quality score does not exceed the preset threshold, a mitigation strategy is determined by a reflector based on the text evaluation information; adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector.

[0065] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0066] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the hallucination text mitigation method provided by the above methods, which includes: obtaining a first hallucination text generated by a large language model; correcting the first hallucination text through a basic corrector to obtain a second hallucination text; evaluating the second hallucination text through an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, using the second hallucination text as output text; when the quality score does not exceed the preset threshold, determining a mitigation strategy through a reflector based on the text evaluation information; adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector.

[0067] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the hallucination text mitigation method provided by the above-mentioned methods, the method comprising: obtaining a first hallucination text generated by a large language model; correcting the first hallucination text by a basic corrector to obtain a second hallucination text; evaluating the second hallucination text by an evaluator to obtain text evaluation information and a quality score of the correction process; when the quality score exceeds a preset threshold, using the second hallucination text as output text; when the quality score does not exceed the preset threshold, determining a mitigation strategy by a reflector based on the text evaluation information; adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector.

[0068] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0069] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for alleviating hallucination text, characterized in that: include: Get the first hallucination text generated by the large language model; Correcting the first hallucination text by a basic corrector to obtain a second hallucination text; The second hallucinated text is evaluated by an evaluator to obtain text evaluation information and a quality score of the correction process; When the quality score exceeds a preset threshold, using the second hallucination text as output text; In the case where the quality score does not exceed the preset threshold, determining a mitigation strategy through a reflector based on the text evaluation information; Adjusting the correction strategy of the basic corrector according to the mitigation strategy, and re-inputting the second hallucination text into the adjusted basic corrector; When the basic corrector is called, it performs error correction based on the evidence set, which is a collection of factual evidence related to the text topic; After the first hallucination text is corrected by the basic corrector to obtain the second hallucination text, the method further includes: Storing the second hallucination text in a memory unit to obtain historical memory information; The step of determining a mitigation strategy based on the text evaluation information by a reflector includes: The mitigation strategy is generated based on the text evaluation information and the historical memory information.

2. The method for alleviating hallucination text according to claim 1, characterized in that: The method of correcting the first hallucination text by a basic corrector to obtain a second hallucination text includes: Performing error detection on the content of the first hallucinated text based on the evidence set carried by the basic corrector to generate a correction strategy; The first hallucination text is corrected according to the correction strategy to obtain the second hallucination text.

3. The method for alleviating hallucination text according to claim 2, characterized in that: The step of evaluating the second hallucinated text by an evaluator to obtain text evaluation information and a quality score of the correction process includes: Analyzing the consistency of the second hallucination text with the first hallucination text and the evidence set to determine the degree to which the second hallucination text satisfies accuracy and relevance; The quality score is generated based on the degree to which the second hallucinated text satisfies accuracy and relevance.

4. The method for alleviating hallucination text according to claim 2, characterized in that: The step of evaluating the second hallucinated text by an evaluator to obtain text evaluation information and a quality score of the correction process includes: Analyzing the consistency between the second hallucination text, the first hallucination text, and the evidence set to determine credible information and uncredible information in the second hallucination text; generating text evaluation information according to the credible information and the uncredible information; The credible information refers to information that meets the requirements of accuracy and relevance, and the uncredible information refers to information that does not meet the requirements of accuracy or relevance.

5. A device for alleviating hallucination text, characterized in that: include: Acquisition module and processing module; The acquisition module is used to acquire a first hallucination text generated by a large language model; The processing module is used to correct the first hallucination text through a basic corrector to obtain a second hallucination text; evaluate the second hallucination text through an evaluator to obtain text evaluation information and a quality score of this correction process; when the quality score exceeds a preset threshold, use the second hallucination text as an output text; when the quality score does not exceed the preset threshold, determine a mitigation strategy through a reflector based on the text evaluation information; adjust the correction strategy of the basic corrector according to the mitigation strategy, and re-input the second hallucination text into the adjusted basic corrector; When the basic corrector is called, it performs error correction based on the evidence set, which is a collection of factual evidence related to the text topic; The processing module is used to store the second hallucination text through a memory unit to obtain historical memory information; and generate the mitigation strategy based on the text evaluation information and the historical memory information.

6. The device for alleviating hallucination text according to claim 5, characterized in that: The processing module is used to perform error detection on the content of the first hallucination text based on the evidence set carried by the basic corrector to generate a correction strategy; and correct the first hallucination text according to the correction strategy to obtain the second hallucination text.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for alleviating hallucination text according to any one of claims 1 to 4 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for alleviating hallucinatory text according to any one of claims 1 to 4 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for alleviating hallucinatory text according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Training method of translation text correction model and translation text correction method

    CN119047493A

  • Large model illusion relieving method and device and storage medium

    CN119166770A