Multi-interference term generation method based on large language model and reinforcement learning
Through methods based on large language models and reinforcement learning, the interference item generation for English reading comprehension questions is optimized, solving the problem of low quality interference items in the existing technology, achieving high-quality and efficient interference item generation, and reducing the cost of interference items. The workload of the question maker.
Patent Information
- Application Number
- CN202410893196.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-04
AI Technical Summary
When the existing technology generates distractors for English reading comprehension questions, the model input only includes articles, questions, and answers. It is difficult to effectively model the relationship between distractors, questions, and answers, resulting in low quality of distractor generation and increasing the number of problems. The workload of the questioner.
Using a multi-interference item generation method based on large language models and reinforcement learning, by obtaining EQG-RACE data, a distractor generation model for text instructions is established, and supervised fine-tuning and reward model training are performed to calculate the pairwise ranking loss and optimize the interference items. Generate models to improve the quality and diversity of distractors.
The quality of interference item generation that meets the needs of realistic question generation is achieved, reducing the workload of question makers, improving question generation efficiency, and further improving the confusion and diversity of interference items through reinforcement learning.
Smart Images

Figure CN118760765A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically to a method for generating multiple interference items based on a large language model and reinforcement learning. Background Art
[0002] English reading comprehension questions usually appear in the form of multiple-choice questions on the test paper. The options other than the correct answer are called distractors. The distractors are placed together with the correct answer to confuse the test takers. Therefore, distractors are an important part of reading comprehension questions, and the quality of distractors determines the quality of a multiple-choice question. English is a key subject for students of all ages in my country. Every year, a large number of high-quality new reading comprehension multiple-choice questions are needed for practice and assessment. Among them, the most tedious and laborious process of writing is the distractors of multiple-choice questions.
[0003] There have been only a few studies in recent years. In general, previous work generally applies the most common sequence-to-sequence model in text generation tasks to the task of automatically generating distractors. The sequence-to-sequence model consists of an encoder and a decoder. Researchers pass articles, questions, and answers as input to the encoder. When decoding, the model uses the encoder-decoder attention to select appropriate contextual information from the input to generate distractors. The present invention believes that the input of the model includes three different inputs: articles, questions, and answers. Therefore, the encoder structure and the attention mechanism of the model are adjusted, hoping that the model can correctly model the relationship between distractors and questions and answers, enhance the model's ability to understand the long text of the article, and find the content basis for generating distractors from the text.
[0004] In order to reduce the workload of test setters and improve their work efficiency, it is necessary to study the automatic generation technology of interference items based on artificial intelligence for realistic test-setting scenarios.
[0005] Therefore, it is an urgent problem for those skilled in the art to propose a method for generating multiple interference items based on a large language model and reinforcement learning to solve the difficulties existing in the prior art. Summary of the invention
[0006] In view of this, the present invention provides a method for generating multiple interference items based on a large language model and reinforcement learning, which is used to solve the technical problems existing in the prior art.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A method for generating multiple distractors based on a large language model and reinforcement learning, comprising the following steps:
[0009] Obtain EQG-RACE data and divide the EQG-RACE data into a training set and a validation set;
[0010] Establish a distractor generation model based on text instructions;
[0011] The training set is input into the distractor generation model and supervised fine-tuned to obtain the distractor generation model after supervised fine-tuning;
[0012] Input the validation set into the supervised fine-tuned distractor generation model and sort it according to the generated results;
[0013] Build a reward model, obtain the training data set of the reward model based on the ranking results, and calculate the pairwise ranking loss;
[0014] The supervised fine-tuned distractor generation model is further trained based on the reward model and reinforcement learning to obtain the highest quality multiple distractors.
[0015] Optionally, the specific contents of establishing a distractor generation model based on text instructions are:
[0016] First, the reading comprehension article, questions and answers, and the number of distractors are written into a text instruction template to obtain text instructions. Then, the text instructions are input into the distractor generation model after fine-tuning the instructions. According to the response format and the number of distractors required in the instructions, a response text containing the specified number of distractors is generated. Finally, the generated multiple distractors are extracted from the response text.
[0017] Optionally, the specific content of the distractor generation model after supervised fine-tuning is:
[0018] Take the text instruction as the existing text and predict each word of the reply text. When using the distractor generation model after supervised fine-tuning, combine the text instruction and the reply text into a target text. Use the Teacher-Forcing technique to predict the word of the next time step based on the target historical context, thereby converting the text generation task into a word classification task. The classification target of each time step is the next word of the target text, and calculate the classification loss of each time step.
[0019] Optionally, the specific content of the training data set for the reward model obtained according to the sorting results is: constructing the distractor evaluation criteria, articles, questions, answers and distractors into text instructions, using ChatGPT to sort the samples, and obtaining the sorting results to construct the training data set.
[0020] Optionally, sort by a single distractor evaluation criterion.
[0021] Optionally, individual distractor evaluation criteria include: legitimacy and obfuscation.
[0022] Optionally, the distractor generation model and the reward model after supervised fine-tuning both include: a word embedding layer, a plurality of decoders, and a linear layer.
[0023] Optionally, the specific content of training the reward model based on pairwise ranking loss is:
[0024] The reward model combines the text instructions of a single distractor and the distractor itself into the input text, which is as follows:
[0025] Given a reading comprehension article P, a reading comprehension question Q constructed based on the article, the correct answer A corresponding to the question, and a distractor D generated by a distractor generation model, the input text T of the reward model is represented as T = [P; Q; A; D], and an input text T = (t1, t2, ..., t n ) Input the reward model, first pass through the word embedding layer, and get the feature matrix M, the formula is:
[0026] M=Embedding(T),M∈R n×d
[0027] Among them, d is the hidden layer feature dimension of the model;
[0028] Assuming that the reward model has L decoders, the output of the last decoder is expressed as:
[0029] H L =Decorder L (H L-1 ), H L ∈R n×d
[0030] Among them, H i is the output of the i-th decoder;
[0031] The output of the last decoder layer contains the hidden layer vector corresponding to each input word, so it is represented as H L =(h1,h2,...,h n ),h i ∈R d , take out the hidden layer vector corresponding to the last word With learnable parameters Multiply them together to get the bonus score. The formula is:
[0032]
[0033] Therefore, the pairwise ranking loss is calculated as:
[0034]
[0035] Among them, r ais the bonus score for the high ranking distractors, r b Bonus points for low ranked distractors.
[0036] Optionally, the specific content of further training the supervised fine-tuned distractor generation model based on the reward model and reinforcement learning is:
[0037] First, several corresponding interference items are generated according to the text instructions, and then the interference items are input into the reward model to obtain the reward score of the quality of a single interference item. At the same time, the diversity scores between multiple interference items are calculated, and the two scores are input into the objective function to obtain the final score. Finally, the score of the objective function is optimized by gradient descent.
[0038] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a method for generating multiple interference items based on a large language model and reinforcement learning, which has the following beneficial effects:
[0039] 1) Based on the model and training method of the present invention, the quality of interference item generation reaches a level that meets the actual test requirements;
[0040] 2) The method of the present invention can reduce the workload of the test setter and improve his / her work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flowchart of a method for generating multiple interference items based on a large language model and reinforcement learning provided by the present invention;
[0043] Figure 2 A flow chart for generating interference items provided by the present invention;
[0044] Figure 3 A schematic diagram of supervised fine-tuning provided by the present invention;
[0045] Figure 4 A schematic diagram of the reward model provided by the present invention;
[0046] Figure 5 A schematic diagram of the reinforcement learning process provided by the present invention;
[0047] Figure 6 This is a statistical chart of the artificial evaluation ranking of interference items provided by the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] See also Figure 1 As shown, the present invention discloses a method for generating multiple interference items based on a large language model and reinforcement learning, comprising the following steps:
[0050] Obtain EQG-RACE data and divide the EQG-RACE data into a training set and a validation set;
[0051] Establish a distractor generation model based on text instructions;
[0052] The training set is input into the distractor generation model and supervised fine-tuned to obtain the distractor generation model after supervised fine-tuning;
[0053] Input the validation set into the supervised fine-tuned distractor generation model and sort it according to the generated results;
[0054] Build a reward model, obtain the training data set of the reward model based on the ranking results, and calculate the pairwise ranking loss;
[0055] The supervised fine-tuned distractor generation model is further trained based on the reward model and reinforcement learning to obtain the highest quality multiple distractors.
[0056] Specifically, the reading comprehension single-choice questions in English exams usually have multiple distractors, which together with the correct answer constitute the options. The task studied is to generate multiple high-quality distractors. Specifically, given a reading comprehension passage P, a reading comprehension question Q and a correct answer A, the task definition of generating n distractors is as follows: Where D represents a text containing n distractors, D = (D1, D2, ..., D n ).
[0057] For further information, see Figure 2 As shown in the figure, the specific contents of establishing the distractor generation model based on text instructions are as follows: first, the reading comprehension article, questions and answers, and the number of distractors are written into the text instruction template to obtain text instructions, and then the text instructions are input into the distractor generation model after fine-tuning the instructions, and according to the reply format and the number of distractors required in the instructions, a reply text containing the specified number of distractors is generated, and finally the generated multiple distractors are extracted from the reply text.
[0058] Specifically, the text instruction template includes the definition and requirements of the distractor generation task, especially the confusing requirements for each distractor and the diversity requirements between multiple distractors for high-quality distractors. The translated text instruction template is shown in Table 1. The actual instruction template is an English template.
[0059] Table 1 Text instruction template for distractor generation task
[0060]
[0061] In actual use, replace "{{N}}" in the template with the number of distractors generated, replace "{{passage}}" with the actual article content, replace "{{question}}" with the question, and replace "{{answer}}" with the answer to obtain a text instruction. Input the written text instruction into the distractor generation model, and the distractor generation model generates a text containing a specified number of distractors according to the response format and the number of distractors generated required in the instruction, and finally extracts the generated multiple distractors from the text.
[0062] For further information, see Figure 3 As shown in Figure 2, the specific content of the interference term generation model after supervised fine-tuning is:
[0063] Take the text instruction as the existing text and predict each word of the reply text. When using the distractor generation model after supervised fine-tuning, combine the text instruction and the reply text into a target text. Use the Teacher-Forcing technique to predict the word of the next time step based on the target historical context, thereby converting the text generation task into a word classification task. The classification target of each time step is the next word of the target text, and calculate the classification loss of each time step.
[0064] Furthermore, the specific content of the training data set of the reward model obtained according to the sorting results is: the distractor evaluation criteria, articles, questions, answers and distractors are constructed as text instructions, and ChatGPT is used to sort the samples, as shown in Table 2, to obtain the sorting results and thus construct the training data set.
[0065] Table 2 Text instruction template for calling ChatGPT to sort distractors
[0066]
[0067] Furthermore, the items are sorted according to the evaluation criteria of individual distractors.
[0068] Furthermore, the evaluation criteria for individual distractors include: legitimacy and confusingness.
[0069] Specifically, in addition to the criteria of legitimacy and confusing nature of individual distractors, there is also diversity among multiple distractors. These three points constitute the evaluation criteria for distractors.
[0070] Furthermore, the interference generation model and reward model after supervised fine-tuning both include: a word embedding layer, several decoders, and a linear layer.
[0071] See also Figure 4 The following is a schematic diagram of the reward model.
[0072] Furthermore, the specific content of the reward model based on pairwise ranking loss training is:
[0073] The reward model combines the text instructions of a single distractor and the distractor itself into the input text, which is as follows:
[0074] Given a reading comprehension article P, a reading comprehension question Q constructed based on the article, the correct answer A corresponding to the question, and a distractor D generated by a distractor generation model, the input text T of the reward model is represented as T = [P; Q; A; D], and an input text T = (t1, t2, ..., t n ) Input the reward model, first pass through the word embedding layer, and get the feature matrix M, the formula is:
[0075] M=Embedding(T),M∈R n×d
[0076] Among them, d is the hidden layer feature dimension of the model;
[0077] Assuming that the reward model has L decoders, the output of the last decoder is expressed as:
[0078] H L =Decorder L (H L-1 ), H L ∈R n×d
[0079] Among them, H i is the output of the i-th decoder;
[0080] The output of the last decoder layer contains the hidden layer vector corresponding to each input word, so it is represented as H L =(h1,h2,...,h n ),h i ∈R d , take out the hidden layer vector corresponding to the last word With learnable parameters Multiply them together to get the bonus score. The formula is:
[0081]
[0082] Therefore, the pairwise ranking loss is calculated as:
[0083]
[0084] Among them, r a is the bonus score for the high ranking distractors, r b Bonus points for low ranked distractors.
[0085] Specifically, we first calculate the difference in reward scores between high-ranking and low-ranking interference items, then input the difference into the sigmoid function to get a value between 0 and 1, and finally calculate the negative logarithm as the loss value.
[0086] For further information, see Figure 5 As shown in Figure 1, the specific content of the interference generation model after further training with supervised fine-tuning based on the reward model and reinforcement learning is:
[0087] First, several corresponding interference items are generated according to the text instructions, and then the interference items are input into the reward model to obtain the reward score of the quality of a single interference item. At the same time, the diversity scores between multiple interference items are calculated, and the two scores are input into the objective function to obtain the final score. Finally, the score of the objective function is optimized by gradient descent.
[0088] Specifically, the present invention uses proximal strategy optimization as a reinforcement learning algorithm. Suppose the text instruction received by the interference model is x, and the n interference items generated are d=(d1, d2, ..., d n ), and its objective function formula is as follows:
[0089]
[0090] In the formula, Generate a model for interference items to receive reinforcement learning training; π SFT Generate a model for distractors after supervised fine-tuning; D KL is the Kulbeck-Leibler divergence, i.e., KL divergence; D is the diversity score; α, β, γ, and δ are all hyperparameters.
[0091] In general, the objective function consists of the mean reward score of each distractor, the minimum reward score of each distractor, the diversity score among multiple distractors, and the KL divergence between the distractor generation results after reinforcement learning and supervised fine-tuning.
[0092] Specifically, in the reinforcement learning process, two sets of objective function hyperparameters are used to train two interference generation models with different emphases on the quality of a single interference item and the diversity of multiple interference items.
[0093] Generative models that focus on the quality of individual distractors are called During reinforcement learning, the mean reward score weight α = 0.2, the minimum reward score weight β = 0.1, and the diversity score weight γ = 0.2.
[0094] Generative models that focus on the diversity of multiple distractors are called During reinforcement learning, the mean reward score weight α=0.2, and the minimum reward score weight β=0.
[0095] After experimental comparison, DISTINCT-1 was selected as the diversity score, which had the best training effect. Therefore, the above two models both used DISTINCT-1 as the diversity score when receiving reinforcement learning.
[0096] The distractor generation model, reward model, and reinforcement learning after supervised fine-tuning all use LoRA as a parameter efficient fine-tuning method. The distractor generation model after supervised fine-tuning is called DGRL SFT .
[0097] Specifically, the comparative experiment is as follows:
[0098] HSA: A hierarchical encoder is used to model the long text of the article at word level and sentence level. A static attention mechanism is also designed to prevent the model from generating interference items that are too close to the answer.
[0099] CHN: Based on HSA, a hierarchical encoder enhanced with a collaborative attention mechanism is proposed to better capture the relationship between the article and the question, thereby guiding the decoder to generate more coherent distractors. By calculating the semantic similarity loss, the generated distractors are made more relevant to the article.
[0100] HMD-Net: Uses an attention mechanism with a gating mechanism in the encoder and multiple decoders for generating diverse distractors.
[0101] EDGE: An encoding module for articles and questions is designed based on attention and gating mechanisms to improve the generation of distractors.
[0102] TMCA: Based on HSA, topic information and topic attention are introduced to enhance the generation effect of distractors.
[0103] MSG: A diversified content selection model is proposed to select diverse content from the text as the basis for generating distractors to improve the diversity among distractors.
[0104] QDG: A question-interference item joint generation model is proposed to generate questions and interference items. The average value between each generated interference item and the three interference items in the data set is specifically counted, and the present invention counts the total average value for comparison. The statistical results are shown in Table 3:
[0105] Table 3 Comparative experimental results
[0106]
[0107] It can be seen that except for the third distractor, whose ROUGE-L score is slightly lower than MSG, DGRL SFT The BLEU1-4 and ROUGE-L scores of the three generated distractors on the test set all exceed the previous model with the highest score. Since BLEU and ROUGE scores have only limited reference value, we will continue to evaluate the generation quality through other methods.
[0108] The most common automated evaluation metrics are BLEU and ROUGE. These two evaluation metrics were originally used for two text generation tasks, machine translation or summary generation. Later, researchers tended to use the level of these two metrics to demonstrate the advancement of the proposed method in other generation tasks. Most researchers use BLEU and ROUGE to measure the level of interference item generation in their experiments.
[0109] BLEU and ROUGE essentially reflect the similarity between the generated results and the target text at the word granularity, that is, the higher the BLEU and ROUGE values, the more similar the generated results are to the target text. The distractor generation task belongs to the open domain generation task. The samples written by humans in the dataset are only a relatively high-quality reference, but not the only correct answer. Even if it is assumed that the reference sample in the dataset is the highest quality perfect answer, it does not mean that 90% similarity with the reference result is "90% perfect". Through a simple experiment, it can be further demonstrated that the quality of the distractor has nothing to do with its similarity to the distractor samples in the dataset.
[0110] In the RACE dataset, each sample has three human-written distractors. Assume a distractor generation scenario: Assume that each sample in the RACE dataset has only two distractors. At this time, a distractor model named "Genius" generates the same result as the third distractor in the RACE dataset. The average BLEU and ROUGE scores obtained on the EQG-RACE test set are shown in Table 4.
[0111] Table 4 BLEU and ROUGE scores of Genius on the EQG-RACE test set
[0112] Model Name BLEU-1 BLEU-2 BLEU-3 BLEU-4 ROUGE-L Genius 31.55 15.28 10.18 8.0 22.89
[0113] This shows that calculating the BLEU and ROUGE scores between the generated results and the reference samples given in the dataset cannot accurately measure the quality of the distractors for the distractor generation task.
[0114] Next, we use a variety of evaluation methods to compare DGRL SFT and DGRL RL The quality of distractor generation will be compared with the quality of human-written distractors in the EQG-RACE test set.
[0115] Use the reward model to evaluate the quality of individual distractors:
[0116] The reward model is used to represent the quality of a single distractor by generating a score within a real number range during reinforcement learning. Therefore, the reward model is used to calculate the generation results of the two DGRLs and the score of each distractor in the EQG-RACE test set to represent the overall level of the distractors. It should be noted that the samples evaluated by the reward model are taken from the test set of EQG-RACE and the generation results of the distractor generation model on the test set. The evaluation samples did not appear in the training set and validation set of the reward model and the distractor generation model. Therefore, for the reward model, the distractors from the four sources are all unfamiliar and have similar data distributions.
[0117] In order to comprehensively compare the quality of interference items between the model and the dataset, the mean, maximum, and minimum values of each group of interference item scores are counted. Since the output of the reward model is in the real number range, the real number score is first put into the sigmoid function, the score is reduced to the range of 0-1 to calculate the mean, and then it is amplified 100 times to make it a score in the range of 0-100. Specifically, calculate n interference items d = (d1, d2, ..., d n )’s reward model is divided equally into r as shown in the following formula, and the results are shown in Table 5.
[0118]
[0119] Table 5 Reward model scoring table
[0120]
[0121] The results in Table 5 show that, whether it is the distractor generation model after supervised fine-tuning or the model after further reinforcement learning, their distractor generation results on the EQG-RACE test set are better than the distractor samples in the EQG-RACE dataset in terms of the quality of a single distractor. This shows that the quality of distractor samples in the EQG-RACE, or RACE dataset, has not reached the ideal level for human question setting needs. It is necessary to further explore the research on high-quality distractor generation based on supervised fine-tuning using datasets. At the same time, DGRL SFT The score of is higher than that of EQG-RACE, which proves the effectiveness of the proposed distractor generation method based on text instructions and instruction fine-tuning of large language model.
[0122] Evaluate the quality of individual distractors by rating:
[0123] In addition to evaluating the quality of individual distractors through scoring by the reward model, distractors can also be graded. Based on the requirements for the quality of individual distractors in real-world question-setting scenarios, distractor quality is divided into three levels:
[0124] (1) Strongly confusing distractors. One of the goals of the generation is that when a distractor appears as an option together with the correct answer, it can effectively confuse the test taker. Usually, a strongly confusing distractor can become a possible answer to the question without the context of the article. Even with the context of the article, the content it describes also appears in the article, but it is not the specific content of the question.
[0125] (2) Simple distractors. Simple distractors are usually easier to eliminate than the correct answer. The content of such distractors is usually not in line with common sense or even absurd, or is too far from the content described in the article.
[0126] (3) Illegal interference items. The semantics of interference items overlap too much with the correct answer and cannot be distinguished, so that the test taker cannot choose the only correct answer. Considering the high labor cost and long evaluation time, ChatGPT based on GPT4 is used to replace humans to evaluate the EQG-RACE test set and DGRL test set. SFT , and The four groups of samples generated contained a total of 11,256 interference items for rating.
[0127] The definitions of the quality levels of the above three distractors are combined with the distractors in the model generation or data set into text instructions, which are then passed to ChatGPT, requiring it to automatically grade the given distractors based on the grade definition combined with the article content and the answers to the questions. In order to make the evaluation results as credible as possible, in the text instructions transmitted to ChatGPT, it is required to first reply to the reasons for the evaluation in the form of a thought chain, and then give a rating. Statistics EQG-RACE test set, DGRL SFT and DGRL RL The number and proportion of each rating are used to further compare the quality of individual distractors. The results are shown in Table 6.
[0128] Table 6 Results of interference item rating
[0129]
[0130] You can see the interference sample and DGRL of EQG-RACE SFT The generated distractors are roughly the same in terms of the number distribution of each level, with about two-thirds of them being strong distractors and about one-third being simple distractors, as well as a small number of illegal distractors.
[0131] DGRL with reinforcement learning RL Among the generated interference items, the proportion of highly confusing interference items increased significantly, and the proportion of simple interference items decreased significantly, which further shows that reinforcement learning further improves the overall quality of the interference items.
[0132] However, the number of illegal interference items in EQG-RACE is significantly less than that generated by DGRL, so there is still room for improvement in DGRL in terms of controlling the number of illegal interference items.
[0133] The quality of multiple interference items is evaluated by calculating the diversity evaluation index:
[0134] Real-world scenarios require not only the obfuscation and legitimacy of distractors, but also the diversity of multiple distractors. Therefore, the diversity of distractors will be measured by calculating common automatic evaluation indicators. Specifically, the following four diversity scores will be calculated:
[0135] 1. Self-BLEU: Calculates the average BLEU score between multiple samples, using BLEU-4 as the calculation metric. The lower the Self-BLEU value, the lower the similarity between samples and the greater the diversity.
[0136] 2. DISTINCT-1: Calculates the percentage of non-repeated words among multiple samples. The higher the DISTINCT-1 value, the more non-repeated words there are and the greater the diversity.
[0137] 3. DISTINCT-2: Calculates the proportion of non-repeating bigrams among multiple samples. Similarly, the more non-repeating bigrams there are, the greater the diversity.
[0138] 4. Average cosine distance: Calculate the cosine distance between the vector representations of multiple samples. The specific formula is as follows:
[0139]
[0140] Where n is the number of interference items, d i is the vector representation of the i-th interference item. The larger the cosine distance, the stronger the semantic diversity between the interference items.
[0141] The calculation results of diversity evaluation indicators are shown in Table 7.
[0142] Table 7 Calculation results of diversity evaluation indicators
[0143]
[0144] In general, the diversity of interference items generated by DGRL is significantly different from that of interference items in EQG-RACE. The best results were achieved in each diversity score, indicating that the objective function hyperparameter setting that focuses on diversity has played a role, and the diversity of the model has been further improved with reinforcement learning. While the quality of individual interference items has been significantly improved, its diversity score is generally similar to DGRL. SFT Maintained at the same level.
[0145] Evaluate the comprehensive quality of distractors through the multiple-choice question answering model:
[0146] In order to further evaluate the applicability of DGRL in real-world question-setting and question-answering scenarios, BERT was selected as the multiple-choice question answering model. It was first fine-tuned on the EQG-RACE training set using the multiple-choice task, and then answered questions on the test set and the distractor generation results of DGRL, and its accuracy was statistically analyzed. The results are shown in Table 8.
[0147] Table 8 BERT answer accuracy on distractor generation results
[0148]
[0149] The above results show that using The reading comprehension multiple-choice questions constructed with generated distractors have the highest difficulty, while the samples in EQG-RACE have the lowest difficulty, which proves the effectiveness of reinforcement learning.
[0150] Evaluate the comprehensive quality of interference items through manual evaluation:
[0151] Finally, we invited an English test setter with rich experience in setting questions to conduct manual evaluation on 10 samples extracted from the EQG-RACE test set. The evaluators will evaluate the manually written distractors in the 10 samples based on the confusion and legitimacy of the distractors. SFT and The interference items generated on it are sorted. Different from the reward model data construction, each sample in this sorting will have 9 interference items to be selected. After sorting, the evaluator also needs to give a score ranging from 0 to 5 points for the diversity of the two DGRL interference items respectively.
[0152] Plot the number of times each distractor appears at each ranking position as a bar graph, see Figure 6 As shown in the figure. The blank squares represent the interference items written by humans in EQG-RACE, the shaded squares represent the interference items generated by DGRLSFT, and the black squares represent The interference term generated from Figure 6 It can be seen that The generated distractors are ranked highest overall.
[0153] The total number of times the EQG-RACE test set and the two DGRLs ranked first and top three, as well as the diversity score results, are shown in Table 9.
[0154] Table 9 Interference item generation manual evaluation results
[0155]
[0156] The total number of interference items ranked first and top three was the highest, reaching 8 and 15 times respectively. SFT Although it did not take first place once, it ranked second with 9 top three positions. EQG-RACE ranked lowest overall but had the highest diversity score.
[0157] From the above content, we can draw the following conclusions:
[0158] (1) Focus on the quality of a single interference item While the diversity remains basically unchanged, more confusing and higher-quality individual interference items can be generated.
[0159] (2) Focus on the diversity of interference items When the quality of a single interference item remains basically unchanged, the diversity is better than that of DGRL. SFT Further improvement has been achieved.
[0160] (3) In terms of the quality of individual distractors, especially the confusion of distractors, the human-written distractors in EQG-RACE are not as good as those generated by the DGRL model. However, in terms of diversity, human-written distractors still have a very obvious advantage, and in terms of legitimacy, they are more stable than the DGRL model.
[0161] (4) The proposed distractor generation model based on a large language model and the reinforcement learning-based method are effective and advanced, and can be used in real-world test-setting scenarios as a distractor automatic generation assistant to provide test-setters with distractor samples and references.
[0162] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0163] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating multiple interference items based on a large language model and reinforcement learning, characterized in that: The following steps are involved: Obtain EQG-RACE data and divide the EQG-RACE data into a training set and a validation set; Build a distractor generation model based on text instructions; The training set is input into the distractor generation model and supervised fine-tuned to obtain the distractor generation model after supervised fine-tuning; The validation set is input into the supervised fine-tuned distractor generation model and sorted according to the generated results; Build a reward model, obtain the training data set of the reward model based on the ranking results, and calculate the pairwise ranking loss; The supervised fine-tuned distractor generation model is further trained based on the reward model and reinforcement learning to obtain the highest quality multiple distractors.
2. According to claim 1, a method for generating multiple interference items based on a large language model and reinforcement learning is characterized in that: The specific contents of establishing the distractor generation model based on text instructions are: First, the reading comprehension article, questions and answers, and the number of distractors are written into a text instruction template to obtain text instructions. Then, the text instructions are input into the distractor generation model after fine-tuning the instructions. According to the response format and the number of distractors required in the instructions, a response text containing the specified number of distractors is generated. Finally, the generated multiple distractors are extracted from the response text.
3. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 1, characterized in that: The specific content of the interference term generation model after supervised fine-tuning is: Take the text instruction as the existing text and predict each word of the reply text. When using the distractor generation model after supervised fine-tuning, combine the text instruction and the reply text into a target text. Use the Teacher-Forcing technique to predict the word of the next time step based on the target historical context, thereby converting the text generation task into a word classification task. The classification target of each time step is the next word of the target text, and calculate the classification loss of each time step.
4. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 1, characterized in that: The specific content of the training data set for the reward model obtained according to the sorting results is: construct the distractor evaluation criteria, articles, questions, answers and distractors into text instructions, use ChatGPT to sort the samples, and obtain the sorting results to construct the training data set.
5. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 4, characterized in that: Sort by individual distractor evaluation criteria.
6. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 5, characterized in that: The evaluation criteria for individual distractors include: legitimacy and confusion.
7. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 1, characterized in that: The distractor generation model and reward model after supervised fine-tuning both include: word embedding layer, several decoders, and linear layer.
8. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 7, characterized in that: The specific content of training the reward model based on pairwise ranking loss is: The reward model combines the text instructions of a single distractor and the distractor itself into the input text, which is as follows: Given a reading comprehension article P, a reading comprehension question Q constructed based on the article, the correct answer A corresponding to the question, and a distractor D generated by a distractor generation model, the input text T of the reward model is represented as T = [P; Q; A; D], and an input text T = (t1, t2, ..., t n ) Input the reward model, first pass through the word embedding layer, and get the feature matrix M, the formula is: M=Embedding(T),M∈R n×d Among them, d is the hidden layer feature dimension of the model; Assuming that the reward model has L decoders, the output of the last decoder is expressed as: H L =Decorder L (H L-1 ),H L ∈R n×d Among them, H i is the output of the i-th decoder; The output of the last decoder layer contains the hidden layer vector corresponding to each input word, so it is represented as H L =(h1,h2,...,h n ),h i ∈R d , take out the hidden layer vector corresponding to the last word With learnable parameters Multiply them together to get the bonus score. The formula is: Therefore, the pairwise ranking loss is calculated as: Among them, r a is the bonus score for the high ranking distractors, r b Bonus points for low ranked distractors.
9. The method for generating multiple interference items based on a large language model and reinforcement learning according to claim 8, characterized in that: The specific content of the distractor generation model after further training with supervised fine-tuning based on the reward model and reinforcement learning is as follows: First, several corresponding interference items are generated according to the text instructions, and then the interference items are input into the reward model to obtain the reward score of the quality of a single interference item. At the same time, the diversity scores between multiple interference items are calculated, and the two scores are input into the objective function to obtain the final score. Finally, the score of the objective function is optimized by gradient descent.
Citation Information
Patent Citations
Chinese choice question interference item generation method based on free text
CN112686025A
Multi-topic interference item sorting method and system based on multi-information source enhancement
CN116227627A
Questionnaire generation method and device, computer equipment and storage medium
CN117056770A
Generative large language model selection question evaluation method and system
CN118113845A
Conversational Interface for Content Creation and Editing Using Large Language Models
US20240126576A1
Cited By
Multi-modal selection question interference term generation method and system based on knowledge guidance thinking chain
CN120541226A
Intelligent test question generation method and system based on learning behavior analysis
CN121034144A
