A complex multi-field guided teaching question and answer generation method and device and a storage medium
By constructing a multi-round guided teaching question-and-answer language model, the problems of limited applicability and insufficient guidance capacity of existing models are solved. This enables comprehensive evaluation of multi-domain adaptability and teaching effectiveness, and enhances the interactivity and effectiveness of the teaching question-and-answer system.
Patent Information
- Application Number
- CN202510900516.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-07-01
AI Technical Summary
Existing teaching question-and-answer language models have limited applicability, lack guidance capabilities, have poor interactive capabilities, and use limited teaching effectiveness evaluation indicators, making it difficult to meet diverse teaching needs and rapidly changing knowledge domains.
A multi-round guided teaching question-and-answer big language model is constructed. By collecting teaching question-and-answer pairs from multiple fields and transforming them into a thought chain, combined with prompt word engineering and context learning mechanisms, guided answers are generated. The model is then trained and optimized to adapt to the teaching needs of multiple fields, and a multi-index evaluation system is used for quality assessment and optimization.
It enhances the applicability and practicality of the model, improves its problem-guiding capabilities, provides a comprehensive and accurate evaluation of teaching effectiveness, and supports diverse teaching methods and rapidly changing knowledge domains.
Smart Images

Figure CN120448505B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large language model, in particular to a complex multi-field guided teaching question and answer generation method, device, equipment and computer storage medium. BACKGROUND
[0002] In recent years, large language models have shown great application potential in the field of intelligent education due to their excellent knowledge reserve and problem understanding ability. In particular, in the education question and answer system, using large language models as intelligent teachers to guide students to solve various problems encountered in the learning process has become an important direction of research.
[0003] Current research mainly focuses on two aspects: one is to optimize the prompt words, such as thought chain (COT), thought tree (TOT) and other methods, to make general large language models better adapt to individualized teaching needs; the second is to fine-tune large models based on specific multi-turn question and answer data sets, and build customized large language models for teaching scenarios.
[0004] However, the current teaching question and answer large language models are mostly optimized and designed for specific fields or tasks (such as math problem solving, language learning, etc.), resulting in very limited scope of application. In addition, existing models are difficult to meet the diverse teaching needs in actual education, limiting their promotion and popularization. At the same time, the existing models lack the ability to adapt to new fields, and when faced with emerging disciplines or rapidly changing knowledge fields, they often need to be retrained or adjusted, consuming a lot of time and resources, and reducing the actual usability.
[0005] Although the existing teaching question and answer large language models can generate logical and clear answers, they are more "passive answers" rather than "active guidance". For example, when faced with open-ended questions, the model often directly outputs the answer, without helping students think independently through step-by-step questioning or heuristic dialogue, ignoring the cultivation of students' thinking ability.
[0006] The existing technology in evaluating the teaching effect usually relies on simple question and answer matching degree or standardized test results, without fully considering the diversity of students' actual learning achievements (such as knowledge mastery, skill improvement, thinking ability development, etc.). In addition, the existing evaluation system ignores the multi-dimensionality of teaching goals, only focusing on the surface language matching degree, while ignoring the deep learning effectiveness. SUMMARY
[0007] Therefore, the technical problem to be solved by the present application is to overcome the problems of single application field, small application range, lack of guidance ability, poor interaction ability and single teaching effect evaluation index of the existing teaching question and answer large language model.
[0008] To solve the above technical problems, the application provides a complex multi-field guided teaching question and answer generation method, comprising:
[0009] Collecting teaching question and answer pairs in multiple fields and converting them into thought chain form to construct a multi-round question and answer pair dataset, which is divided into a training set and a test set in proportion;
[0010] Taking the current user question input and the current dialogue history record as input and constructing a complete prompt word based on the prompt word engineering and the context learning mechanism to guide the teaching answer as output, constructing a multi-round guided teaching question and answer large language model, and training the multi-round guided teaching question and answer large language model according to the training set to obtain a target teaching question and answer large language model;
[0011] According to the test set, the target teaching question and answer large language model is tested, and the target teaching question and answer large language model is quality evaluated and optimized based on multiple indexes including a first index measuring the length difference between the generated text and the reference answer, a second index measuring the degree of lexical matching between the generated text and the reference answer, and a third index evaluating the coincidence degree of the generated text and the reference answer at the word level, phrase level and longest common subsequence;
[0012] Continuously monitor the user online question input and real-time obtain the historical dialogue record, and generate guided teaching answers according to the optimized target teaching question and answer large language model.
[0013] Preferably, the collecting teaching question and answer pairs in multiple fields and converting them into thought chain form to construct a multi-round question and answer pair dataset comprises:
[0014] Collecting teaching question and answer pairs in multiple fields;
[0015] By analyzing the characteristics of the teaching question and answer pairs including question complexity and answer completeness, and evaluating the relevance and accuracy of the teaching question and answer pairs by a large language model, the teaching question and answer pairs are screened;
[0016] Based on the prompt word engineering, the screened teaching question and answer pairs are converted into thought chain form to construct a multi-round question and answer pair dataset;
[0017] Based on multiple student key cognitive state dimensions, diversified answers to the same question are simulated to expand the multi-round question and answer pair dataset.
[0018] Preferably, the taking the current user question input and the current dialogue history record as input and constructing a complete prompt word based on the prompt word engineering and the context learning mechanism to guide the teaching answer as output, constructing a multi-round guided teaching question and answer large language model comprises:
[0019] Constructing a memory module for storing user dialogue records;
[0020] The prompt word combination module is constructed to generate a guided teaching complete prompt word based on a prompt word engineering and a context learning mechanism, and based on a current user question input and a current dialogue history record obtained from the memory module;
[0021] The large model inference module is constructed to infer and generate a teaching guide answer based on the teaching guide complete prompt word.
[0022] Preferably, the generation of the guided teaching complete prompt word based on the prompt word engineering and the context learning mechanism, and based on the current user question input and the current dialogue history record obtained from the memory module comprises:
[0023] The structured teaching guide prompt word template is generated based on the fusion of the thinking chain reasoning and the few-shot example learning strategy;
[0024] The guided teaching complete prompt word is dynamically generated based on the prompt word template, and in combination with the current user question input and the context key information of the current dialogue history record obtained from the memory module.
[0025] Preferably, before the target teaching question and answer large language model is obtained, the trained multi-round guided teaching question and answer large language model is fine-tuned by using a low-rank matrix model.
[0026] Preferably, the calculation formula of the first index is:
[0027]
[0028] Wherein, R represents a reference answer, C represents a generated text, T(X) represents tokenization of the text X, and |T(X)| represents the length of the text X.
[0029] Preferably, the quality evaluation and optimization of the target teaching question and answer large language model comprises:
[0030] The target teaching question and answer large language model is evaluated based on a weighted average score of multiple indexes, if the evaluation score is less than a preset threshold, the performance of the target teaching question and answer large language model on the test set is analyzed, and the target teaching question and answer large language model is optimized by one or more of multiple methods including increasing training data, adjusting the prompt word template and optimizing the model hyperparameters.
[0031] The application also provides a complex multi-field guided teaching question and answer generation device, comprising:
[0032] The multi-round question and answer pair data set construction module is used to collect teaching question and answer pairs of multiple fields, and convert them into thinking chain form to construct a multi-round question and answer pair data set, which is proportionally divided into a training set and a test set;
[0033] The target teaching question and answer large language model acquisition module is configured to take the current user question input and the current dialogue history record as input, construct a guided teaching complete prompt based on a prompt word engineering and a context learning mechanism, take a guided teaching answer as output, construct a multi-round guided teaching question and answer large language model, and train the multi-round guided teaching question and answer large language model according to the training set to obtain the target teaching question and answer large language model.
[0034] The model optimization module is configured to test the target teaching question and answer large language model according to the test set, and perform quality evaluation and optimization on the target teaching question and answer large language model based on multiple indexes including a first index for measuring the length difference between generated text and a reference answer, a second index for measuring the degree of word matching between the generated text and the reference answer, and a third index for evaluating the coincidence degree of the generated text and the reference answer at the word level, the phrase level, and the longest common subsequence.
[0035] The teaching question and answer generation module is configured to continuously monitor user online question input, and acquire historical dialogue records in real time, and generate guided teaching answers in batches according to the optimized target teaching question and answer large language model.
[0036] The application further provides a complex multi-field guided teaching question and answer generation device, which comprises:
[0037] The memory is configured to store a computer program.
[0038] The processor is configured to implement the steps of the complex multi-field guided teaching question and answer generation method when the computer program is executed.
[0039] The application further provides a computer readable storage medium having a computer program stored thereon, and the computer program is configured to implement the steps of the complex multi-field guided teaching question and answer generation method when executed by a processor.
[0040] The above technical solutions of the application have the following advantages compared with the prior art:
[0041] The complex multi-field guided teaching question and answer generation method provided by the application solves the problem of single field of the model, enhances the applicability and practicality of the teaching question and answer model, further processes the input of the teaching question and answer model to improve the problem guiding ability of the model, and proposes a new evaluation system with multiple evaluation indexes to more comprehensively and accurately evaluate and optimize the teaching effect of the model. Attached Figure Description
[0042] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein:
[0043] Figure 1 This is a flowchart illustrating the implementation of a complex multi-domain guided teaching question-and-answer generation method provided by the present invention;
[0044] Figure 2 This is a flowchart of the multi-turn question-and-answer dataset construction process;
[0045] Figure 3 This is a diagram of a multi-turn guided question-answering model architecture;
[0046] Figure 4 This is a schematic diagram of a model prompt word template in one embodiment of the present invention;
[0047] Figure 5 This is a comparison chart showing the effect of intelligent teaching question-and-answering under existing technology and the effect of intelligent teaching question-and-answering of the present invention. Detailed Implementation
[0048] The core of this invention is to provide a method, apparatus, device, and computer storage medium for generating complex, multi-domain guided teaching questions and answers, which effectively solves the problems of limited applicability of large language models for teaching questions and answers, lack of guidance capabilities, poor interactivity, and limited evaluation indicators for teaching effectiveness.
[0049] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] Please refer to Figure 1. Figure 1 The flowchart for the implementation of a complex multi-domain guided teaching question-and-answer generation method provided by this invention is shown below; the specific operation steps are as follows:
[0051] S101: Collect teaching question-and-answer pairs from multiple fields, transform them into a thought chain format, construct a multi-round question-and-answer pair dataset, and divide it into training and test sets according to the proportions;
[0052] S102: input the current user question input and the current dialogue history record, and construct a guided teaching complete prompt based on the prompt word engineering and the context learning mechanism, to guide the teaching answer as output, construct a multi-round guided teaching question and answer large language model, and train the multi-round guided teaching question and answer large language model according to the training set to obtain a target teaching question and answer large language model;
[0053] S103: test the target teaching question and answer large language model according to the test set, and perform quality evaluation and optimization on the target teaching question and answer large language model based on multiple indicators including a first indicator measuring the length difference between the generated text and the reference answer, a second indicator measuring the degree of lexical matching between the generated text and the reference answer, and a third indicator evaluating the overlap of the generated text and the reference answer at the word level, phrase level and longest common subsequence;
[0054] S104: continuously monitor user online question input and obtain historical dialogue records in real time, and generate guided teaching answers according to the optimized target teaching question and answer large language model.
[0055] Based on the above embodiment, step S101 is described in detail:
[0056] In one embodiment, a plurality of teaching question and answer pairs in multiple fields are collected and converted into a thought chain form to construct a multi-round question and answer pair dataset, including:
[0057] Collecting a plurality of teaching question and answer pairs in multiple fields;
[0058] By analyzing the characteristics of the teaching question and answer pairs including question complexity and answer completeness, and evaluating the relevance and accuracy of the teaching question and answer pairs by a large language model, the teaching question and answer pairs are screened;
[0059] Based on prompt word engineering, the screened teaching question and answer pairs are converted into a thought chain form to construct a multi-round question and answer pair dataset;
[0060] Based on multiple student key cognitive state dimensions, diversified answers to the same question are simulated to expand the multi-round question and answer pair dataset.
[0061] In a specific embodiment, the data sources of the plurality of teaching question and answer pairs in multiple fields can include:
[0062] Education platform: extracting question and answer pairs from course discussion areas and problem solving of platforms such as Coursera, edX, and NetEase Cloud Classroom.
[0063] Academic resources: extracting key knowledge points and answers from papers and teaching materials in academic databases such as JSTOR and CNKI.
[0064] Competition Projects: Extract technical problems and solutions from innovation and entrepreneurship competition, and subject competition project documents.
[0065] Ensure that the Q&A covers at least 10 subject areas such as mathematics, physics, chemistry, history, literature, etc.
[0066] The extraction method can include:
[0067] Natural Language Processing Techniques: Use Named Entity Recognition (NER) to extract key terms in the question, and use relation extraction techniques to identify the logical connection between the question and the answer.
[0068] Large Language Model Assistance: Guide the model to automatically generate Q&A pairs through prompt words such as "Please extract technical questions and solutions from the following text".
[0069] For example, Figure 2 In one embodiment, the invention uses large language models to convert extracted Q&A pairs into thought chains, and then processes them into dialogues that conform to the teacher-student teaching scenario. In this process, first, the logicality and accuracy of the thought chain need to be ensured, and second, the generated dialogue style needs to be close to the real teaching interaction scenario. For this purpose, we use prompt-based techniques, including thought chains and few-shot learning methods, such as:
[0070] Break down complex problems into logically coherent sub-problems. For example:
[0071] Original question: "How to design a low-cost smart home system?"
[0072] Thought chain:
[0073] What are the core components of a smart home system?
[0074] What are the low-cost implementation solutions for each component?
[0075] How to ensure system compatibility and security?
[0076] Dialogue form conversion: Convert Q&A pairs into teacher-student dialogue format, for example:
[0077] Student: "Why does photosynthesis need light?"
[0078] Teacher: "What is the energy source of photosynthesis? What is the role of light in it?"
[0079] In one embodiment, based on multiple student key cognitive state dimensions, simulate diversified answers to the same question, and expand the multi-round Q&A pair dataset, including:
[0080] Based on educational psychology theories, design six types of students:
[0081] Weak knowledge: Frequent factual errors in answers.
[0082] Logical confusion: Answers lack coherence and jump around.
[0083] Superficial: Only answers surface-level questions, lacks in-depth analysis.
[0084] Over-divergence: Answers deviate from the core of the question and introduce irrelevant content.
[0085] Perfectionism: Answers are lengthy and overly pursue perfection.
[0086] All-around: Answers are accurate, concise, and logically clear.
[0087] Answer generation: For the same question, generate differentiated answers for each type of student, simulate real teaching scenarios, use generative adversarial networks (GAN) to automatically generate more diverse student answers, and expand the multi-round question and answer pair dataset.
[0088] Based on the above embodiments, this embodiment details step S102:
[0089] As Figure 3 In one embodiment, the current user question input and the current dialogue history record are input to build a guided teaching complete prompt based on the prompt engineering and context learning mechanism, and the guided teaching answer is output, and a multi-round guided teaching question and answer large language model is built, including:
[0090] A memory module is built to store user dialogue records;
[0091] A prompt word combination module is built to generate guided teaching complete prompts based on prompt engineering and context learning mechanism from the current user question input and the current dialogue history record obtained from the memory module;
[0092] A large model reasoning module is built to generate guided teaching answers based on the teaching complete prompt.
[0093] The memory module is responsible for storing and updating the memory of the current dialogue, providing context support for subsequent dialogues. At the beginning of the dialogue, the memory module provides the history of the current dialogue to the prompt word combination module. When the large model question and answer module generates new output, the memory module updates its storage content in time, saves the user input and model answer as a new round of dialogue record. In one embodiment, the dialogue history is divided into short-term memory (recent 5 rounds) and long-term memory (key conclusions) stored in the memory module.
[0094] The prompt word module first receives the user's input and obtains the history of the current dialogue from the memory module. Then, the module embeds this information into a preset prompt word template, which usually contains the specific content of the user's input, the historical context of the current dialogue, and specific task instructions or role settings. Finally, the module outputs a complete prompt word string for the large model reasoning module.
[0095] Without fine-tuning the model parameters, the present application uses prompt word engineering and context learning mechanisms to enable large language models to complete task responses in specific roles (such as the teacher role). By designing a structured prompt word template, the model can effectively guide and provide high-quality answers to user questions without additional training. To improve the logic and accuracy of the question and answer process, the present application proposes a prompt word construction method that combines Chain-of-Thought (CoT) reasoning and Few-shot Learning strategies. This method significantly enhances the model's ability to understand and respond to complex questions by guiding it to reason step by step and referencing a small number of typical examples.
[0096] In addition, the present application supports automatic loading and context integration of dialogue history, enabling dynamic construction of a complete prompt word structure that includes historical interaction information and current input. When this structured prompt word template is input into a pre-trained language model, it can generate natural language output with teaching guidance, thereby achieving an efficient and intelligent interactive question and answer experience. This technical solution has good universality and scalability, and is suitable for various role-playing-based intelligent question and answer systems, especially for educational assistance, online tutoring, and other application scenarios.
[0097] In one embodiment, the prompt word combination module is used to generate a structured teaching guide prompt word template based on the fusion of Chain-of-Thought reasoning and Few-shot Learning strategies, and to dynamically generate a complete teaching guide prompt word based on the current user question input and the context key information obtained from the memory module. For example:
[0098] Role setting: Clearly define the model's identity (e.g., "You are a patient physics teacher").
[0099] Task instruction: Define the answer requirements (e.g., "Please use Socrates-style questioning to guide students to think").
[0100] Example injection: Add a few-shot example to the prompt word (e.g., "Student: Why is the Earth round? Teacher: What do you think the effect of gravity on the shape of an object is?").
[0101] First-round dialogue template: "Please answer the following question as a teacher: [User question input]."
[0102] Multi-round dialogue template: "Based on the previous discussion ([historical dialogue record]), please further guide the students to think: [user question input]."
[0103] The dynamic integration of dialogue history and user input generates a complete context. In addition, the long dialogue history can be summarized to retain key information.
[0104] As Figure 4 , Figure 4 The model prompt word template diagram in another embodiment.
[0105] The large model inference module generates answers based on the prompt word generation model, which is the core part of the entire system. This module first receives the complete prompt word generated by the prompt word combination module and inputs it into the large model to trigger the reasoning process of the model. After the model generates an answer based on the prompt word, the result is returned. The generated answer is also transmitted to the memory module to update the dialogue history.
[0106] Based on the above embodiments, in one embodiment, the target teaching question and answer large language model further includes fine-tuning the trained multi-round guided teaching question and answer large language model using a low-rank matrix model. The low-rank matrix model fine-tuning method is a technique for fine-tuning instruction models. The core idea of this method is to reduce the number of model parameters by introducing low-rank matrix decomposition technology, and only update a small number of parameters during fine-tuning, thereby significantly reducing computational cost and storage requirements while maintaining high performance.
[0107] As Figure 5 , Figure 5 The comparison chart of the intelligent teaching question and answer effect of the prior art and the intelligent teaching question and answer effect of the present application.
[0108] Based on the above embodiments, the present embodiment will explain step S103 in detail:
[0109] The present application proposes a first index for measuring the length difference between the generated text and the reference answer, reflecting the balance of the model in content comprehensiveness and conciseness. Since there is no standard answer in the teaching process, the previous index of calculating the similarity between the model generated response and the annotated response may not fully evaluate the teaching quality of the large language model. When the model reasons, it often gives answers that are too complex. Therefore, the present application proposes a new index, the logarithmic proportional error, to measure the balance of the model in content comprehensiveness and conciseness. The calculation formula of the first index is:
[0110]
[0111] Where R represents the reference answer, C represents the generated text, T(X) represents tokenizing the text X, and |T(X)| represents the length of the text X.
[0112] The calculation formula of the second indicator is:
[0113]
[0114] Where: BP: Brevity Penalty, defined as:
[0115]
[0116] c: length of the candidate translation; r: length of the best matching of the reference translation
[0117] : n-gram precision, defined as:
[0118]
[0119] : weight, usually uniformly assigned, satisfying
[0120] The calculation formula of the third indicator is:
[0121] ROUGE-1, ROUGE-2, ROUGE-L: respectively evaluate the overlap of generated text and reference answer at word level, phrase level and longest common subsequence.
[0122]
[0123] Where: S: reference summary set; g: n-gram; Countmatch(g): number of matching n-grams in the candidate summary and the reference summary; Count(g): total number of n-grams in the reference summary.
[0124] Consider multiple indicators to evaluate the overall performance of the model. For example, you can calculate the weighted average score, and adjust the weight of each indicator according to actual needs.
[0125] According to the results of quality evaluation, optimize the model:
[0126] Analyze the performance of the model on the test set and find out the existing problems (such as too long generated text, low word matching degree, etc.). According to the problem analysis results, adjust the training strategy or structure of the model. For example, increase the training data, adjust the prompt word template, optimize the hyperparameters of the model, etc. Retrain and test the optimized model to verify the optimization effect.
[0127] In one embodiment, the quality evaluation and optimization of the target teaching Q&A large language model include:
[0128] The target teaching Q&A large language model is evaluated based on a weighted average score of multiple indicators, and if the evaluation score is less than a preset threshold, the performance of the target teaching Q&A large language model on the test set is analyzed, and the target teaching Q&A large language model is optimized by one or more of multiple methods including increasing training data, adjusting prompt word templates, and optimizing model hyperparameters:
[0129] Based on the above embodiments, step S104 is described in detail:
[0130] The embodiment of the application also provides a complex multi-field guided teaching Q&A generation device; the specific device can include:
[0131] The multi-turn Q&A pair data set construction module is used to collect teaching Q&A pairs in multiple fields and convert them into thought chain form, construct a multi-turn Q&A pair data set, and divide it into a training set and a test set according to a proportion;
[0132] The target teaching Q&A large language model acquisition module is used to input the current user question and the current dialogue history record as input, and construct a complete guided teaching prompt based on the prompt word engineering and the context learning mechanism to guide the teaching answer as output, construct a multi-turn guided teaching Q&A large language model, and train the multi-turn guided teaching Q&A large language model according to the training set to obtain the target teaching Q&A large language model;
[0133] The model optimization module is used to test the target teaching Q&A large language model according to the test set, and perform quality evaluation and optimization on the target teaching Q&A large language model based on multiple indicators including a first indicator measuring the length difference between the generated text and the reference answer, a second indicator measuring the degree of word matching between the generated text and the reference answer, and a third indicator evaluating the overlap degree of the generated text and the reference answer at the word level, phrase level and longest common subsequence;
[0134] The teaching Q&A generation module is used to continuously monitor the user online question input and real-time acquire the historical dialogue record, and generate guided teaching answers according to the optimized target teaching Q&A large language model.
[0135] The complex multi-field guided teaching question and answer generation device of the embodiment is used to implement the complex multi-field guided teaching question and answer generation method, and therefore the specific embodiments in the complex multi-field guided teaching question and answer generation device can be seen from the embodiment part of the complex multi-field guided teaching question and answer generation method. For example, the multi-round question and answer pair data set construction module, the target teaching question and answer large language model acquisition module, the model optimization module, and the teaching question and answer generation module are respectively used to implement steps S101, S102, S103, S104, and S105 in the complex multi-field guided teaching question and answer generation method. Therefore, the specific embodiments can be referred to the description of the corresponding embodiment part, and will not be described here.
[0136] The embodiment of the present application also provides a complex multi-field guided teaching question and answer generation device, which comprises a memory for storing a computer program and a processor for implementing the steps of the complex multi-field guided teaching question and answer generation method when the computer program is executed.
[0137] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the steps of the complex multi-field guided teaching question and answer generation method are implemented when the computer program is executed by a processor.
[0138] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0139] The present application is described with reference to flowcharts and / or block diagrams according to the method, device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The function of one flow or multiple flows and / or blocks Figure 1 The device that implements the function specified in one block or multiple blocks.
[0140] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 The flow or flows and / or blocks Figure 1 The flow or flows and / or blocks
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 The flow or flows and / or blocks Figure 1 The flow or flows and / or blocks
[0142] Obviously, the above-described embodiments are only examples and are not intended to limit the present application. Other variations and modifications can be made based on the above description and illustrations, and such variations and modifications are also within the scope of the present application. It is not necessary to recite all the embodiments of the present application. The obvious variations and modifications that are derived from the present application are also within the scope of the present application.
Claims
1. A complex multi-domain guided teaching question and answer generation method, characterized in that, The application relates to a method for constructing a multi-turn guided teaching question and answer large language model. The method comprises the following steps: collecting teaching question and answer pairs in multiple fields and converting the teaching question and answer pairs into a thinking chain form to construct a multi-turn question and answer pair dataset, wherein the teaching question and answer pairs are collected, the teaching question and answer pairs are screened through feature analysis including question complexity and answer integrity, and the relevance and accuracy of the teaching question and answer pairs are evaluated through a large language model, the screened teaching question and answer pairs are converted into a thinking chain form based on a prompt word engineering, the multi-turn question and answer pair dataset is constructed, and the multi-turn question and answer pair dataset is expanded based on multiple student key cognitive state dimensions to simulate diversified answers to the same question; inputting current user question input and current dialogue history records and constructing guided teaching complete prompt words based on a prompt word engineering and a context learning mechanism, taking guided teaching answers as output, constructing a multi-turn guided teaching question and answer large language model, training the multi-turn guided teaching question and answer large language model according to the training set, and obtaining a target teaching question and answer large language model; testing the target teaching question and answer large language model according to the test set, and performing quality evaluation and optimization on the target teaching question and answer large language model based on multiple indexes including a first index for measuring the length difference between generated text and reference answers, a second index for measuring the word matching degree between generated text and reference answers, and a third index for evaluating the coincidence degree of generated text and reference answers at the word level, the phrase level and the longest common subsequence; 2. The complex multi-domain guided instruction Q&A generation method of claim 1, wherein, continuously monitoring user online question input, and obtaining historical dialogue records in real time, and generating guided teaching answers according to the optimized target teaching question and answer large language model. The method comprises the following steps: constructing a memory module for storing user dialogue records; constructing a prompt word combination module for generating guided teaching complete prompt words based on the prompt word engineering and the context learning mechanism and the current user question input and the current dialogue history records obtained from the memory module; 3. The complex multi-domain guided instruction Q&A generation method of claim 2, wherein, constructing a large model reasoning module for generating teaching guidance answers based on the teaching guidance complete prompt words. The method comprises the following steps: generating a structured teaching guidance prompt word template based on a fusion thinking chain reasoning and a few-shot example learning strategy; 4. The complex multi-domain guided instruction Q&A generation method of claim 1, wherein, generating guided teaching complete prompt words based on the prompt word template and the context key information of the current user question input and the current dialogue history records obtained from the memory module.
5. The complex multi-domain guided instruction Q&A generation method of claim 1, wherein, Before obtaining the target teaching question and answer large language model, the method further comprises the following step: fine-tuning the trained multi-turn guided teaching question and answer large language model using a low-rank matrix model. The calculation formula of the first index is: Wherein, R represents the reference answer, C represents the generated text, T(X) represents the tokenization of text X, and |T(X)| represents the length of text X.
6. The complex multi-domain guided instruction Q&A generation method of claim 1, wherein, The quality evaluation and optimization of the target teaching Q&A large language model includes: Based on the weighted average score of multiple indicators, the target teaching Q&A large language model is evaluated, and if the evaluation score is less than a preset threshold, the performance of the target teaching Q&A large language model on the test set is analyzed, and the target teaching Q&A large language model is optimized by one or more of multiple methods including increasing training data, adjusting prompt word templates, and optimizing model hyperparameters.
7. A complex multi-domain guided teaching question and answer generation apparatus characterized by, It includes: A multi-round Q&A pair data set construction module is used to collect teaching Q&A pairs in multiple fields and convert them into thought chain form to construct a multi-round Q&A pair data set, which is divided into a training set and a test set in proportion. The teaching Q&A pairs in multiple fields are collected, the characteristics of the teaching Q&A pairs including question complexity and answer completeness are analyzed, and the relevance and accuracy of the teaching Q&A pairs are evaluated by a large language model to filter the teaching Q&A pairs. Based on the prompt word engineering, the filtered teaching Q&A pairs are converted into thought chain form to construct a multi-round Q&A pair data set, and based on multiple student key cognitive state dimensions, diversified answers to the same question are simulated to expand the multi-round Q&A pair data set; A target teaching Q&A large language model acquisition module is used to input the current user question and the current dialogue history record and construct guided teaching complete prompts based on the prompt word engineering and the context learning mechanism to guide the teaching of the answer as the output, construct a multi-round guided teaching Q&A large language model, and train the multi-round guided teaching Q&A large language model according to the training set to obtain the target teaching Q&A large language model; A model optimization module is used to test the target teaching Q&A large language model according to the test set, and evaluate and optimize the target teaching Q&A large language model based on multiple indicators including a first indicator measuring the length difference between the generated text and the reference answer, a second indicator measuring the degree of word matching between the generated text and the reference answer, and a third indicator evaluating the overlap degree of the generated text and the reference answer at the word level, phrase level, and longest common subsequence. A teaching Q&A generation module is used to continuously monitor user online question input and real-time obtain historical dialogue records, and generate guided teaching answers according to the optimized target teaching Q&A large language model.
8. A complex multi-domain guided teaching Q&A generation apparatus, characterized by, It includes: A memory is used to store a computer program; A processor is used to execute the computer program to implement the steps of the complex multi-field guided teaching Q&A generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the processor executes the computer program to implement the steps of the complex multi-field guided teaching Q&A generation method according to any one of claims 1 to 6. The computer program is stored on the computer readable storage medium, and the processor executes the computer program to implement the steps of the complex multi-field guided teaching Q&A generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Large language model-based Scogla bottom type mathematics teaching method
CN119107206A
Training method of thinking chain compression large model for rewriting task, electronic equipment and storage medium
CN119940553A