Large model cue word engineering method and system based on expert model assistance

Through expert model-assisted large-model prompt word engineering, the professional knowledge of small models is used to improve the generation ability of large-models in professional fields, solving the problems of high fine-tuning costs of large-models and inaccurate generation results, and achieving high-quality result generation and Low maintenance costs.

CN118982070APending Publication Date: 2024-11-19CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411026692.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

Existing large language models perform poorly on professional field tasks, require fine-tuning but are costly and can lead to catastrophic forgetting, suggesting that word engineering lacks expertise, resulting in inaccurate and redundant generation results.

Method used

The big model prompt word engineering method is adopted based on expert model assistance, and the professional knowledge learned through small models is passed to the big model as a propt, generating more accurate and high-quality results, avoiding the high cost and performance degradation of big model fine-tuning.

Benefits of technology

It improves the quality of the generation results of large models in the professional field, reduces the cost of new task development and design, and maintains the universal capabilities of large models and the fluency of language generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982070A_ABST
    Figure CN118982070A_ABST
Patent Text Reader

Abstract

The invention relates to a large model cue word engineering method and system based on expert model assistance, and the method comprises the steps: matching a to-be-processed information set by using a first expert model to generate an alternative word set, and matching the alternative word set by using a second expert model to generate a keyword set. In order to overcome the defects that a large model is poor in language generation capability and a small model is poor in language generation capability, professional knowledge learned in the small model serves as an expert model and is transmitted to the large model in a prompt mode, original parameters of the large model are reserved, the large model does not need to be finely adjusted, and the advantages of high universality and language generation capability of the large model are fully utilized; and the small model training management and maintenance cost is low and the professional knowledge field capability is high, so that the large model generation result quality is effectively improved, and the new task development and design cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of generative models, model prompt word engineering and data processing technology, and in particular to a large model prompt word engineering method and system based on expert model assistance. Background Art

[0002] In recent years, research on pre-trained large language models has made a lot of progress. Compared with traditional small models, pre-trained large models have significantly improved their general capabilities and have also performed well in some financial-related tasks. However, general large language models do not perform as well as small models trained on specific datasets in some tasks that require specific expertise. Therefore, it is usually necessary to fine-tune the large language model to make it more suitable for tasks in some professional fields.

[0003] Under the existing technology, fine-tuning methods can be divided into two categories: supervised fine-tuning and reinforcement learning from human feedback. Among them, due to the large number of parameters of large models, fully supervised learning fine-tuning requires a large amount of labeled data, the training cost is extremely high, and it may cause catastrophic forgetting of the model, reducing the performance of the model. Therefore, the current common parameter adjustment methods such as LoRA (Low-Rank Adaptation) reduce the number of parameters that need to be trained to reduce the computing resources required for large model fine-tuning. However, there is still a great demand for training data, computing resources, model storage space, etc. required for large model fine-tuning. Some other training methods such as prefix-tuning are more difficult to train, and the sequence becomes longer after adding prefixes, which will also occupy the input space. On the other hand, some models with smaller parameters, such as BERT, ERNIE, RoBERTa, etc., have performed very well in professional fields after being trained with data containing professional knowledge. At the same time, the training and maintenance costs of small models are much lower than those of large models.

[0004] In order to make the output of the large model more in line with the requirements, prompt engineering is also a commonly used improvement method. However, there are few types of manually set prompts, and they usually contain less professional knowledge, which is of limited help in improving the ability of large models in professional fields. Therefore, prompt engineering under the existing technology performs well in tasks that do not require rich professional knowledge, but for tasks that require professional knowledge that is difficult to summarize with artificially formulated rules, the performance is not as good as using a fine-tuned large model.

[0005] It can be seen that the working ability of existing large models mainly comes from the training data of the models. Although the current training of large models uses a large amount of data, there is a lack of effective methods for training targeted data in specific application fields. Therefore, they generally do not have the ability to accurately respond to specific data processing and identification needs; on the other hand, the processing results directly generated by existing large models often contain a certain proportion of colloquial expressions and redundant parts, which seriously affect the content generation effect of large models. At the same time, although the existing large model fine-tuning methods can increase the influence of data training in specific fields to a certain extent, fine-tuning not only requires a lot of computing resources and manpower costs, but also reduces the ability of large models to solve general problems and the versatility of the model. At the same time, the catastrophic forgetting that may be caused by parameter adjustment will affect the model's original excellent ability to generate fluent language. Summary of the invention

