Model training method, system and related apparatus

By scoring the response samples of a large language model and dynamically generating targeted question samples using negative correlations, the problem that training datasets cannot accurately locate weaknesses in existing technologies is solved, achieving efficient model training and performance improvement.

CN123180401APending Publication Date: 2026-11-27ANHUI IFLYHEALTH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611147646.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, manually designed training datasets cannot accurately pinpoint the performance weaknesses of large language models, resulting in low training efficiency and a bottleneck in model performance improvement. Furthermore, expanding manually labeled datasets is both costly and inefficient.

Method used

By scoring the response samples output by the target model and utilizing the negative correlation between the score values ​​of the response samples and the score values ​​of the question samples, targeted question samples are dynamically generated. The question generation model is then trained to encourage or inhibit the generation of samples similar to the target question samples, thus achieving targeted training.

Benefits of technology

It improves the relevance and efficiency of model training, eliminates the dependence on fixed sets of manually generated questions, and enhances the model's generalization ability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180401A_ABST
    Figure CN123180401A_ABST
Patent Text Reader

Abstract

The application provides a model training method, system and related device, and relates to the technical field of artificial intelligence. The model training method comprises the following steps: inputting a target problem sample into a target model to obtain a target reply sample output by the target model; scoring the reply sample to obtain a first score value of the reply sample; determining a second score value of the target problem sample according to the first score value of the target reply sample; wherein the score value of the reply sample and the score value of the problem sample are in a negative correlation relationship; and training a question generation model according to the second score value of the target problem sample; wherein the second score value is used to stimulate or inhibit the question generation model to generate a question sample similar to the target problem sample. The technical scheme provided by the application can solve the problem that the model training method in the prior art is difficult to perform targeted training on weak items of a model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a model training method, system, and related apparatus. Background Technology

[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) have demonstrated outstanding performance in natural language understanding, generation, and dialogue interaction, and have been widely applied in various industries such as intelligent customer service, content creation, autonomous driving interaction, and medical consultation.

[0003] In training such models, the design of the training data is the core element that determines the training effect. In current mainstream training schemes, the set of questions (Q-set) in the training dataset is usually constructed manually, that is, technicians manually design a series of questions as training samples according to the application scenario of the model.

[0004] However, manual design cannot accurately pinpoint the model's performance weaknesses, making it difficult to conduct targeted reinforcement training for the model's shortcomings. This results in low training efficiency and a bottleneck in improving model performance. Summary of the Invention

[0005] Based on the aforementioned defects and shortcomings of the prior art, this application proposes a model training method, system, and related apparatus, which can solve the problem that existing model training schemes are unable to target the weaknesses of the model for training.

[0006] According to a first aspect of the embodiments of this application, a model training method is provided, the method comprising: Input the target question sample into the target model to obtain the target response sample output by the target model; wherein, the target question sample includes at least one of text-based question samples and voice-based question samples; The target response sample is scored to obtain a first score value for the target response sample; Based on the first rating value of the target response sample, a second rating value of the target question sample is determined; wherein, the rating values ​​of the response samples and the rating values ​​of the question samples are negatively correlated. The problem generation model is trained based on the second score value of the target problem sample; wherein, the second score value is used to encourage or inhibit the problem generation model from generating problem samples similar to the target problem sample; the problem samples generated by the problem generation model are used to train the target model.

[0007] According to a second aspect of the embodiments of this application, a model training apparatus is provided, the apparatus comprising: The first training module is used to input the target question sample into the target model and obtain the target response sample output by the target model; wherein, the target question sample includes at least one of text-based question samples and voice-based question samples; The first scoring module is used to score the target response sample and obtain a first score value for the target response sample; The second scoring module is used to determine the second scoring value of the target question sample based on the first scoring value of the target response sample; wherein the scoring value of the response sample and the scoring value of the question sample are negatively correlated. The second training module is used to train the question generation model based on the second score value of the target question sample; wherein the second score value is used to encourage or inhibit the question generation model from generating question samples similar to the target question sample; the question samples generated by the question generation model are used to train the target model.

[0008] According to a third aspect of the embodiments of this application, a model training system is provided, the system comprising: The target model is used to receive a target question sample and output a target response sample corresponding to the target question sample. An evaluation model is used to score the target response sample according to the response evaluation criteria corresponding to the target question sample, to obtain a first score value of the target response sample; and to determine a second score value of the target question sample based on the first score value of the target response sample; wherein, there is a negative correlation between the score value of the response sample and the score value of the question sample; A question generation model is used to output new question samples based on a second score value of the question sample and question generation prompt words; wherein, the second score value is used to encourage or inhibit the question generation model from generating question samples similar to the target question sample; the question samples generated by the question generation model are used to train the target model.

[0009] According to a fourth aspect of the present application, an electronic device is provided, including a memory and a processor; the memory is connected to the processor and is used to store a program; the processor is used to implement the model training method as described in the first aspect by running the program in the memory.

[0010] According to a fifth aspect of the embodiments of this application, a storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method described in the first aspect.

[0011] According to a sixth aspect of the embodiments of this application, a computer program product or a computer program is provided, the computer program product including the computer program, wherein a processor executes the computer program to implement the steps in the method as described in the first aspect.

[0012] In the technical solution provided in this application, the response samples output by the trained target model are scored, and the question samples are scored based on the scoring results of the response samples. Then, the question generation model is trained based on the scoring results of the question samples. There is a negative correlation between the score of the response samples and the score of the question samples. If the target model's response score for a question is lower, it indicates that the question exposes the target model's weaknesses more effectively, resulting in a higher question score. This leads to a higher reward for the question generation model, incentivizing it to continuously generate such targeted questions that address its weaknesses. Conversely, if the target model's response score for a question is higher, it indicates that the question is a strength of the target model, resulting in a lower question score. This leads to a lower reward for the question generation model, inhibiting it from generating questions that do not significantly improve the target model. In this way, the question generation model can dynamically generate question samples targeting the performance weaknesses of the target model based on its response performance, achieving targeted reinforcement of the training data. This allows for targeted training of the model's weaknesses, improving training efficiency and performance, while eliminating reliance on a fixed set of manually generated questions. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0014] Figure 1 This is a flowchart illustrating a model training method provided in an embodiment of this application.

[0015] Figure 2 This is a block diagram of a model training system provided in an embodiment of this application.

[0016] Figure 3 This is a block diagram of a model training device provided in an embodiment of this application.

[0017] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] Application Overview For training large language models (hereinafter referred to as large models), reinforcement learning (RL) is one of the key technologies to improve the performance of large models. By constructing an interaction mechanism of "agent-environment-reward", the model optimizes decision-making and generation strategies in continuous training iterations, which significantly improves the model's adaptability to complex scenarios and the reliability of output results.

