Training methods, text generation methods, devices, equipment, and media for large models
By acquiring multi-category dialogue text and labeled data, a large model is trained to generate question recommendation text, which solves the problems of high cost and low coverage in existing technologies, and achieves improved cost-effectiveness and expanded coverage.
Patent Information
- Application Number
- CN202411944211.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Existing question recommendation services are costly and have low coverage, making it difficult to effectively recommend questions for different types of conversations.
By acquiring sample dialogue texts belonging to multiple dialogue categories and their corresponding labeled question recommendation texts, the first prompt texts corresponding to each of the multiple dialogue categories are determined. The large model training method is used to connect the dialogue texts of multiple categories into the same generative model, and the model parameters are adjusted to generate question recommendation texts.
It reduced business costs, increased coverage for different types of dialogues, and improved the coverage of question recommendations and user experience.
Smart Images

Figure CN119760091B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of natural language processing and deep learning, and can be used in application scenarios such as generative retrieval, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Specifically, it relates to a training method for a large model, a text generation method, a training device for a large model, a text generation device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include natural language processing, computer vision, speech recognition, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides a method for training large models, a method for generating text, a device for training large models, a device for generating text, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of this disclosure, a method for training a large model is provided, comprising: acquiring multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories; determining multiple first prompt texts corresponding to the multiple dialogue categories, wherein the first prompt texts are used to instruct a first large model to generate predicted question recommendation texts that conform to the dialogue category corresponding to the first prompt text; and adjusting the parameters of the first large model using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts.
[0006] According to another aspect of this disclosure, a text generation method is provided, comprising: acquiring target dialogue text and determining the target dialogue category of the target dialogue text; and inputting the target dialogue text and a first prompt text corresponding to the target dialogue category into a large model to obtain question recommendation text, wherein the large model is trained using the training method of the large model described above.
[0007] According to another aspect of this disclosure, a training apparatus for a large model is provided, comprising: a first acquisition unit configured to acquire multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories; a determination unit configured to determine multiple first prompt texts corresponding to the multiple dialogue categories, wherein the first prompt texts are used to instruct a first large model to generate predicted question recommendation texts that conform to the dialogue category corresponding to the first prompt text; and a first parameter tuning unit configured to adjust the parameters of the first large model using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts.
[0008] According to another aspect of this disclosure, a text generation apparatus is provided, comprising: a fourth acquisition unit configured to acquire target dialogue text and determine a target dialogue category of the target dialogue text; and a fourth large model input unit configured to input the target dialogue text and a first prompt text corresponding to the target dialogue category into a large model in a step to obtain question recommendation text, wherein the large model is trained using the training apparatus of the aforementioned large model.
[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described above.
[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the above-described method.
[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-described method when executed by a processor.
[0012] According to one or more embodiments of this disclosure, by obtaining sample dialogue texts belonging to multiple dialogue categories and corresponding labeled question recommendation texts, this disclosure determines the first prompt texts corresponding to each of the multiple dialogue categories, thereby enabling the integration of dialogue texts of multiple categories into the same large generation model to generate question recommendation texts, thereby reducing business costs and improving the coverage of question recommendation for different categories of dialogues.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0015] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown;
[0016] Figure 2 A flowchart illustrating a training method for a large model according to an embodiment of the present disclosure is shown;
[0017] Figure 3 A flowchart illustrating a training method for a large model according to an embodiment of the present disclosure is shown;
[0018] Figure 4 A flowchart illustrating the acquisition of multiple sample dialogue texts and corresponding multiple labeled question recommendation texts according to embodiments of the present disclosure is shown.
[0019] Figure 5 A flowchart illustrating a training method for a large model according to an embodiment of the present disclosure is shown;
[0020] Figure 6 A flowchart of a text generation method according to an embodiment of the present disclosure is shown;
[0021] Figure 7 A structural block diagram of a training apparatus for a large model according to an embodiment of the present disclosure is shown;
[0022] Figure 8 A structural block diagram of a text generation apparatus according to an embodiment of the present disclosure is shown; and
[0023] Figure 9 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0024] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0025] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0026] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0027] Among related technologies, existing problem recommendation services have relatively high business costs.
[0028] To address the aforementioned issues, this disclosure obtains sample dialogue texts belonging to multiple dialogue categories and their corresponding labeled question recommendation texts, thereby determining the first prompt texts corresponding to each of the multiple dialogue categories. This enables the integration of dialogue texts from multiple categories into a single large-scale generation model to generate question recommendation texts, thereby reducing business costs and increasing the coverage of question recommendations for different categories of dialogues.
[0029] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0030] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0031] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of the methods of this disclosure.
[0032] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.
[0033] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0034] Users can use client devices 101, 102, 103, 104, 105, and / or 106 for human-computer interaction. The client devices provide interfaces that enable users to interact with them. The client devices can also output information to the user through these interfaces. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0035] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0036] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0037] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0038] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0039] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.
[0040] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0041] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0042] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.
[0043] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0044] According to one aspect of this disclosure, a method for training large models is provided. For example... Figure 2 As shown, the training method includes: step S201, obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories; step S202, determining multiple first prompt texts corresponding to the multiple dialogue categories, wherein the first prompt texts are used to instruct the first model to generate predicted question recommendation texts that conform to the dialogue category corresponding to the first prompt text; and step S203, adjusting the parameters of the first model using the multiple first prompt texts, multiple sample dialogue texts, and multiple labeled question recommendation texts.
[0045] Therefore, by acquiring sample dialogue texts belonging to multiple dialogue categories and their corresponding labeled question recommendation texts, the first prompt texts corresponding to each of the multiple dialogue categories can be determined. This enables the integration of dialogue texts from multiple categories into a single large-scale generation model to generate question recommendation texts, thereby reducing business costs and increasing the coverage of question recommendation for different categories of dialogues.
[0046] In this disclosure, "large model" refers to a deep learning large model, which has end-to-end characteristics and can directly generate response data based on user input data without relying on functional components or other inputs outside the deep learning large model. In other words, the deep learning large model itself has generative capabilities. A deep learning large model can be a large language model. Large language models typically refer to deep learning large models with billions or even hundreds of billions of parameters, which are usually trained on large-scale text data or other modal data. Large language models can be used for various natural language processing tasks, such as text generation, language translation, and question answering systems.
[0047] Large-scale deep learning models can employ, for example, an N-layer Transformer network structure with an encoder and decoder, or a Unified pre-trained Language Model (UniLM) network structure. It is understood that large-scale deep learning models can also be other neural network models based on Transformer network structures, which are not limited here. The input and output of large-scale deep learning models consist of tokens. Each token can correspond to a single word, character, phrase, or special symbol, as described below. Large-scale deep learning models can be trained using pre-training and generation tasks to acquire the aforementioned generation capabilities.
[0048] The training method proposed in this disclosure is used to train a large model's ability to generate question recommendation text (also referred to as question recommendation or Sug in this disclosure). In question recommendation, the issue is how the question recommendation system can predict and generate the user's next possible query text based on user dialogue, ensuring generation quality while improving question recommendation coverage. This, in turn, can broaden the impact of the question recommendation strategy, enhance user experience, and drive growth in core product metrics.
[0049] In other words, we write corresponding first prompt texts for each dialogue category, organize training data, and simulate a Mixture-of-Experts (MoE) system using different first prompt texts to solve the problem of low coverage caused by the single category and high cost of using large models to generate question recommendations (Sug).
[0050] Question-based recommendation refers to a recommendation system predicting and generating questions the user might ask in the next round of conversation based on the user's questions and the system's responses in the previous dialogue, and then displaying these questions on the client for the user to select and click. The dialogue system can be implemented using a large model, which can be different from the primary model used to generate the question recommendation text or the secondary model used to generate the labeled data, as will be discussed below. The recommended words or other forms of content predicted by the recommendation system are called question-based recommendations.
[0051] In step S201, multiple sample dialogue texts and corresponding multiple labeled question recommendation texts are obtained. The multiple sample dialogue texts belong to multiple dialogue categories.
[0052] According to some embodiments, multiple dialogue categories may include knowledge-based Q&A, text creation, and casual conversation. In addition to the categories mentioned above, dialogue categories may also include other content, which is not limited here.
[0053] For each dialogue category, one or more sample dialogue texts can be obtained. These sample dialogue texts may include user query texts (questions) and dialogue system response texts (answers). The labeled question recommendation texts corresponding to the sample dialogue texts can serve as the ground truth for the question recommendation task. In other words, the parameters of the first main model can be tuned using the predicted question recommendation texts generated by the first main model from multiple sample dialogue texts and the multiple labeled question recommendation texts (e.g., fine-tuning or other training methods), as will be described below.
[0054] In step S202, multiple first prompt texts corresponding to multiple dialogue categories are determined. The prompt text uses natural language to instruct the large model to complete a specific task while meeting specific detailed requirements. The first prompt text needs to instruct the large model to generate question recommendation text that conforms to the corresponding dialogue category. By constructing first prompt texts corresponding to multiple dialogue categories, the understanding and generation capabilities of the large model can be fully utilized, enabling a single large model to generate question recommendation text that conforms to the corresponding dialogue category for different dialogue categories.
[0055] In some embodiments, the first prompt text may include task description text. The task description text includes at least the dialogue category corresponding to the first prompt text. The task description text may also include the identity corresponding to the dialogue category.
[0056] In some embodiments, the first prompt text may include question restriction text. The question restriction text describes the content requirements and format requirements.
[0057] In some embodiments, the first prompt text may include a question-asking approach text. The question-asking approach text describes at least one direction for asking a question. An exemplary question-asking approach may include recommendations based on the context.
[0058] In some embodiments, the first prompt text may include at least one case. Each case includes an example user query text, an example dialogue system response text, and at least one example question recommendation text.
[0059] In some embodiments, the first prompt text may also include formatting requirement text. The formatting requirement text describes the format of the results output by the large model.
[0060] In some embodiments, the first large model can use the small model mT5-Large. mT5-Large is a multilingual version of T5, with powerful sequence-to-sequence (Seq2Seq) generation capabilities and excellent performance on multilingual tasks. With only 1.2 bytes of parameters, it ensures high-quality generation while maintaining a fast enough speed to meet the time requirements of problem recommendation tasks. The mT5 structure is based on Transformers. Its encoder is a BERT-like encoder built on multi-head self-attention, responsible for embedding and understanding the input information and passing it to the decoder. The decoder is a masked self-attention-based decoder structure, responsible for using the input information to generate the corresponding output text. The two combine features through a cross-attention mechanism.
[0061] It is understandable that the first major model may also adopt other model structures, which are not limited here.
[0062] According to some embodiments, step S203, adjusting the parameters of the first large model using multiple first prompt texts, multiple sample dialogue texts, and multiple labeled question recommendation texts, may include: for a second sample dialogue text among the multiple sample dialogue texts, inputting the second sample dialogue text and the first prompt text corresponding to the second dialogue category into the first large model to obtain the predicted question recommendation text corresponding to the second sample dialogue text, wherein the second sample dialogue text belongs to the second dialogue category; and adjusting the parameters of the first large model based on the predicted question recommendation text and the labeled text recommendation text corresponding to the second sample dialogue text.
[0063] During the training process described above, training strategies, training parameters, and testing methods can be determined according to requirements, and are not limited here. It is understood that, in addition to the methods mentioned above, the parameters of the primary model can also be adjusted using multiple initial prompt texts, multiple sample dialogue texts, and multiple labeled question recommendation texts.
[0064] According to some embodiments, such as Figure 3 As shown, the training method may further include: step S304, obtaining multiple second test dialogue texts; step S305, inputting the multiple second test dialogue texts and their corresponding first prompt texts into the adjusted first large model to obtain multiple second test question recommendation texts; and step S306, in response to determining that the multiple second test question recommendation texts do not meet the third preset requirements, readjusting the parameters of the first large model. It is understandable that... Figure 3 Steps S301-S304 can be referred to the above text. Figure 2 The descriptions of steps S201-S204 are not repeated here.
[0065] After adjusting the parameters of the first model, it can be tested using the second test dialogue text. If the question recommendation text output by the first model does not meet the requirements, its parameters can be readjusted. Thus, the above method enables the testing, evaluation, and updating of the first model.
[0066] In some embodiments, the third preset requirement may include offline testing metrics and / or online testing metrics. Offline testing metrics may include relevance, diversity, coverage, fluency, and other evaluation metrics for natural language text, and may also include human evaluation metrics. Online testing metrics may include click-through rate, conversion rate, user retention rate, etc.
[0067] According to some embodiments, multiple second test dialogue texts may include target test dialogue texts, which may correspond to test dialogue categories among multiple dialogue categories. Step S306, in response to determining that multiple second test question recommendation texts do not meet the third preset requirement, readjusting the parameters of the first large model may include: in response to determining that the target test question recommendation text among the multiple second test question recommendation texts does not meet the third preset requirement, optimizing the first prompt text corresponding to the test dialogue category, wherein the target test question recommendation text is obtained by inputting the target test dialogue text and the first prompt text corresponding to the test dialogue category into the adjusted first large model; and using the optimized first prompt text, readjusting the parameters of the first large model.
[0068] If the question recommendation text output by the first model does not meet the third preset requirement, it can be determined which dialogue category has poor output performance. Then, the first prompt text corresponding to that dialogue category can be adjusted, and the parameters of the first model can be readjusted using the adjusted first prompt text to improve the first model's ability to generate question recommendation text for that dialogue category.
[0069] In some embodiments, optimizing the first prompt text may include determining a first target questioning direction based on the target test question recommendation text; and adding the first target questioning direction to the questioning idea text in the first prompt text.
[0070] According to some embodiments, step S306, in response to determining that multiple second test question recommended texts do not meet the third preset requirements, readjusting the parameters of the first large model may include: adjusting the ratio of sample dialogue texts in multiple sample dialogue texts corresponding to each of the multiple dialogue categories; and using the multiple sample dialogue texts with adjusted ratios to readjust the parameters of the first large model.
[0071] If the question recommendation text output by the first large model does not meet the third preset requirement, the distribution of training data is optimized by dynamically adjusting the sample ratio of different dialogue categories, thereby enhancing the generalization ability of the large model and improving the coverage of multi-category requirements.
[0072] In some embodiments, data allocation needs to consider the model's online performance and user behavior. First, user dialogue data can be collected over a certain period to count the frequency of each category of dialogues (QA). Training data is then constructed based on the proportion of these frequencies. If the model fails to meet expected metrics after deployment, the click-through rate (CTR) for each category during the online experiment can be calculated. For dialogue categories with low CTR, more data of that category is added to the training data, and the training data is cleaned up based on the problems encountered during question recommendation (Sug) testing.
[0073] In step S306, the generation parameters or training parameters can also be adjusted.
[0074] In some embodiments, a batch of dialogue texts can be randomly selected for generation parameters, and the large model can be used to generate them in an offline environment. Using the default generation parameters of the large model as a baseline, the generation parameters are adjusted to conduct a control experiment, obtaining multiple sets of data (e.g., dozens of sets). The question recommendation texts are evaluated (e.g., according to quality and diversity), and the set with the best evaluation results is selected as the final generation parameters used.
[0075] In some embodiments, three sets of training parameters can be selected: a conservative set, a commonly used set, and a more aggressive set. The large model is then trained using these three sets of parameters. The large model is evaluated offline and / or online, and the set with the best performance is selected as the training parameters for subsequent training of the large model.
[0076] Returning to step S201, the recommended text for multiple annotation issues can be generated using another large model.
[0077] According to some embodiments, such as Figure 4 As shown, step S201, obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, may include: step S401, determining multiple second prompt texts corresponding to multiple dialogue categories, wherein the second prompt texts are used to instruct the trained second large model to generate labeled question recommendation texts that conform to the dialogue category corresponding to the second prompt text; and step S402, for the first sample dialogue text among the multiple sample dialogue texts, inputting the first sample dialogue text and the second prompt text corresponding to the first dialogue category among the multiple dialogue categories into the second large model to obtain the first labeled question recommendation text corresponding to the first sample dialogue text, wherein the first sample dialogue text belongs to the first dialogue category.
[0078] The above method can effectively utilize the trained second-largest model to generate labeled data, thus achieving the distillation of the second-largest model by the first-largest model.
[0079] In some embodiments, the first large model has fewer parameters than the second large model. The second large model can be a large language model with stronger generation, reasoning, and creative capabilities, and it can have a higher number of parameters. Consequently, its training and deployment costs are much higher than those of the first large model. By using the second large model with a larger number of parameters for annotation, and training the first large model with these high-quality annotated question recommendation texts, knowledge distillation is achieved. This enables the first large model to provide recommendation performance close to that of the second large model at a lower cost for the task of generating question recommendations for multiple dialogue categories.
[0080] In some embodiments, the second major model can use the ERNIE Bot 4.0 (EB4) model. EB4 is based on the Transformer architecture and has tens of billions of parameters. It integrates multimodal understanding and generation capabilities, supports various input formats such as text and images, and provides high accuracy and fluency in natural language processing tasks. EB4 is widely used in fields such as intelligent customer service and content creation, significantly improving user interaction experience and system efficiency.
[0081] Understandably, other large language models can also be used as the second major model, and no restrictions are imposed here.
[0082] In some embodiments, by constructing second prompt texts corresponding to multiple dialogue categories respectively, the understanding and generation capabilities of the second large model can be fully utilized, enabling the generation of question recommendation texts that conform to the corresponding dialogue category using a single large model for different dialogue categories.
[0083] In some embodiments, the second prompt text may include task description text. The task description text includes at least the dialogue category corresponding to the second prompt text. The task description text may also include the identity corresponding to the dialogue category.
[0084] In some embodiments, the second prompt text may include question restriction text. The question restriction text describes content requirements and format requirements.
[0085] In some embodiments, the second prompt text may include a question-asking approach text. The question-asking approach text describes at least one direction for asking a question. An exemplary question-asking approach may include recommendations based on the context.
[0086] In some embodiments, the second prompt text may include at least one case. Each case includes an example user query text, an example dialogue system response text, and at least one example question recommendation text.
[0087] In some embodiments, the second prompt text may also include formatting requirement text. The formatting requirement text describes the format of the results output by the large model.
[0088] According to some embodiments, the first dialogue category may include multiple dialogue subcategories. The second prompt text corresponding to the first dialogue category may include multiple subcategory prompt texts corresponding to the multiple dialogue subcategories, and the subcategory prompt texts are used to instruct the second main model to generate labeled question recommendation text that conforms to the corresponding dialogue subcategory. The first sample dialogue text belongs to the first dialogue subcategory among the multiple dialogue subcategories. The first sample dialogue text and the subcategory prompt text corresponding to the first dialogue subcategory are input into the second main model to obtain the first labeled question recommendation text.
[0089] By refining the first dialogue category into multiple dialogue subcategories, the number and coverage of training samples for the first main model can be increased, significantly improving the training performance of subsequent main models. It's important to note that while the second main model is aware of the dialogue subcategory corresponding to the sample dialogue text during annotation, the first prompt text does not contain information related to the dialogue subcategory. In other words, within the same dialogue category, sample dialogue texts from different dialogue subcategories all use the same first prompt text when generating prediction question recommendation text using the first main model—that is, the first prompt text corresponding to the common dialogue category to which these different dialogue subcategories belong. This approach forces the first main model to learn the content corresponding to different dialogue subcategories, thereby improving its generalization ability.
[0090] In one exemplary embodiment, the first dialogue category can be casual conversation, which may include two dialogue subcategories: content recommendation and daily discussion. It is understood that the dialogue category "casual conversation" may also include other dialogue subcategories, and each of these other dialogue categories may include multiple corresponding dialogue subcategories; this is not limited here.
[0091] In some embodiments, the subcategory prompt text may include the task description text, question limitation text, question approach text, and / or at least one example. The task description text in the subcategory prompt text may include the corresponding dialogue category and / or the corresponding dialogue subcategory.
[0092] According to some embodiments, such as Figure 5 As shown, the training method may further include: step S504, obtaining the first test dialogue text corresponding to the first dialogue sub-category; step S505, inputting the first test dialogue text and the first prompt text corresponding to the first dialogue category into the adjusted first large model to obtain the first test question recommendation text; step S506, in response to determining that the first test question recommendation text does not meet the first preset requirement, optimizing the sub-category prompt text corresponding to the first dialogue sub-category; step S507, inputting the optimized sub-category prompt text and the first sample dialogue text into the second large model to obtain the second labeled question recommendation text; and step S508, readjusting the parameters of the first large model using the first sample dialogue text, the first prompt text corresponding to the first dialogue category, and the second labeled question recommendation text.
[0093] Understandable Figure 5 The operations and effects of steps S501-S503 can be referred to the above text. Figure 2 The descriptions of steps S201-S203 are not repeated here.
[0094] The above method can couple the two parts of data annotation using the second model and training the first model, and can effectively improve the first model's ability to generate recommendations for different subcategories of problems.
[0095] In some embodiments, in step S506, optimizing the subcategory prompt text corresponding to the first dialogue subcategory may include determining a second target questioning direction based on the first test question recommendation text; and adding the second target questioning direction to the questioning idea text in the subcategory prompt text.
[0096] According to some embodiments, such as Figure 4 As shown, step S201, obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, may further include: step S403, in response to determining that the first labeled question recommendation text does not meet the second preset requirement, optimizing the second prompt text corresponding to the first dialogue category.
[0097] Therefore, by using the above method, the second prompt text can be iterated to improve the quality of the labeled data.
[0098] In some embodiments, optimizing the second prompt text may include determining a third target question direction based on the second labeled question recommendation text; and adding the third target question direction to the questioning idea text in the second prompt text.
[0099] According to some embodiments, such as Figure 4 As shown, step S201, obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, may further include: step S404, determining the first batch of sample dialogue texts from the multiple sample dialogue texts, the first batch of sample dialogue texts including the first sample dialogue text; step S405, in response to determining that the labeled question recommendation texts obtained after inputting the first batch of sample dialogue texts and their corresponding second prompt texts into the second large model all meet the second preset requirements, determining the second batch of sample dialogue texts from the multiple sample dialogue texts, the second batch being larger than the first batch; and step S406, inputting the second batch of sample dialogue texts and their corresponding second prompt texts into the second large model to obtain multiple labeled question recommendation texts.
[0100] Therefore, the generated data can be evaluated. If it does not meet expectations, the second suggestion text can be optimized based on its appearance in the question recommendation text, and then a small batch can be generated again. If the data quality meets expectations, a large batch of labeled data can be used for subsequent training of the first large model.
[0101] According to another aspect of this disclosure, a text generation method is provided. For example... Figure 6As shown, the text generation method includes: step S601, obtaining the target dialogue text and determining the target dialogue category of the target dialogue text; step S602, inputting the target dialogue text and the first prompt text corresponding to the target dialogue category into the large model to obtain the question recommendation text. The large model is trained using the large model training method provided above.
[0102] In some embodiments, the target dialogue text may include the user's target query text and the dialogue system's target response text. The target dialogue category may be determined from among the multiple dialogue categories involved in the large model training method provided above. The large model may be the first large model trained.
[0103] According to another aspect of this disclosure, a training apparatus for large models is provided. For example... Figure 7 As shown, the training device 700 includes: a first acquisition unit 710 configured to acquire multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories; a determination unit 720 configured to determine multiple first prompt texts corresponding to the multiple dialogue categories, wherein the first prompt texts are used to instruct the first model to generate predicted question recommendation texts that conform to the dialogue category corresponding to the first prompt text; and a first parameter tuning unit 730 configured to adjust the parameters of the first model using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts.
[0104] It is understood that the operation and effects of units 710-730 in device 700 can be referred to the description of steps S201-S203 above, and will not be repeated here.
[0105] According to some embodiments, multiple dialogue categories may include knowledge-based Q&A, text creation, and casual conversation.
[0106] According to some embodiments, the first parameter tuning unit may include: a third large model input subunit, configured to input the second sample dialogue text and the first prompt text corresponding to the second dialogue category into the first large model for a second sample dialogue text among multiple sample dialogue texts, so as to obtain the predicted question recommendation text corresponding to the second sample dialogue text, wherein the second sample dialogue text belongs to the second dialogue category; and a third parameter tuning subunit, configured to adjust the parameters of the first large model based on the predicted question recommendation text and the labeled text recommendation text corresponding to the second sample dialogue text.
[0107] According to some embodiments, the training device may further include: a third acquisition unit configured to acquire a plurality of second test dialogue texts; a third large model input unit configured to input the plurality of second test dialogue texts and corresponding first prompt texts into an adjusted first large model to obtain a plurality of second test question recommendation texts; and a third parameter tuning unit configured to readjust the parameters of the first large model in response to determining that the plurality of second test question recommendation texts do not meet a third preset requirement.
[0108] According to some embodiments, the plurality of second test dialogue texts may include target test dialogue text, which may correspond to a test dialogue category among a plurality of dialogue categories. The third parameter tuning unit may include: a second optimization subunit configured to optimize a first prompt text corresponding to a test dialogue category in response to determining that the target test question recommendation text among the plurality of second test question recommendation texts does not meet a third preset requirement, wherein the target test question recommendation text is obtained by inputting the target test dialogue text and the first prompt text corresponding to the test dialogue category into an adjusted first large model; and a first parameter tuning subunit configured to readjust the parameters of the first large model using the optimized first prompt text.
[0109] According to some embodiments, the third parameter tuning unit may include: a ratio adjustment subunit configured to adjust the ratio of sample dialogue texts corresponding to each of the multiple dialogue categories in the multiple sample dialogue texts; and a second parameter tuning subunit configured to readjust the parameters of the first large model using the multiple sample dialogue texts after the ratio adjustment.
[0110] According to some embodiments, the first acquisition unit may include: a first determining subunit, configured to determine a plurality of second prompt texts corresponding to a plurality of dialogue categories, wherein the second prompt texts are used to instruct a trained second large model to generate labeled question recommendation text that conforms to the dialogue category corresponding to the second prompt text; and a first large model input subunit, configured to input a first sample dialogue text and a second prompt text corresponding to the first dialogue category from a plurality of sample dialogue texts into the second large model to obtain a first labeled question recommendation text corresponding to the first sample dialogue text, wherein the first sample dialogue text belongs to the first dialogue category.
[0111] According to some embodiments, the number of parameters in the first large model can be smaller than that in the second large model.
[0112] According to some embodiments, the first dialogue category may include multiple dialogue subcategories, and the second prompt text corresponding to the first dialogue category may include multiple subcategory prompt texts corresponding to the multiple dialogue subcategories. The subcategory prompt texts can be used to instruct the second main model to generate labeled question recommendation text that conforms to the corresponding dialogue subcategory. The first sample dialogue text belongs to the first dialogue subcategory among multiple dialogue subcategories. The first sample dialogue text and the subcategory prompt text corresponding to the first dialogue subcategory can be input into the second main model to obtain the first labeled question recommendation text.
[0113] According to some embodiments, the training device may further include: a second acquisition unit configured to acquire a first test dialogue text corresponding to a first dialogue sub-category; a first large model input unit configured to input the first test dialogue text and a first prompt text corresponding to the first dialogue category into an adjusted first large model to obtain a first test question recommendation text; an optimization unit configured to optimize the sub-category prompt text corresponding to the first dialogue sub-category in response to determining that the first test question recommendation text does not meet a first preset requirement; a second large model input unit configured to input the optimized sub-category prompt text and a first sample dialogue text into a second large model to obtain a second labeled question recommendation text; and a second parameter tuning unit configured to readjust the parameters of the first large model using the first sample dialogue text, the first prompt text corresponding to the first dialogue category, and the second labeled question recommendation text.
[0114] According to some embodiments, the first acquisition unit may include: a first optimization subunit, configured to optimize the second prompt text corresponding to the first dialogue category in response to determining that the recommended text for the first labeled question does not meet the second preset requirement.
[0115] According to some embodiments, the first acquisition unit may include: a second determining subunit configured to determine a first batch of sample dialogue texts from a plurality of sample dialogue texts, the first batch of sample dialogue texts including the first sample dialogue text; a third determining subunit configured to determine a second batch of sample dialogue texts from a plurality of sample dialogue texts, the second batch being larger than the first batch, in response to determining that the labeled question recommendation texts obtained after inputting the first batch of sample dialogue texts and their corresponding second prompt texts into a second large model all meet a second preset requirement; and a second large model input subunit configured to input the second batch of sample dialogue texts and their corresponding second prompt texts into a second large model to obtain a plurality of labeled question recommendation texts.
[0116] According to another aspect of this disclosure, a text generation apparatus is provided. For example... Figure 8As shown, the text generation device 800 includes: a fourth acquisition unit 810, configured to acquire target dialogue text and determine the target dialogue category of the target dialogue text; and a fourth large model input unit 820, configured to input the target dialogue text and a first prompt text corresponding to the target dialogue category into a large model in a step to obtain question recommendation text. The large model is trained using the aforementioned device 700. It can be understood that the operation and effect of units 810-820 in device 800 can be referred to the description of steps S601-S602 above.
[0117] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0119] refer to Figure 9 The present invention describes a structural block diagram of an electronic device 900 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0120] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded into a random access memory (RAM) 903 from a storage unit 908. The RAM 903 may also store various programs and data required for the operation of the electronic device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0121] Multiple components in electronic device 900 are connected to I / O interface 905, including: input unit 906, output unit 907, storage unit 908, and communication unit 909. Input unit 906 can be any type of device capable of inputting information to electronic device 900. Input unit 906 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and can include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 907 can be any type of device capable of presenting information, and can include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 908 can include, but is not limited to, hard disk and optical disk. Communication unit 909 allows electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and can include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0122] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods, processes, and / or processes described above. For example, in some embodiments, these methods, processes, and / or processes may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the methods, processes, and / or processes described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform these methods, processes, and / or processes by any other suitable means (e.g., by means of firmware).
[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0128] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the management difficulties and weak business scalability inherent in traditional physical hosts and VPS (Virtual Private Server) services. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0129] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0130] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A training method for a large model, comprising: Obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories, the multiple sample dialogue texts include a first sample dialogue text, the multiple dialogue categories include a first dialogue category, the first dialogue category includes multiple dialogue subcategories, and the first sample dialogue text belongs to the first dialogue subcategory among the multiple dialogue subcategories. Obtaining the multiple sample dialogue texts and corresponding multiple labeled question recommendation texts includes: Determine multiple second prompt texts corresponding to the multiple dialogue categories, wherein the second prompt text is used to instruct the trained second main model to generate labeled question recommendation text that matches the dialogue category corresponding to the second prompt text, and the second prompt text corresponding to the first dialogue category includes multiple sub-category prompt texts that correspond to the multiple dialogue sub-categories, the sub-category prompt texts being used to instruct the second main model to generate labeled question recommendation text that matches the corresponding dialogue sub-category; and The first sample dialogue text and the sub-category prompt text corresponding to the first dialogue sub-category are input into the second large model to obtain the first labeled question recommendation text; Determine multiple first prompt texts corresponding to the multiple dialogue categories, wherein the first prompt text is used to instruct the first large model to generate prediction question recommendation text that matches the dialogue category corresponding to the first prompt text; The parameters of the first large model are adjusted using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts; Obtain the first test dialogue text corresponding to the first dialogue sub-category; Input the first test dialogue text and the first prompt text corresponding to the first dialogue category into the adjusted first large model to obtain the first test question recommendation text; In response to determining that the recommended text for the first test question does not meet the first preset requirement, the subcategory prompt text corresponding to the first dialogue subcategory is optimized; The optimized sub-category prompt text and the first sample dialogue text are input into the second large model to obtain the second labeled question recommendation text; and The parameters of the first large model are readjusted using the first sample dialogue text, the first prompt text corresponding to the first dialogue category, and the second labeled question recommendation text.
2. The method according to claim 1, wherein, Obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts also includes: In response to the determination that the recommended text for the first labeled question does not meet the second preset requirement, the second prompt text corresponding to the first dialogue category is optimized.
3. The method according to claim 2, wherein, Obtaining multiple sample dialogue texts and corresponding multiple labeled question recommendation texts also includes: A first batch of sample dialogue texts is determined from the plurality of sample dialogue texts, wherein the first batch of sample dialogue texts includes the first sample dialogue texts. In response to determining that the labeled question recommendation texts obtained after inputting the first batch of sample dialogue texts and their corresponding second prompt texts into the second large model all meet the second preset requirements, a second batch of sample dialogue texts is determined from the plurality of sample dialogue texts, wherein the second batch is larger than the first batch; and The sample dialogue texts of the second batch and the corresponding second prompt texts are input into the second large model to obtain the multiple labeled question recommendation texts.
4. The method according to claim 1, wherein, The number of parameters in the first largest model is smaller than that in the second largest model.
5. The method according to any one of claims 1-4, further comprising: Obtain multiple second test dialogue texts; The multiple second test dialogue texts and their corresponding first prompt texts are input into the adjusted first large model to obtain multiple second test question recommendation texts; as well as In response to the determination that the recommended texts for the plurality of second test questions do not meet the third preset requirements, the parameters of the first large model are readjusted.
6. The method according to claim 5, wherein, The plurality of second test dialogue texts include target test dialogue texts, which correspond to test dialogue categories among the plurality of dialogue categories. The adjustment of the parameters of the first large model in response to determining that the plurality of second test question recommendation texts do not meet the third preset requirement includes: In response to determining that the target test question recommendation text among the plurality of second test question recommendation texts does not meet the third preset requirement, the first prompt text corresponding to the test dialogue category is optimized. The target test question recommendation text is obtained by inputting the target test dialogue text and the first prompt text corresponding to the test dialogue category into an adjusted first large model; and Using the optimized first prompt text, the parameters of the first large model are readjusted.
7. The method according to claim 5, wherein, In response to the determination that the recommended texts for the plurality of second test questions do not meet the third preset requirements, the parameters of the first large model are readjusted, including: Adjust the proportion of sample dialogue texts in multiple sample dialogue texts corresponding to each of the multiple dialogue categories; and The parameters of the first large model were readjusted using multiple sample dialogue texts with adjusted ratios.
8. The method according to any one of claims 1-4, wherein, Adjusting the parameters of the first large model using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts includes: For the second sample dialogue text among the plurality of sample dialogue texts, the second sample dialogue text and the first prompt text corresponding to the second dialogue category are input into the first large model to obtain the predicted question recommendation text corresponding to the second sample dialogue text, wherein the second sample dialogue text belongs to the second dialogue category; and Based on the predicted question recommendation text and the labeled recommendation text corresponding to the second sample dialogue text, the parameters of the first large model are adjusted.
9. The method according to any one of claims 1-4, wherein, The various dialogue categories include knowledge quizzes, writing, and casual conversation.
10. A text generation method, comprising: Obtain the target dialogue text and determine the target dialogue category of the target dialogue text; as well as The target dialogue text and the first prompt text corresponding to the target dialogue category are input into a large model to obtain the question recommendation text, wherein the large model is trained using the method according to any one of claims 1-9.
11. A training device for a large model, comprising: The first acquisition unit is configured to acquire multiple sample dialogue texts and corresponding multiple labeled question recommendation texts, wherein the multiple sample dialogue texts belong to multiple dialogue categories, the multiple sample dialogue texts include a first sample dialogue text, the multiple dialogue categories include a first dialogue category, the first dialogue category includes multiple dialogue subcategories, and the first sample dialogue text belongs to a first dialogue subcategory among the multiple dialogue subcategories. The first acquisition unit includes: A first determining subunit is configured to determine multiple second prompt texts corresponding to the plurality of dialogue categories, wherein the second prompt texts are used to instruct a trained second main model to generate labeled question recommendation texts that conform to the dialogue category corresponding to the second prompt texts, and the second prompt texts corresponding to the first dialogue category include multiple sub-category prompt texts that correspond to the plurality of dialogue sub-categories, the sub-category prompt texts being used to instruct the second main model to generate labeled question recommendation texts that conform to the corresponding dialogue sub-category; and The first large model input subunit is configured to input the first sample dialogue text and the subcategory prompt text corresponding to the first dialogue subcategory into the second large model to obtain the first labeled question recommendation text; The determining unit is configured to determine a plurality of first prompt texts corresponding to the plurality of dialogue categories, wherein the first prompt text is used to instruct the first large model to generate a prediction question recommendation text that conforms to the dialogue category corresponding to the first prompt text; The first parameter tuning unit is configured to adjust the parameters of the first large model using the multiple first prompt texts, the multiple sample dialogue texts, and the multiple labeled question recommendation texts. The second acquisition unit is configured to acquire the first test dialogue text corresponding to the first dialogue sub-category; The first large model input unit is configured to input the first test dialogue text and the first prompt text corresponding to the first dialogue category into the adjusted first large model to obtain the first test question recommendation text; The optimization unit is configured to optimize the subcategory prompt text corresponding to the first dialogue subcategory in response to determining that the recommended text of the first test question does not meet the first preset requirement; The second large model input unit is configured to input the optimized sub-category prompt text and the first sample dialogue text into the second large model to obtain the second labeled question recommendation text; and The second parameter tuning unit is configured to readjust the parameters of the first large model using the first sample dialogue text, the first prompt text corresponding to the first dialogue category, and the second labeled question recommendation text.
12. The apparatus according to claim 11, wherein, The first acquisition unit includes: The first optimization subunit is configured to optimize the second prompt text corresponding to the first dialogue category in response to determining that the recommended text of the first labeled question does not meet the second preset requirement.
13. The apparatus according to claim 12, wherein, The first acquisition unit includes: The second determining subunit is configured to determine a first batch of sample dialogue texts from the plurality of sample dialogue texts, the first batch of sample dialogue texts including the first sample dialogue texts. The third determining subunit is configured to, in response to determining that the labeled question recommendation texts obtained after inputting the first batch of sample dialogue texts and their corresponding second prompt texts into the second large model all meet the second preset requirements, determine a second batch of sample dialogue texts from the plurality of sample dialogue texts, wherein the second batch is larger than the first batch; and The second large model input subunit is configured to input the sample dialogue text of the second batch and the corresponding second prompt text into the second large model to obtain the multiple labeled question recommendation texts.
14. The apparatus according to claim 11, wherein, The number of parameters in the first largest model is smaller than that in the second largest model.
15. The apparatus according to any one of claims 11-14, further comprising: The third acquisition unit is configured to acquire multiple second test dialogue texts; The third large model input unit is configured to input the multiple second test dialogue texts and the corresponding first prompt texts into the adjusted first large model to obtain multiple second test question recommendation texts; as well as The third parameter tuning unit is configured to readjust the parameters of the first large model in response to determining that the recommended texts for the plurality of second test questions do not meet the third preset requirements.
16. The apparatus according to claim 15, wherein, The plurality of second test dialogue texts include target test dialogue text, which corresponds to a test dialogue category among the plurality of dialogue categories. The third parameter tuning unit includes: The second optimization subunit is configured to optimize the first prompt text corresponding to the test dialogue category in response to determining that the target test question recommendation text among the plurality of second test question recommendation texts does not meet the third preset requirement; wherein the target test question recommendation text is obtained by inputting the target test dialogue text and the first prompt text corresponding to the test dialogue category into an adjusted first large model; and The first parameter tuning subunit is configured to readjust the parameters of the first large model using the optimized first prompt text.
17. The apparatus according to claim 15, wherein, The third parameter tuning unit includes: The proportion adjustment subunit is configured to adjust the proportion of sample dialogue texts corresponding to each of the multiple dialogue categories in the multiple sample dialogue texts; and The second parameter tuning subunit is configured to readjust the parameters of the first large model using multiple sample dialogue texts with adjusted ratios.
18. The apparatus according to any one of claims 11-14, wherein, The first parameter tuning unit includes: The third large model input subunit is configured to input the second sample dialogue text from the plurality of sample dialogue texts, along with the first prompt text corresponding to the second dialogue category, into the first large model to obtain the predicted question recommendation text corresponding to the second sample dialogue text, wherein the second sample dialogue text belongs to the second dialogue category; and The third parameter tuning subunit is configured to adjust the parameters of the first large model based on the predicted question recommendation text and the labeled recommendation text corresponding to the second sample dialogue text.
19. The apparatus according to any one of claims 11-14, wherein, The various dialogue categories include knowledge quizzes, writing, and casual conversation.
20. A text generation apparatus, comprising: The fourth acquisition unit is configured to acquire the target dialogue text and determine the target dialogue category of the target dialogue text; as well as The fourth large model input unit is configured to input the target dialogue text and the first prompt text corresponding to the target dialogue category into the large model in the step to obtain the question recommendation text, wherein the large model is trained using the apparatus according to any one of claims 11-19.
21. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-10.
22. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-10.
23. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method of any one of claims 1-10.
Citation Information
Patent Citations
Question recommendation method and device, computer equipment and storage medium
CN117033588A
Dialogue processing method and device and dialogue model training method and device
CN117556007A
Text analysis model training method and device, equipment and storage medium
CN117688385A
Text generation method and device and language model training method and device
CN118193674A