[0006] In order to address the shortcomings of the prior art, the present invention proposes a large model prompt word engineering method and system based on expert model assistance, which aims at the shortcomings of weak professional ability of the large model, high training and fine-tuning cost, and weak language generation ability of the small model. By applying the professional knowledge learned in the small model as an expert model, it is passed to the large model in the form of prompt, so that the large model retains the original parameters and does not need to be fine-tuned. The advantages of the large model's strong general ability and strong language generation ability, as well as the advantages of the small model's low training, management and maintenance cost and strong professional knowledge field ability are fully utilized, effectively improving the quality of the large model generation results, and can help reduce the cost of new task development and design.

[0007] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0008] A large model prompt word engineering method based on expert model assistance, characterized by comprising:

[0009] S1. Obtain the data to be processed, perform information splitting operations on the data to be processed according to the preset information classification, and generate several sets of information to be processed;

[0010] S2, using a preset first expert model to match the information set to be processed, inputting the information set to be processed into the first expert model to perform a first data processing operation, and generating a candidate word set;

[0011] S3, using a preset second expert model to match the candidate word set, inputting the candidate word set into the second expert model to perform a second data processing operation, and generating a keyword set;

[0012] S4, using the keyword set to perform an assembly operation according to one or more preset generation templates to obtain one or more prompt word options matching the information set to be processed;

[0013] S5. Use the prompt word option as the input item of the large model to obtain the corresponding generation result;

[0014] S6. Determine whether the generated result meets the preset output condition. When it is determined whether the generated result meets the preset output condition, add the corresponding prompt word option to the generated result as a mark output.

[0015] Furthermore, the method further comprises:

[0016] Using a plurality of preset first expert models to independently match the information set to be processed, inputting the information set to be processed into each first expert model to independently perform a first data processing operation, and generating corresponding candidate word sets respectively;

[0017] Use multiple preset second expert models to independently match the candidate word sets, input the candidate word sets into each corresponding second expert model to independently perform the second data processing operation, and generate corresponding keyword sets respectively.

[0018] Furthermore, the method further comprises:

[0019] Determine whether there are multiple keyword sets;

[0020] When it is determined that there are multiple keyword sets, an independent generation task is established according to each keyword set;

[0021] According to the generated task, each keyword set is assembled to obtain one or more prompt word options corresponding to the generated task;

[0022] According to the generation task, the corresponding prompt word option is used as the input item of the large model to obtain the corresponding generation result.

[0023] Further, the first expert model includes an information encoder formed by combining a plurality of sequentially connected first data processing layer groups, the first data processing layer group includes a multi-head attention layer, a residual connection and layer normalization layer, and an expert layer, and the expert layer includes a gating structure and at least one feedforward layer as an expert;

[0024] The output of the gating structure is shown in Formula 1, and the output of the feedforward layer as expert i is shown in Formula 2:

[0025] G(x t )=GATE(x t ) Formula 1

[0026] E i (x t )=w 2i ReLU(w 1i ·x t ) Formula 2

[0027] In formulas 1 and 2, x t represents the input of the expert layer, w 1i and w 2i are the input projection matrix and output projection matrix of expert i respectively.

[0028] Furthermore, the second expert model includes a Transformer decoder.

[0029] Furthermore, the gating structure also includes using a softmax function and a trainable parameter matrix.

[0030] The present invention also relates to a large model prompt word engineering system based on expert model assistance, which is characterized by comprising:

[0031] An information splitting module is used to perform information splitting operations on the data to be processed according to the preset information classification, and generate a number of information sets to be processed;

[0032] A first data processing module, used for inputting the information set to be processed into a first expert model to perform a first data processing operation and generate a candidate word set;

[0033] A second data processing module, used for inputting the candidate word set into the second expert model to perform a second data processing operation and generate a keyword set;

