Model processing method, device, electronic device and readable storage medium

By disassembling complex tasks into instruction task chains and generating corresponding propt data, the task execution model is gradually optimized, and the problem of insufficient model execution capabilities in the existing technology is solved, and the capability improvement and generalization capabilities of the model in complex tasks is realized. Enhanced.

CN117350407BActive Publication Date: 2024-11-05北京中关村科金技术有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311549066.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2024-11-05
Estimated Expiration
2043-11-20

AI Technical Summary

Technical Problem

The existing technology cannot effectively improve the execution capabilities of task execution models, mainly due to the limitations of model scale and training data volume.

Method used

By disassembling complex tasks into multi-level instruction task chains, first and second prompt data are generated, pre-trained models are trained using the first prompt data, initial task execution models are generated, and the model is adjusted using the second prompt data to obtain the target Task execution model, thereby gradually optimizing the model's task execution capabilities.

Benefits of technology

It improves the model's ability when executing complex tasks, enhances the understanding of the logical relationship between fine-grained tasks and atomic tasks, reduces the difficulty of the emergence of complex tasks, and improves the model's task execution ability and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117350407B_ABST
    Figure CN117350407B_ABST
Patent Text Reader

Abstract

The present application discloses a model processing method, device, electronic device and readable storage medium, which belongs to the field of artificial intelligence technology. The model processing method in the embodiment of the present application includes: obtaining training data; generating first prompt data and second prompt data according to the training data and a pre-established prompt template; the first prompt data is related to the first task, and the first task at least includes a target atomic task; the second prompt data is related to the second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is more than the number of atomic tasks included in the first task; the pre-trained model is trained using the first prompt data to obtain an initial task execution model; the initial task execution model is adjusted using the second prompt data to obtain a target task execution model. In this way, the task execution capability of the model can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a model processing method, device, electronic device and readable storage medium. Background Art

[0002] In the related art, in order to improve the execution capability of the task execution model when facing complex tasks, new tasks, etc., the task execution model is usually trained by increasing the model size and / or increasing the amount of training data. However, due to reasons such as training costs, the increase in model size and the amount of training data are usually limited, which will result in the inability to effectively improve the task execution capability of the model. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a model processing method, device, electronic device and readable storage medium to solve the problem that the task execution capability of the model cannot be effectively improved at present.

[0004] In order to solve the above technical problems, this application is implemented as follows:

[0005] In a first aspect, a model processing method is provided, comprising:

[0006] Get training data;

[0007] Generate first prompt data and second prompt data according to the training data and a pre-established prompt template; wherein the first prompt data is related to a first task, and the first task at least includes a target atomic task; the second prompt data is related to a second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is greater than the number of atomic tasks included in the first task;

[0008] Using the first prompt data to train the pre-trained model to obtain an initial task execution model;

[0009] The initial task execution model is adjusted using the second prompt data to obtain a target task execution model.

[0010] In a second aspect, a model processing device is provided, comprising:

[0011] Get module for training data;

[0012] A generation module, configured to generate first prompt data and second prompt data according to the training data and a pre-established prompt template; wherein the first prompt data is related to a first task, and the first task at least includes a target atomic task; and the second prompt data is related to a second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is greater than the number of atomic tasks included in the first task;

[0013] A training module, used to train the pre-trained model using the first prompt data to obtain an initial task execution model;

[0014] An adjustment module is used to adjust the initial task execution model using the second prompt data to obtain a target task execution model.

[0015] In a third aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0016] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0017] In an embodiment of the present application, after obtaining the training data, the first prompt data and the second prompt data can be generated according to the training data and the pre-established prompt template; the first prompt data is related to the first task, and the first task includes at least the target atomic task; the second prompt data is related to the second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is more than the number of atomic tasks included in the first task; the pre-trained model is trained using the first prompt data to obtain an initial task execution model; and the initial task execution model is adjusted using the second prompt data to obtain a target task execution model. Thus, the task execution model can be gradually adjusted / optimized according to the complexity of the task, so that the model can understand the force of the logical relationship between fine-grained tasks / atomic tasks while establishing the understanding and cognitive ability of fine-grained tasks / atomic tasks in the process of learning the solution of complex tasks, so that the model essentially understands the solution process and logic of complex tasks, builds the ability to execute complex tasks, and then when executing complex tasks, the ability can increase sharply, thereby effectively improving the task execution ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a model processing method provided in an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of a hierarchical instruction task chain in a specific embodiment of the present application;

[0020] Figure 3 is a schematic diagram of the model processing process in a specific embodiment of the present application;

