Model updating method, electronic device, storage medium and program product
By updating the probability distribution table and adjusting the output strategy under abnormal conditions of the large language model, the problem of low accuracy caused by frequent model switching ideas is solved, and rapid recovery performance and improved output accuracy are achieved.
Patent Information
- Application Number
- CN202510885829.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-06-27
AI Technical Summary
Large language models frequently switch ideas during the dynamic adjustment of reasoning, resulting in premature abandonment of correct reasoning ideas, prolonged reasoning time, wasted computing resources, and low-accuracy output results.
By obtaining the current input data of the target model and determining that its state is abnormal, the probability distribution table is updated, and the input data is processed according to the updated probability distribution table to adjust the output strategy.
Quickly restore model performance, reduce erroneous output under abnormal conditions, and improve the accuracy of output results.
Smart Images

Figure CN120406989B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model updating method, electronic device, storage medium, and program product. Background Art
[0002] With the development of artificial intelligence, models can imitate the process of deep human thinking, continuously explore multiple reasoning strategies, reflect on decisions, and iteratively optimize solutions when dealing with complex tasks, providing innovative solutions in scenarios such as mathematical problem solving and code generation.
[0003] As the model dynamically adjusts its reasoning, it may switch ideas more frequently, causing the model to abandon potentially correct reasoning ideas prematurely and generate a large amount of intermediate reasoning data, which prolongs the reasoning time, wastes computing resources, and results in lower accuracy of the model output results. Summary of the Invention
[0004] The embodiments of the present application provide a model updating method, an electronic device, a storage medium, and a program product to at least solve the problem of low accuracy of model output results in related technologies.
[0005] This application provides a model updating method, including:
[0006] Get the current input data of the target model input;
[0007] Determine a current state of the target model, where the current state includes a normal state and an abnormal state. The current state is determined based on a first indicator value and a second indicator value of the target model. The first indicator value is used to indicate the degree of overthinking of the target model during the solution process, and the second indicator value is used to indicate the degree of diversity of ideas of the target model during the solution process.
[0008] When the current state of the target model is an abnormal state, the probability distribution table corresponding to the target model is updated, and the current input data is processed according to the target model and the updated probability distribution table to obtain the current output result. The probability distribution table is used to indicate the probability of each word in multiple words being the output word.
[0009] This application also provides a model updating device, comprising:
[0010] The acquisition module is used to obtain the current input data of the target model input;
[0011] a determination module, configured to determine a current state of the target model, the current state including a normal state and an abnormal state, the current state being determined based on a first indicator value and a second indicator value of the target model, the first indicator value being used to indicate a degree of overthinking of the target model during the solution process, and the second indicator value being used to indicate a degree of diversity of ideas of the target model during the solution process;
[0012] The output module is used to update the probability distribution table corresponding to the target model when the current state of the target model is an abnormal state, and to process the current input data according to the target model and the updated probability distribution table to obtain the current output result. The probability distribution table is used to indicate the probability of each word in multiple words being the output word.
[0013] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned model updating methods when executing the computer program.
[0014] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned model updating methods are implemented.
[0015] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned model updating methods when executed by a processor.
[0016] Through this application, since when the current state of the target model is an abnormal state, the probability distribution table corresponding to the target model is updated and processed, and the current input data is processed according to the target model and the updated probability distribution table to obtain the current output result, the output strategy of the target model can be adjusted, the performance of the target model can be quickly restored, the erroneous output caused by the abnormal state can be reduced, and the accuracy of the model output result is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A schematic diagram of the structure of a model updating system provided in an embodiment of the present application;
[0019] Figure 2 A flowchart of a model updating method provided in an embodiment of the present application;
[0020] Figure 3 A flowchart of another model updating method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of another model updating method provided in an embodiment of the present application;
[0022] Figure 5 A flowchart of another model updating method provided in an embodiment of the present application;
[0023] Figure 6 A flowchart of another model updating method provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of the structure of a model updating device provided in an embodiment of the present application;
[0025] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0028] With the development of artificial intelligence, large language models can imitate the process of deep human thinking, continuously explore multiple reasoning strategies, reflect on decisions, and iteratively optimize solutions when handling complex tasks, providing innovative solutions in scenarios such as mathematical problem solving and code generation.
[0029] When a large language model dynamically adjusts its reasoning, it may switch ideas more frequently, causing the model to abandon potentially correct reasoning ideas prematurely and generate a large amount of intermediate reasoning data, which prolongs the reasoning time, wastes computing resources, and results in lower accuracy of the model output results.
[0030] To address the above technical issues, an embodiment of the present application provides a model updating method that obtains the current input data of a target model input, updates the probability distribution table corresponding to the target model when the current state of the target model is abnormal, and processes the current input data based on the target model and the updated probability distribution table to obtain the current output result. In this way, when the current state of the target model is abnormal, by updating the probability distribution table to adjust the output strategy of the target model, the performance of the target model can be quickly restored, the erroneous output caused by the abnormal state can be reduced, and the accuracy of the model output results can be improved.
[0031] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the model updating method depends, the specific application environment architecture or specific hardware architecture is described here.
[0033] Figure 1 This is a schematic diagram of the structure of a model updating system provided in an embodiment of the present application. Figure 1 , Figure 1 It can include data input layer, model status monitoring layer, model update layer and model output layer.
[0034] Among them, the data input layer can be used to provide the input data required by the target model.
[0035] For example, the input data can be text data input by a user, sensor data, numerical data, and so on.
[0036] The data input layer can also be used to clean, format, and preliminarily process the input data to ensure that the data meets the input requirements of the model.
[0037] For example, preprocessing operations such as word segmentation and stop word removal can be performed on text data.
[0038] The model status monitoring layer can store the historical output results of the target model.
[0039] The model status monitoring layer can be used to analyze the historical output results of the target model, determine multiple indicator values of the target model, and determine the current status of the target model.
[0040] The model update layer can store the probability distribution table of the target model.
[0041] The probability distribution table can be the basis for the target model to dynamically adjust the output. By updating the probability distribution table, the target model can better adapt to changes in input data and quickly restore the performance of the target model.
[0042] The model output layer can be used to generate output results based on input data and probability distribution tables.
[0043] For example, in a natural language generation task, a more appropriate word unit is selected as the output according to the updated probability distribution table to obtain the output result.
[0044] Figure 2 This is a flow chart of a model updating method provided in an embodiment of the present application. The execution subject of the embodiment of the present application may be a processor. The processor may be implemented by software or by a combination of software and hardware. Figure 2 , the method comprising:
[0045] S201: Obtain current input data of the target model.
[0046] The target model can be a large language model, which is not limited here.
[0047] For example, the target model could be a long thought chain model.
[0048] A long thought chain model can refer to a large language model that can generate a longer reasoning process and solve complex problems by simulating the step-by-step thinking of humans.
[0049] The current input data may be the input data received by the target model at the current moment.
[0050] Input data can refer to the specific data content that the target model needs to process.
[0051] The current input data of the target model may be obtained in response to the data input by the user in the text box control of the target model and the selection operation of the confirmation control of the target model.
[0052] S202: Determine the current state of the target model.
[0053] The current state includes a normal state and an abnormal state.
[0054] The current state is determined according to the first indicator value and the second indicator value of the target model.
[0055] The first indicator value is used to indicate the degree to which the target model overthinks during the solution process.
[0056] The second indicator value is used to indicate the degree of diversity of ideas in the target model during the solution process.
[0057] Optionally, the current state of the target model may be determined by obtaining multiple historical output results of the target model, inputting the multiple historical output results into a state prediction model, and determining the current state of the target model.
[0058] Optionally, the current state of the target model can be determined by: obtaining multiple historical output results of the target model; determining a first indicator value and a second indicator value based on the multiple historical output results; and determining the current state of the target model based on the first indicator value and the second indicator value.
[0059] The first indicator value and the second indicator value may be determined by using multiple preset formulas according to multiple historical output results.
[0060] The first weight value of the first indicator value can be determined based on the first preset weight corresponding to the first indicator value; the second weight value of the second indicator value can be determined based on the second preset weight corresponding to the second indicator value; and the current state of the target model can be determined based on the first weight value and the second weight value.
[0061] The first preset weight may be a preset value, and the second preset weight may be a preset value, which are not limited here.
[0062] The current state of the target model may be determined based on whether the first weight value is within a first preset range and whether the second weight value is within a second preset range.
[0063] S203. When the current state of the target model is an abnormal state, the probability distribution table corresponding to the target model is updated, and the current input data is processed according to the target model and the updated probability distribution table to obtain the current output result.
[0064] The probability distribution table is used to indicate the probability that each word-gram in the plurality of word-grams is an output word-gram.
[0065] The probability distribution table may store the probability of each word-gram in the vocabulary being an output word-gram.
[0066] The updating process may be used to change the output probabilities of a plurality of predetermined word-grams among the plurality of word-grams.
[0067] Optionally, when the current state of the target model is an abnormal state, the probability distribution table corresponding to the target model can be updated according to a preset algorithm, and the updated probability distribution table can be used in combination with other parameters of the target model to process the current input data to obtain the current output result.
[0068] Optionally, when the current state of the target model is an abnormal state, the current input data can be analyzed and processed by the target model to determine the first initial probability distribution table, and generate the first output word element based on the first initial probability distribution table; determine the i+1th initial probability distribution table based on the first i output words; update the i+1th initial probability distribution table to obtain the i+1th updated probability distribution table, and generate the i+1th output word element based on the i+1th updated probability distribution table.
[0069] Here, i is 1, 2, ..., n, until the n-th output word element meets the preset termination condition, and the current output result is determined based on the n output word elements.
[0070] The first initial probability distribution table can directly determine the first output word.
[0071] The (i+1)th initial probability distribution table is used to indicate the initial probability of each word-gram in the plurality of word-grams being the (i+1)th output word-gram.
[0072] Assume that when the t-th word is generated, the initial prediction value of the model output layer is obtained, which is recorded as logit t The length of the initial prediction value is the same as the length of the vocabulary during target model training. A preset function can be used to calculate the initial probability values of multiple word units at that position based on the initial prediction value to obtain the initial probability distribution table.
[0073] For example, suppose that when the t-th word is generated based on the first (t-1) words that have been generated, the initial probability value of the word is w It can be expressed as follows:
[0074]
[0075] Among them, V can represent the vocabulary of the target model, which includes multiple word units. It can represent the initial prediction value corresponding to any word v in multiple words in the vocabulary. It can represent the initial prediction value corresponding to the word w, and exp() can represent the exponential function.
[0076] The preset termination condition may be determining whether the output word is a preset termination word.
[0077] Optionally, when the current state of the target model is a normal state, the current input data is processed according to the target model to obtain the current output result.
[0078] The present embodiment provides a model updating method, which obtains the current input data of the target model input; determines the current state of the target model, the current state includes a normal state and an abnormal state, and the current state is determined according to a first indicator value and a second indicator value of the target model, the first indicator value is used to indicate the degree of overthinking of the target model during the solution process, and the second indicator value is used to indicate the degree of diversity of ideas of the target model during the solution process; when the current state of the target model is an abnormal state, updates the probability distribution table corresponding to the target model, and processes the current input data according to the target model and the updated probability distribution table to obtain the current output result, the probability distribution table is used to indicate the probability of each word in multiple words being the output word. In this way, when the current state of the target model is an abnormal state, by updating the probability distribution table to adjust the output strategy of the target model, the performance of the target model can be quickly restored, the erroneous output caused by the abnormal state can be reduced, and the accuracy of the model output result can be improved.
[0079] Next, combine Figure 3 , the specific process of updating the i+1th initial probability distribution table and obtaining the i+1th updated probability distribution table is explained.
[0080] Figure 3 This is a flow chart of another model updating method provided in the embodiment of the present application. Based on the above embodiment, please refer to Figure 3 , the method comprising:
[0081] S301: Acquire multiple preset word units corresponding to the target model.
[0082] The preset word unit is used to represent the thinking transformation of the target model during the solution process.
[0083] For example, the plurality of preset word elements may include but, wait, however, or, possibly, perhaps, again, let me again, let us again, Wait, Hmm, but, perhaps, alternatively, again, Or, and the like.
[0084] Multiple preset word units corresponding to the target model can be obtained in the storage space.
[0085] S302: Determine the target order corresponding to the target word in the first i output word units.
[0086] The target word is any word among a plurality of preset words.
[0087] The target order is the maximum order of the target word among the first i output words.
[0088] The target order corresponding to the target word-gram may be used to represent the order corresponding to any preset word-gram closest to the (i+1)th output word-gram.
[0089] The order corresponding to at least one target word-unit may be determined in the first i output word-units, and the largest order among the at least one order may be determined as the target order.
[0090] S303: Determine whether the interval between the target order and the corresponding order i+1 is less than a first threshold.
[0091] If yes, execute S304;
[0092] If not, execute S305.
[0093] The interval may be the interval between the target word-gram and the (i+1)th output word-gram.
[0094] The interval between the target order and the corresponding order i+1 may be used to determine whether the interval is smaller than a first threshold.
[0095] S304 : Update multiple word units in the (i+1)th initial probability distribution table to obtain the (i+1)th updated probability distribution table.
[0096] For any word, according to the preset conditions, it can be determined whether the initial prediction value corresponding to the word needs to be updated. If so, the updated prediction value corresponding to the word is obtained. If not, the initial prediction value corresponding to the word is determined as the updated prediction value. According to the updated prediction values corresponding to multiple words, the i+1th update probability distribution table is determined.
[0097] The preset conditions may include whether the initial preset value is less than the second threshold, whether the word unit is a preset word unit, etc., which are not limited here.
[0098] S305: Determine the (i+1)th initial probability distribution table as the (i+1)th updated probability distribution table.
[0099] If the interval between the target order and the i+1 corresponding order is greater than the first threshold, there is no need to update the i+1 th initial probability distribution table.
[0100] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0101] This embodiment provides a model updating method, which obtains multiple preset word elements corresponding to the target model, and the preset word elements are used to represent the target model's thinking transition during the solution process; determines the target order corresponding to the target word element in the first i output word elements, where the target word element is any word element among the multiple preset word elements, and the target order is the maximum order of the target word element in the first i output word elements; determines whether the interval between the target order and the corresponding order of i+1 is less than a first threshold; if so, updates the multiple word elements in the i+1th initial probability distribution table to obtain the i+1th updated probability distribution table; if not, determines the i+1th initial probability distribution table as the i+1th updated probability distribution table. In this way, by introducing a judgment mechanism of preset word elements and target order, the probability distribution of the model's output word elements is dynamically adjusted, so that the model can explore each reasoning idea more deeply when facing complex problems, avoids prematurely abandoning a potentially correct reasoning direction, reduces invalid content generated by frequent switching of ideas, makes the reasoning process more efficient, and improves the accuracy of the model output results.
[0102] Next, combine Figure 4 , the specific process of updating multiple word units in the i+1th initial probability distribution table and obtaining the i+1th updated probability distribution table is explained.
[0103] Figure 4 This is a flow chart of another model updating method provided in the embodiment of the present application. Based on the above embodiment, please refer to Figure 4 , the method comprising:
[0104] S401: For any word-gram, determine whether the word-gram is a preset word-gram.
[0105] If yes, execute S402;
[0106] If not, execute S407.
[0107] The preset word element can be used to represent the thinking transition of the target model during the solution process.
[0108] S402: Determine whether the initial prediction value corresponding to the word is less than a second threshold value, and obtain a determination result.
[0109] The second threshold may be a preset value.
[0110] The initial prediction value can be used to represent the original prediction value output by the target model without normalization.
[0111] For example, the initial prediction value can be the log probability vector corresponding to the word.
[0112] The judgment result may include that the initial prediction value is less than the second threshold value, and that the initial prediction value is greater than or equal to the second threshold value.
[0113] S403: Determine a first correction coefficient according to the target order.
[0114] The first correction coefficient may be a coefficient for correcting the initial prediction value according to the distance from the last thought switching position.
[0115] The closer the current position is to the last path switch, the larger the value of the first correction coefficient.
[0116] A first mapping table may be obtained, and a first correction coefficient may be determined according to the interval between the target order and the i+1 corresponding order and the first mapping table.
[0117] The first mapping table may include multiple intervals and a first correction coefficient corresponding to each interval.
[0118] Optionally, the first correction coefficient can be determined according to the target order in the following manner: obtain a first preset parameter corresponding to the first correction coefficient; determine a first difference between the first preset maximum value and the first preset minimum value; determine the interval between the target order and the order corresponding to i+1; determine a first factor based on the interval and the first threshold; determine a first numerical value based on the first difference and the product of the first factor and the first preset coefficient; and determine the difference between the first preset maximum value and the first numerical value as the first correction coefficient.
[0119] The first preset parameter includes a first preset maximum value and a first preset minimum value.
[0120] For example, the first correction coefficient can be determined by the following formula :
[0121]
[0122] in, and are the maximum and minimum values set artificially, t last is the target order, t is the corresponding order of i+1, and a is a constant.
[0123] a can be used to indicate that only the preset word that appears again within the range of a of the preset word of the last idea switch will be punished. The larger the value of a, the wider the penalty range for the initial prediction value and the stronger the penalty.
[0124] S404: Determine a second correction coefficient according to the order corresponding to i+1.
[0125] The second correction coefficient may be a coefficient used to correct the initial prediction value according to the distance between the current position and the inference starting position.
[0126] When the position corresponding to i+1 is within the starting position range of reasoning, the target model is allowed to switch ideas more flexibly. When the preceding sequence of the position corresponding to i+1 has generated a large number of words, the penalty is increased to reduce the possibility of switching ideas again.
[0127] A second mapping table may be obtained, and a second correction coefficient may be determined according to the order corresponding to i+1 and the second mapping table.
[0128] The second mapping table may include multiple orders and a second correction coefficient corresponding to each order.
[0129] Optionally, the second correction coefficient can be determined according to the order corresponding to i+1 in the following manner: obtain the second preset parameter corresponding to the second correction coefficient; determine the second difference between the second preset maximum value and the second preset minimum value; determine the second factor according to the order corresponding to i+1 and the preset length; determine the product of the second difference, the second factor and the second preset coefficient as the second numerical value; and determine the difference between the second preset maximum value and the second numerical value as the second correction coefficient.
[0130] The second preset parameter includes a second preset maximum value and a second preset minimum value.
[0131] For example, the second correction coefficient can be determined by the following formula :
[0132]
[0133] in, and are the maximum and minimum values set artificially, t max is the maximum output length of the target model, and t is the order corresponding to i+1.
[0134] The farther the current position is from the starting position, the larger the value of the second correction coefficient is, and the stronger the penalty for the initial prediction value is.
[0135] S405. When the judgment result is that the initial prediction value is less than the second threshold, determine the product value of the first correction coefficient, the second correction coefficient and the third threshold, subtract the product value from the initial prediction value, and obtain the updated prediction value corresponding to the word.
[0136] When the judgment result is that the initial prediction value is less than the second threshold, a subtraction algorithm can be used to implement a stronger penalty on the initial prediction value to obtain a smaller updated prediction value.
[0137] The third threshold may indicate the severity of the punishment.
[0138] The larger the third threshold, the greater the penalty.
[0139] S406. When the judgment result is that the initial prediction value is greater than or equal to the second threshold, the product value of the initial prediction value, the first correction coefficient, the second correction coefficient and the fourth threshold is determined as the updated prediction value corresponding to the word.
[0140] After executing S406 , execute S408 .
[0141] When the judgment result is that the initial prediction value is greater than or equal to the second threshold, a stronger penalty can be imposed on the initial prediction value through a multiplication algorithm to obtain a smaller updated prediction value.
[0142] The fourth threshold may be determined according to the initial prediction value.
[0143] Among them, when the initial prediction value is greater than 0, the fourth threshold is the first preset value, and when the initial prediction value is less than or equal to 0, the fourth threshold is the second preset value. The first preset value and the second preset value are reciprocals of each other, and the second preset value is a number greater than 1.
[0144] The larger the second preset value, the greater the penalty.
[0145] S407: Determine the initial prediction value corresponding to the word-gram as the updated prediction value corresponding to the word-gram.
[0146] S408 : Determine the (i+1)th update probability distribution table according to the update prediction values corresponding to the multiple word-units.
[0147] The (i+1)th update probability distribution table may include update prediction values corresponding to a plurality of word-units.
[0148] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0149] This embodiment provides a model updating method, which determines, for any word-gram, whether the word-gram is a preset word-gram; if so, determines whether the initial prediction value corresponding to the word-gram is less than a second threshold value, obtains a judgment result, and determines a first correction coefficient according to the target order; determines a second correction coefficient according to the order corresponding to i+1; when the judgment result is that the initial prediction value is less than the second threshold value, determines the product value of the first correction coefficient, the second correction coefficient and the third threshold value, subtracts the product value from the initial prediction value to obtain an updated prediction value corresponding to the word-gram; when the judgment result is that the initial prediction value is greater than or equal to the second threshold value, determines the product value of the initial prediction value, the first correction coefficient, the second correction coefficient and the fourth threshold value as the updated prediction value corresponding to the word-gram; if not, determines the initial prediction value corresponding to the word-gram as the updated prediction value corresponding to the word-gram; and determines the i+1th update probability distribution table based on the updated prediction values corresponding to multiple word-grams. In this way, by updating the probability distribution table, the penalty reduces the number of thought switching tokens and increases the interval between thoughts, thereby penalizing thought switching during the reasoning decoding process, thereby encouraging the model to more fully elaborate each reasoning idea before considering alternative ideas, and improving the accuracy of the model output results.
[0150] Next, combine Figure 5 The specific process of determining the first indicator value based on multiple historical output results is explained. The historical output results include at least one idea data and result data.
[0151] Figure 5 This is a flow chart of another model updating method provided in the embodiment of the present application. Based on the above embodiment, please refer to Figure 5 , the method comprising:
[0152] S501: For any historical output result, analyze and process the result data corresponding to the historical output result to determine whether the result data is analyzed correctly.
[0153] If yes, execute S502;
[0154] If not, execute S503.
[0155] For example, the analysis process may include analyzing grammatical errors or semantic incoherence in the generated text of the result data, analyzing whether there are samples with target model prediction errors, and analyzing the deviation between the result data and the real data.
[0156] S502: Determine that the first score corresponding to the historical output result is 0.
[0157] If the target model switches many rounds during the thinking process but can still obtain correct result data, the thinking process of the target model is not considered redundant, and the first score corresponding to the historical output result is determined to be 0.
[0158] If the target model obtains an incorrect final result after multiple rounds of switching ideas, but has never obtained the correct answer in the intermediate thinking process, this is not a problem caused by the overthinking phenomenon of the large language model, then the first score corresponding to the historical output result is determined to be 0.
[0159] S503: Analyze and process at least one piece of thought data to determine whether there is correct thought data.
[0160] If it exists, execute S504;
[0161] If it does not exist, execute S502.
[0162] The analysis process may include grammatical errors or semantic incoherence in the generated text of the thought data, analyzing whether there are samples with target model prediction errors, and analyzing the deviation between the result data and the real data.
[0163] The at least one piece of thought data may be analyzed and processed, and it may be determined whether there is any thought data that is correctly analyzed in the at least one piece of thought data.
[0164] S504: Determine a first score corresponding to the historical output result according to at least one idea data.
[0165] The first score may be used to indicate the degree to which the target model overthinks during the solution process in the historical output results.
[0166] Optionally, the first word unit number corresponding to the analysis error idea data can be determined, the total word unit number corresponding to the historical output result can be determined, and the ratio of the first word unit number to the total word unit number can be determined as the first score corresponding to the historical output result.
[0167] Optionally, the first score corresponding to the historical output result can be determined based on at least one idea data in the following manner: determine the total number of word units corresponding to the historical output result; determine the target number of word units corresponding to the target idea data; determine a first ratio of the target number of word units to the total number of word units; and determine the difference between 1 and the first ratio as the first score corresponding to the historical output result.
[0168] The target idea data is the first correctly analyzed idea data in the historical output results, and the target word number is the word number corresponding to when the target idea data is output.
[0169] S505: Determine a first indicator value according to first scores corresponding to the plurality of historical output results.
[0170] The first scores corresponding to the multiple historical output results can be added together to determine a first total value, the number of results corresponding to the multiple historical output results can be determined, and the ratio between the first total value and the number of results can be determined as the first indicator value.
[0171] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0172] This embodiment provides a model updating method that, for any historical output result, analyzes and processes the result data corresponding to the historical output result to determine whether the result data is analyzed correctly; if so, determines that the first score corresponding to the historical output result is 0; if not, analyzes and processes at least one piece of thought data to determine whether there is correct thought data; if so, determines the first score corresponding to the historical output result based on the at least one piece of thought data; if not, determines that the first score corresponding to the historical output result is 0; and determines a first index value based on the first scores corresponding to multiple historical output results. In this way, if the target model obtains an incorrect final result after multiple rounds of thought switching, but the correct answer was obtained in the intermediate thinking process, the severity of overthinking is measured by the first index value to determine the status of the target model.
[0173] Next, combine Figure 6 The specific process of determining the second indicator value based on multiple historical output results is explained. The historical output results include at least one idea data and result data.
[0174] Figure 6 This is a flow chart of another model updating method provided in the embodiment of the present application. Based on the above embodiment, please refer to Figure 6 , the method comprising:
[0175] S601: Analyze and process any historical output result to determine multiple solution ideas corresponding to the historical output result and a generation order corresponding to each solution idea.
[0176] Solution ideas can be multiple possible thinking paths explored by the target model during the reasoning process.
[0177] The generation order can be a time sequence or a logical sequence.
[0178] The text corresponding to the historical output results can be analyzed and processed to determine multiple solution ideas and the generation order corresponding to each solution idea.
[0179] S602. Sort the multiple solution ideas according to their corresponding generation orders.
[0180] This determines the order of each solution idea in the historical output results.
[0181] S603: Determine the second ratios corresponding to the multiple solution ideas in sequence according to the order of the multiple solution ideas.
[0182] The second ratio can be used to indicate the degree to which the solution idea is not repeated with other ideas.
[0183] Optionally, the second ratios corresponding to the multiple solution ideas can be determined in sequence according to the order of the multiple solution ideas in the following manner: determining the total number of word units corresponding to the historical output results; judging, for the j-th solution idea, whether there is a solution idea in the previous j-1 solution ideas whose similarity to the j-th solution idea is greater than a fifth threshold value; if so, determining the second ratio corresponding to the j-th solution idea to be 0; if not, determining the first number of word units corresponding to the j-th solution idea, and using the ratio between the first number of word units and the total number of word units to determine the second ratio corresponding to the j-th solution idea;
[0184] Among them, j is 1, ..., m, and m is the number of ideas corresponding to multiple solution ideas.
[0185] The fifth threshold value may be a predetermined value.
[0186] Among them, it can be judged in the following way whether there is a solution idea in the first j-1 solution ideas whose similarity with the j-th solution idea is greater than the fifth threshold: judge whether j-1 is greater than 0; if so, determine the similarity between the j-th solution idea and the first j-1 solution ideas respectively, if there is at least one similarity greater than the fifth threshold, then determine that there is a solution idea whose similarity with the j-th solution idea is greater than the fifth threshold, if there is not at least one similarity greater than the fifth threshold, then determine that there is no solution idea whose similarity with the j-th solution idea is greater than the fifth threshold; if not, determine that there is no solution idea whose similarity with the j-th solution idea is greater than the fifth threshold.
[0187] S604: Add the second ratios corresponding to the multiple solution ideas to determine the second score corresponding to the historical output result.
[0188] The second score can be used to indicate the degree of diversity of ideas of the target model in the solution process in the historical output results.
[0189] S605: Determine a second indicator value according to the second scores corresponding to the plurality of historical output results.
[0190] The second indicator value is used to indicate the degree of diversity of ideas in the target model during the solution process.
[0191] The reasoning process repeatedly jumps between several fixed similar solution strategies and cannot lead to the correct ideas to obtain the correct results, which reflects the lack of richness of thinking angles in the large model reasoning process.
[0192] Optionally, the second indicator value can be determined based on the second scores corresponding to multiple historical output results in the following manner: add the second scores corresponding to multiple historical output results to determine the second total value; determine the number of results corresponding to the multiple historical output results; and determine the ratio between the second total value and the number of results as the second indicator value.
[0193] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0194] This embodiment provides a model updating method that analyzes and processes any historical output result, determines multiple solution ideas corresponding to the historical output result, and the generation order corresponding to each solution idea, sorts the multiple solution ideas according to the generation order corresponding to each of the multiple solution ideas, sequentially determines the second ratios corresponding to each of the multiple solution ideas according to the order of the multiple solution ideas, adds the second ratios corresponding to each of the multiple solution ideas, determines a second score corresponding to the historical output result, and determines a second index value based on the second scores corresponding to each of the multiple historical output results. In this way, the diversity of solution ideas can be measured by the second index value to determine the state of the target model.
[0195] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0196] Figure 7 This is a schematic diagram of the structure of a model updating device provided in an embodiment of the present application. Figure 7 The model updating device 700 includes an acquisition module 701 , a determination module 702 and an output module 703 .
[0197] The acquisition module 701 is used to obtain the current input data of the target model;
[0198] Determination module 702, configured to determine a current state of the target model, where the current state includes a normal state and an abnormal state. The current state is determined based on a first indicator value and a second indicator value of the target model, where the first indicator value indicates the degree of overthinking of the target model during the solution process, and the second indicator value indicates the degree of diversity of ideas of the target model during the solution process;
[0199] Output module 703 is used to update the probability distribution table corresponding to the target model when the current state of the target model is an abnormal state, and to process the current input data according to the target model and the updated probability distribution table to obtain the current output result. The probability distribution table is used to indicate the probability of each word in multiple words being the output word.
[0200] In a possible implementation, the output module 703 is specifically configured to:
[0201] Analyze and process the current input data through the target model to determine the first initial probability distribution table, and generate the first output word based on the first initial probability distribution table;
[0202] Determine an i+1th initial probability distribution table based on the first i output word-grams, where the i+1th initial probability distribution table is used to indicate the initial probability that each word-gram in the plurality of word-grams is the i+1th output word-gram;
[0203] Update the i+1th initial probability distribution table to obtain the i+1th updated probability distribution table, and generate the i+1th output word based on the i+1th updated probability distribution table;
[0204] Here, i is 1, 2, ..., n, until the n-th output word element meets the preset termination condition, and the current output result is determined based on the n output word elements.
[0205] In a possible implementation, the output module 703 is specifically configured to:
[0206] Obtain multiple preset word units corresponding to the target model, where the preset word units are used to represent the idea conversion of the target model during the solution process;
[0207] Determine a target order corresponding to a target word among the first i output words, where the target word is any one of a plurality of preset words, and the target order is the maximum order of the target word among the first i output words;
[0208] Determine whether the interval between the target order and the corresponding order i+1 is less than a first threshold;
[0209] If yes, then update the multiple word-units in the i+1th initial probability distribution table to obtain the i+1th updated probability distribution table;
[0210] If not, the i+1th initial probability distribution table is determined as the i+1th updated probability distribution table.
[0211] In a possible implementation, the output module 703 is specifically configured to:
[0212] For any word, determine whether the word is a preset word;
[0213] If so, determining whether the initial prediction value corresponding to the word-unit is less than a second threshold, obtaining a determination result, and determining an updated prediction value corresponding to the word-unit based on the determination result and the initial prediction value corresponding to the word-unit;
[0214] If not, the initial prediction value corresponding to the word-unit is determined as the updated prediction value corresponding to the word-unit;
[0215] According to the update prediction values corresponding to the multiple word-units, an (i+1)th update probability distribution table is determined.
[0216] In a possible implementation, the output module 703 is specifically configured to:
[0217] Determine the first correction coefficient according to the target order;
[0218] Determine the second correction coefficient according to the order corresponding to i+1;
[0219] If the initial prediction value is less than the second threshold, determining a product value of the first correction coefficient, the second correction coefficient, and the third threshold, and subtracting the product value from the initial prediction value to obtain an updated prediction value corresponding to the word;
[0220] When the judgment result is that the initial prediction value is greater than or equal to the second threshold, the product value of the initial prediction value, the first correction coefficient, the second correction coefficient and the fourth threshold is determined as the updated prediction value corresponding to the word.
[0221] In a possible implementation, the output module 703 is specifically configured to:
[0222] Obtaining a first preset parameter corresponding to the first correction coefficient, the first preset parameter including a first preset maximum value and a first preset minimum value;
[0223] determining a first difference between a first preset maximum value and a first preset minimum value;
[0224] Determine the interval between the target order and the corresponding order of i+1;
[0225] determining a first factor according to the interval and the first threshold;
[0226] Determine a first value according to the first difference and the product of the first factor and the first preset coefficient;
[0227] The difference between the first preset maximum value and the first value is determined as a first correction coefficient.
[0228] In a possible implementation, the output module 703 is specifically configured to:
[0229] Obtaining a second preset parameter corresponding to the second correction coefficient, where the second preset parameter includes a second preset maximum value and a second preset minimum value;
[0230] determining a second difference between a second preset maximum value and a second preset minimum value;
[0231] Determine the second factor according to the order and preset length corresponding to i+1;
[0232] determining a second value by multiplying the second difference, the second factor, and the second preset coefficient;
[0233] The difference between the second preset maximum value and the second value is determined as the second correction coefficient.
[0234] In one possible implementation, the fourth threshold is determined based on the initial prediction value;
[0235] Among them, when the initial prediction value is greater than 0, the fourth threshold is the first preset value, and when the initial prediction value is less than or equal to 0, the fourth threshold is the second preset value. The first preset value and the second preset value are reciprocals of each other, and the second preset value is a number greater than 1.
[0236] In a possible implementation, the determining module 702 is specifically configured to:
[0237] Obtain multiple historical output results of the target model;
[0238] Determining a first indicator value and a second indicator value based on a plurality of historical output results;
[0239] A current state of the target model is determined according to the first indicator value and the second indicator value.
[0240] In a possible implementation, the historical output result includes at least one idea data and result data, and the determination module 702 is specifically configured to:
[0241] For any historical output result, analyze and process the result data corresponding to the historical output result to determine whether the result data is analyzed correctly;
[0242] If so, determine that the first score corresponding to the historical output result is 0;
[0243] If not, analyze and process the at least one piece of thought data to determine whether there is correct thought data; if so, determine a first score corresponding to the historical output result based on the at least one piece of thought data; if not, determine the first score corresponding to the historical output result to be 0;
[0244] A first indicator value is determined according to first scores corresponding to the plurality of historical output results.
[0245] In a possible implementation, the determining module 702 is specifically configured to:
[0246] Determine the total number of tokens corresponding to the historical output results;
[0247] Determine the target number of word units corresponding to the target idea data. The target idea data is the first correctly analyzed idea data in the historical output results. The target number of word units is the number of word units corresponding to the target idea data when it is output.
[0248] determining a first ratio of the target word number to the total word number;
[0249] The difference between 1 and the first ratio is determined as the first score corresponding to the historical output result.
[0250] In a possible implementation, the determining module 702 is specifically configured to:
[0251] For any historical output result, analyze and process the historical output result to determine multiple solution ideas corresponding to the historical output result and the generation order corresponding to each solution idea;
[0252] Determining a second score corresponding to the historical output result based on the multiple solution ideas and the generation order corresponding to each solution idea;
[0253] A second indicator value is determined according to the second scores respectively corresponding to the plurality of historical output results.
[0254] In a possible implementation, the determining module 702 is specifically configured to:
[0255] Sort multiple solution ideas according to their corresponding generation order;
[0256] Determine the second ratios corresponding to the plurality of solution ideas in sequence according to the order of the plurality of solution ideas;
[0257] The second ratios corresponding to the multiple solution ideas are added together to determine the second score corresponding to the historical output result.
[0258] In a possible implementation, the determining module 702 is specifically configured to:
[0259] Determine the total number of tokens corresponding to the historical output results;
[0260] According to the order of multiple solution ideas, for the j-th solution idea, determine whether there is a solution idea in the first j-1 solution ideas whose similarity with the j-th solution idea is greater than the fifth threshold;
[0261] If so, the second ratio corresponding to the j-th solution idea is determined to be 0;
[0262] If not, determine the first word unit number corresponding to the j-th solution idea, and use the ratio between the first word unit number and the total word unit number to determine the second ratio corresponding to the j-th solution idea;
[0263] Among them, j is 1, ..., m, and m is the number of ideas corresponding to multiple solution ideas.
[0264] In a possible implementation, the determining module 702 is specifically configured to:
[0265] Determine whether j-1 is greater than 0;
[0266] If so, determine the similarity between the j-th solution idea and the previous j-1 solution ideas respectively. If there is at least one similarity greater than the fifth threshold, then determine that there is a solution idea with a similarity greater than the fifth threshold to the j-th solution idea. If there is not at least one similarity greater than the fifth threshold, then determine that there is no solution idea with a similarity greater than the fifth threshold to the j-th solution idea.
[0267] If not, it is determined that there is no solution whose similarity to the j-th solution is greater than the fifth threshold.
[0268] In a possible implementation, the determining module 702 is specifically configured to:
[0269] Adding the second scores corresponding to the plurality of historical output results to determine a second total value;
[0270] Determine the number of results corresponding to multiple historical output results;
[0271] A ratio between the second total value and the number of results is determined as a second index value.
[0272] In a possible implementation, the determining module 702 is specifically configured to:
[0273] Determining a first weight value of the first indicator value according to a first preset weight corresponding to the first indicator value;
[0274] Determining a second weight value of the second indicator value according to a second preset weight corresponding to the second indicator value;
[0275] A current state of the target model is determined according to the first weight value and the second weight value.
[0276] For the description of the features in the embodiment corresponding to the model updating device, reference can be made to the relevant description of the embodiment corresponding to the model updating method, which will not be repeated here.
[0277] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes: at least one processor 801 and a memory 802. Optionally, the device 80 further includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected via a bus.
[0278] During the specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 802, so that the at least one processor 801 executes the above-mentioned model updating method embodiment.
[0279] The specific implementation process of the processor 801 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0280] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0281] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0282] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0283] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above-mentioned model updating method embodiments when running.
[0284] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0285] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above-mentioned model updating method embodiments are implemented.
[0286] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned model updating method embodiments are implemented.
[0287] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0288] The above is a detailed introduction to a model updating method provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A model updating method, characterized in that: include: Get the current input data of the target model input; Determine a current state of the target model, the current state including a normal state and an abnormal state, the current state being determined based on a first indicator value and a second indicator value of the target model, the first indicator value being used to indicate the degree of overthinking of the target model during the solution process, and the second indicator value being used to indicate the degree of diversity of thinking of the target model during the solution process; overthinking means that the target model obtains a final result after multiple rounds of switching thinking, but the correct thinking process has already been obtained in the intermediate thinking process; insufficient diversity of thinking means that the reasoning process repeatedly jumps between multiple fixed similar solution strategies and cannot be guided to the correct thinking to obtain the correct result; When the current state of the target model is the abnormal state, the probability distribution table corresponding to the target model is updated, and the current input data is processed according to the target model and the updated probability distribution table to obtain the current output result. The probability distribution table is used to indicate the probability of each word in a plurality of words being an output word.
2. The method according to claim 1, characterized in that Updating the probability distribution table corresponding to the target model, and processing the current input data according to the target model and the updated probability distribution table to obtain a current output result, including: Analyzing and processing the current input data using the target model to determine a first initial probability distribution table, and generating a first output word based on the first initial probability distribution table; Determining an i+1th initial probability distribution table based on the first i output word-grams, wherein the i+1th initial probability distribution table is used to indicate an initial probability that each word-gram in the plurality of word-grams is the i+1th output word-gram; Updating the i+1th initial probability distribution table to obtain an i+1th updated probability distribution table, and generating an i+1th output word element based on the i+1th updated probability distribution table; Here, i is 1, 2, ..., n, until the n-th output word element meets the preset termination condition, and the current output result is determined based on the n output word elements.
3. The method according to claim 2, characterized in that The i+1th initial probability distribution table is updated to obtain the i+1th updated probability distribution table, including: Acquire a plurality of preset word units corresponding to the target model, wherein the preset word units are used to represent the idea conversion of the target model in the solution process; Determining a target order corresponding to a target word among the first i output words, where the target word is any one of the plurality of preset words, and the target order is the maximum order of the target word among the first i output words; Determine whether the interval between the target order and the i+1 corresponding order is less than a first threshold; If so, update the multiple word units in the i+1th initial probability distribution table to obtain the i+1th updated probability distribution table; If not, the (i+1)th initial probability distribution table is determined as the (i+1)th updated probability distribution table.
4. The method according to claim 3, characterized in that The multiple word units in the (i+1)th initial probability distribution table are updated to obtain the (i+1)th updated probability distribution table, including: For any word-gram, determining whether the word-gram is the preset word-gram; If yes, determining whether the initial prediction value corresponding to the word-gram is less than a second threshold value, obtaining a determination result, and determining an updated prediction value corresponding to the word-gram based on the determination result and the initial prediction value corresponding to the word-gram; If not, determining the initial prediction value corresponding to the word-gram as the updated prediction value corresponding to the word-gram; The (i+1)th update probability distribution table is determined according to the update prediction values corresponding to the multiple word-units.
5. The method according to claim 4, characterized in that Determining an updated prediction value corresponding to the word-gram according to the judgment result and the initial prediction value corresponding to the word-gram includes: determining a first correction coefficient according to the target order; Determine a second correction coefficient according to the order corresponding to the i+1; If the judgment result is that the initial prediction value is less than the second threshold, determining a product value of the first correction coefficient, the second correction coefficient, and a third threshold, and subtracting the product value from the initial prediction value to obtain an updated prediction value corresponding to the word-gram; When the judgment result is that the initial prediction value is greater than or equal to the second threshold, the product value of the initial prediction value, the first correction coefficient, the second correction coefficient and the fourth threshold is determined as the updated prediction value corresponding to the word.
6. The method according to claim 5, characterized in that Determining a first correction coefficient according to the target order includes: Obtaining a first preset parameter corresponding to the first correction coefficient, where the first preset parameter includes a first preset maximum value and a first preset minimum value; determining a first difference between the first preset maximum value and the first preset minimum value; Determine the interval between the target sequence and the i+1 corresponding sequence; determining a first factor according to the interval and the first threshold; Determine a first value according to the product of the first difference, the first factor and the first preset coefficient; The difference between the first preset maximum value and the first value is determined as a first correction coefficient.
7. The method according to claim 5, characterized in that Determining a second correction coefficient according to the order corresponding to the i+1 includes: Obtaining a second preset parameter corresponding to the second correction coefficient, where the second preset parameter includes a second preset maximum value and a second preset minimum value; determining a second difference between the second preset maximum value and the second preset minimum value; Determine the second factor according to the order and preset length corresponding to the i+1; determining a second value by multiplying the second difference, the second factor, and the second preset coefficient; The difference between the second preset maximum value and the second value is determined as a second correction coefficient.
8. The method according to any one of claims 5 to 7, characterized in that: The fourth threshold is determined according to the initial prediction value; Among them, when the initial prediction value is greater than 0, the fourth threshold is a first preset value, and when the initial prediction value is less than or equal to 0, the fourth threshold is a second preset value, the first preset value and the second preset value are reciprocals of each other, and the second preset value is a number greater than 1.
9. The method according to any one of claims 1 to 7, characterized in that Determining a current state of the target model includes: Obtaining multiple historical output results of the target model; determining the first indicator value and the second indicator value according to the plurality of historical output results; A current state of the target model is determined according to the first indicator value and the second indicator value.
10. The method according to claim 9, characterized in that The historical output results include at least one idea data and result data. Determining the first indicator value based on the multiple historical output results includes: For any historical output result, analyzing and processing the result data corresponding to the historical output result to determine whether the result data is analyzed correctly; If so, determining that the first score corresponding to the historical output result is 0; If not, analyzing and processing the at least one piece of thought data to determine whether there is correct thought data; if so, determining a first score corresponding to the historical output result based on the at least one piece of thought data; if not, determining the first score corresponding to the historical output result to be 0; The first indicator value is determined according to the first scores respectively corresponding to the multiple historical output results.
11. The method according to claim 10, characterized in that Determining, according to the at least one idea data, a first score corresponding to the historical output result includes: Determining the total number of word units corresponding to the historical output results; Determining a target number of word units corresponding to target train of thought data, wherein the target train of thought data is the first train of thought data correctly analyzed in the historical output results, and the target number of word units is the number of word units corresponding to when the target train of thought data is output; determining a first ratio of the target word-unit number to the total word-unit number; The difference between 1 and the first ratio is determined as a first score corresponding to the historical output result.
12. The method according to claim 9, characterized in that Determining the second indicator value according to the multiple historical output results includes: For any historical output result, the historical output result is analyzed and processed to determine multiple solution ideas corresponding to the historical output result and the generation order corresponding to each solution idea; Determining a second score corresponding to the historical output result according to the multiple solution ideas and the generation order corresponding to each solution idea; The second indicator value is determined according to the second scores respectively corresponding to the multiple historical output results.
13. The method according to claim 12, characterized in that Determining a second score corresponding to the historical output result according to the multiple solution ideas and the generation order corresponding to each solution idea includes: Sorting the multiple solution ideas according to the generation order corresponding to the multiple solution ideas; Determining, in order of the plurality of solution ideas, the second ratios corresponding to the plurality of solution ideas respectively; The second ratios corresponding to the multiple solution ideas are added together to determine a second score corresponding to the historical output result.
14. The method according to claim 13, characterized in that Determining, in order of the plurality of solution ideas, second ratios corresponding to the plurality of solution ideas respectively, includes: Determining the total number of word units corresponding to the historical output results; According to the order of the multiple solution ideas, for the j-th solution idea, determine whether there is a solution idea among the first j-1 solution ideas whose similarity with the j-th solution idea is greater than a fifth threshold; If so, determining that the second ratio corresponding to the j-th solution idea is 0; If not, determining a first word unit number corresponding to the j-th solution idea, and using the ratio between the first word unit number and the total word unit number to determine a second ratio corresponding to the j-th solution idea; Here, j is 1, ..., m, and m is the number of ideas corresponding to the multiple solution ideas.
15. The method according to claim 14, characterized in that Determining whether there is a solution among the first j-1 solution ideas whose similarity to the j-th solution idea is greater than a fifth threshold includes: Determine whether j-1 is greater than 0; If so, determine the similarity between the j-th solution idea and the previous j-1 solution ideas respectively. If there is at least one similarity greater than the fifth threshold, determine that there is a solution idea with a similarity greater than the fifth threshold to the j-th solution idea. If there is not at least one similarity greater than the fifth threshold, determine that there is no solution idea with a similarity greater than the fifth threshold to the j-th solution idea. If not, it is determined that there is no solution whose similarity to the j-th solution is greater than a fifth threshold.
16. The method according to any one of claims 12 to 15, characterized in that: Determining the second indicator value according to the second scores respectively corresponding to the plurality of historical output results includes: Adding the second scores corresponding to the plurality of historical output results to determine a second total value; Determining the number of results corresponding to the multiple historical output results; A ratio between the second total value and the number of results is determined as a second index value.
17. The method according to claim 9, characterized in that Determining a current state of the target model according to the first indicator value and the second indicator value includes: Determining a first weight value of the first indicator value according to a first preset weight corresponding to the first indicator value; Determining a second weight value of the second indicator value according to a second preset weight corresponding to the second indicator value; A current state of the target model is determined according to the first weight value and the second weight value.
18. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the model updating method according to any one of claims 1 to 17 when executing the computer program.
19. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the model updating method according to any one of claims 1 to 17 are implemented.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the model updating method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Large language model reasoning acceleration method, device and system and medium
CN119067221A
Inference method and device based on large model and program product
CN119990339A