[0034] A prompt word assembly module, used to use a keyword set to perform an assembly operation according to one or more preset generation templates to obtain one or more prompt word options matching the information set to be processed;

[0035] A generation module is used to use the prompt word option as a large model input item to obtain a corresponding generation result;

[0036] The output judgment module is used to judge whether the generated result meets the preset output condition. When it is judged whether the generated result meets the preset output condition, the generated result is added with the corresponding prompt word option as a mark output.

[0037] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and the computer program implements the above method when executed by a processor.

[0038] The present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;

[0039] The memory is used for storing;

[0040] The processor is used to execute the above method by calling.

[0041] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.

[0042] The beneficial effects of the present invention are:

[0043] The method and system for engineering prompt words for a large model assisted by an expert model described in the present invention are used to address the shortcomings of the large model's weak professional ability, high training and fine-tuning costs, and weak language generation capabilities of the small model. The professional knowledge learned in the small model is used as an expert model and is passed to the large model in the form of prompts, so that the large model retains its original parameters and does not need to be fine-tuned. While improving the performance of the large model in a professional field, the general ability of the large model will not be reduced. The advantages of the large model's strong general ability and strong language generation capabilities, as well as the advantages of the small model's low training, management and maintenance costs and strong professional knowledge field capabilities are fully utilized to effectively improve the quality of the large model generation results. By adapting multiple different expert models, a single large model can be used to process multiple different tasks in a targeted manner without the need to train the large model, etc., which can help reduce the cost of developing and designing new tasks, and the cost of later updates and maintenance is also low. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the flow of the large model prompt word engineering method based on the expert model assistance of the present invention.

[0045] Figure 2 This is a schematic diagram of the structure of the large model prompt word engineering system based on the expert model assistance of the present invention. DETAILED DESCRIPTION

[0046] In order to more clearly understand the content of the present invention, it will be described in detail with reference to the accompanying drawings and embodiments. It should be noted that in the embodiments of the present application, some existing solutions in the industry such as certain software, components, models, etc. may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0047] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0048] The first aspect of the present invention relates to a process of steps as follows Figure 1 The large model prompt word engineering method based on expert model assistance shown includes:

[0049] S1. Obtain the data to be processed, perform information splitting operations on the data to be processed according to preset information classification, and generate several sets of information to be processed.

[0050] In the specific implementation, taking the use of expert models to assist big models in due diligence reports related to financial risks as an example, for each input due diligence report, the information contained in the report is first split. The customer's name, gender, address and other information contained in the report belong to the customer's basic information, and the number of account opening and closing, card replacement and loss inquiry records and other information belong to account information. In addition to basic information and account information, there are also large-value transaction information, suspicious report information, risk information, etc.

[0051] S2. Use a preset first expert model to match the information set to be processed, input the information set to be processed into the first expert model to perform a first data processing operation, and generate a candidate word set.

[0052] Preferably, the first expert model comprises an information encoder formed by combining a plurality of sequentially connected first data processing layer groups, wherein the first data processing layer group comprises a multi-head attention layer, a residual connection and layer normalization layer, and an expert layer, wherein the expert layer comprises a gating structure and at least one feedforward layer as an expert;

[0053] The output of the gating structure is shown in Formula 1, and the output of the feedforward layer as expert i is shown in Formula 2:

[0054] G(x t )=GATE(x t ) Formula 1

[0055] E i (x t )=w 2i ReLU(w 1i ·x t ) Formula 2

[0056] In formulas 1 and 2, x t represents the input of the expert layer, w 1i and w 2i are the input projection matrix and output projection matrix of expert i respectively. Correspondingly, when there are E experts, the output of the expert layer can be expressed by Formula 3.

[0057]

[0058] Further preferably, in order to reduce the number of system parameters and speed up the processing speed of the system, the gating structure also includes using a softmax function and a trainable parameter matrix W, as shown in Formula 4.

[0059] G(x) = softmax(x·W) Formula 4