[0021] Figure 4 is a structural schematic diagram of a model processing device provided in an embodiment of the present application;

[0022] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0025] In order to solve the problem that the task execution capability of the model cannot be effectively improved at present, and considering that the capability emergence of the model may be related to the epiphany of the model, the embodiment of the present application proposes to decompose complex tasks into multi-level instruction task chains, establish associations from complex tasks to simple tasks, and establish the internal logic between fine-grained tasks. In this way, when the model is learning to solve complex tasks, it focuses on the solution of fine-grained tasks while understanding the logical relationship between fine-grained tasks. This allows the model to essentially understand the solution process and logic of complex tasks, thereby providing effective fine-grained sub-tasks for the solution of other complex tasks. Through the combination of simple fine-grained sub-tasks, it is easier to optimize the solution logic of complex tasks, so that the model can quickly produce capability emergence phenomenon.

[0026] The model processing method, device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0027] See also Figure 1 , Figure 1 is a flow chart of a model processing method provided in an embodiment of the present application, the method is applied to electronic devices, such as Figure 1 As shown, the method comprises the following steps:

[0028] Step 11: Get training data;

[0029] Step 12: Generate first prompt data and second prompt data according to the training data and the pre-established prompt template; the first prompt data is related to the first task, and the first task at least includes a target atomic task; the second prompt data is related to the second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is more than the number of atomic tasks included in the first task;

[0030] Step 13: Use the first prompt data to train the pre-trained model to obtain an initial task execution model;

[0031] Step 14: Use the second prompt data to adjust the initial task execution model to obtain a target task execution model.

[0032] In the embodiments of the present application, the training data may be selected as documents, question and answer (QA) peer data, etc. in a document question and answer scenario, or may be selected as text data in other scenarios, etc., without limitation.

[0033] The pre-trained model can be an open source large model, such as Baichuan large model, chatGLM6B, llama2, etc. The prompt template is an input template built / created for a task (such as a single or multiple atomic tasks), which can help build prompt data for training the model.

[0034] The first task and the second task may be tasks in a specific field, such as finance, medicine, or communications. The atomic task may be understood as a task unit that implements a basic function. A complex task may include multiple atomic tasks, and the more atomic tasks included, the higher the complexity of the corresponding complex task.

[0035] Optionally, the second task can be understood as a hierarchical instruction task chain / complex task, in which each atomic task has an intrinsic correlation relationship with each other.

[0036] Optionally, the atomic task may be but is not limited to any of the following: word segmentation task, part-of-speech tagging task, text classification task, entity disambiguation task, entity extraction task, text generation task, reading comprehension task, syntactic analysis task, etc.

[0037] Optionally, the first task only includes the target atomic task, such as only the word segmentation task or the text classification task, etc. In this case, the model can be trained based on the first prompt data related only to the target atomic task, and then the model can be gradually fine-tuned based on the second prompt data related to the complex task including the target atomic task, until the model can show a sharp increase in capability when performing the complex task.

[0038] Through the scheme in this application, the task execution model can be gradually optimized / adjusted according to the complexity of the task, so that the model can understand the force of the logical relationship between fine-grained tasks / atomic tasks while building the understanding and cognitive ability of fine-grained tasks / atomic tasks in the process of learning to solve complex tasks, so that the model can build the ability to execute complex tasks with the help of solving fine-grained tasks / atomic tasks, and understand the solution process and logic of complex tasks in essence, and then there can be a phenomenon of a sharp increase in ability when executing complex tasks, thereby effectively improving the model's task execution ability. In addition, through the scheme in this application, the generalization ability of the model's domain complex tasks can also be improved, reducing the difficulty of the emergence of complex task capabilities.

[0039] It can be understood that through the above-mentioned operation of adjusting the model, the logical relationship between atomic tasks and atomic tasks can be injected into the model through complex tasks, so that the model can continuously understand the interaction between atomic tasks and atomic tasks, thereby constructing a unity of logical forces between atomic tasks and atomic tasks, so that the model can be generalized to more complex tasks on the basis of the unity, and so on, continuously expanding the model's ability to solve more complex tasks, thereby continuously promoting the emergence of the model's capabilities in multi-level dimensions.

[0040] Optionally, the second prompt data is related to a plurality of second tasks, the plurality of second tasks are divided into n levels, the number of atomic tasks included in the second task of the i-th level is less than the number of atomic tasks included in the second task of the j-th level, 1≤i<j≤n; that is, in the n levels, the complexity of the second task increases with the increase of the level. The above-mentioned use of the second prompt data to adjust the initial task execution model to obtain the target task execution model may include:

[0041] The initial task execution model is adjusted by using the second prompt data related to the second task of each level of the n levels in turn to obtain the target task execution model. In this way, the initial task execution model can be gradually optimized / adjusted according to the complexity of the task, which is conducive to the emergence of the model's ability to handle complex tasks.

[0042] Optionally, before the above step 12, the model processing method in this embodiment may also include: first, according to the hierarchical instruction task chain under the pre-established target domain, preliminarily establish a prompt template for the instruction task; then, use the pre-trained language model to expand the preliminarily established prompt template to obtain the pre-established prompt template. For example, the pre-trained language model is GPT4, etc. In this way, with the help of the expansion of the language model, the prompt template can be enriched, which is helpful for subsequent model training and adjustment.

[0043] Optionally, in order to ensure correctness, after obtaining the prompt template, the prompt template may be manually reviewed, optimized, and verified.

[0044] Optionally, the target domain includes but is not limited to the text processing domain, etc. The hierarchical instruction task chain may be established for complex tasks in specific scenarios, such as complex tasks in document question-answering scenarios, combined with natural language processing (NLP) instruction tasks.

[0045] Optionally, the NLP instruction tasks include but are not limited to: (1) explanation / description, including but not limited to noun / term explanation, semantic explanation, behavior explanation, cause explanation, etc.; (2) creation, including but not limited to writing poems, songs, articles, comments, etc.; (3) coding, including but not limited to writing comments, code generation, code completion, grammar testing, etc.; (4) description, including but not limited to task / role description, status description, phenomenon description, fact description, etc.

[0046] Optionally, the hierarchical instruction task chain can be as follows Figure 2 As shown in the figure, each branch can be understood as a hierarchical instruction task chain, and each node represents an atomic task. For example, the previous level task of the atomic task "word segmentation" is "syntactic analysis", the previous level task is "keyword recognition", the previous level task is "semantic understanding", the previous level task is "language point", and the previous level task is "context understanding"; for another example, the previous level task of the atomic task "name / verb division" is "lexical analysis", the previous level task is "keyword recognition", and the previous level task is "query understanding"; and so on.

[0047] Optionally, the prompt template includes a task part, an input data part and an output result part; the above process of generating the first prompt data and the second prompt data according to the training data and the pre-established prompt template may include: adding the information of the first task to the task part in the prompt template, adding the training data to the input data part in the prompt template, and adding the result obtained by executing the first task on the training data to the output result part in the prompt template, to obtain the first prompt data; and adding the information of the second task to the task part in the prompt template, adding the training data to the input data part in the prompt template, and adding the result obtained by executing the second task on the training data to the output result part in the prompt template, to obtain the second prompt data.

[0048] Optionally, the prompt template also includes an output json format to standardize the output results.

[0049] For example, taking the target atomic task as word segmentation, several instances of the first prompt data may be as follows:

[0050] 1){Segment the input sentence;

[0051] #input#: Region A is an integral part of country B;

[0052] #output#:

[0053] {Region A is an integral part of Country B}}

[0054] 2) {Segment the input sentence and output the words that are "nouns";

[0055] #input#: Region A is an integral part of country B;

[0056] Output json format;

[0057] #output#:

[0058] #Word segmentation results:

[0059] #noun:

[0060] {“Word segmentation result”: [“region A”, “is”, “country B”, “indivisible”, “of”, “part”], “noun”: [“region A”, “country B”, “part”]}}

[0061] 3) {Segment the input sentence and output the words that are “function words”;

[0062] #input#: Region A is an integral part of country B;

[0063] Output json format;

[0064] #output#:

[0065] #Word segmentation results:

[0066] # Function words:

[0067] {“Word segmentation results”: [“Region A”, “is”, “Country B”, “Indivisible”, “of”, “part”], “Function words”: [“is”, “of”]}}

[0068] 4) {Segment the input sentence and output words with subject-object relationship;

[0069] #input#: Region A is an integral part of country B;

[0070] Output json format;

[0071] #output#:

[0072] #Word segmentation results:

[0073] #{predicate, object}:

[0074] {"Word segmentation result": ["Region A", "is", "Country B", "Indivisible", "of", "part"], "Predicate, Object": ["is", "part"]}}

[0075] Several examples of the second prompt data may be as follows:

[0076] ①{Segment the input sentence and select the three most important words to form a sentence, the number is 2;

[0077] #input#: Region A is an integral part of country B;

[0078] Output json format: {words: [], sentences: []};

[0079] #output#:

[0080] {"Words":["Region A","Country B","Indivisible"],"Sentences":["Region A is part of Country B","Country B considers Region A to be indivisible"]}}