[0020] In existing large-scale reinforcement learning training techniques, the construction of training data is one of the core steps determining training effectiveness. In current mainstream reinforcement learning training schemes, the problem set (Q-set) in the training dataset is typically constructed manually, meaning that technicians manually design a series of questions as training samples based on the model's application scenario. This fixed training data construction mode has significant limitations: manual design cannot accurately pinpoint the model's performance weaknesses, nor can it achieve targeted reinforcement training for model shortcomings, resulting in low training efficiency and a bottleneck in model performance improvement.

[0021] To address these issues, the industry has attempted to increase the coverage of training data by expanding manually labeled datasets. However, this approach not only requires significant manpower and material resources but also suffers from low labeling efficiency, making it difficult to keep up with the rapid iteration needs of large models. Furthermore, simply expanding the dataset size is insufficient to address the core issue of targeted reinforcement and cannot fundamentally improve the training efficiency and model performance of reinforcement learning.

[0022] To address this, this application provides a solution that scores the response samples output by the trained target model, scores the question samples based on the negative correlation between the score values ​​of the response samples and the score values ​​of the question samples, and then trains the question generation model based on the score results of the question samples. This allows the question generation model to accurately identify the weaknesses of the target model based on its response performance and dynamically generate question samples that expose the performance shortcomings of the target model, thus enabling better targeted training to address these shortcomings.

[0023] Exemplary methods This application provides a model training method applied to an electronic device, in which a model to be trained can be deployed and the training method for the model can be executed.

[0024] The electronic device can be a terminal device or a server. When the electronic device is a terminal device, it may include, but is not limited to, smartphones, tablets, laptops, desktop computers, and in-vehicle terminals. When the electronic device is a server, it may include, but is not limited to, independent physical servers, server clusters or distributed systems composed of multiple physical servers, and cloud servers capable of providing cloud services.

[0025] The method is described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0026] like Figure 1 As shown, the model training method may include steps 101 to 103, as described below.

[0027] Step 101: Input the target question sample into the target model to obtain the target response sample output by the target model.

[0028] The target model described here, also known as the policy model, is one of the trained models used to output corresponding responses based on user input. For example, if a user inputs "How's the weather today?", the target model would output the response: "The weather is great today, sunny and perfect for outdoor activities." This target model can be a large language model, a multimodal large language model, or other AI models capable of question-and-answer functionality. Applications of this target model include, but are not limited to: medical consultation, intelligent customer service, intelligent cockpit voice interaction, and intelligent assistants—any application requiring responses to user questions.

[0029] The target question sample mentioned herein is sample data used to train the target model, and may include at least one of the following: question samples in text form and question samples in speech form. The target question sample may be one of the question samples generated in the same batch by the question generation model. The question generation model can generate corresponding question samples based on question generation prompts. The question generation model is another model trained in this application embodiment. The question generation model may be a large language model, a multimodal large language model, or other artificial intelligence models capable of achieving question generation functionality.

[0030] After inputting the target question sample into the target model, the target model can parse the target question sample and output the corresponding response. Based on the response output by the model, the target response sample can be obtained.

[0031] Step 102: Score the target response sample to obtain the first score value of the target response sample.

[0032] In this embodiment, the target model can be trained using reinforcement learning techniques. Therefore, the target response sample can be evaluated based on the pre-trained reward model to obtain its reward value, which is also its first score. Alternatively, the target response sample can be scored using other feasible methods, such as by using pre-set evaluation criteria. These criteria can include multi-dimensional evaluation dimensions, such as accuracy and comprehensiveness, which can be set according to actual needs.

[0033] Step 103: Determine the second score of the target question sample based on the first score of the target response sample.

[0034] There is a negative correlation between the rating of the response sample and the rating of the question sample. Therefore, the larger the first rating of the target response sample, the smaller the second rating of the target question sample; conversely, the smaller the first rating of the target response sample, the larger the second rating of the target question sample.

[0035] Step 104: Train the problem generation model based on the second score of the target problem sample.

[0036] The question generation model described here generates question samples for training the target model.

[0037] In this embodiment, a problem generation model can be trained using reinforcement learning techniques. The second score value of the target problem sample can be used as a problem reward value. Reinforcement learning training of the problem generation model based on the second score value can either incentivize or inhibit the model from generating problem samples similar to the target problem sample.

[0038] If the target model scores lower on a particular question, it indicates that the question exposes the model's weaknesses more effectively, resulting in a higher question score. This leads to a higher reward for the question-generating model, incentivizing it to continuously generate such targeted questions that address these weaknesses. Conversely, if the target model scores higher on a particular question, it indicates that the question is a strength of the target model, resulting in a lower question score. This leads to a lower reward for the question-generating model, discouraging it from generating questions that offer little benefit to the target model's improvement. In this way, the question-generating model can dynamically generate question samples targeting the target model's performance weaknesses based on the model's responses, achieving targeted reinforcement of training data. This allows for targeted training of the model's weaknesses, thereby improving training efficiency and performance. Furthermore, it eliminates the reliance on fixed sets of manually generated questions, overcoming the limitations of existing technologies. Moreover, when the identified weaknesses are found in complex scenarios or edge cases, the technical solution provided in this application can expand the generation of questions for such scenarios, enriching training data and enhancing the model's generalization ability.

[0039] In some alternative embodiments, in order to encourage the problem generation model to generate more diverse bottleneck problems and avoid homogenization of training data, a uniform distribution regularization term for output probability can be added to the subsequent reinforcement learning training optimization objective of the problem generation model to force the policy output to be as dispersed as possible, thereby ensuring the diversity of problems, as described below.

[0040] Step 104: Train the question generation model based on the second score of the target question sample, which may include: The problem generation model is trained based on the second score of the target problem sample and the optimization objective.

[0041] The optimization objective may include a uniform distribution regularization term for the output probability, which is used to constrain the difference between the optimization strategy of the problem generation model and the uniform distribution, that is, to constrain the probability distribution of the model output to approximate the uniform distribution, thereby increasing the diversity of the generated results.

[0042] Optionally, the output probability uniform distribution regularization term can be the product of the KL divergence between the current policy distribution and the uniform distribution of the problem generation model and a preset coefficient, which can be expressed as: .

[0043] in, Indicates a uniform distribution; Indicates the current strategy of the problem generation model; This represents the KL divergence, which measures the degree of difference between the probability distributions of the model outputs. The smaller the value, the closer the distributions are. The adjustable parameter (i.e., the preset coefficient mentioned above) is the uniformly regularized penalty weight, which is used in the early stages of training. It can be set to 0.05; if the generated problems lack diversity, it can be increased. An increase in this value indicates that if the distribution is not even, the total revenue will be reduced more significantly.

