Large model illusion relieving method and device, equipment, storage medium and program product
By generating and using prompt words to extract and correct the output data of the big model, the problem of big model illusion is solved, and a lower cost and higher accuracy mitigation solution is achieved.
Patent Information
- Application Number
- CN202411846091.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-25
AI Technical Summary
Large models are prone to hallucinations when performing tasks, that is, the generated content does not match the facts or is completely fictional. The existing technology alleviates hallucinations by fine-tuning the large models, etc., but the cost is high.
By obtaining the target input data and the output data generated by the first large model, a first prompt word is generated to extract conflict information, a second large model is configured to output conflict information, and a second prompt word is generated based on the conflict information to correct the output data, so as to realize the correction of the output data of the first large model.
It effectively alleviates the hallucination problem of large models when generating output data, reduces the cost of retraining large models, and improves the accuracy of output data.
Smart Images

Figure CN119692448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a large model hallucination alleviation method, device, equipment, storage medium and program product. Background Art
[0002] Large Model refers to a neural network model with a large number of parameters. Large models are trained with large data sets and can learn rich language representations and knowledge, thus performing well in various tasks such as text understanding, summary generation, multi-round dialogue, and instruction following.
[0003] However, when performing tasks, large models are prone to hallucinations, that is, the generated content is inconsistent with the facts or is completely fictitious. In related technologies, large model hallucinations are alleviated by retraining large models by fine-tuning them, but this method is costly. Summary of the invention
[0004] The embodiments of the present invention provide a large model hallucination alleviation method, device, equipment, storage medium and program product for hallucinating large models.
[0005] In a first aspect, an embodiment of the present invention provides a large model hallucination mitigation method, the method comprising:
[0006] Acquire target input data, and first output data generated by the first large model according to a preconfigured target knowledge base and the target input data;
[0007] Generate a first prompt word according to the target input data and the first output data, wherein the first prompt word is used to extract conflicting information in the first output data that does not match the target input data and / or the knowledge in the target knowledge base;
[0008] inputting the first prompt word into a second large model so that the second large model outputs the conflict information, wherein the second large model is configured with the target knowledge base;
[0009] generating a second prompt word according to the first output data and the conflict information, wherein the second prompt word is used to correct the first output data according to the conflict information;
[0010] The second prompt word is input into the first large model, so that the first large model outputs second output data corresponding to the first output data after correction.
[0011] In a second aspect, an embodiment of the present invention provides a large model hallucination alleviation device, the device comprising:
[0012] An acquisition module, used for acquiring target input data and first output data generated by the first large model according to a pre-configured target knowledge base and the target input data;
[0013] a first processing module, configured to generate a first prompt word according to the target input data and the first output data, wherein the first prompt word is used to extract conflict information in the first output data that does not match the target input data and / or the knowledge of the target knowledge base; input the first prompt word into a second large model so that the second large model outputs the conflict information, wherein the second large model is configured with the target knowledge base;
[0014] The second processing module is used to generate a second prompt word according to the first output data and the conflict information, and the second prompt word is used to correct the first output data according to the conflict information; the second prompt word is input into the first large model so that the first large model outputs the second output data corresponding to the first output data after correction.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the large model hallucination mitigation method as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the large model hallucination mitigation method as described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, the processor can at least implement the large model hallucination mitigation method as described in the first aspect.
[0018] In the solution provided by the embodiment of the present invention, in order to alleviate the model hallucination generated by the first large model during use, first, the target input data and the first output data generated by the first large model according to the pre-configured target knowledge base and the target input data are obtained. Then, according to the target input data and the first output data, a first prompt word is generated, wherein the first prompt word is used to extract conflict information in the first output data that does not match the knowledge of the target input data and / or the target knowledge base. After that, the first prompt word is input into the second large model so that the second large model outputs conflict information, and the second large model is configured with the target knowledge base. Among them, if the conflict information is extracted by the second large model, it is considered that the first large model has a model hallucination when generating the first output data; if the conflict information is not extracted by the second large model, it is considered that the first large model does not have a model hallucination when generating the first output data. When the conflict information is extracted by the second large model, further, according to the first output data and the conflict information, a second prompt word for correcting the first output data according to the conflict information can be generated, and the second prompt word is input into the first large model so that the first large model outputs the second output data corresponding to the corrected first output data. In this solution, for the first output data output by the first large model based on the target input data, it is first determined whether the first large model has a model hallucination problem when generating the first output data, that is, whether the above-mentioned conflicting information exists in the first output data; if there is conflicting information, the first large model is controlled to generate the output data corresponding to the target input data again based on the conflicting information, that is, the first output data is corrected by the conflicting information to obtain the second output data, thereby alleviating the model hallucination problem existing in the first large model when generating the output data corresponding to the target input data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0020] Figure 1 A flowchart of a large model hallucination mitigation method provided by an embodiment of the present invention;
[0021] Figure 2 A flowchart of a method for generating a second prompt word provided by an embodiment of the present invention;
[0022] Figure 3 A flowchart of another method for generating a second prompt word provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of the structure of a large-model hallucination alleviation device provided by an embodiment of the present invention;
[0024] Figure 5 For Figure 4 A schematic structural diagram of an electronic device corresponding to the large-scale hallucination mitigation device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0027] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0028] Large Model refers to a neural network model with a large number of parameters. Large models are trained with large data sets and can learn rich language representations and knowledge, thus performing well in various tasks such as text understanding, summary generation, multi-round dialogue, and instruction following.
[0029] However, when performing tasks, large models are prone to hallucinations, that is, the generated content is inconsistent with the facts or is completely fictitious. In related technologies, large model hallucinations are alleviated by retraining large models through supervised fine-tuning (SFT) or reinforcement learning from human feedback (RLHF), but this method is costly.
[0030] To solve at least one of the above technical problems, an embodiment of the present invention provides a large model hallucination mitigation method, comprising: obtaining target input data, and first output data generated by a first large model according to a pre-configured target knowledge base and target input data; generating a first prompt word according to the target input data and the first output data, the first prompt word being used to guide the second large model to extract conflicting information in the first output data that does not match the target input data and / or the knowledge of the target knowledge base; inputting the first prompt word into the second large model so that the second large model outputs conflicting information, the second large model being configured with the aforementioned target knowledge base; generating a second prompt word according to the first output data and the conflicting information, the second prompt word being used to correct the first output data according to the conflicting information; inputting the second prompt word into the first large model so that the first large model outputs second output data corresponding to the corrected first output data. In this solution, for the first output data output by the first large model based on the target input data, it is first determined whether the first large model has a model hallucination problem when generating the first output data, that is, whether the above-mentioned conflicting information exists in the first output data; if there is conflicting information, the first large model is controlled to generate the output data corresponding to the target input data again based on the conflicting information, that is, the first output data is corrected by the conflicting information to obtain the second output data, thereby alleviating the model hallucination problem existing in the first large model when generating the output data corresponding to the target input data.
[0031] The large model hallucination alleviation method provided by the embodiment of the present invention is described in detail below in conjunction with specific embodiments.
[0032] It should be noted that various prompts are involved in the embodiments of the present invention, wherein the prompts are used to guide the corresponding large model to generate expected outputs according to specific requirements and contexts.
[0033] The large model hallucination mitigation method provided in the embodiment of the present invention can be executed by an electronic device, which can be a terminal device such as a PC, a laptop, a smart phone, etc., or a server. The server can be a physical server including an independent host, or a virtual server, or a cloud server or a server cluster.
[0034] Figure 1 A flowchart of a large model hallucination mitigation method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps may be included:
[0035] 101. Obtain target input data and first output data generated by a first large model according to a preconfigured target knowledge base and the target input data.
[0036] The first large model is the large model that needs to be judged whether there is an illusion in the embodiment of the present invention. The target input data is the input of the first large model. The first output data is the output corresponding to the target input data generated by the first large model according to the target knowledge base configured by itself. By judging whether the first output data is inconsistent with the facts or completely fictitious, it is determined whether the first large model has a model illusion when generating the first output data.
[0037] 102. Generate a first prompt word according to the target input data and the first output data, where the first prompt word is used to extract conflicting information in the first output data that does not match the target input data and / or knowledge in the target knowledge base.
[0038] 103. Input the first prompt word into the second largest model so that the second largest model outputs conflict information, and the second largest model is configured with a target knowledge base.
[0039] In this embodiment, the second largest model is used to determine whether the first largest model has model hallucination when generating the first output data. Specifically, firstly, based on the target input data and the first output data, a first prompt word is generated to guide the second largest model to extract conflicting information that does not match the target input data and / or the knowledge of the target knowledge base from the first output data; then, the first prompt word is input into the second largest model, so that the second largest model extracts the conflicting information under the guidance of the first prompt word.
[0040] Whether the first large model has model hallucination when generating the first output data is determined by whether the second large model extracts conflicting information from the first output data that does not match the knowledge of the target input data and / or the target knowledge base. Specifically, if conflicting information is extracted from the first output data by the second large model, it is considered that the first large model has model hallucination when generating the first output data; if conflicting information is not extracted from the first output data by the second large model, it is considered that the first large model does not have model hallucination when generating the first output data.
[0041] The first output data does not match the target input data, which can be understood as the first output data generated by the first large model does not match the task indicated in the input target input data. For example, the task instruction in the target input data is: please extract the conversation between person A and person B from the target paragraph, and the first output data is: the conversation between person B and person C.
[0042] The first output data does not match the knowledge in the target knowledge base, which can be understood as a conflict between the first output data generated by the first large model and the knowledge in the target knowledge base. For example, the specific time of occurrence of a historical event in the target knowledge base is xx / xx / xx, and when the user asks for the specific time of the historical time through the target input data, the time in the first output data output by the first large model is inconsistent with the specific time of occurrence of the historical event in the target knowledge base.
[0043] In addition, in actual applications, users usually interact with the big model multiple times, that is, in order to get the answer to a question, users may ask and answer questions multiple times in a row. In this case of multiple rounds of dialogue, the big model may have conflicting information in multiple answers.
[0044] For example, suppose that in order to obtain the answer to a question, the user has conducted multiple rounds of conversations with the first large model. The multiple answers of the first large model include: the first output data corresponding to the target input data, and other output data. Among them, the other output data is the output data generated by the first large model before the first output data is generated. Due to the problem of model hallucination, the first output data may contain conflicting information that does not match the other output data. For example, for the same scientific concept, the description in other output data is C, while the description in the first output data is D, that is, the explanations of the same scientific concept in the two output data generated by the first large model are inconsistent.
[0045] Based on this, optionally, when determining whether the first large model has model hallucination when generating the first output data through the second large model, it is also possible to:
[0046] Acquire first output data generated by the first large model during multiple rounds of conversations with the user according to a pre-configured target knowledge base and target input data, as well as other output data generated before the first output data;
[0047] Generate a first prompt word according to the target input data, the first output data and other output data, wherein the first prompt word is used to extract conflicting information in the first output data that does not match the target input data, the knowledge of the target knowledge base and / or other output data;
[0048] The first prompt word is input into the second largest model so that the second largest model outputs conflicting information.
[0049] 104. Generate a second prompt word according to the first output data and the conflict information, where the second prompt word is used to correct the first output data according to the conflict information.
[0050] 105. Input the second prompt word into the first large model, so that the first large model outputs second output data corresponding to the first output data after correction.
[0051] As described above, if the second largest model extracts conflicting information from the first output data, it is considered that the first largest model has model hallucination when generating the first output data. At this time, it is further necessary to solve the model hallucination problem of the first largest model when generating the first output data.
[0052] In this embodiment, the first output data and the conflict information are first used to generate a second prompt word, wherein the second prompt word is used to guide or instruct the first large model to correct the first output data according to the conflict information. Afterwards, the second prompt word is input into the first large model so that the first large model outputs the second output data corresponding to the first output data after correction.
[0053] Optionally, for the second output data output by the first large model, the above-mentioned model hallucination mitigation method can also be used to determine whether the first large model has model hallucination when generating the second output data. If model hallucination exists, the second output data is further corrected until output data without model hallucination corresponding to the target input data is obtained.
[0054] In summary, in the embodiment of the present invention, in order to alleviate the model hallucination generated by the first large model during use, first, the target input data and the first output data generated by the first large model according to the pre-configured target knowledge base and the target input data are obtained. Then, a first prompt word is generated according to the target input data and the first output data, wherein the first prompt word is used to extract conflict information in the first output data that does not match the knowledge of the target input data and / or the target knowledge base. After that, the first prompt word is input into the second large model so that the second large model outputs conflict information, and the second large model is configured with the target knowledge base. Among them, if the conflict information is extracted by the second large model, it is considered that the first large model has a model hallucination when generating the first output data; if the conflict information is not extracted by the second large model, it is considered that the first large model does not have a model hallucination when generating the first output data. When the conflict information is extracted by the second large model, further, a second prompt word for correcting the first output data according to the conflict information can be generated according to the first output data and the conflict information, and the second prompt word is input into the first large model so that the first large model outputs the second output data corresponding to the corrected first output data. In this solution, for the first output data output by the first large model based on the target input data, it is first determined whether the first large model has a model hallucination problem when generating the first output data, that is, whether the above-mentioned conflicting information exists in the first output data; if there is conflicting information, the first large model is controlled to generate the output data corresponding to the target input data again based on the conflicting information, that is, the first output data is corrected by the conflicting information to obtain the second output data, thereby alleviating the model hallucination problem existing in the first large model when generating the output data corresponding to the target input data.
[0055] It is worth noting that, in the embodiment of the present invention, the type of generation task performed by the first large model when generating the first output data according to the preset target knowledge base and target input data is not limited.
[0056] It is understandable that different types of generation tasks naturally generate different contents or expressions of the first output data. Furthermore, if the first large model has model hallucinations when generating the first output data, the correction strategies adopted for the first output data are also different.
[0057] Based on this, in step 104, a second prompt word is generated according to the first output data and the conflict information, and the second prompt word is used to correct the first output data according to the conflict information, including:
[0058] A second prompt word matching the generation task type is generated according to the generation task type performed when the first large model generates the first output data, the first output data and the conflict information.
[0059] The following uses the generation task types of question-answer generation task and structured content generation task as examples for illustration, but the present invention is not limited thereto.
[0060] For the sake of distinction, the second prompt word corresponding to the question-answering generation task is called the second prompt word of the first category; the second prompt word corresponding to the structured content generation task is called the second prompt word of the second category.
[0061] Figure 2 A flowchart of a method for generating a second prompt word provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the following steps may be included:
[0062] 201. If the generation task type performed when the first large model generates the first output data is a question-answering generation task, then obtain context information of the first output data.
[0063] 202. Generate a second prompt word of the first category according to the context information and conflict information of the first output data, wherein the second prompt word of the first category is used to guide the first large model to regenerate output data corresponding to the target input data according to the context information and conflict information of the first output data.
[0064] In the embodiment of the present invention, the first large model is used to perform question-answering generation tasks.
[0065] Among them, the question-answering generation task is to input a question or query into the big model so that the big model can generate one or more possible answers based on its internal knowledge base and training data. Common application scenarios include but are not limited to: intelligent customer service chat, medical and health consultation, etc.
[0066] Figure 1 In the illustrated embodiment, inputting target input data into the first large model means inputting a question or query into the first large model, and the first large model generates first output data according to a preset target knowledge base, that is, the first large model generates an answer corresponding to the target input data.
[0067] When it is determined that the first large model has model hallucination when generating the first output data, in order to ensure the correction effect of the first output data, firstly, the context information of the first output data is obtained, wherein the context information of the first output data is also the context information generated in the process of question and answer with the first large model; then, according to the context information and conflict information of the first output data, the second prompt word of the first category is generated, so that the first large model can regenerate the output data corresponding to the target input data according to the context information and conflict information of the first output data under the guidance of the second prompt word of the first category. Among them, the output data corresponding to the regenerated target input data is also the context information generated in the process of question and answer with the first large model. Figure 1 The second output data corresponding to the first output data after correction in the embodiment shown.
[0068] In this solution, the additional background information in the context information of the first output data or the history of the previous conversation can provide necessary reference information for the first large model to regenerate the output data corresponding to the target input data; the conflict information can provide additional reference information for the first large model to regenerate the output data corresponding to the target input data. Based on the second prompt word of the first category containing the context information of the first output data and the conflict information, the first large model can generate output data with high correlation and accuracy with the target input data, and alleviate the model illusion of the first large model when generating the output data corresponding to the target input data.
[0069] Figure 3 A flowchart of another method for generating a second prompt word provided by an embodiment of the present invention, such as Figure 3 As shown, the following steps may be included:
[0070] 301. If the generation task type performed when the first large model generates the first output data is a structured content generation task, determine the target structured content corresponding to the conflicting information in the first output data.
[0071] 302. Generate a second prompt word of a second category according to the first output data and the target structured content, wherein the second prompt word of the second category is used to guide the first large model to delete the target structured content from the first output data.
[0072] In the embodiment of the present invention, the first large model is used to perform the structured content generation task.
[0073] Among them, the structured content generation task is to automatically generate content that conforms to the predefined format and structure based on the given big model input or instructions. Different from the question-answering generation task, the structured content generation task not only needs to ensure that the generated results are semantically accurate, but also needs to ensure that the format strictly follows the specified specifications.
[0074] For ease of understanding, the structured content generation task of "generating a session instruction with a set format corresponding to the session record according to the session record in the target input data" is taken as an example for explanation, but the present invention is not limited to this.
[0075] Assume that the conversation record in the target input data is a conversation between a merchant and an intelligent customer service representative, including:
[0076] Merchant: Hello.
[0077] Intelligent Customer Service: Hello, how can I help you?
[0078] Merchant: What should I do if there is no money in my account?
[0079] Smart Customer Service: Your current account balance is low, you can consider recharging.
[0080] Assume that you want to generate a conversation instruction with the following format based on the conversation record in the target input data:
[0081] Instruct: If the merchant is aaa; answer: then reply “bbb”.
[0082] Among them, "aaa" summarizes the conversation message content of the merchant, and "bbb" summarizes the conversation message content of the intelligent customer service.
[0083] Assume that the first output data generated by the first large model according to the above content is:
[0084] Instruct: If the merchant greets you; answer: Reply "Hello, how can I help you?"
[0085] Instruct: If the merchant asks what to do if there is no money in the account; answer: just reply "You currently have little balance in your account, you can consider recharging."
[0086] Instruct: If the merchant reports malicious clicks; Answer: Reply "Don't worry, our platform has a complete complaint mechanism."
[0087] Instruct: If the user passes the friend verification request; answer: Send a greeting message.
[0088] Based on the above assumptions, it is not difficult to find that in the first output data, there are conversation instructions that do not match the content of the conversation record in the target input data:
[0089] Instruct: If the merchant reports malicious clicks; answer: Reply "Don't worry, our platform has a complete complaint mechanism" and
[0090] Instruct: If the user passes the friend verification request; answer: Send a greeting message.
[0091] Among them, the conversation instruction "Instruct: if the user passes the friend verification request; answer: send a greeting message." not only does not match the content of the conversation record in the target input data, but also its format does not match the set format of the conversation instruction.
[0092] In the model hallucination mitigation method provided by the embodiment of the present invention, the conversation instructions in the first output data that are inconsistent with the content and / or preset format of the target input data will all be determined as conflicting information.
[0093] In order to alleviate the model hallucination problem when the first large model generates the first output data corresponding to the target input data, in the embodiment of the present invention, the target structured content corresponding to the conflicting information in the first output data is first determined, and then, based on the first output data and the target structured content, a second prompt word of the second category is generated, so that the first large model can delete the target structured content from the first output data under the guidance of the second prompt word of the second category. Among them, the result after deleting the target structured content from the first output data, that is, Figure 1 The second output data corresponding to the first output data after correction in the embodiment shown.
[0094] Still taking the above assumption as an example, the conversation instruction in the first output data: Instruct: If the merchant reports that there is a malicious click; answer: then reply "Don't worry, our platform has a complete complaint mechanism", and the conversation instruction: Instruct: If the user passes the friend verification request; answer: then send a greeting message, and delete it to obtain the second output data corresponding to the modified first output data:
[0095] Instruct: If the merchant greets you; answer: Reply "Hello, how can I help you?"
[0096] Instruct: If the merchant asks what to do if there is no money in the account; answer: just reply "You currently have little balance in your account, you can consider recharging."
[0097] In this solution, by deleting the target structured content in the first output data that does not conform to the content and / or preset format of the target input data, the model hallucination of the first large model when generating output data corresponding to the target input data is alleviated.
[0098] The following will describe in detail the large model hallucination mitigation device of one or more embodiments of the present invention. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.
[0099] Figure 4 A schematic diagram of the structure of a large-scale model hallucination alleviation device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device includes: an acquisition module 11, a first processing module 12, and a second processing module 13.
[0100] The acquisition module 11 is used to acquire target input data and first output data generated by the first large model according to a pre-configured target knowledge base and the target input data.
[0101] The first processing module 12 is used to generate a first prompt word based on the target input data and the first output data, wherein the first prompt word is used to extract conflicting information in the first output data that does not match the target input data and / or the knowledge of the target knowledge base; input the first prompt word into a second large model so that the second large model outputs the conflicting information, and the second large model is configured with the target knowledge base.
[0102] The second processing module 13 is used to generate a second prompt word according to the first output data and the conflict information, and the second prompt word is used to correct the first output data according to the conflict information; the second prompt word is input into the first large model so that the first large model outputs the second output data corresponding to the first output data after correction.
[0103] Optionally, the second processing module 13 is specifically configured to generate a second prompt word matching the generation task type according to the generation task type performed when the first large model generates the first output data, the first output data and the conflict information.
[0104] Optionally, the second processing module 13 is specifically used to obtain context information of the first output data if the type of generation task performed by the first large model when generating the first output data is a question-answering type generation task; generate a second prompt word of the first category based on the context information of the first output data and the conflict information, and the second prompt word of the first category is used to guide the first large model to regenerate the output data corresponding to the target input data based on the context information of the first output data and the conflict information.
[0105] Optionally, the second processing module 13 is further specifically used to determine the target structured content corresponding to the conflicting information in the first output data if the type of generation task performed by the first large model when generating the first output data is a structured content generation task; generate a second prompt word of the second category based on the first output data and the target structured content, and the second prompt word of the second category is used to guide the first large model to delete the target structured content from the first output data.
[0106] Optionally, the structured content generation task includes: generating, according to the session record in the target input data, a session instruction having a set format corresponding to the session record.
[0107] Figure 4 The device shown can execute the steps introduced in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments, which will not be repeated here.
[0108] In one possible design, the above Figure 4 The structure of the large-scale model hallucination mitigation device shown can be implemented as an electronic device, such as Figure 5 As shown, the electronic device may include: a memory 21, a processor 22, and a communication interface 23. The memory 21 stores executable codes, and when the executable codes are executed by the processor 22, the processor 22 can at least implement the large model hallucination mitigation method provided in the above-mentioned embodiment.
[0109] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the large model hallucination mitigation method provided in the aforementioned embodiment.
[0110] An embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, the processor is caused to execute the large model hallucination mitigation method provided in the above-mentioned embodiment.
[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0113] 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 large model hallucinations, characterized in that: include: Obtain target input data, and first output data generated by the first large model according to a preconfigured target knowledge base and the target input data; Generate a first prompt word according to the target input data and the first output data, wherein the first prompt word is used to extract conflicting information in the first output data that does not match the target input data and / or the knowledge in the target knowledge base; inputting the first prompt word into a second large model so that the second large model outputs the conflict information, wherein the second large model is configured with the target knowledge base; generating a second prompt word according to the first output data and the conflict information, wherein the second prompt word is used to correct the first output data according to the conflict information; The second prompt word is input into the first large model, so that the first large model outputs second output data corresponding to the first output data after correction.
2. The method according to claim 1, characterized in that Generating a second prompt word according to the first output data and the conflict information includes: A second prompt word matching the generation task type is generated according to the generation task type performed when the first large model generates the first output data, the first output data, and the conflict information.
3. The method according to claim 2, characterized in that The step of generating a second prompt word matching the generation task type according to the generation task type performed when the first output data is generated according to the first large model, the first output data, and the conflict information comprises: If the type of generation task performed by the first large model when generating the first output data is a question-answering generation task, obtaining context information of the first output data; Based on the context information of the first output data and the conflict information, a second prompt word of the first category is generated, and the second prompt word of the first category is used to guide the first large model to regenerate the output data corresponding to the target input data based on the context information of the first output data and the conflict information.
4. The method according to claim 2, characterized in that: The step of generating a second prompt word matching the generation task type according to the generation task type performed when the first output data is generated according to the first large model, the first output data, and the conflict information comprises: If the type of generation task performed when the first large model generates the first output data is a structured content generation task, determining the target structured content corresponding to the conflicting information in the first output data; A second prompt word of a second category is generated according to the first output data and the target structured content, and the second prompt word of the second category is used to guide the first large model to delete the target structured content from the first output data.
5. The method according to claim 4, characterized in that The structured content generation task includes: generating a session instruction with a set format corresponding to the session record according to the session record in the target input data.
6. A large-scale model hallucination relief device, characterized in that: include: An acquisition module, used for acquiring target input data and first output data generated by the first large model according to a pre-configured target knowledge base and the target input data; A first processing module, configured to generate a first prompt word according to the target input data and the first output data, wherein the first prompt word is used to extract conflicting information in the first output data that does not match the target input data and / or the knowledge in the target knowledge base; inputting the first prompt word into a second large model so that the second large model outputs the conflict information, wherein the second large model is configured with the target knowledge base; A second processing module, configured to generate a second prompt word according to the first output data and the conflict information, wherein the second prompt word is used to correct the first output data according to the conflict information; The second prompt word is input into the first large model, so that the first large model outputs second output data corresponding to the first output data after correction.
7. The device according to claim 6, characterized in that The second processing module is specifically configured to generate a second prompt word matching the generation task type according to the generation task type executed when the first large model generates the first output data, the first output data and the conflict information.
8. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the large model hallucination mitigation method as described in any one of claims 1 to 5.
9. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable codes, and when the executable codes are executed by a processor of an electronic device, the processor is caused to execute the large model hallucination mitigation method according to any one of claims 1 to 5.
10. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to execute the large model hallucination mitigation method according to any one of claims 1 to 5.
Citation Information
Cited By
Question and answer processing method, model training method, equipment and storage medium
CN122311471A
Process track-based EDA training data set construction method, decision method and device
CN122527717A