[0081] ②{Segment the input sentence and output the two most important words and the corresponding word count;

[0082] #input#: Region A is an integral part of country B;

[0083] Output json format: {word, number of words};

[0084] #output#:

[0085] {"Region A","2";"Country B","2"}

[0086] It should be noted that the above examples of the first prompt data and the second prompt data are only for illustrating and understanding the solution in this application. Different first prompt data and second prompt data can be generated according to specific training data, training requirements and corresponding instruction task chains, and this is not limited.

[0087] See also Figure 3 As shown, after generating the first prompt data and the second prompt data, the model training can be performed according to the first prompt data, wherein the tasks involved may include but are not limited to the word segmentation task of the following sentence, extracting the product entity in the following sentence, answering questions according to the information provided by the context, pointing out the pronouns in the input, etc.; and then fine-tuning the model according to the second prompt data, so that the final model has the ability to understand and execute atomic tasks (such as word segmentation, part-of-speech tagging, text classification, syntax analysis, text generation, etc.), and understands the logic of complex tasks such as the task logic, task relevance, task hierarchy, task interaction, task reasoning, etc. between the atomic tasks. Afterwards, when facing other complex tasks, such as "Financial Management No. 1 and Financial Management No. 2, how to choose? What is the starting amount of the following financial management items?", it can understand the logic of the complex task, so that the complex task can be divided into effective fine-grained subtasks, and the solution logic of the complex task is obtained through the combination of fine-grained subtasks, and then the correct output result is obtained.

[0088] It should be noted that the model processing method provided in the embodiment of the present application can be executed by a model processing device or a control module in the model processing device for executing the model processing method. In the embodiment of the present application, the model processing device provided in the embodiment of the present application is described by taking the execution of the model processing method by the model processing device as an example.

[0089] See also Figure 4 , Figure 4 is a schematic diagram of a model processing device provided in an embodiment of the present application, and the device is applied to electronic equipment, such as Figure 4 As shown, the model processing device 40 includes:

[0090] An acquisition module 41 is used for training data;

[0091] A generating module 42, configured to generate first prompt data and second prompt data according to the training data and a pre-established prompt template; wherein the first prompt data is related to a first task, and the first task at least includes a target atomic task; and the second prompt data is related to a second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is greater than the number of atomic tasks included in the first task;

[0092] A training module 43 is used to train the pre-trained model using the first prompt data to obtain an initial task execution model;

[0093] The adjustment module 44 is used to adjust the initial task execution model using the second prompt data to obtain a target task execution model.

[0094] Optionally, the second prompt data is related to a plurality of second tasks, the plurality of second tasks are divided into n levels, the number of atomic tasks included in the i-th level second task is less than the number of atomic tasks included in the j-th level second task, 1≤i<j≤n;

[0095] The adjustment module 44 is specifically used to adjust the initial task execution model by sequentially using the second prompt data related to the second task of each level in the n levels to obtain the target task execution model.

[0096] Optionally, the prompt template includes a task part, an input data part and an output result part; the generation module 42 is specifically used to: add the information of the first task to the task part of the prompt template, add the training data to the input data part of the prompt template, and add the result obtained by executing the first task on the training data to the output result part of the prompt template, so as to obtain the first prompt data; add the information of the second task to the task part of the prompt template, add the training data to the input data part of the prompt template, and add the result obtained by executing the second task on the training data to the output result part of the prompt template, so as to obtain the second prompt data.

[0097] Optionally, the model processing device 40 further includes

[0098] Before generating the first prompt data and the second prompt data according to the pre-established prompt template, the method further includes:

[0099] An establishment module, used for preliminarily establishing a prompt template of the instruction task according to a hierarchical instruction task chain under a pre-established target domain before generating the first prompt data and the second prompt data according to the training data and the pre-established prompt template;

[0100] The extension module is used to expand the initially established prompt template using a pre-trained language model to obtain the pre-established prompt template.

[0101] Optionally, the first task only includes the target atomic task.

[0102] Optionally, the atomic task is any one of the following:

[0103] Word segmentation task, part-of-speech tagging task, text classification task, entity disambiguation task, entity extraction task, text generation task, reading comprehension task, and syntactic analysis task.

[0104] The model processing device 40 of the embodiment of the present application can realize the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0105] Optional, such as Figure 5 As shown, an embodiment of the present application also provides an electronic device 50, including a processor 51, a memory 52, and a program or instruction stored in the memory 52 and executable on the processor 51. When the program or instruction is executed by the processor 51, each process of the above-mentioned model processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0106] An embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned model processing method embodiment can be implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0107] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRA4), static random access memory (SRA4), dynamic random access memory (DRA4), other types of random access memory (RA4), read-only memory (RO4), electrically erasable programmable read-only memory (EEPRO4), flash memory or other memory technology, compact disc read-only memory (CD-RO4), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transitory 4edia), such as modulated data signals and carrier waves.