[0044] This regularization term is a penalty term used to force the output distribution of the policy to tend towards a uniform distribution, thereby maintaining the diversity of problem samples while generating samples that can expose the shortcomings of the model, and avoiding the homogenization of training data.

[0045] Optionally, the loss function of the problem generation model It can be expressed by the following formula (1): (1) in, Indicates the current strategy of the problem generation model; The reference policy is the initial policy distribution during the model pre-training phase. It is fixed and remains unchanged, meaning it is frozen and fixed during subsequent reinforcement learning training and does not participate in parameter updates. Indicates network parameters; x represents a problem sample (such as a target problem sample) generated by the current strategy. This represents the score of the problem sample; and These are adjustable parameters; Let KL divergence be a metric. It indicates a uniform distribution.

[0046] Indicating in strategy The expected value is the average reward (i.e., score) of all questions generated by the current problem generation model according to the current strategy. This term is a positive reward for the optimization objective, and its role is to guide the problem generation model to continuously generate high-reward questions that can expose the performance shortcomings of the target model, thereby achieving targeted reinforcement and expansion of the training data.

[0047] Used to measure the current policy πθ and the reference policy The difference in probability distribution between them; can be achieved through Punishment optimization strategy Excessive deviation from reference strategy The behavior constrains the strategy to be optimized. Reference Strategy The distribution differences prevent the policy from deviating from the high-quality distribution of pre-training during reinforcement learning training. Optionally, in the early stages of training, It can be set to 0.1. If the quality of the model generation problem is found to be deteriorating, it can be increased. .

[0048] for Please refer to the above description, and I will not repeat it here.

[0049] To better understand the above content, an example will be provided below.

[0050] When the model generates the bottleneck problem, the available problem types include: careless calculation, conceptual confusion, misreading the question, and missing steps. The ideal uniform distribution means that the probability of each class being selected is strictly equal, i.e., [0.25, 0.25, 0.25, 0.25].

[0051] exist Without uniform regularization, assuming a pre-training reference distribution =[0.4,0.3,0.2,0.21], biased towards computationally careless and conceptual confusion problems. In this case, reinforcement learning training primarily aims to maximize the reward R. The system discovers that computationally careless problems are the easiest to score highly, causing the model to tilt its probability, resulting in a post-training policy πθ=[0.85,0.1,0.03,0.02], meaning an 85% probability of generating computationally careless problems, while other types of problems are generated very rarely, leading to highly homogenized training data. The value will be relatively large, meaning that the distributions of the two strategies are quite different.

[0052] exist When uniform regularization is added, the optimization objective will be forcibly reduced. This prevents the model from cramming all probabilities into careless problem categories. After training, the policy is flattened to πθ = [0.32, 0.28, 0.22, 0.18], ensuring stable generation of all four problem categories. The probability differences between categories decrease, increasing the diversity of the problem set. At this point, the uniform KL divergence decreases, and the loss function... There won't be a significant deduction in points.

[0053] In this embodiment, the target model and the question generation model can be trained separately based on response rewards and question rewards. For the target model, the response score corresponding to the question sample is used as the reward signal. By iteratively updating the model parameters, the target model learns to generate responses with higher rewards, improving its adaptability to various types of questions. For the question generation model, the question score is used as the reward signal, and an additional uniform distribution regularization term is added for iterative optimization, enhancing its ability to generate high-reward questions. This means it can better expose the shortcomings and diversity of the target model, achieving adversarial collaborative optimization between the two models. During training, the two models iterate synchronously: new questions generated by the question generation model are continuously input into the target model, and the response performance of the target model is converted into training rewards for both models through an evaluation mechanism, driving the optimization of both models in reverse. During training, the weaknesses of the target model are continuously compensated for, and the shortcomings that the question generation model needs to identify are also in a continuous dynamic iterative process, forming a closed-loop training process of "generation-evaluation-reward-optimization".

[0054] In one embodiment, the training termination conditions for the target model and the problem generation model may include condition 1 and condition 2, and training can be terminated when either condition is met.

[0055] Condition 1 indicates that the problem generation efficiency has failed. This means that the problem generation model generates problem samples in multiple consecutive batches that meet the target conditions. These target conditions include a ratio of the first number to the second number of problem samples greater than or equal to a ratio threshold. The first number is the number of problem samples generated by the problem generation model whose similarity to problem samples in the qualified problem set is greater than or equal to a similarity threshold. The second number is the total number of problem samples generated by the problem generation model. In short, model training stops when the proportion of candidate problems discarded due to unmet similarity conditions in multiple consecutive batches exceeds a preset threshold. In layman's terms, if, after similarity checks, the vast majority of problems generated by the problem generation model in multiple consecutive batches are discarded because they are similar to data in the qualified problem set, and the discard rate consistently exceeds a preset threshold (e.g., 80%), it indicates that the problem generation model is struggling to generate effective new problems, and training data expansion has stagnated. At this point, dual-model training can be stopped, and the final optimized target model and problem generation model can be output.

[0056] Condition 2 indicates that the target model optimization has stalled. This means that the number of times the average score of the response samples output by the target model changes less than or equal to the average score of the question samples generated in the same batch by the question generation model is greater than or equal to a threshold value. In simpler terms, if in multiple consecutive training iterations, the average response reward score of the target model and the average question reward score of the question generation model show no significant change (i.e., the change is below a preset threshold, such as 0.05), it indicates that the two models have reached the optimal balance under the current training framework. Continuing training will not achieve significant optimization. At this point, the dual-model training can be stopped, and the final optimized target model and question generation model can be output.

[0057] Optionally, for the training data of the problem model, the sampling scope can cover two parts: one is the newly added problems to be trained in this round of problem sampling, and the other is the old problems already existing in the dataset of problems to be trained, ensuring that the sampled data takes into account both new and historical task scenarios. The number of samples can be flexibly set according to training needs, and there is no restriction on the quality of responses during the sampling process, so as to cover responses of different quality levels such as excellent, qualified, and unqualified, providing sufficient data support for subsequent comprehensive evaluation of the target model's performance.

[0058] Optionally, before inputting the target problem sample into the target model, the method may further include steps A1 to A3, as described below: Step A1: Input the question generation prompts into the question generation model, and generate multiple question samples through the question generation model.

[0059] In this embodiment, a preset question generation prompt can be used as the input to the question generation model, and the question generation model generates an initial question set based on the input. The initial question set includes multiple question samples.

[0060] For example, if the target task is to train a medical question-answering model, the prompts for generating questions could include: Task area: Consultation on common internal medicine diseases; Target users: The general public without a medical background; Question types: Symptom inquiry, medication guidance, nursing advice; Difficulty level: Basic common sense level, avoid professional in-depth consultation questions; Expression guidelines: Use concise and plain language, avoid piling up technical jargon, and keep the word count of a single question between 10 and 30 words.