[0060] In the specific implementation, the first expert model corresponds to the Transformer encoder, and the feedforward layer in the Transformer encoder is replaced by a gated structure and several feedforward layers as experts. For each piece of input information, the text vector generation tool is first used to obtain the vector representation and position vector representation of the information, and the vector and position vector are added as input. The first expert model as an encoder can be composed of a total of N layers, and the structure of each layer includes a multi-head attention layer, a residual connection and a layer normalization layer, and an expert layer composed of a gated structure and an expert. The output of the first expert model is a representation of the input information in the form of a vector. The softmax function is used on the output representation to obtain the probability that the input information is risk information.

[0061] For typical applications in which multiple parallel tasks are processed using the same large model, it is preferred to use multiple preset first expert models to independently match the information set to be processed, input the information set to be processed into each first expert model to independently perform the first data processing operation, and generate corresponding sets of alternative words respectively.

[0062] S3. Use a preset second expert model to match the candidate word set, input the candidate word set into the second expert model to perform a second data processing operation, and generate a keyword set.

[0063] Preferably, corresponding to the first expert model, the second expert model includes a Transformer decoder.

[0064] In the specific implementation, the information judged as risk information is input into the second expert model, and the output is some numerical values, entities and other keywords extracted from the information. The structure of the second expert model is similar to the decoder structure of the Transformer, and preferably, the feedforward layer in the Transformer decoder is replaced by an expert layer composed of a gate structure and experts (feedforward layer), and then the output of the first expert model is also input into the second expert model to improve the second expert model's ability to understand information.

[0065] Preferably, when there are multiple parallel tasks, multiple preset second expert models are used to independently match the candidate word sets, and the candidate word sets are input into each corresponding second expert model to independently perform the second data processing operation to generate corresponding keyword sets.

[0066] S4. Using the keyword set to perform an assembly operation according to one or more preset generation templates, one or more prompt word options are obtained that match the information set to be processed.

[0067] In the specific implementation, the keywords output by the second expert model and the generation templates corresponding to each type of information are spliced ​​together as the prompt of the large language model. For the application scenario of risk due diligence, in order to improve the robustness of the generated results, for each due diligence report, it is preferred to use three different sets of generation templates to generate three different prompts, and then use the keywords of each risk information to match the results generated by different prompts, calculate the accuracy and recall rate of risk information contained in the generated results, and then calculate F 0.5 Value, select F 0.5 The result with the highest value will be used as the rating reason for the due diligence report.

[0068] Preferably, it includes determining whether there are multiple keyword sets; when it is determined that there are multiple keyword sets, establishing independent generation tasks based on each keyword set; and performing assembly operations on each keyword set based on the generation task to obtain one or more prompt word options corresponding to the generation task.

[0069] S5. Use the prompt word option as the input item of the large model to obtain the corresponding generation result.

[0070] When there are multiple parallel tasks, it is preferred to use the corresponding prompt word options as the large model input items according to the generation task to obtain the corresponding generation results.

[0071] S6. Determine whether the generated result meets the preset output condition. When it is determined whether the generated result meets the preset output condition, add the corresponding prompt word option to the generated result as a mark output.

[0072] In specific use, a professional data set is used to train an expert model (small model) to generate corresponding prompts containing professional knowledge. Different tasks use prompts generated by different small models as part of the input of the large model, and different generation results are obtained after inputting the large model. The small model can choose different models according to different tasks, such as BERT, BART, GPT, etc.

[0073] For example, taking the due diligence report evaluation of customer risk as an example, the due diligence report usually contains many aspects of customer information, such as basic information, account information, transaction information, etc. For customers, not all information in the report is risk information, and the rating reasons only need to include information about the customer's risks, not information about non-risks. Therefore, it is necessary to filter out risk information from the report and then summarize the risk information. The steps of applying the above method to perform analysis may include:

[0074] The small model filters out risk information. The customer information in the due diligence report is split, and each piece of information is input into the hybrid expert system encoder (the first expert model). The output of the encoder is calculated by the softmax function to obtain the probability that the information is risk information, and the threshold is set to filter out risky information.

