Model illusion relieving method, program product, equipment and medium
By acquiring a question set and an initial answer set, calculating the average score using a scoring model, and optimizing the large language model based on gradient descent, the problem of high cost in mitigating model illusion is solved, achieving efficient model optimization and improved accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-10
AI Technical Summary
Existing large language models suffer from model illusion in their output results. Current mitigation methods are costly and ineffective, relying on high-performance hardware and human resources.
By obtaining the question set and initial answer set of the target model, the average score of each answer and the overall average score are calculated using the scoring model. The target model is then optimized based on the gradient descent optimization rule, reducing the input of computing resources and manpower.
It effectively alleviates model illusion, reduces computational and human resource costs, and improves the accuracy of model output.
Smart Images

Figure CN121835795A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a model illusion alleviating method, a program product, a device and a medium. BACKGROUND
[0002] With the rapid development of large language models (LLM), various fields have begun to actively use artificial intelligence technologies based on large language models to improve the automation and intelligence level of their own businesses. A large language model refers to a neural network model with a large number of parameters, which can learn rich knowledge and expression through a large number of text language data sets. Therefore, the artificial intelligence assistant based on a large language model through natural language interaction is the most widely used at present. For convenience of description, the large language model is abbreviated as a large model below.
[0003] Although the large model can process a lot of data and tasks, sometimes the output result of the large model is not completely correct. The output result of the large model has a defect called "model illusion", which means that the output result of the large model looks reasonable and logical, but the content in it actually has errors or is factitious. In fact, the large model is based on semantic information to make text inference, so the model illusion cannot be completely eliminated at present and can only be alleviated through fine-tuning and other technical means.
[0004] If fine-tuning is used to alleviate the model illusion, a high-quality data set containing correct facts and typical illusions needs to be constructed, which relies on domain experts to annotate data, and the cost of collection and cleaning is extremely high. In terms of model calculation, high-performance GPU clusters are also needed to support, as well as consumption costs such as hardware rental and electricity. Moreover, the fine-tuning has limited generalization, and new scenarios or knowledge updates need to be repeatedly invested. Although the effect of illusion alleviation is the best, the cost and expenditure are also higher. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a model illusion alleviating method, a program product, a device and a medium, to solve the problem of high cost and poor effect of the current model illusion alleviating method.
[0006] In a first aspect, the embodiments of the present application provide a model illusion alleviating method, which comprises: obtaining a question set and an initial answer set of a target model; inputting the question set and the initial answer set into a scoring model to obtain an average score of all category answers of the target model and an average score of the initial answer set as a whole; wherein the average score of each category answer is obtained according to the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained according to the scores of all answers in the initial answer set; According to the average score of all the class answers and the average score of the initial answer set as a whole, the target model is optimized based on the optimization rule of gradient descent.
[0007] In the implementation process, the average score of all the class answers and the average score of the initial answer set as a whole are obtained by inputting the question set of the target model and the initial answer set into the scoring model. According to the average score of all the class answers and the average score of the initial answer set as a whole, the target model is optimized based on the optimization rule of gradient descent. The scoring model can be used to efficiently obtain the scoring results of all the class answers and the initial answer set as a whole. Based on the optimization rule of gradient descent, the target model is comprehensively optimized in combination with the scoring results, thereby relieving the illusion of the target model and reducing the cost of computing resources and human labor investment.
[0008] Further, the obtaining of the question set of the target model comprises: Obtaining questions corresponding to the application scenario and business field of the target model to obtain the question set.
[0009] In the implementation process, the question set is obtained by obtaining questions corresponding to the application scenario and business field of the target model, which can ensure that the question set covers the common application scenarios of the target model and typical problem types prone to illusion, and is conducive to subsequent targeted optimization of the target model.
[0010] Further, the obtaining of the initial answer set of the target model comprises: Inputting the question set into the target model to obtain a plurality of answers corresponding to each question in the question set, and determining all the answers corresponding to each question as a class answer; Summarizing all the class answers to obtain the initial answer set.
[0011] In the implementation process, the initial answer set is obtained by using the target model to answer each question in the question set and determining all the answers corresponding to each question as a class answer, which can consider the case that each question has multiple answers and ensure that answers representing different angles are covered.
[0012] Further, before the inputting of the question set and the initial answer set into the scoring model to obtain the average score of all the class answers of the target model and the average score of the initial answer set as a whole, the method further comprises: Setting the scoring rule of the scoring model; The setting of the scoring rule of the scoring model comprises: Splitting the question and the answer to obtain split elements; wherein the split elements of the question include question background, question requirement and question object, and the split elements of the answer include answer object, answer context and answer conclusion; Vectorize each split element to obtain the vector corresponding to each split element; Determine the cosine similarity between the vector of the question object and the vector of the answer object; Determine the Euclidean distance between the vector of the question context and the vector of the answer context; Determine the Pearson correlation coefficient between the vector of the question requirement and the vector of the answer conclusion; Determine the score of the answer based on the sum of the cosine similarity, the Euclidean distance, and the Pearson correlation coefficient.
[0013] In the above implementation process, by setting the scoring rules based on the split elements of the question and the split elements of the answer, and using the scoring model to score all answers corresponding to each question output by the target model according to the scoring rules, the scoring model can reasonably score all answers corresponding to each question output by the target model.
[0014] Further, the input question set and the initial answer set are input to the scoring model to obtain the average score of all class answers of the target model and the average score of the initial answer set as a whole, including: Input each question in the question set and all answers corresponding to the current question into the scoring model to obtain the scores of all answers output by the scoring model after scoring each answer according to the scoring rules; Based on the scores of all answers corresponding to the current question, determine the average score of all answers corresponding to the current question to obtain the average score of a class of answers; Based on the scores of all answers in the initial answer set, determine the average score of the initial answer set as a whole.
[0015] In the above implementation process, the average score of all class answers and the average score of the initial answer set as a whole can be quickly obtained, which facilitates subsequent optimization rules based on gradient descent to optimize the target model according to the scoring results.
[0016] Further, the optimization rules based on gradient descent optimize the target model according to the average score of all class answers and the average score of the initial answer set as a whole, including: Take all class answers as the optimization space, and take the class of answers with the lowest average score as the current optimization direction; Sort the class of answers with the lowest average score from low to high according to the scores, and select the first set of answers with the lowest scores in the current class of answers; Input the first set of answers and the scoring basis corresponding to the first set of answers into the target model to obtain the second set of answers output by the target model after learning and answering the questions corresponding to the current class of answers again; wherein the scoring basis is generated by the scoring model, and the scoring basis includes the scoring dimension and the scoring details; inputting the second set quantity of answers into the scoring model to obtain average scores of the second set quantity of answers; comparing the average scores of the first set quantity of answers and the average scores of the second set quantity of answers to determine whether the target model is optimized; if the target model is optimized, the second set quantity of answers and the scoring basis corresponding to the second set quantity of answers are used to optimize the target model, and the optimized target model replaces the target model before optimization; the target model is continuously optimized using the current type of answers until the average scores of subsequent set quantities of answers generated by the target model are less than or equal to the overall average score of the preposed answer set.
[0017] In the above implementation process, the target model is optimized according to the scoring results based on the gradient descent optimization rule, which can effectively alleviate the illusion of the target model.
[0018] Further, the comparison of the average scores of the first set quantity of answers and the average scores of the second set quantity of answers to determine whether the target model is optimized comprises: if the average score of the first set quantity of answers is less than the average score of the second set quantity of answers, the target model is optimized; if the average score of the first set quantity of answers is greater than or equal to the average score of the second set quantity of answers, the number of boundary touchings in the optimization direction is recorded, and the target model is continuously optimized using the current type of answers.
[0019] In the above implementation process, the optimization effect of the target model can be ensured.
[0020] Further, the method further comprises: inputting the question set into the optimized target model to obtain a new answer set; inputting the new answer set into the scoring model to score and obtain a scoring basis; selecting a type of answers with the lowest average score as the current optimization direction to optimize the target model until a termination condition of optimization end is reached; saving the structure and parameters of the current target model to obtain a final optimized target model.
[0021] In the above implementation process, the target model is repeatedly optimized to obtain an optimal target model.
[0022] Further, the termination condition of optimization end comprises: when the number of boundary touchings reaches a preset maximum value, the termination condition of optimization end is reached; when the number of cyclic optimization reaches a preset maximum upper limit, the termination condition of optimization end is reached.
[0023] In the implementation process, when the condition is met, the structure and parameters of the current target model are saved, i.e., an optimized model is obtained.
[0024] In a second aspect, the embodiments of the present application provide a model illusion alleviation device, which comprises: a data acquisition module configured to acquire a question set and an initial answer set of a target model; a score generation module configured to input the question set and the initial answer set into a scoring model to obtain an average score of all category answers of the target model and an average score of the initial answer set as a whole; wherein the average score of each category answer is obtained according to the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained according to the scores of all answers in the initial answer set; a model optimization module configured to optimize the target model according to the average scores of all category answers and the average score of the initial answer set as a whole based on a gradient descent optimization rule.
[0025] In a third aspect, the embodiments of the present application provide a computer program product, which comprises instructions, and the instructions, when executed by a computer, cause the computer to implement the method described above.
[0026] In a fourth aspect, the embodiments of the present application provide an electronic device, which comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; and the processor implements the method described above when executing the computer program.
[0027] In a fifth aspect, the embodiments of the present application provide a computer readable storage medium, which comprises a stored computer program; and when the computer program is running, the computer readable storage medium controls a device where the computer readable storage medium is located to execute the method described above. BRIEF DESCRIPTION OF DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0029] Figure 1 A flowchart of a model illusion alleviation method provided by the first embodiment of the present application; Figure 2 A structural diagram of a model illusion alleviation device provided by the second embodiment of the present application; Figure 3A structural schematic diagram of an electronic device provided for a fourth embodiment of the present application. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0031] It should be noted that in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. At the same time, the step numbers in the text are only for the convenience of explaining the embodiments of the present application, and do not serve as the function of limiting the execution sequence of the steps.
[0032] With the rapid development of Large Language Model (LLM), various fields have begun to actively use artificial intelligence technologies based on large language models to improve the automation and intelligence level of their own businesses. Large language model refers to a neural network model with a large number of parameters, which can learn rich knowledge and expression through a large number of text language data sets. Therefore, the artificial intelligence assistant based on large language model through natural language interaction is the most widely used at present. For convenience of description, the large language model is abbreviated as large model below.
[0033] Although the large model can process a lot of data and tasks, the effect obtained is not always perfect. The result output by the large model has a defect called "model hallucination", which means that the output result of the large model looks reasonable and logical, but in fact the content in it has errors or is factitious. In fact, the large model is based on semantic information to make text inference, so the model hallucination cannot be completely eliminated at present and can only be alleviated by fine-tuning and other technical means.
[0034] If fine-tuning is used to alleviate model hallucination, a high-quality data set containing correct facts and typical hallucinations needs to be constructed, relying on domain experts to annotate data, which has extremely high collection and cleaning costs. In terms of model calculation, high-performance GPU clusters are also needed to support, as well as consumption costs such as hardware rental and electricity. Moreover, fine-tuning has limited generalization, and new scenarios or knowledge updates need to be repeatedly invested. Although the effect of hallucination alleviation is the best, the cost and overhead are also higher.
[0035] To this end, the application provides a model illusion alleviating method, which comprises the following steps: inputting a question set of a target model and an initial answer set into a scoring model to obtain average scores of all category answers of the target model and an average score of the initial answer set as a whole; and optimizing the target model based on a gradient descent optimization rule according to the average scores of all category answers and the average score of the initial answer set as a whole. The model illusion alleviating method can efficiently obtain scoring results of all category answers and the initial answer set as a whole by using the scoring model, and comprehensively optimize the target model based on the gradient descent optimization rule and the scoring results, so as to alleviate the illusion of the target model and reduce the cost of computing resources and manpower investment of the target model.
[0036] The technical solutions in the embodiments of the application will be described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments.
[0037] Please refer to Figure 1 , Figure 1 A flowchart of a model illusion alleviating method provided by the first embodiment of the application is shown in FIG. 1. The model illusion alleviating method provided by the first embodiment of the application comprises steps S101-S103. S101, obtaining a question set and an initial answer set of a target model.
[0038] Specifically, a plurality of questions corresponding to the target model are selected to obtain the question set of the target model, and the target model answers all the questions in the question set to obtain the initial answer set.
[0039] As an example, a plurality of questions corresponding to the application scenario and business field of the target model are selected to obtain the question set of the target model based on the application scenario and business field of the target model. The questions can be collected from multiple channels, such as professional literature and data, online Q&A platforms, historical data mining, etc., and clear screening criteria are formulated to ensure the quality of the question set, which can include the relevance, clarity, diversity, etc. of the questions. The screened questions are classified and arranged according to certain rules for subsequent use and management, which can be classified according to the theme, type, difficulty, etc. of the questions.
[0040] As an example, the target model answers all the questions in the question set, and each question corresponds to multiple answers, and all the answers to all the questions constitute the initial answer set. Specifically, after receiving a question, the target model analyzes and processes the question by using its internal neural network structure and algorithm to finally generate a corresponding answer.
[0041] S102, input the question set and the initial answer set to the scoring model to obtain the average score of all class answers of the target model and the average score of the initial answer set as a whole; wherein the average score of each class answer is obtained according to the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained according to the scores of all answers in the initial answer set.
[0042] It should be noted that the core role of the scoring model is to evaluate the quality of the target model answers through the association analysis of the questions and the answers, including whether it meets the requirements of the questions, whether the content has logical or factual errors, etc. Therefore, the scoring model needs to have strong natural language understanding ability, long text processing ability, and can access multi-domain knowledge base. Alternatively, the embodiment of the present application selects Qwen3 as the scoring model based on this.
[0043] It should be noted that the target model answers each question in the question set multiple times to form a class of answers (i.e., one question corresponds to multiple answers).
[0044] As an example, if the question set contains Z questions, Z classes of answers are finally formed to constitute the initial answer set; wherein the number of answers to each question needs to be set according to the scene requirements to cover answers from different angles.
[0045] Each question in the question set and all answers corresponding thereto are input to the Qwen3 scoring model, the scoring model scores each answer according to the scoring rules, and then calculates the average score of the class of answers based on the scores of all answers corresponding to each question, which is recorded as the average score of the class of answers; at the same time, the average score of the answer data set as a whole is calculated based on the scores of all answers of all questions, which is used as the initial optimization benchmark.
[0046] S103, based on the optimization rule of gradient descent, the target model is optimized according to the average score of all class answers and the average score of the initial answer set as a whole.
[0047] It should be noted that based on the optimization rule of gradient descent, the optimization direction is selected according to the average score of all class answers (analogous to selecting the direction with the steepest gradient in gradient descent), and the target model is optimized in combination with the average score of the initial answer set as a whole.
[0048] The embodiment of the application inputs the question set and the initial answer set of the target model into the scoring model to obtain the average score of all class answers of the target model and the average score of the initial answer set as a whole, and optimizes the target model based on the optimization rule of gradient descent according to the average score of all class answers and the average score of the initial answer set as a whole, so that the scoring model can be used to efficiently obtain the scoring results of all class answers and the scoring result of the initial answer set as a whole, and the target model can be comprehensively optimized based on the optimization rule of gradient descent and in combination with the scoring results, thereby relieving the illusion of the target model and reducing the cost of computing resources and manpower investment of the target model.
[0049] In optional embodiments, the question set of the target model is obtained by obtaining questions corresponding to the application scenario and the business field of the target model.
[0050] For example, based on the application scenario and the business field of the target model, questions highly related to the business are randomly selected and numbered; the question set needs to cover common application scenarios of the target model and typical question types prone to illusion, so as to ensure the pertinence of subsequent optimization.
[0051] Optionally, each question is described in detail and accurately to ensure clear and unambiguous expression of the question, and the question description can include information such as background, purpose and specific content of the question. The source of each initial question is recorded, including information such as selection basis and reference cases, which is helpful for subsequent tracing and analysis of the question to understand the rationality and scientificity of the question selection. In order to facilitate the query and management of the question set, a question index is established, which can be indexed according to question number, question type and keyword. The question set is updated and improved regularly.
[0052] The embodiment of the application obtains the question set by obtaining questions corresponding to the application scenario and the business field of the target model, which can ensure that the question set covers common application scenarios of the target model and typical question types prone to illusion, and is conducive to subsequent targeted optimization of the target model.
[0053] In optional embodiments, the initial answer set of the target model is obtained by inputting the question set into the target model to obtain multiple answers corresponding to each question in the question set, and determining all answers corresponding to each question as a class of answers; and the initial answer set is obtained by summarizing all class answers.
[0054] For example, the target model answers each question in the initial question set multiple times to form a class of answers (i.e., one question corresponds to multiple answers). If the question set contains Z questions, Z classes of answers are finally formed to constitute the initial answer set. The number of answers to each question needs to be set according to the scene requirement to cover answers from different angles.
[0055] The embodiment of the application can consider the case that each question has multiple answers, and ensure that answers representing different angles are obtained.
[0056] In the optional embodiment, before the input question set and the initial answer set are input into the scoring model to obtain the average score of all the class answers of the target model and the average score of the initial answer set as a whole, the method further comprises: setting a scoring rule of the scoring model; the setting of the scoring rule of the scoring model comprises: splitting the question and the answer to obtain split elements; wherein the split elements of the question comprise a question background, a question requirement and a question object, and the split elements of the answer comprise an answer object, an answer context and an answer conclusion; performing vectorization processing on each split element to obtain a vector corresponding to each split element; determining a cosine similarity between the vector of the question object and the vector of the answer object; determining an Euclidean distance between the vector of the question background and the vector of the answer context; determining a Pearson correlation coefficient between the vector of the question requirement and the vector of the answer conclusion; and determining a score of the answer based on the cosine similarity, the Euclidean distance and the Pearson correlation coefficient.
[0057] For example, the question split dimensions are: background (the scene or premise in which the question is located), requirement (the core appeal of the question), and object (the subject focused by the question); and the answer split dimensions are: object (the subject surrounded by the answer), context (the content supporting the conclusion), and conclusion (the response result to the question).
[0058] The scoring model scores according to the following steps: 1. performing vectorization processing on each split part to obtain a corresponding vector; 2. calculating the cosine similarity between the vector of the question object and the vector of the answer object, wherein the greater the similarity, the higher the matching degree between the answer object and the question object, and the higher the score of this dimension; 3. calculating the Euclidean distance between the vector of the question background and the vector of the answer context, wherein the smaller the distance, the stronger the logical correlation between the answer context and the question background, and the higher the score of this dimension; 4. calculating the Pearson correlation coefficient between the vector of the question requirement and the vector of the answer conclusion, wherein the greater the coefficient, the higher the matching degree between the conclusion and the question requirement, and the higher the score of this dimension; and 5. calculating the score of the answer based on the scores of the above three dimensions, and optionally, the full score is 100.
[0059] The embodiment of the application sets a scoring rule based on the split elements of the question and the split elements of the answer, and uses the scoring model to score all the answers corresponding to each question output by the target model according to the scoring rule, so that the scoring model can reasonably score all the answers corresponding to each question output by the target model.
[0060] In optional embodiments, the input question set and initial answer set are input into the scoring model to obtain the average score of all classes of answers of the target model and the average score of the initial answer set as a whole, including: inputting each question in the question set and all answers corresponding to the current question into the scoring model to obtain the scores of all answers output by the scoring model after scoring each answer according to the scoring rule; determining the average score of all answers corresponding to the current question based on the scores of the answers, to obtain the average score of a class of answers; determining the average score of the initial answer set as a whole based on the scores of all answers in the initial answer set.
[0061] It can be understood that questions that may cause the model to output illusory answers are collected to form a question set. Each question causes the target optimization model to reply multiple times to obtain multiple answers. The multiple answers corresponding to one question are referred to as a class of answers. When scoring, each answer is scored based on the question, but ultimately we mainly focus on the average score of the entire answer data set and the average score of each class of answers.
[0062] The embodiments of the present application can quickly obtain the average score of all classes of answers and the average score of the initial answer set as a whole, facilitating subsequent optimization of the target model according to the gradient descent optimization rule based on the scoring results.
[0063] In optional embodiments, the optimization rule based on gradient descent optimizes the target model according to the average score of all classes of answers and the average score of the initial answer set as a whole, including: taking all classes of answers as an optimization space, and taking the class of answers with the lowest average score as the current optimization direction; sorting the class of answers with the lowest average score from low to high according to the scores, and selecting a first set quantity of answers with the lowest scores in the current class of answers; inputting the first set quantity of answers and the scoring basis corresponding to the first set quantity of answers into the target model to obtain a second set quantity of answers output by the target model after learning to answer the question corresponding to the current class of answers again; wherein the scoring basis is generated by the scoring model, and the scoring basis includes a scoring dimension and scoring details; inputting the second set quantity of answers into the scoring model to obtain the average score of the second set quantity of answers; comparing the average score of the first set quantity of answers and the average score of the second set quantity of answers to determine whether the target model is optimized; if the target model is optimized, using the second set quantity of answers and the scoring basis corresponding to the second set quantity of answers to optimize the target model, and replacing the target model before optimization with the optimized target model; continuing to optimize the target model using the current class of answers until the average score of a subsequent set quantity of answers generated by the target model is less than or equal to the overall average score of the previous answer set. The previous answer set includes each answer output by the target model in the last iteration process, which can be understood as the previous answer of the current iteration process, and the overall average score of the previous answer set is calculated based on the scores of each answer output by the target model in the last iteration process.
[0064] In an optional embodiment, the comparing the average score of the first set of answers and the average score of the second set of answers to determine whether the target model is optimized comprises: if the average score of the first set of answers is less than the average score of the second set of answers, the target model is optimized; and if the average score of the first set of answers is greater than or equal to the average score of the second set of answers, the number of boundary touches in the optimization direction is recorded, and the current class of answers is used to optimize the target model.
[0065] For example, based on the gradient descent optimization method, first, the optimization direction is selected: all classes of answers are used as the optimization space, and the class of answers with the lowest average score is used as the current optimization direction, which is similar to selecting the direction with the steepest gradient in the gradient descent method; specifically, the class of answers is sorted from low to high according to the scores, and K answers with the lowest scores are selected, where 0 < K ≤ N, which is the total number of answers in the class.
[0066] The selected K low-score answers and their corresponding scores are input into the target model, and the target model learns based on these information and then answers the original question to generate new K' answers; the score basis is generated by the scoring model and includes the score details of each dimension. The scoring model scores the newly generated K' answers, calculates their average score, and compares it with the average score of the original K answers; if the new average score is higher than the old average score, it indicates that the hallucination of the target model is alleviated, and the model is optimized, if the new average score is not improved, the number of boundary touches in the optimization direction is recorded, and the selection of the L answers with the lowest scores in the class is repeated until the average score of the new answers is higher than the average score of the initial answers.
[0067] The embodiments of the present application can optimize the target model based on the gradient descent optimization rule according to the score results, and can effectively alleviate the hallucination of the target model.
[0068] In an optional embodiment, the method further comprises step S104: S104, input the question set into the optimized target model to obtain a new answer set; input the new answer set into the scoring model to score and obtain the score basis; select a class of answers with the lowest average score as the current optimization direction to optimize the target model until the termination condition of optimization is reached; save the structure and parameters of the current target model to obtain the final optimized target model.
[0069] For example, after optimizing the target model, a new model with updated target model parameters is obtained, and then the new model is used to generate a new answer set corresponding to the initial question set, and the scoring model is used to score and continue to optimize the target model.
[0070] The embodiment of the application takes all the types of answers as the optimization space, and takes the type of answer with the lowest average score as the optimization direction. The number of answers that can be modified in the optimization direction is regarded as the step size of each step. The process is abstracted as the gradient descent process of the average score of each type of answer to the optimal point. The process is repeated until the overall average score does not improve or reaches the upper limit of the specified number of cycles, and the optimal target model is obtained.
[0071] In the optional embodiment, the termination condition of reaching the end of optimization includes: when the boundary touch number reaches the preset maximum value, the termination condition of reaching the end of optimization is reached; when the number of cycle optimization reaches the preset maximum number of rounds, the termination condition of reaching the end of optimization is reached.
[0072] Specifically, the overall average score of the answer data set reaches the optimal boundary, that is, the boundary touch number of the model overall optimization process reaches the preset maximum value, which indicates that there is no obvious improvement in continuous optimization; or the number of cycle optimization reaches the preset maximum number of rounds, the termination condition of reaching the end of optimization is reached.
[0073] For example, the number of large cycles is x (i.e. the number of times of generating new answer sets), and the maximum number of cycles is X. Before starting the cycle, that is, when x=0, the target model answers z questions, and a total of z types of initial answer sets are obtained. The scoring model performs initial scoring on the initial answer set. Let the overall average score of the initial answer set in the xth cycle be score_ans_sx, and the average score of the zth type of answer be score_ans_sx_z. The average score of each type of initial answer is score_ans_s0_1=Y1, score_ans_s0_2=Y2,..., score_ans_s0_z=Yz, and the average score of the initial answer set is score_ans_s0=Y. The step size k of each optimization is selected, that is, the k questions with the lowest score in the type of answer with the lowest average score (selected according to the model performance); the boundary touch number t_s of the optimization direction (referring to the number of continuous times that the average score does not improve when optimizing the type of question with the lowest score), the boundary touch number t_m of the overall optimization process (referring to the number of continuous times that the average score of the newly generated answer set does not improve when optimizing the model), the maximum boundary touch number T_s of the optimization direction, and the maximum boundary touch number T_m of the overall optimization process.
[0074] The first cycle optimization starts, i.e. when x = 0, t_s = 0, t_m = 0. The z-th type of answer with the lowest average score is selected from the z-th type of answer, and the k answers with the lowest scores are selected from it, and the target model is learned based on the score basis of the k answers, and the k questions are reanswered and scored to obtain the new z-th type of question average score, i.e. score_ans_s0_z = Yz'. Compare the scores of the new and old answers, if Yz > Yz', the target model is not optimized, the boundary touch frequency in the optimization direction is increased by one, t_s = t_s + 1, and the target model is reanswered based on the score basis. Repeat the above cycle optimization process. Until Yz < Yz', it means that the target model is optimized, and the current model parameters are saved.
[0075] The optimized target model answers the question set, and the cycle has ended at this time, the cycle number is increased by one, x = x + 1, a new answer set is generated and scored, score_ans_s1 = Y', if Y > Y', the overall model is not optimized, the boundary touch frequency of the overall optimization is increased by one, t_m = t_m + 1; if Y < Y', the model is optimized. Continue the next optimization cycle process until t_m = T_m or x > X, then the cycle is automatically ended, and the model optimization has reached the optimum.
[0076] By setting a scientific and reasonable scoring rule, the target model answers are reasonably and effectively scored to obtain an index that can measure the quality of the model answers and detect the degree of hallucination of the model. The score of the model answer is based on the scoring model, which provides the basis for scoring, so that the optimized target model can combine the scoring basis when optimizing the answer, improving the explainability of the model hallucination mitigation process. It has significant advantages in computing and labor costs. In terms of computing cost, it does not need to fine-tune the model on a large scale or rely on high-performance clusters. The core relies on the scoring model to score the existing answers. Only the lowest average score of one type of answer is optimized each time, and only k low-score answers (small batch) are selected to drive the target model learning, avoiding additional algorithm consumption of model training. In terms of labor cost, it does not need to construct a large amount of labeled training data, but relies on the scoring basis provided by the scoring model to guide optimization, reducing the need for large-scale data labeling, and the optimization process is automatically iterated according to the gradient descent logic. Artificially, only the initial rule and termination condition need to be set, which greatly reduces the investment of professional labor.
[0077] For example, step 1: there is an existing model hallucination model Test Model, which is the target model that needs to be hallucination relieved, and an evaluation model Qwen3. Prepare a question set containing 1000 questions; traverse the 1000 questions, and let the Test Model model answer each question 10 times to obtain an answer data set containing 10000 answers, i.e. a data set of 1000 types of answers.
[0078] Step 2: Current cycle number x = 0, set the maximum cycle number X = 100, the optimized step size k = 1, the boundary touch number t_s = 0, t_m = 0, the maximum boundary touch number T_s = 5, T_m = 5. The problem set and the initial answer set are input into the evaluation large model Qwen3 one by one, the evaluation large model Qwen3 scores according to the scoring rules described above and gives the scoring basis, the overall average score score_ans_s0 = 65 of the initial answer data set is calculated, and the average score of each type of answer is calculated, which is score_ans_s0_z here. At this time, the end condition is judged: the boundary touch number t_m of the overall optimization process < T_m, and the cycle number x < X; the end condition is not met.
[0079] Step 3: Select the 63rd answer (63 refers to 10 answers corresponding to the 63rd question) with the lowest average score (such as a score of 51) as the optimization direction. The answers in the 63rd answer are sorted by score, and the k (k = 1 here) answers with the lowest score are selected as follows: The 63rd question is "How many dynasties does China have?"; The 1st answer with the lowest score (score 47) in the 63rd answer is "There have been 25 major dynasties in Chinese history, among which the Xia, Shang, Western Zhou, and Eastern Zhou laid the foundation for early civilization, followed by the Qin, Western Han, Eastern Han, Wei, Shu, Wu, Western Jin, Eastern Jin, Southern and Northern Dynasties, Song, Qi, Liang, Chen, and Northern Wei, Western Wei, Northern Qi, Northern Zhou, followed by the Sui, Tang, Five Dynasties and Ten Kingdoms, and then directly into the Yuan Dynasty, followed by the Ming Dynasty and the Qing Dynasty. Therefore, there are 25 dynasties in China."
[0080] The scoring process given by the evaluation large model Qwen3 is as follows: question splitting: background: "Statistical background of the number of dynasties in Chinese history", requirement: "Statistical and answer to the number of Chinese dynasties", object: "Chinese dynasties". Answer splitting: object: "Chinese dynasties in history", context: "Xia, Shang, Western Zhou, and Eastern Zhou laid the foundation for early civilization, followed by the Qin, Western Han, Eastern Han, Wei, Shu, Wu, Western Jin, Eastern Jin, Southern and Northern Dynasties, Song, Qi, Liang, Chen, and Northern Wei, Western Wei, Northern Qi, Northern Zhou, followed by the Sui, Tang, Five Dynasties and Ten Kingdoms, and then directly into the Yuan Dynasty, followed by the Ming Dynasty and the Qing Dynasty"; conclusion: "There are 25 dynasties in China"; "background, requirement, object" of question splitting and "object, context, conclusion" of answer splitting are respectively vectorized.
[0081] Dimension calculation and scoring analysis: Cosine similarity calculation between question object and answer object, analysis: The answer object clearly points to "dynasties in Chinese history", which is consistent with the question object, but the context has a time sequence error (skipping the Song Dynasty, etc.), calculation result: cosine similarity = 0.75 (minimum 0, maximum 1), score: 75 points. Euclidean distance calculation of background and context, analysis: The question background is the number of dynasties, the context lists the names of the dynasties, but there is a serious time sequence error (directly connecting the Tang Dynasty to the Yuan Dynasty, omitting the Song Dynasty, Liao, Jin, etc.), and the regimes during the Three Kingdoms and the Northern and Southern Dynasties are counted as separate dynasties, which deviates from the conventional classification logic of history, calculation result: Euclidean distance = 1.9 (less than 0.5 highly consistent, greater than 2 basically completely deviated), score: 40 points. Pearson correlation coefficient calculation of requirements and conclusions, analysis: The question requires the number of dynasties, and the conclusion gives "25", but the actual names listed in the context have repeated calculations (such as counting the Three Kingdoms of Wei, Shu, and Wu separately) and omissions (not counting the Song Dynasty, etc.), and the number of main dynasties recognized by history is about 18, the conclusion is incorrect, calculation result: Pearson correlation coefficient = 0.25 (minimum 0, maximum 1), score: 25 points. Comprehensive score: (75+40+25) ÷ 3 ≈ 47 points, conclusion: The model answer has obvious hallucinations, and the comprehensive score is low.
[0082] The answer with the lowest score and the scoring basis are input into the Test Model model, and it is asked to answer question 63 again based on this, resulting in a new answer "There have been 22 main dynasties in Chinese history, including the early dynasties of the Xia, Shang, and Western and Eastern Zhou, followed by the Qin, Western and Eastern Han, the Three Kingdoms period, the Western and Eastern Jin, the Northern and Southern Dynasties, the Sui, Tang, Five Dynasties and Ten Kingdoms, the Song, Yuan, Ming, and Qing dynasties. In addition, there are two less widely recorded dynasties, Liao and Jin, so there are a total of 22 dynasties in China."
[0083] Question 63 and this new answer are input into the evaluation model Qwen3, which is asked to evaluate and score again, resulting in a new score of 58. Conditional judgment is performed, and the average score of the new answer is 58, which is higher than the average score of the original answer, 47, so the model is optimized to some extent. The model parameters are retained, and a new optimized Test Model model is obtained.
[0084] Step 4: Use the new Test Model model to traverse the question set and obtain a new answer data set, ending one cycle, x = 0 + 1. Calculate the average score of the overall answer, score_ans_s1 = 73 > score_ans_s0 = 65. Enter the next optimization cycle process, repeat the above steps.
[0085] In the 56th cycle, the cycle number x = 56, the average score of the overall answer score_ans_s56 = 94, the judgment end condition: the overall average score of the last round score_ans_s55 = 94 is equal to score_ans_s56, the boundary touch number t_m of the overall optimization process is added by 1, and the current t_m = 5 is equal to the maximum boundary touch number T_m of the overall optimization, the cycle number x < X, and the end condition is met.
[0086] The structure and parameters of the Test Model at this time are optimal, that is, the target model obtained by the model hallucination mitigation solution.
[0087] Please refer to Figure 2 , Figure 2 A structural schematic diagram of a model hallucination mitigation device provided by the second embodiment of the present application. The second embodiment of the present application provides a model hallucination mitigation device, which comprises a data acquisition module 201, a score generation module 202, and a model optimization module 203. The data acquisition module 201 is configured to acquire a question set and an initial answer set of a target model. The score generation module 202 is configured to input the question set and the initial answer set into a scoring model to obtain an average score of all category answers of the target model and an average score of the initial answer set as a whole. The average score of each category answer is obtained according to the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained according to the scores of all answers in the initial answer set. The model optimization module 203 is configured to optimize the target model based on a gradient descent optimization rule according to the average score of all category answers and the average score of the initial answer set as a whole.
[0088] In optional embodiments, the question set of the target model is acquired by acquiring questions corresponding to the application scenario and the business field of the target model to obtain the question set.
[0089] In optional embodiments, the initial answer set of the target model is acquired by inputting the question set into the target model to obtain multiple answers corresponding to each question in the question set, and determining all answers corresponding to each question as a category answer. All category answers are summarized to obtain the initial answer set.
[0090] In optional embodiments, the score generation module 202 is further configured to set a scoring rule of the scoring model before inputting the set of input questions and the initial answer set into the scoring model to obtain the average score of all class answers of the target model and the average score of the initial answer set as a whole. The setting of the scoring rule of the scoring model comprises: splitting the questions and answers to obtain split elements; wherein the split elements of the questions include question background, question requirements and question objects, and the split elements of the answers include answer objects, answer contexts and answer conclusions; performing vectorization processing on each split element to obtain a vector corresponding to each split element; determining the cosine similarity between the vector of the question object and the vector of the answer object; determining the Euclidean distance between the vector of the question background and the vector of the answer context; determining the Pearson correlation coefficient between the vector of the question requirements and the vector of the answer conclusions; and determining the score of the answer based on the cosine similarity, the Euclidean distance and the Pearson correlation coefficient.
[0091] In optional embodiments, inputting the set of input questions and the initial answer set into the scoring model to obtain the average score of all class answers of the target model and the average score of the initial answer set as a whole comprises: inputting each question in the set of input questions and all answers corresponding to the current question into the scoring model to obtain the scores of all answers output by the scoring model after scoring each answer according to the scoring rule; determining the average score of all answers corresponding to the current question based on the scores of all answers corresponding to the current question to obtain the average score of a class of answers; and determining the average score of the initial answer set as a whole based on the scores of all answers in the initial answer set.
[0092] In optional embodiments, the optimization rule based on gradient descent optimizes the target model according to the average score of all class answers and the average score of the initial answer set as a whole, which comprises: taking all class answers as an optimization space and taking the class of answers with the lowest average score as the current optimization direction; sorting the class of answers with the lowest average score from low to high according to the scores, and selecting a first set quantity of answers with the lowest scores in the current class of answers; inputting the first set quantity of answers and the scoring basis corresponding to the first set quantity of answers into the target model to obtain a second set quantity of answers output by the target model after learning and answering the questions corresponding to the current class of answers; wherein the scoring basis is generated by the scoring model, and the scoring basis comprises scoring dimensions and scoring details; inputting the second set quantity of answers into the scoring model to obtain the average score of the second set quantity of answers; comparing the average score of the first set quantity of answers with the average score of the second set quantity of answers to determine whether the target model is optimized; if the target model is optimized, using the second set quantity of answers and the scoring basis corresponding to the second set quantity of answers to optimize the target model, and replacing the target model before optimization with the target model after optimization; and continuing to optimize the target model using the current class of answers until the average score of a subsequent set quantity of answers generated by the target model is less than or equal to the average score of the preposed answer set as a whole.
[0093] In an optional embodiment, the comparing the average score of the first set of answers with the average score of the second set of answers to determine whether the target model is optimized comprises: if the average score of the first set of answers is less than the average score of the second set of answers, the target model is optimized; and if the average score of the first set of answers is greater than or equal to the average score of the second set of answers, the number of boundary touchings in the optimization direction is recorded, and the current type of answers is used to optimize the target model.
[0094] In an optional embodiment, the apparatus further comprises a loop execution module configured to: input the question set into the optimized target model to obtain a new answer set; input the new answer set into the scoring model to obtain the scoring basis; select a type of answers with the lowest average score as a current optimization direction, and optimize the target model until a termination condition of optimization end is reached; and save the structure and parameters of the current target model to obtain a final optimized target model.
[0095] In an optional embodiment, the termination condition of optimization end comprises: when the number of boundary touchings reaches a preset maximum value, the termination condition of optimization end is reached; and when the number of loop optimizations reaches a preset maximum upper limit, the termination condition of optimization end is reached.
[0096] The functions and effects of the modules in the apparatus are described in detail in the implementation process of the corresponding steps in the method of the first embodiment of the present application, which will not be repeated here.
[0097] The third embodiment of the present application provides a computer program product, which comprises instructions. When the instructions are executed by a computer, the computer implements the method of the first embodiment of the present application and achieves the same beneficial effects.
[0098] The method of the first embodiment of the present application can be implemented by software, hardware, firmware or any combination thereof, in whole or in part. When implemented by software, the method can be implemented in the form of a computer program product, in whole or in part. The computer program product comprises one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, a core network device, an OAM (Open Application Model) or other programmable devices.
[0099] The computer program or instructions can be stored in or transferred from one computer-readable medium to another computer-readable medium, such as from one website, computer, server, or data center to another website, computer, server, or data center, through wired or wireless ways. The computer-readable medium can be any available medium accessible by the computer or data storage device such as a server, data center, or the like, which integrates one or more available media. The available media can be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; an optical medium, such as a digital video disc; or a semiconductor medium, such as a solid-state disk. The computer-readable medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile storage media.
[0100] Please refer to Figure 3 , Figure 3 A structural schematic diagram of an electronic device provided by the fourth embodiment of the present application. The fourth embodiment of the present application provides an electronic device 30, which includes a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; the processor 301 implements the method described in the first embodiment of the present application when executing the computer program, and achieves the same beneficial effects.
[0101] The processor 301 reads the computer program from the memory 302 through the bus 303 and executes the computer program to implement the method described in the first embodiment of the present application, including any embodiment of the method.
[0102] The processor 301 can process digital signals and can include various computing structures. For example, a complex instruction set computer structure, a reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, the processor 301 can be a microprocessor.
[0103] The memory 302 can be used to store instructions executed by the processor 301 or data related to the execution process of the instructions. These instructions and / or data can include code for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 301 of the embodiments of the present disclosure can be used to execute instructions in the memory 302 to implement the method described in the first embodiment of the present application. The memory 302 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memories well known to those skilled in the art.
[0104] The fifth embodiment of the present application provides a computer readable storage medium, which comprises a stored computer program; wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the method according to the first embodiment of the present application when the computer program is running, and the same beneficial effects can be achieved.
[0105] The method according to the first embodiment of the present application can be implemented by software, hardware, firmware or any combination thereof, in whole or in part. When implemented by software, the method can be implemented in the form of a computer program product, in whole or in part. The computer program product comprises one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, a core network device, an OAM (Open Application Model) or other programmable devices.
[0106] The computer programs or instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer programs or instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired or wireless manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center and the like integrated with one or more available media. The available media can be a magnetic medium, for example, a floppy disk, a hard disk, a magnetic tape; an optical medium, for example, a digital video disc; a semiconductor medium, for example, a solid state disk. The computer readable storage medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile storage media.
[0107] To sum up, the embodiment of the present application provides a model illusion alleviating method, a program product, a device and a medium. The model illusion alleviating method comprises the following steps: obtaining a question set and an initial answer set of a target model; inputting the question set and the initial answer set into a scoring model to obtain an average score of all category answers of the target model and an average score of the initial answer set as a whole; wherein the average score of each category answer is obtained according to the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained according to the scores of all answers in the initial answer set; and based on a gradient descent optimization rule, the target model is optimized according to the average score of all category answers and the average score of the initial answer set as a whole. According to the embodiment of the present application, the question set and the initial answer set of the target model are input into the scoring model to obtain the average score of all category answers of the target model and the average score of the initial answer set as a whole, and based on the gradient descent optimization rule, the target model is optimized according to the average score of all category answers and the average score of the initial answer set as a whole, so that the scoring model can be used to efficiently obtain the score results of all category answers and the score result of the initial answer set as a whole, and based on the gradient descent optimization rule, the target model can be comprehensively optimized in combination with the score results, so as to alleviate the illusion of the target model, and the cost of calculation resources and manpower investment of the target model is reduced.
[0108] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented by other manners. The apparatus embodiments described above are only schematic, for example, the flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks can occur in different orders from those described in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system for implementing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0109] In addition, each functional module in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0110] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0111] The above merely describes the specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for alleviating model hallucinations, characterized in that, The method includes: Obtain the question set and initial answer set for the target model; Input the question set and the initial answer set into the scoring model to obtain the average score of all answer classes in the target model and the average score of the initial answer set as a whole; where the average score of each answer class is obtained based on the scores of all answers corresponding to each question in the question set, and the average score of the initial answer set as a whole is obtained based on the scores of all answers in the initial answer set; The optimization rule based on gradient descent optimizes the target model based on the average score of all answer classes and the overall average score of the initial answer set.
2. The method according to claim 1, characterized in that, The problem set for obtaining the target model includes: Obtain the questions corresponding to the application scenarios and business domains of the target model to obtain a question set.
3. The method according to claim 1, characterized in that, The process of obtaining the initial answer set for the target model includes: Input a set of questions into the target model, obtain multiple answers for each question in the set of questions, and classify all answers for each question into one type of answer; Summarize all the answers to obtain the initial answer set.
4. The method according to claim 1, characterized in that, Before inputting the input question set and initial answer set into the scoring model to obtain the average score of all classes of answers in the target model and the overall average score of the initial answer set, the following steps are also included: Set the scoring rules for the scoring model; The scoring rules for setting the scoring model include: The question and answer are broken down into their constituent elements. The constituent elements of the question include the question background, question requirements, and question object. The constituent elements of the answer include the answer object, answer context, and answer conclusion. Each splitting element is vectorized to obtain the vector corresponding to each splitting element; Determine the cosine similarity between the vector of the question object and the vector of the answer object; Determine the Euclidean distance between the vectors representing the problem context and the vectors representing the answer context; Determine the Pearson correlation coefficient between the vector required by the question and the vector of the answer conclusion; The score for the answer is determined based on cosine similarity, Euclidean distance, and Pearson correlation coefficient.
5. The method according to claim 1, characterized in that, The input question set and initial answer set are fed into the scoring model to obtain the average score of all answer classes in the target model and the overall average score of the initial answer set, including: Input each question in the question set and all the answers corresponding to the current question into the scoring model, and obtain the scores of all answers output by the scoring model after scoring each answer according to the scoring rules; Based on the scores of all answers to the current question, determine the average score of all answers to the current question to obtain the average score of a category of answers; Determine the overall average score of the initial answer set based on the scores of all answers in the initial answer set.
6. The method according to claim 1, characterized in that, The gradient descent-based optimization rule optimizes the target model based on the average score of all answer classes and the overall average score of the initial answer set, including: The optimization space is defined by all types of answers, and the current optimization direction is the type of answer with the lowest average score. Sort the answers with the lowest average score from lowest to highest, and select the first set quantity answer with the lowest score in the current category. Input the first set-value answer and the corresponding scoring criteria into the target model, and obtain the second set-value answer output by the target model after learning and re-answering the question corresponding to the current class of answers; wherein, the scoring criteria are generated by the scoring model, and the scoring criteria include scoring dimensions and scoring details; Input the second set of answers into the scoring model to obtain the average score of the second set of answers; Compare the average score of the first setpoint answer with the average score of the second setpoint answer to determine whether the target model has been optimized; If the target model is optimized, the second set quantity answer and the corresponding scoring criteria are used to optimize the target model, and the optimized target model replaces the unoptimized target model. Continue to optimize the target model using the current type of answer until the average score of the subsequent set of answers generated by the target model is less than or equal to the overall average score of the previous answer set.
7. The method according to claim 6, characterized in that, The step of comparing the average score of the first setpoint answer and the average score of the second setpoint answer to determine whether the target model has been optimized includes: If the average score of the first set quantity answers is less than the average score of the second set quantity answers, then the target model is optimized; If the average score of the first set quantity answer is greater than or equal to the average score of the second set quantity answer, then record the number of boundary touches in one optimization direction, and continue to use the current type of answer to optimize the target model.
8. The method according to claim 7, characterized in that, Also includes: Input the question set into the optimized target model to obtain a new answer set; Input a new set of answers into the scoring model for scoring and obtain the scoring criteria; The lowest average score of the answer type is selected as the current optimization direction, and the target model is optimized until the termination condition for optimization is met. Save the structure and parameters of the current target model to obtain the final optimized target model.
9. The method according to claim 8, characterized in that, The termination conditions for reaching the end of optimization include: When the number of boundary touches reaches the preset maximum value, the optimization ends. When the number of iterations reaches the preset maximum limit, the optimization ends.
10. A computer program product, characterized in that, The computer program product includes instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 9.
11. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; when the processor executes the computer program, it implements the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Target answer generation method and device, storage medium and electronic device
CN116644167A
Large model automatic prompt tuning method and device using gradient optimization and medium
CN119962681A
Data processing method, device and system, computing equipment and storage medium
CN120317380A
Model tuning method and device, equipment and storage medium
CN120371981A
Data evaluation method and device, computer equipment, readable storage medium and program product
CN121117007A