[0061] Based on the prompt words generated for this question, the question generation model can generate corresponding question samples in batches. The number of question samples in the same batch can be preset or limited by the prompt words generated for the question.

[0062] Step A2: Perform a reasonableness check on multiple problem samples, remove unreasonable problem samples, and obtain reasonable problem samples.

[0063] To improve the quality of training data, a rationality check can be performed on the generated initial question set, that is, to check whether the question samples in the question set are reasonable.

[0064] The reasonableness check described herein may include, but is not limited to, any one of the following: 1. Verify whether the problem has real-world existence, that is, whether the scenario or need described by the problem is real and feasible in real life, and exclude problems that violate objective laws, such as "how to make a perpetual motion machine"; 2. Check the consistency of the internal instructions of the problem and whether there are any logical conflicts. For example, reject contradictory problems such as "Please write the English instruction manual in Chinese". 3. Assess the reasonableness of the problem requirements and avoid problems that are overly demanding or impossible to complete, such as "generating 50,000 words of medical records" or "listing all cancer treatment drugs in the world," which are beyond the scope of normal processing or have resources that cannot support them. 4. Screen for misleading questions and exclude questions aimed at obtaining advertising recommendations, illegal information, etc., such as "Generate 10 advertising recommendations for a certain product category for me".

[0065] Questions deemed unreasonable are eliminated, while those deemed reasonable are included as reasonable questions in the next round of screening.

[0066] Optionally, the generated question samples can be validated using a pre-trained question validation model. This question validation model can be a large language model, a multimodal large language model, or other artificial intelligence models capable of performing question validation.

[0067] Step A3: Determine the similarity between each reasonable question sample and each question sample in the qualified question set, and remove reasonable question samples whose similarity to any question sample in the qualified question set is greater than or equal to the similarity threshold, to obtain qualified question samples, and add them to the qualified question set.

[0068] The target problem sample is any one of the qualified problem samples.

[0069] To further improve the quality of training data, similarity checks can be performed on reasonable question samples to enhance the uniqueness and diversity of the dataset.

[0070] The qualified question set mentioned here is a collection of question samples that have undergone historical rationality and similarity checks. The question samples in this set may include: question samples generated by the question generation model and / or question samples designed by humans.

[0071] When performing similarity checks, the similarity between each reasonable question sample and each question sample in the qualified question set can be calculated separately. If the similarity between a reasonable question sample and a question sample in the qualified question set is greater than or equal to the similarity threshold (e.g., 0.7, which can be adjusted according to actual needs), then the reasonable question sample is considered a duplicate or similar question sample and can be removed. Conversely, if the similarity between a reasonable question sample and any question sample in the qualified question set is less than the similarity threshold, then the reasonable question sample is considered a non-duplicate or non-similar question sample and can be added to the qualified question set for training the target model.

[0072] For example, if the reasonable question sample to be verified is "How to physically reduce fever when you have a cold", and an existing question sample in the qualified question set is "What are the physical methods to reduce fever", the similarity score between the two is calculated to be 0.82, which is greater than the similarity threshold of 0.7. This indicates that there are similar questions in the qualified question set, so the reasonable question sample to be verified is judged as a similar question and removed. If the similarity between the reasonable question sample to be verified and any question sample in the qualified question set is less than the similarity threshold of 0.7, it means that there are no similar questions in the qualified question set, and it can be added to the qualified question set.

[0073] In one embodiment, the BERTScore method can be used to calculate the similarity between problem samples, as described below.

[0074] The text is encoded using a pre-trained BERT model to obtain word embedding vectors. Specifically, the word embedding vector of the i-th token obtained after encoding the text of the valid question sample x using the BERT model can be represented as x. i A sample of a specific problem in the qualified problem set. The embedding vector of the j-th word obtained after encoding the text using the same BERT model can be represented as: Using the same BERT model ensures consistency in the vector space.

[0075] The similarity calculation principle of BERTScore is as follows: A pre-trained language model is used to extract the token-level context embeddings of the reference text (i.e., the text corresponding to a reasonable question sample) and the candidate text (i.e., the question samples in the qualified question set). The cosine similarity between token pairs is calculated, and a greedy matching is performed. Finally, precision and recall are aggregated. Then, based on precision and recall, a comprehensive metric, the F1 score, is calculated to measure the semantic matching degree (i.e., semantic similarity) between texts. The above can be expressed by the following formulas (2) to (5): (2) (3) (4) (5) in, Indicates the cosine similarity between token pairs; Indicates recall rate; Indicates precision.

[0076] In some alternative embodiments, the target model can output multiple responses for each question sample, the specific number of which can be preset. Correspondingly, the number of target response samples can be multiple, and its number can be less than or equal to the total number of responses output by the target model.

[0077] Based on this, step 103: Determine the second score of the target question sample according to the first score of the target response sample, which may include steps B1 and B2, as described below: Step B1: Determine the average of the first rating values ​​of multiple target response samples.

[0078] Step B2: Determine the difference between 1 and the average value as the second score for the target problem sample.

[0079] The rating values ​​for both the response samples and the question samples are values ​​greater than or equal to 0 and less than or equal to 1.

[0080] When there are multiple target response samples, the score of a target question sample can be calculated by subtracting the average score of all target response samples for that question from 1, as expressed by formula (6): (6) in, This represents the score of the target question sample; K represents the total number of target response samples; This represents the score of the kth target response sample.

[0081] The above achieves an adversarial objective: if the target model's average response score to a certain question is lower, it indicates that the question exposes the target model's weaknesses more effectively, resulting in a higher question score. This leads to a higher reward for the question-generating model, incentivizing it to continuously generate such targeted weakness-focused questions. Conversely, if the target model's average response score to a certain question is higher, it indicates that the question is the target model's strength, resulting in a lower question score. This leads to a lower reward for the question-generating model, inhibiting it from generating questions that do not significantly improve the target model.

[0082] In existing large-scale reinforcement learning training techniques, the design of the reward mechanism is another core element determining the training effect. In constructing the reward mechanism for reinforcement learning, the training of the reward model (RM) also relies on a fixed training dataset. Existing RM models learn from pre-defined question-and-answer pairs (QA pairs) to form evaluation criteria for the model's output. However, due to the limited coverage of QA pairs in the training set, the evaluation dimensions of the RM model are incomplete, easily leading to evaluation loopholes. These loopholes allow the model to learn speculative strategies (i.e., hacking behavior) to obtain higher rewards instead of generating high-quality results that meet actual needs. For example, the model may bypass the RM's evaluation criteria by outputting ambiguous statements or avoiding core questions, severely impacting the training quality of reinforcement learning and the model's practical application performance. Simply expanding the dataset is insufficient to achieve comprehensive coverage and cannot solve the core problem of evaluation loopholes.