[0075] The decoder (second expert model) of the small model is used to generate prompts. The selected risk information and its corresponding encoder output sequence are input into the hybrid expert system decoder, and the output is the keywords that need to be included in the rating reasons. The keywords and the generation templates corresponding to each type of risk information are combined to obtain the prompts input into the large model. Different generation templates can obtain different prompts.

[0076] Input the prompt into the large language model to generate the result. After experimental comparison of large models, the Xuanyuan large model with the best effect was selected. Different prompt inputs into the large model can get different generation results.

[0077] Filter the results. Determine whether the generated results contain the risk information based on keyword matching, and whether there are sentences that do not contain risk information, and calculate the precision, recall, and F of sentences containing risk information. 0.5 Value, select F 0.5 The result with a higher value is used as the rating reason for the due diligence report.

[0078] By applying the above method to perform due diligence report analysis, the small model has a high accuracy rate in judging risks and generates more accurate results. The small model has a 96% accuracy rate in screening out risk information, and the large language model has a 95% accuracy rate after summarizing the risk information. Compared with using manually set rules to judge risk information, the accuracy rate is higher. At the same time, the prompt generated by the decoder can also be used to help the large model improve the accuracy of risk information. The training cost of the small model is low. The hybrid expert system only uses two hundred due diligence reports after data desensitization for training. The amount of data and computing power resources required for training are far less than those for fine-tuning the large model. At the same time, the structure and parameters of the large model remain unchanged. The model is highly versatile and can be directly applied to other tasks. The language of the rating reasons generated by the large model is natural and fluent. Compared with directly training the small model to generate rating reasons, or using the large model for judgment and summary after segmentation and then splicing, the logic is clearer and more readable.

[0079] Taking the contract review as an example, contracts are divided into named contracts and unnamed contracts according to the different subject matters of the contract. There are fifteen types of named contracts, among which the common named contracts are agency contracts, sales contracts, lease contracts, loan contracts, etc. Unnamed contracts are contracts in which the parties to the contract freely determine the content according to the principle of freedom of contract. Therefore, there are countless types of unnamed contracts. Contracts usually include the subject of the contract, the subject matter of the contract, the payment method, the rights and obligations clauses, the liability for breach of contract, the conditions for the termination of the contract and the initiation of the contract, confidentiality clauses, force majeure, dispute resolution, etc. The terms and contents of different types of contracts are different, and the content of the contract is agreed upon by both parties. Therefore, when conducting a contract review, different questions and answers need to be given according to different contracts. Questions need to be asked about the parts of the contract that may have problems such as unclear statements and omissions, so as to help auditors quickly review the contract. The steps for performing analysis using the above method may include:

[0080] Use the small model to generate questions about the contract. The contract is used as the input of the hybrid expert system, and the output is questions raised by the small model regarding information about possible risks in the contract, such as "how is the liability for breach of contract divided in this contract?"

[0081] Use the big model to answer the generated questions. The big model extracts information and summarizes the content of the contract based on the questions raised by the small model, making it easier for auditors to quickly understand the information of the contract.

[0082] The auditor quickly reviews the contract based on the answers from the big model.

[0083] By applying the above method to perform contract review work, a small model is used to screen the content of the contract that may have risks, and then the large model is used to summarize the information of the content that may have risks. Finally, the contract auditor conducts contract review based on the information summarized by the large model. This can save about 40% of labor costs and improve the efficiency of contract review. Using the trained small model to find contract risk points has significantly improved the accuracy compared to directly using the pre-trained general large model to find risk points. More accurate risk points can also save the contract auditor's review time.

[0084] Another aspect of the present invention also relates to a large model prompt word engineering system based on expert model assistance, the structure of which is as follows: Figure 2 As shown, including:

[0085] An information splitting module is used to perform information splitting operations on the data to be processed according to the preset information classification, and generate a number of information sets to be processed;

[0086] A first data processing module, used for inputting the information set to be processed into a first expert model to perform a first data processing operation and generate a candidate word set;

[0087] A second data processing module, used for inputting the candidate word set into the second expert model to perform a second data processing operation and generate a keyword set;

[0088] A prompt word assembly module, used to use a keyword set to perform an assembly operation according to one or more preset generation templates to obtain one or more prompt word options matching the information set to be processed;