[0108] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0109] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0110] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as RO4 / RA4, a disk, or an optical disk), and includes a number of instructions for enabling a service classification device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0111] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A model processing method, applied to electronic equipment, It is characterized in that include: Acquire training data, where the training data is text data; Generate first prompt data and second prompt data according to the training data and a pre-established prompt template; wherein the first prompt data is related to a first task, and the first task at least includes a target atomic task; the second prompt data is related to a second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is greater than the number of atomic tasks included in the first task, and the first task and the second task are tasks related to text processing; the atomic task is a task unit that realizes a basic function; Using the first prompt data to train the pre-trained model to obtain an initial task execution model; Using the second prompt data to adjust the initial task execution model to obtain a target task execution model; The second prompt data is related to a plurality of second tasks, the plurality of second tasks are divided into n levels, the number of atomic tasks included in the second task of the i-th level is less than the number of atomic tasks included in the second task of the j-th level, 1≤i<j≤n; the second task is a multi-level instruction task chain, and there is an inherent association relationship between the atomic tasks in the second task; The adjusting the initial task execution model by using the second prompt data to obtain the target task execution model includes: The initial task execution model is adjusted by sequentially using the second prompt data associated with the second task of each level in the n levels to obtain the target task execution model.

2. The method according to claim 1, It is characterized in that The prompt template includes a task part, an input data part and an output result part; The step of generating first prompt data and second prompt data according to the training data and a pre-established prompt template includes: Adding information of the first task to a task part in the prompt template, adding the training data to an input data part in the prompt template, and adding a result obtained by executing the first task on the training data to an output result part in the prompt template to obtain the first prompt data; Add information of the second task to the task part in the prompt template, add the training data to the input data part in the prompt template, and add the result obtained by executing the second task on the training data to the output result part in the prompt template to obtain the second prompt data.

3. The method according to any one of claims 1 to 2, It is characterized in that Before generating the first prompt data and the second prompt data according to the training data and the pre-established prompt template, the method further includes: According to the hierarchical instruction task chain under the pre-established target field, a prompt template for the instruction task is initially established; The pre-established prompt template is expanded using a pre-trained language model to obtain the pre-established prompt template.

4. The method according to claim 1, It is characterized in that The first task only includes the target atomic task.

5. The method according to claim 1, It is characterized in that The atomic task is any of the following: Word segmentation task, part-of-speech tagging task, text classification task, entity disambiguation task, entity extraction task, text generation task, reading comprehension task, and syntactic analysis task.

6. A model processing device, It is characterized in that include: An acquisition module is used for training data, wherein the training data is text data; A generation module, used to generate first prompt data and second prompt data according to the training data and a pre-established prompt template; wherein the first prompt data is related to a first task, and the first task at least includes a target atomic task; the second prompt data is related to a second task, and the second task includes the target atomic task, and the number of atomic tasks included in the second task is greater than the number of atomic tasks included in the first task, and the first task and the second task are tasks related to text processing; the atomic task is a task unit that realizes a basic function; A training module, used to train the pre-trained model using the first prompt data to obtain an initial task execution model; An adjustment module, used to adjust the initial task execution model using the second prompt data to obtain a target task execution model; The second prompt data is related to a plurality of second tasks, the plurality of second tasks are divided into n levels, the number of atomic tasks included in the second task of the i-th level is less than the number of atomic tasks included in the second task of the j-th level, 1≤i<j≤n; the second task is a multi-level instruction task chain, and there is an inherent association relationship between the atomic tasks in the second task; The adjustment module is specifically used to adjust the initial task execution model by sequentially using the second prompt data related to the second task of each level in the n levels to obtain the target task execution model.

7. An electronic device, It is characterized in that The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the model processing method according to any one of claims 1 to 5.

8. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the model processing method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Language model training method, NLP task processing method and device

    CN113420123A

  • Intention recognition method and device, electronic device and storage medium

    CN115129859A

  • Text processing method and device, electronic equipment and storage medium

    CN116959433A

  • Aspect prompting framework for language modeling

    US20230237277A1