[0083] To overcome the above problems, in some optional embodiments, personalized response evaluation criteria can be designed for each question sample, thereby enabling targeted evaluation of the response to each question sample and avoiding the problem of evaluation loopholes caused by the reward model's unfamiliarity with the questions, which may result in missing evaluation dimensions.

[0084] Therefore, step 102: evaluating the target response sample to obtain the first score value of the target response sample may include steps C1 and C2, as described below: Step C1: Obtain the response evaluation criteria corresponding to the target question sample.

[0085] The response evaluation criteria described here are used to evaluate the quality of the target response samples output by the target model for the target problem samples.

[0086] Step C2: Evaluate the target response sample according to the response evaluation criteria to obtain the first score of the target response sample.

[0087] In this embodiment, a pre-trained evaluation model can be used to evaluate the target response sample based on the response evaluation criteria corresponding to the target question sample, thereby obtaining a first score value for the target response sample. For example, the target question sample, the target response sample, and the response evaluation criteria corresponding to the target question sample are used as inputs to the evaluation model. The evaluation model evaluates the target response sample, and the resulting evaluation result serves as the primary basis for reward calculation in the model training step.

[0088] Optionally, the evaluation model can be a large language model, specifically an LLM-as-a-Judge model, which refers to a paradigm that uses a large language model as a judge to automatically evaluate the quality of content generated by other large language models.

[0089] Optionally, the aforementioned response evaluation criteria can be generated by a pre-trained evaluation criterion generation model, or they can be manually set based on the target question samples. Different question samples correspond to different response evaluation criteria.

[0090] When the response evaluation criteria are generated by a pre-trained evaluation criterion generation model (hereinafter referred to as the Rubrics generation model), the evaluation criterion generation model can be a large language model, a multimodal large language model, or other artificial intelligence models that can generate corresponding response evaluation criteria based on question samples.

[0091] Specifically, the target question sample can be input into a pre-trained evaluation criterion generation model, which will then generate a response evaluation criterion corresponding to the target question sample.

[0092] The evaluation criteria for responses may include, but are not limited to, at least one of the following: accuracy evaluation criteria, comprehensiveness evaluation criteria, and communication quality pricing criteria, as well as a veto evaluation criterion, and a weight value corresponding to each evaluation criterion. When a target response sample meets the veto evaluation criterion, the first score of the target response sample is zero.

[0093] For the problem sample, a Rubric generative model can be launched to construct a dedicated evaluation criterion. This evaluation criterion can include at least one of the four positive dimensions, along with a fixed set of veto criteria (also known as veto rules).

[0094] The four positive dimensions can be designed as clear, verifiable "yes / no" conditions and corresponding scoring weights. Specifically, these four positive dimensions may include: accuracy evaluation criteria, comprehensiveness evaluation criteria, communication quality evaluation criteria, and instruction compliance evaluation criteria.

[0095] The accuracy evaluation criteria include whether the response matches the core needs of the problem and is free of factual errors. The comprehensiveness evaluation criteria include whether the response covers the key points of the problem's needs and is free of missing core information. The communication quality evaluation criteria include whether the response is concise and fluent, without ambiguity or redundant expressions. The instruction compliance evaluation criteria include whether the response strictly conforms to the clearly defined format, scope, and other instructions in the problem.

[0096] The veto criteria include at least one of the following: advertising content, content containing unethical information (meeting a pre-defined sensitive word list), or content severely deviating from the topic (off-topic). If a response sample meets any of the veto criteria, its score is zero.

[0097] It should be noted that each dimension's evaluation criteria can also include more specific and lower-level evaluation criteria, and each evaluation criterion has a corresponding weight value.

[0098] The following is an example of a response evaluation criterion built by the Rubric generative model for a specific question.

[0099] Let's say the question is: What should elderly people with high blood pressure pay attention to? The positive evaluation criteria can be as follows: [ { "dimension": "Instructions followed" "Criteria": "The answer directly and clearly focuses on the core issue of 'precautions for hypertension in the elderly'." "weight": 0.05 }, { "dimension": "integrity" "criterion": "Mention lifestyle interventions, and cover at least three of the following: diet (e.g., low salt), exercise, smoking cessation and alcohol limitation, and mental well-being." "weight": 0.08 }, { "dimension": "integrity" "criterion": "It emphasizes the importance of medication, stressing the need to take medication as prescribed and not to stop or change medication without medical advice." "weight": 0.06 }, { "dimension": "integrity" "criterion": "Mentions the importance of regular blood pressure monitoring and suggests recording blood pressure values ​​for the doctor's reference." "weight": 0.06 }, { "dimension": "integrity" "criterion": "Mention that in case of an emergency (such as severe headache, chest tightness, numbness in the limbs, etc.), medical attention should be sought immediately." "weight": 0.05 }, { "dimension": "accuracy" "criterion": "The lifestyle recommendations provided (such as daily salt intake, type and intensity of exercise) are in line with recognized medical guidelines." "weight": 0.1 }, { "dimension": "accuracy" "criterion": "The description of drug treatment is accurate, no specific drugs are recommended, and the principles of medication are correctly explained." "weight": 0.1 }, { "dimension": "accuracy", "criterion": "The listed symptoms (warning signs) that require emergency medical attention are clinically associated with hypertensive crisis or complications." "weight": 0.08 }, { "dimension": "accuracy" "criterion": "Accurately point out the unique characteristics of hypertension management in the elderly, such as the risk of orthostatic hypotension and the potential for individualized blood pressure targets." "weight": 0.07 }, { "dimension": "communication quality" "criterion": "Use plain and easy-to-understand language to avoid or explain technical medical terms (such as 'target organ damage', 'orthostatic hypotension')." "weight": 0.08 }, { "dimension": "communication quality" "criterion": "The answer is clearly structured, using bullet points, lists, or bolding to organize the content, making it easier for older adults to read and understand." "weight": 0.07 }, { "dimension": "communication quality" "criterion": "The writing style should be calm and positive, showing care, rather than harsh or commanding." "weight": 0.05}, ] The veto criteria can be as follows: [ "Answers containing any illegal, discriminatory, or unethical content." The answer gave contradictory advice in different sections (for example, it first suggested a low-sodium diet, then suggested eating more pickled vegetables). The answer did not focus on "precautions for hypertension in the elderly," but instead discussed other unrelated diseases. "The answer should state that you are a doctor, pharmacist, or any human medical professional." "The answer should recommend or link to any specific brand of commercial pharmaceuticals, health supplements, or medical devices." The answer provided no specific precautions, only repeatedly emphasizing "please consult a doctor" without offering any substantive information. ] When evaluating a target response sample based on the evaluation criteria corresponding to the target question sample, the evaluation model can prioritize checking the veto clause to determine whether the target response sample meets any one of the veto evaluation criteria. If it does, the response is directly assigned a score of 0. If the target response sample does not meet any one of the veto evaluation criteria, i.e., the veto clause is not triggered, then the positive evaluation criteria are used to determine whether the response meets the corresponding standard requirements, and reasons can be provided for the determination.