[0089] A generation module is used to use the prompt word option as a large model input item to obtain a corresponding generation result;

[0090] The output judgment module is used to judge whether the generated result meets the preset output condition. When it is judged whether the generated result meets the preset output condition, the generated result is added with the corresponding prompt word option as a mark output.

[0091] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.

[0092] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.

[0093] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as a set of information to be processed, a set of alternative words, a set of keywords and prompt word options, etc., and the processor calls the data and programs in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.

[0094] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.

[0095] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.

[0096] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.

[0098] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0100] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A large model prompt word engineering method based on expert model assistance, characterized in that: include: S1. Obtain the data to be processed, perform information splitting operations on the data to be processed according to the preset information classification, and generate several sets of information to be processed; S2, using a preset first expert model to match the information set to be processed, inputting the information set to be processed into the first expert model to perform a first data processing operation, and generating a candidate word set; S3, using a preset second expert model to match the candidate word set, inputting the candidate word set into the second expert model to perform a second data processing operation, and generating a keyword set; S4, using the keyword set to perform an assembly operation according to one or more preset generation templates to obtain one or more prompt word options matching the information set to be processed; S5. Use the prompt word option as the input item of the large model to obtain the corresponding generation result; S6. Determine whether the generated result meets the preset output condition. When it is determined whether the generated result meets the preset output condition, add the corresponding prompt word option to the generated result as a mark output.

2. The method according to claim 1, characterized in that The method further comprises: Using a plurality of preset first expert models to independently match the information set to be processed, inputting the information set to be processed into each first expert model to independently perform a first data processing operation, and generating corresponding candidate word sets respectively; Use multiple preset second expert models to independently match the candidate word sets, input the candidate word sets into each corresponding second expert model to independently perform the second data processing operation, and generate corresponding keyword sets respectively.

3. The method according to claim 3, characterized in that The method further comprises: Determine whether there are multiple keyword sets; When it is determined that there are multiple keyword sets, an independent generation task is established according to each keyword set; According to the generated task, each keyword set is assembled to obtain one or more prompt word options corresponding to the generated task; According to the generation task, the corresponding prompt word option is used as the input item of the large model to obtain the corresponding generation result.

4. The method according to claim 1, characterized in that The first expert model includes an information encoder formed by combining a plurality of sequentially connected first data processing layer groups, the first data processing layer group includes a multi-head attention layer, a residual connection and layer normalization layer, and an expert layer, the expert layer includes a gating structure and at least one feedforward layer as an expert; The output of the gating structure is shown in Formula 1, and the output of the feedforward layer as expert i is shown in Formula 2: G(x t )=GATE(x t ) Formula 1 E i (x t )=w 2i ReLU(w 1i ·x t ) Formula 2 In formulas 1 and 2, x t represents the input of the expert layer, w 1i and w 2i are the input projection matrix and output projection matrix of expert i respectively.

5. The method according to claim 4, characterized in that The second expert model includes a Transformer decoder.

6. The method according to claim 4, characterized in that The gating structure also includes the use of a softmax function and a trainable parameter matrix.

7. A large model prompt word engineering system based on expert model assistance, characterized in that: include: An information splitting module is used to perform information splitting operations on the data to be processed according to the preset information classification, and generate a number of information sets to be processed; A first data processing module, used for inputting the information set to be processed into a first expert model to perform a first data processing operation and generate a candidate word set; A second data processing module, used for inputting the candidate word set into the second expert model to perform a second data processing operation and generate a keyword set; A prompt word assembly module, used to use a keyword set to perform an assembly operation according to one or more preset generation templates to obtain one or more prompt word options matching the information set to be processed; A generation module is used to use the prompt word option as a large model input item to obtain a corresponding generation result; The output judgment module is used to judge whether the generated result meets the preset output condition. When it is judged whether the generated result meets the preset output condition, the generated result is added with the corresponding prompt word option as a mark output.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store the information set to be processed, the candidate word set, the keyword set and the prompt word options; The processor is used to execute the method according to any one of claims 1 to 6 by calling the information set to be processed, the candidate word set, the keyword set and the prompt word option.

10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.