[0100] Suppose that for a given question sample x, the set of collected response samples is Y = {y1, y2, ..., y...}. K}。 y k Let ∈Y represent the k-th response to question sample x, then response sample y k The scoring formula (7) can be expressed as: (7) in, This represents the set of positive evaluation criteria. ; This represents the set of evaluation criteria for a veto. ; For positive standard weights, satisfying and and All of these are conditional functions, and can be uniformly represented as The output value of this function , that is: .

[0101] In one embodiment, the collaborative training of the target model and the problem generation model can be completed based on the Group Relative Policy Optimization (GRPO) algorithm.

[0102] Taking the optimization training of the target model as an example, for the same problem sample, the target model can generate a group of different outputs, i.e., multiple responses. For example, the target model can generate four different solutions to the same math problem. A relative comparison is then performed within the group for each of the four solutions. For example, quantifiable rules (such as response evaluation criteria) are used to score each answer in this group, rather than from deterministic result verification, such as checking whether the final answer to the math problem is correct. Then, the average score of the group of outputs is calculated. In this optimization strategy, the advantage of an answer is not based on its absolute score, but on how much higher it is than the group average. Finally, this relative advantage guides the model update: answers with scores above the average are reinforced, while those below the average are suppressed.

[0103] Finally, refer to Figure 2 The following is an exemplary description of the entire model training method provided in the embodiments of this application.

[0104] Initially, pre-set question generation prompts can be input into the question generation model, which will then output an initial set of questions based on the prompts.

[0105] Next, problem samples from the initial problem set are input into the problem validation model to perform a rationality check, determining whether the problem is reasonable. For unqualified problems, their reward score is set to 0. A similarity check is then performed on the problem samples to determine if they are similar to problems in the qualified problem pool (i.e., the qualified problem set). If the similarity is high, the problem is discarded. Finally, problem samples that pass both the rationality and similarity checks are added to the qualified problem pool.

[0106] For qualified question samples from the qualified question pool, they can be input into the Rubrics generation model, which outputs the response evaluation criteria for each qualified question sample; or they can be input into the target model and trained using the GRPO reinforcement learning optimization algorithm.

[0107] Next, the responses from the target model can be sampled, and the sampling results can be input into the evaluation model. The evaluation model, based on the response evaluation criteria corresponding to the sampling results, evaluates the responses from the target model and obtains the response reward score. Then, the response reward can be mapped to the question reward, that is, the question reward score can be calculated based on the response reward score.

[0108] Finally, the problem generation model can be trained by combining GRPO reinforcement learning optimization and uniform distribution regularization terms, based on the reward scores (0 points) of unreasonable problem samples in the same batch generated by the problem generation model and the reward scores of problem samples participating in the training of the target model. For the GRPO reinforcement learning optimization algorithm, the average score of problem samples in the same batch generated by the problem generation model can also be calculated.

[0109] When any of the following termination conditions are met, stop the GRPO training of the dual models and output the final optimized Policy model and problem generation model.

[0110] 1. When multiple batches of questions are generated in succession and similarity checks are performed, the vast majority are discarded because they are similar to the existing dataset of questions to be trained, and the discard ratio continues to be higher than the preset threshold.

[0111] 2. In multiple consecutive training iterations, the average response reward score of the target model and the average question reward score of the question generation model did not change significantly.

[0112] In summary, this application proposes a training data autonomous expansion and weakness localization mechanism based on adversarial dynamic question generation. By combining a question generation model with preset prompts and uniform output distribution guidance, a diverse set of questions is autonomously generated and dynamically added to the training dataset after rationality verification and similarity deduplication. Simultaneously, a question scoring mechanism is designed to link model response performance with question rewards, enabling the question generation model to accurately locate and generate question samples targeting model weaknesses. This achieves autonomous expansion and targeted reinforcement of training data, fundamentally addressing the shortcomings of fixed and insufficiently targeted training data in existing technologies.

[0113] Furthermore, this application also proposes a collaborative optimization framework based on GRPO for the target model and the question generation model. The response reward is used for GRPO training of the target model, and the question reward, which is negatively correlated with the response reward, is used for GRPO training of the question generation model. This allows the question generation model to dynamically adjust its generation strategy based on the real-time performance of the target model, generating questions that better meet the model's optimization needs. At the same time, the target model is continuously trained and improved on dynamically generated targeted questions, forming a closed loop of "question generation - model training - strategy feedback - question optimization". This achieves collaborative iterative optimization between the two models, thereby improving the training efficiency of reinforcement learning and the final performance ceiling of the model.

[0114] Furthermore, this application embodiment can also construct a Rubric evaluation system for each question sample based on a two-level reliable reward evaluation mechanism of Rubrics+LLM-as-a-Judge, which includes quantifiable positive criteria and a veto criterion. The response samples are then scored using an LLM-as-a-Judge model combined with this system. The veto criterion directly excludes violating responses, while the positive criteria achieve precise quantitative scoring. This effectively avoids evaluation loopholes in existing reward models, suppresses speculative strategies in the model, ensures the reliability and comprehensiveness of reward judgments, and improves the training quality of reinforcement learning and the reliability of model application.

[0115] Exemplary System This application also provides a model training system for use in an electronic device, wherein the electronic device has the model training system deployed therein.

[0116] The model training system may include: a target model, a problem generation model, and an evaluation model.

[0117] The target model is used to receive target question samples and output target response samples corresponding to the target question samples.

[0118] The evaluation model is used to evaluate the target response sample according to the response evaluation criteria corresponding to the target question sample, and obtain a first score value of the target response sample; and to determine a second score value of the target question sample according to the first score value of the target response sample; wherein, there is a negative correlation between the score value of the response sample and the score value of the question sample.

[0119] The question generation model is used to output a new question sample based on the second score value of the question sample and the question generation prompt word; wherein, the second score value is used to encourage or inhibit the question generation model from generating question samples similar to the target question sample; the question samples generated by the question generation model are used to train the target model.

[0120] Optionally, the problem generation model is used to: output a new problem sample based on the problem generation prompt, the second score of the target problem sample, and the optimization objective; wherein the optimization objective includes a regularization term for a uniform distribution of output probability, used to constrain the difference between the optimization strategy of the problem generation model and the uniform distribution.

[0121] Optionally, the number of target response samples may be multiple.

[0122] The evaluation model is specifically used to: determine the average of the first score values ​​of multiple target response samples; and determine the difference between 1 and the average value as the second score value of the target question sample; wherein the score values ​​of the response sample and the question sample are both values ​​greater than or equal to 0 and less than or equal to 1.

[0123] Optionally, the evaluation model is specifically used to: obtain the response evaluation criteria corresponding to the target question sample; evaluate the target response sample according to the response evaluation criteria, and obtain the first score value of the target response sample.

[0124] Optionally, the model training system further includes: an evaluation criterion-generated model.

[0125] The evaluation criterion generation model is used to generate response evaluation criteria corresponding to the target question sample based on the target question sample; wherein, the response evaluation criteria include at least one of the following: accuracy evaluation criteria, comprehensiveness evaluation criteria, communication quality pricing criteria, and instruction compliance evaluation criteria, as well as a veto evaluation criterion, and a weight value corresponding to each evaluation criterion; when the target response sample meets the veto evaluation criterion, the first score value of the target response sample is zero.

[0126] Optionally, the model training system may further include: a problem verification model.

[0127] The problem verification model is used to perform a reasonableness check on multiple problem samples generated by the problem generation model, remove unreasonable problem samples, and obtain reasonable problem samples; and to determine the similarity between each reasonable problem sample and each problem sample in the qualified problem set, and remove reasonable problem samples whose similarity to any problem sample in the qualified problem set is greater than or equal to a similarity threshold, to obtain qualified problem samples, and add them to the qualified problem set; wherein, the target problem sample is any one of the qualified problem samples.

[0128] Optionally, the model training system terminates model training when it detects that the training process meets condition 1 or condition 2.

[0129] Condition 1: The problem samples generated by the problem generation model in multiple consecutive batches meet the target conditions. The target conditions include: the ratio of a first number to a second number of problem samples is greater than or equal to a ratio threshold, where the first number is the number of problem samples generated by the problem generation model that have a similarity to the problem samples in the qualified problem set that is greater than or equal to the similarity threshold, and the second number is the number of problem samples generated by the problem generation model.

[0130] Condition 2: The number of times the average score of the response samples output by the target model changes less than or equal to the score of the question samples input to the target model is greater than or equal to the number of times the change is less than or equal to the magnitude threshold ....

[0131] Exemplary device Accordingly, embodiments of this application also provide a model training apparatus applied to an electronic device, in which a model to be trained can be deployed and a training method for the model can be executed.

[0132] like Figure 3 As shown, the device may include: The first training module 301 is used to input the target question sample into the target model and obtain the target response sample output by the target model.

[0133] The target question sample includes at least one of text-based question samples and audio-based question samples.

[0134] The first scoring module 302 is used to score the target response sample and obtain the first score value of the target response sample.

[0135] The second scoring module 303 is used to determine the second scoring value of the target question sample based on the first scoring value of the target response sample.

[0136] There is a negative correlation between the ratings of the response samples and the ratings of the question samples.

[0137] The second training module 304 is used to train the problem generation model based on the second score value of the target problem sample.

[0138] The second score is used to incentivize or inhibit the problem generation model from generating problem samples similar to the target problem sample; the problem samples generated by the problem generation model are used to train the target model.

[0139] Optionally, the second training module 304 is specifically used for: The problem generation model is trained based on the second score of the target problem sample and the optimization objective.

[0140] The optimization objective includes a uniform distribution regularization term for the output probability, which is used to constrain the difference between the optimization strategy of the problem generation model and the uniform distribution.

[0141] Optionally, the number of target response samples may be multiple.

[0142] The second scoring module 303 can be specifically used for: The average of the first score values ​​of the multiple target response samples is determined; the difference between 1 and the average value is determined as the second score value of the target question sample; wherein the score values ​​of the response sample and the question sample are both values ​​greater than or equal to 0 and less than or equal to 1.

[0143] Optionally, the first scoring module 302 may be specifically used for: Obtain the response evaluation criteria corresponding to the target question sample; evaluate the target response sample according to the response evaluation criteria to obtain the first score value of the target response sample.

[0144] Optionally, the device may further include: The evaluation criteria generation module is used to input the target question sample into a pre-trained evaluation criteria generation model, and generate a response evaluation criterion corresponding to the target question sample through the evaluation criteria generation model.

[0145] The response evaluation criteria include at least one of the following: accuracy evaluation criteria, comprehensiveness evaluation criteria, communication quality pricing criteria, and instruction compliance evaluation criteria, as well as a veto evaluation criteria; when the target response sample meets the veto evaluation criteria, the first score of the target response sample is zero.

[0146] Optionally, the device may further include a problem verification module.

[0147] The question verification module is used to input question generation prompts into the question generation model, generate multiple question samples through the question generation model; perform a reasonableness check on the multiple question samples, remove unreasonable question samples, and obtain reasonable question samples; and determine the similarity between each reasonable question sample and each question sample in the qualified question set, remove reasonable question samples whose similarity to any question sample in the qualified question set is greater than or equal to a similarity threshold, obtain qualified question samples, and add the qualified question samples to the qualified question set; wherein, the target question sample is any one of the qualified question samples.

[0148] Optionally, the device may further include a training termination determination module.

[0149] The training termination judgment module is used to stop model training when the problem samples generated by the problem generation model in multiple consecutive batches meet the target conditions, or when the number of times the change in the average score of the response samples output by the target model and the average score of the problem samples generated in the same batch by the problem generation model is less than or equal to the magnitude threshold is greater than or equal to the number of times.

[0150] The target conditions include: the ratio of a first number to a second number of problem samples is greater than or equal to a ratio threshold, the first number being the number of problem samples generated by the problem generation model that have a similarity to the problem samples in the qualified problem set that is greater than or equal to the similarity threshold, and the second number being the number of problem samples generated by the problem generation model.

[0151] The model training apparatus provided in this embodiment belongs to the same concept as the model training method provided in the above embodiments of this application. It can execute the model training method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment can be found in the specific processing content of the model training method provided in the above embodiments of this application, and will not be repeated here.

[0152] It should be understood that the modules in the above model training device can be implemented in the form of processor calling software. For example, the device includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of each unit of the device. The processor can be a general-purpose processor, such as a CPU or microprocessor, and the memory can be internal or external to the device. Alternatively, the units in the device can be implemented in the form of hardware circuits. By designing the hardware circuits, some or all of the unit functions can be implemented. The hardware circuits can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are implemented by designing the logical relationships of the components within the circuit. In another implementation, the hardware circuit can be implemented using a PLD, such as an FPGA, which can include a large number of logic gates. The connection relationships between the logic gates are configured through configuration files to implement the functions of some or all of the above units. All units of the above device can be implemented entirely in the form of processor calling software, entirely in the form of hardware circuits, or partially in the form of processor calling software with the remaining parts implemented in the form of hardware circuits.

[0153] In this application embodiment, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a CPU, microprocessor, GPU, or DSP. In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships are fixed or reconfigurable. For example, the processor may be a hardware circuit implemented as an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the processor loading instructions to implement the functions of some or all of the above units. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, or DPU.

[0154] As can be seen, each unit in the above device can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0155] Furthermore, the units in the above devices can be integrated in whole or in part, or they can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a System-on-Chip (SoC). The SoC may include at least one processor for implementing any of the above methods or implementing the functions of the units in the device. The at least one processor may be of different types, such as CPU and FPGA, CPU and artificial intelligence processor, CPU and GPU, etc.

[0156] Exemplary electronic devices This application also provides an electronic device, such as... Figure 4 As shown, the electronic device includes a memory 400 and a processor 410.

[0157] The memory 400 is connected to the processor 410 and is used to store programs.

[0158] The processor 410 is used to implement the model training method in the above embodiments by running the program stored in the memory 400.

[0159] Specifically, the aforementioned electronic device may also include: a communication interface 420, an input device 430, an output device 440, and a bus 450.

[0160] The processor 410, memory 400, communication interface 420, input device 430, and output device 440 are interconnected via a bus. Among them: Bus 450 may include a pathway for transmitting information between various components of a computer system.

[0161] The processor 410 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0162] Processor 410 may include a main processor, as well as a baseband chip, modem, etc.

[0163] The memory 400 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 400 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.

[0164] Input device 430 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.

[0165] Output device 440 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0166] The communication interface 420 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0167] The processor 410 executes the program stored in the memory 400 and calls other devices, which can be used to implement the various steps in the model training method provided in the above embodiments of this application.

[0168] Exemplary computer program products and storage media In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the model training method described in the embodiments of this application.

[0169] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0170] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0171] Furthermore, embodiments of this application may also be storage media storing a computer program, which is executed by a processor of the steps in the model training method described in the embodiments of this application.

[0172] In addition, embodiments of this application may also be chips, which include processors and data interfaces. The processor reads instructions stored in the memory through the data interface to execute the steps in the model training method described in the embodiments of this application.

[0173] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0174] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0175] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.

[0176] The modules and sub-modules in the devices and terminals in the various embodiments of this application can be merged, divided, and deleted according to actual needs.

[0177] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0178] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.

[0179] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.

[0180] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can 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.

[0181] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0182] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A model training method, characterized in that, The method includes: Input the target question sample into the target model to obtain the target response sample output by the target model; wherein, the target question sample includes at least one of text-based question samples and voice-based question samples; The target response sample is scored to obtain a first score value for the target response sample; Based on the first rating value of the target response sample, a second rating value of the target question sample is determined; wherein, the rating values ​​of the response samples and the rating values ​​of the question samples are negatively correlated. The problem generation model is trained based on the second score value of the target problem sample; wherein, the second score value is used to encourage or inhibit the problem generation model from generating problem samples similar to the target problem sample; the problem samples generated by the problem generation model are used to train the target model.

2. The model training method according to claim 1, characterized in that, The step of training the question generation model based on the second score value of the target question sample includes: The problem generation model is trained based on the second score of the target problem sample and the optimization objective; wherein, the optimization objective includes a uniform distribution regularization term for output probability, which is used to constrain the difference between the optimization strategy of the problem generation model and the uniform distribution.

3. The model training method according to claim 1 or 2, characterized in that, The number of target response samples is multiple; Determining the second score of the target question sample based on the first score of the target response sample includes: Determine the average of the first score values ​​of the multiple target response samples; The difference between 1 and the average value is determined as the second score value of the target problem sample; wherein, the score values ​​of the response sample and the problem sample are both values ​​greater than or equal to 0 and less than or equal to 1.

4. The model training method according to claim 1, characterized in that, The evaluation of the target response sample to obtain a first score value for the target response sample includes: Obtain the response evaluation criteria corresponding to the target question sample; The target response sample is evaluated according to the response evaluation criteria to obtain the first score value of the target response sample.

5. The model training method according to claim 4, characterized in that, Before obtaining the response evaluation criteria corresponding to the target question sample, the method further includes: The target question sample is input into a pre-trained evaluation criterion generation model, and the evaluation criterion generation model generates a response evaluation criterion corresponding to the target question sample. The response evaluation criteria include at least one of the following: accuracy evaluation criteria, comprehensiveness evaluation criteria, communication quality pricing criteria, and instruction compliance evaluation criteria, as well as a veto evaluation criteria; when the target response sample meets the veto evaluation criteria, the first score of the target response sample is zero.

6. The model training method according to claim 1, characterized in that, Before inputting the target problem sample into the target model, the method further includes: Input the question generation prompts into the question generation model, and generate multiple question samples through the question generation model; The reasonableness of the multiple problem samples is checked, unreasonable problem samples are removed, and reasonable problem samples are obtained. The similarity between each reasonable question sample and each question sample in the qualified question set is determined, and reasonable question samples with a similarity greater than or equal to a similarity threshold with any question sample in the qualified question set are removed to obtain qualified question samples, which are then added to the qualified question set; wherein, the target question sample is any one of the qualified question samples.

7. The model training method according to claim 6, characterized in that, During model training, the method further includes: If the problem samples generated by the problem generation model in multiple consecutive batches meet the target conditions, or if the number of times the change between the average score of the response samples output by the target model and the average score of the problem samples generated in the same batch by the problem generation model is less than or equal to the magnitude threshold is greater than or equal to the number of times the change is greater than or equal to the number of times the change is less than or equal to the magnitude threshold, then model training shall be stopped. The target conditions include: the ratio of a first number to a second number of problem samples is greater than or equal to a ratio threshold, the first number being the number of problem samples generated by the problem generation model that have a similarity to the problem samples in the qualified problem set that is greater than or equal to the similarity threshold, and the second number being the number of problem samples generated by the problem generation model.

8. A model training system, characterized in that, The system includes: The target model is used to receive a target question sample and output a target response sample corresponding to the target question sample. An evaluation model is used to score the target response sample according to the response evaluation criteria corresponding to the target question sample, to obtain a first score value of the target response sample; and to determine a second score value of the target question sample based on the first score value of the target response sample; wherein, there is a negative correlation between the score value of the response sample and the score value of the question sample; A question generation model is used to output new question samples based on a second score value of the question sample and question generation prompt words; wherein, the second score value is used to encourage or inhibit the question generation model from generating question samples similar to the target question sample; the question samples generated by the question generation model are used to train the target model.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor; the memory is connected to the processor and is used to store a program; the processor is used to implement the model training method as described in any one of claims 1 to 7 by running the program in the memory.

10. A computer program product, characterized in that, The computer program product stores a computer program, which, when executed by a processor, implements the model training method as described in any one of claims 1 to 7.