Method and system for adjusting hierarchical parameters of multi-task joint large model

The hierarchical parameters of the large model are adjusted through the Lora fine-tuning method, and a multi-task joint large model is generated, which solves the problem of insufficient multi-task processing capabilities under limited computing resources, and achieves efficient parameter adjustment and performance improvement.

CN119128111AActive Publication Date: 2024-12-13CHENGDU GUOZHI FUTURE TECH CO LTD

Patent Information

Application Number
CN202411331520.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-13
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

The existing large model parameter adjustment method consumes a lot of computing resources and has high time costs, making it difficult to realize the ability of multitasking in a limited computing resource environment.

Method used

The Lora fine-tuning method is used to iteratively adjust the hierarchical parameters of the large model to generate a multi-task joint large model. By merging Lora parameters of different task types, the resource requirements are reduced and efficiency is improved.

Benefits of technology

The multi-tasking capability of the large model under limited computing resources is realized, the overall performance and iteration cycle of the model are improved, and the resource and time cost required for parameter adjustment is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128111A_ABST
    Figure CN119128111A_ABST
Patent Text Reader

Abstract

The invention provides a multi-task joint large model hierarchical parameter adjustment method and system, and belongs to the technical field of model parameter adjustment. The method comprises the steps that according to task types executed by a large model and a parameter adjustment data set, a Lora fine adjustment mode is adopted to conduct iterative adjustment on hierarchical parameters of the large model, and Lora parameters corresponding to each task type are obtained; combining the original large model parameters with the Lora fine tuning parameters of the plurality of task types to generate a multi-task joint large model; and performing model performance evaluation on the multi-task joint large model according to a preset task index, and deploying the multi-task joint large model of which a model performance evaluation result meets a multi-task requirement to an actual application environment. According to the method, hierarchical parameter adjustment is performed on multiple tasks of a large model, the parameters of other layers are frozen in sequence, and the specific layer is adjusted, so that the number of resources required by parameter adjustment is reduced, and the parameter adjustment efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of model parameter adjustment, and in particular to a multi-task joint large model hierarchical parameter adjustment method and system. Background Art

[0002] With the rapid development of artificial intelligence technology, especially the increasing maturity of large model technology, its application scenarios in the real world are constantly expanding and deepening. In many fields such as intelligent customer service, cross-language translation, and text classification, large models need to simultaneously cope with multiple task challenges such as the accuracy of questions and answers, the effective classification of information, and efficient and accurate translation. Faced with these complex requirements, how to enable a single large model to have the ability to handle multiple tasks when the computing resource environment is limited and multiple large models cannot be deployed at the same time has become an urgent problem to be solved. This not only requires the model to have a high degree of flexibility and scalability, but also requires a sophisticated parameter adjustment strategy to enable the model to adaptively balance the performance requirements between tasks, thereby maximizing the use of limited computing resources and achieving collaborative optimization between tasks.

[0003] However, since large models have a large number of parameters, their parameters require a huge amount of resources, which puts great pressure on cost control. Therefore, it is particularly important to design an efficient parameter adjustment method. This is not only related to effectively reducing the computing resources and time costs required during the training process, but also the key to improving the overall performance of the model and accelerating the model iteration cycle. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a multi-task joint large model hierarchical parameter adjustment method and system to solve the problem that the existing model parameter adjustment method consumes a lot of computing resources and has a high time cost.

[0005] The technical solution adopted by the present invention is: In a first aspect, the present invention provides a multi-task joint large model hierarchical parameter adjustment method, comprising: According to the task type and parameter adjustment data set executed by the large model, the hierarchical parameters of the large model are iteratively adjusted respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type; the parameter adjustment data set includes a question data set, a question-answering data set and a translation data set; the task types include classification tasks, question-answering tasks and machine translation tasks; Merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance of the multi-task joint large model is evaluated according to the preset task indicators, and the multi-task joint large model whose model performance evaluation results meet the multi-task requirements is deployed to the actual application environment.

[0006] Furthermore, the method also includes a process of obtaining a parameter adjustment data set: Collecting multiple model parameter adjustment data, and storing the multiple model parameter adjustment data in an object database; Performing data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data; Segment the preprocessed data to obtain multiple segments of preprocessed data; Input each section of preprocessed data into the preset large model, generate multiple first question texts related to model parameter adjustment, and set the labels of the first question texts as professional questions; extract some questions as second question texts based on the first open source data set, and set the labels of the second question texts as non-professional questions; combine the first question texts, the second question texts and the labels corresponding to the texts to obtain a question data set; Input each segment of preprocessed data into a preset large model, generate multiple first question-answer pairs related to model parameter adjustment as professional question-answer pairs; extract some question-answer pairs based on the first open source data set as non-professional question-answer pairs, combine the professional question-answer pairs with the non-professional question-answer pairs, and obtain a question-answer data set; Each piece of preprocessed data is input into the preset large model respectively, multiple sentences are extracted and translated into sentences of a preset language to obtain professional translation data; based on the second open source data set, part of the translation data is extracted as non-professional translation data, and the professional translation data is combined with the non-professional translation data to obtain a translation data set.

[0007] Furthermore, the task type and parameter adjustment data set executed by the large model are used to iteratively adjust the hierarchical parameters of the large model respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type, including: Determine the task type performed by the large model. If the task type is a classification task, fine-tune the hierarchical parameters of the large model based on the problem data to obtain the classification Lora parameters; the large model includes an embedding layer, a position encoding layer, an attention layer, and a feedforward layer; If the task type is a question-answering task, the hierarchical parameter Lora of the large model is fine-tuned based on the question-answering dataset to obtain the question-answering Lora parameters; If the task type is a machine translation task, the hierarchical parameter Lora of the large model is fine-tuned based on the translation data set to obtain the translation Lora parameters.

[0008] Furthermore, the Lora fine-tuning process of the layered parameters includes: First, freeze the other layers of the large model and fine-tune the parameters of the embedding layer. Then freeze the other layers except the position encoding layer in the large model, fine-tune the parameters of the position encoding layer, and assign a position code to the position of each element in the input sequence; freeze the other layers except the attention layer in the large model, fine-tune the parameters of the attention layer, calculate the similarity between the elements in the input sequence, assign a weight to each element, and capture the dependency and importance between different elements according to the weight of the element; then freeze the other layers except the feedforward layer in the large model, fine-tune the parameters of the feedforward layer, map the input sequence to a higher dimensional space than the original dimension through a linear transformation, apply the ReLU activation function, and map the data back to the original dimension through a linear transformation; finally, freeze the other layers except the output layer in the large model, fine-tune the parameters of the output layer, and output the final result generated by the model.

[0009] Furthermore, the parameter Lora fine-tuning process is specifically as follows: fix the weight parameters of the original large model, define two low-rank matrices A and B as new parameters to participate in the operation, and sum the results of the two links as the output of this layer in the large model; when updating the layered parameters, calculate the loss function based on the difference between the model's answer and the correct answer, and update the low-rank matrices A and B through the back propagation algorithm to minimize the loss function; iteratively update the layered parameters until the performance of the large model reaches the predetermined standard or the training reaches a preset number of iterations.

[0010] Furthermore, the original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model, including: Define the original large model parameters as After completing the parameter layered Lora adjustment for different tasks, the task The corresponding large model The lora parameters of the layer are ,satisfy: ; in, and are two low-rank matrices; The original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model that can handle multiple tasks simultaneously. The parameters of the large model after parameter merging are , calculated as: ; That is, the lora parameters of different tasks are merged into the parameters of the basic model according to the preset ratio; among them, is the total number of tasks; The proportion of the Lora parameters corresponding to each task in the entire large model parameter adjustment. The larger it is, the more important the corresponding task is; are the original large model parameters.

[0011] Furthermore, the model performance evaluation of the multi-task joint large model according to the preset task indicators includes: For classification tasks, accuracy, precision, recall and F1 score are used to evaluate the performance of large models; for question-answering tasks, the C-Eval evaluation suite is used to evaluate the performance of the model; for machine translation tasks, the BLEU score is used to evaluate the performance of the model.

[0012] In a second aspect, the present invention provides a multi-task joint large model hierarchical parameter adjustment system, comprising: A hierarchical parameter adjustment module is used to iteratively adjust the hierarchical parameters of the large model according to the task type and parameter adjustment data set executed by the large model, and obtain the Lora parameters corresponding to each task type by using the Lora fine-tuning method; the parameter adjustment data set includes a question data set, a question-answering data set, and a translation data set; the task types include classification tasks, question-answering tasks, and machine translation tasks; The parameter merging module is used to merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance evaluation module is used to evaluate the model performance of the multi-task joint large model according to the preset task indicators, and deploy the multi-task joint large model whose model performance evaluation results meet the multi-task requirements to the actual application environment.

[0013] Furthermore, the system also includes a data set preparation module, and the data set preparation module specifically includes: A data collection unit, used for collecting a variety of model parameter adjustment data, and storing the various model parameter adjustment data in an object database; A data preprocessing unit performs data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data; A data segmentation unit, used for segmenting the preprocessed data to obtain multiple segments of preprocessed data; The question data set combination unit is used to input each section of preprocessed data into the preset large model, generate multiple first question texts related to model parameter adjustment, and set the labels of the first question texts as professional questions; extract part of the questions as second question texts based on the first open source data set, and set the labels of the second question texts as non-professional questions; combine the first question texts, the second question texts and the labels corresponding to the texts to obtain the question data set; The question-answer data set combination unit inputs each segment of preprocessed data into a preset large model, generates a plurality of first question-answer pairs related to model parameter adjustment as professional question-answer pairs; extracts some question-answer pairs based on the first open source data set as non-professional question-answer pairs, combines the professional question-answer pairs with the non-professional question-answer pairs, and obtains a question-answer data set; The translation data set combination unit is used to input each section of pre-processed data into a preset large model, extract multiple sentences and translate the multiple sentences into sentences in a preset language to obtain professional translation data; extract part of the translation data as non-professional translation data based on the second open source data set, combine the professional translation data with the non-professional translation data to obtain a translation data set.

[0014] In summary, the beneficial effects of the present invention are as follows: The present invention provides a multi-task joint large model hierarchical parameter adjustment method, the method collects relevant information through multiple channels; pre-processes the collected information and converts it into a unified text format; generates multi-task data such as questions and labels, question-answer pairs, and translation for the collected information to support subsequent model parameter adjustment; hierarchical parameter adjustment is performed for different tasks such as classification, question-answering, and machine translation, and the parameters of other layers are frozen in turn, and specific layers are adjusted, thereby reducing the number of resources required for parameter adjustment and improving parameter adjustment efficiency; after completing the large model parameter adjustment for different tasks, different lora parameters are obtained and merged, so that the large model can handle multiple tasks at the same time; and the performance of the large model obtained after the parameter merging is evaluated to ensure that it meets the requirements of multiple tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.

[0016] Figure 1 A flow chart of a multi-task joint large model hierarchical parameter adjustment method of the present invention; Figure 2 It is a hierarchical parameter adjustment flow chart of the present invention; Figure 3 This is a functional module architecture diagram of the multi-task joint large model hierarchical parameter adjustment system of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. If there is no conflict, the various features of the present invention and the embodiments can be combined with each other, all within the scope of protection of the present invention.

[0018] Embodiment 1:

[0019] See also Figure 1 , Figure 1 This is a flow chart of a multi-task joint large model hierarchical parameter adjustment method in Example 1 of the present invention. Figure 1 As shown, the method mainly includes: According to the task type and parameter adjustment data set executed by the large model, the hierarchical parameters of the large model are iteratively adjusted respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type; the parameter adjustment data set includes a question data set, a question-answering data set and a translation data set; the task types include classification tasks, question-answering tasks and machine translation tasks; Merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance of the multi-task joint large model is evaluated according to the preset task indicators, and the multi-task joint large model whose model performance evaluation results meet the multi-task requirements is deployed to the actual application environment.

[0020] Furthermore, if Figure 1 As shown, the method of the embodiment of the present invention also includes a process of acquiring a parameter adjustment data set (ie, a data preparation process), which specifically includes: Collect various model parameter adjustment data and store them in the object database. Specifically, professional books, reports, web pages and other materials can be collected through libraries and networks, and stored in the object database to support subsequent data set generation.

[0021] Perform data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data. The main operations of data preprocessing include text verification and correction, cleaning unnecessary characters, deleting duplicate content, and standardizing and formatting time information. By writing automated scripts, existing text processing tools and libraries (such as NLTK, spaCy, etc.) are used to assist in completing preprocessing.

[0022] The embodiment of the present invention performs preprocessing operations such as cleaning and standardization on the acquired data to ensure data quality and improve the accuracy of subsequent model training.

[0023] The preprocessed data is segmented to obtain multiple segments of preprocessed data. Specifically, the preprocessed data can be segmented every 200 words to obtain multiple segments of preprocessed data.

[0024] Each piece of preprocessed data is input into the preset large model respectively to generate multiple first question texts related to model parameter adjustment, and the labels of the first question texts are set as professional questions; then, based on the first open source data set, some questions are extracted as second question texts, and the labels of the second question texts are set as non-professional questions; finally, the first question text, the second question text and the labels corresponding to the texts are combined to obtain the question data set.

[0025] Each piece of preprocessed data is input into the preset large model respectively to generate multiple first question-answer pairs related to the model parameter adjustment as professional question-answer pairs; based on the first open source data set, some question-answer pairs are extracted as non-professional question-answer pairs, and the professional question-answer pairs are combined with the non-professional question-answer pairs to obtain a question-answer data set.

[0026] The first open source dataset is the OMGEval open source dataset. The preset large model can use large models such as qwen and llama.

[0027] Each pre-processed data is input into the preset large model, multiple sentences are extracted and translated into sentences of the preset language to obtain professional translation data; based on the second open source data set, part of the translation data is extracted as non-professional translation data, and the professional translation data and the non-professional translation data are combined to obtain a translation data set. Among them, the preset language can be set by yourself, such as other languages ​​besides Chinese.

[0028] Furthermore, in the embodiment of the present invention, according to the task type and parameter adjustment data set executed by the large model, the layered parameters of the large model are iteratively adjusted respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type, including: Determine the task type performed by the large model. If the task type is a classification task, fine-tune the hierarchical parameters of the large model based on the problem data to obtain the classification Lora parameters; the large model includes an embedding layer, a position encoding layer, an attention layer, and a feedforward layer; If the task type is a question-answering task, the hierarchical parameter Lora of the large model is fine-tuned based on the question-answering dataset to obtain the question-answering Lora parameters; If the task type is a machine translation task, the hierarchical parameter Lora of the large model is fine-tuned based on the translation data set to obtain the translation Lora parameters.

[0029] Specifically, the Lora fine-tuning process of the layered parameters includes: First, freeze the other layers of the large model and fine-tune the parameters of the embedding layer. Then freeze the other layers except the position encoding layer in the large model, fine-tune the parameters of the position encoding layer, and assign a position code to the position of each element in the input sequence; freeze the other layers except the attention layer in the large model, fine-tune the parameters of the attention layer, calculate the similarity between the elements in the input sequence, assign a weight to each element, and capture the dependency and importance between different elements according to the weight of the element; then freeze the other layers except the feedforward layer in the large model, fine-tune the parameters of the feedforward layer, map the input sequence to a higher dimensional space than the original dimension through a linear transformation, apply the ReLU activation function, and map the data back to the original dimension through a linear transformation; finally, freeze the other layers except the output layer in the large model, fine-tune the parameters of the output layer, and output the final result generated by the model.

[0030] In an embodiment of the present invention, hierarchical parameter adjustment is performed for different tasks such as classification, question and answer, and machine translation, that is, the parameters of other layers are frozen in turn, and the specific layer is adjusted, thereby reducing the number of resources required for parameter adjustment and improving the efficiency of parameter adjustment. When adjusting parameters for a specific layer, the lora fine-tuning method is adopted to further reduce the consumption of computing resources and speed up the completion of parameter adjustment. For classification tasks, the question data set is used for parameter adjustment; for question and answer tasks, the question and answer data set is used for parameter adjustment; for machine translation tasks, the translation data set is used for parameter adjustment.

[0031] Reference Figure 2 As shown, the main process of the hierarchical parameter adjustment method of the embodiment of the present invention is: first, freeze the other layers, adjust the parameters of the embedding layer, and improve the representation ability of the model. Then freeze the other layers, adjust the parameters of the position encoding layer, and improve the sensitivity of the model to the element position information. Then freeze the other layers, adjust the parameters of the attention layer, and capture the dependencies and importance between different elements. Then freeze the other layers, adjust the parameters of the feedforward layer, process the relationship between words, and introduce nonlinear activation functions to enable the model to learn more complex patterns and relationships. Finally, freeze the other layers, adjust the parameters of the output layer, and output the final result generated by the model. Differentiated learning strategies are implemented for the parameters of different layers. For example, for the underlying shared parameters, a more conservative learning rate is adopted to maintain a stable feature extraction capability; while for task-specific parameters, a more active learning strategy is adopted to quickly adapt to the needs of each task.

[0032] Furthermore, the embedding layer converts each element (such as a word) in the input sequence into a vector representation of fixed dimensions, which are then used for subsequent calculations and processing. Vector embedding maps each discrete element to a real vector with a fixed dimension, which represents the position of the element in an abstract space, so that text data that cannot be directly mathematically operated can be processed and understood by the model, thereby capturing the semantic information of the vocabulary.

[0033] Furthermore, in many natural language processing tasks, the order between words is crucial. The position encoding layer assigns a unique vector to each position in the sequence, helping the model to distinguish information at different positions and making up for the shortcoming that the attention layer cannot capture the order information of elements in the sequence, thereby better understanding the structure and content of the text.

[0034] Furthermore, the attention layer captures the dependencies between different elements, calculates the similarities between the elements in the input sequence, assigns a weight to each element, and thus determines which parts are more important for the current task and captures information at different levels. Furthermore, the feed-forward layer consists of two linear transformations with a ReLU activation function between the two transformations. First, the input is mapped to a higher-dimensional space (usually called "expansion") through a linear transformation, then the ReLU activation function is applied, and finally the data is mapped back to the original dimension through a linear transformation. The purpose of this "expansion" and "contraction" design is to process the relationship between words, and by introducing nonlinear activation functions, the model can capture more complex features and improve the model's expressiveness.

[0035] Furthermore, the output layer is usually composed of a linear layer and is the last layer of the model structure. The output layer outputs the final results generated by the model, such as the probability of each word, classification results, etc. Fine-tuning the parameters of this layer ensures that the model can generate accurate and relevant outputs.

[0036] Furthermore, the parameter Lora fine-tuning process is specifically as follows: fix the weight parameters of the original large model, define two low-rank matrices A and B as new parameters to participate in the operation, and sum the results of the two links as the output of this layer in the large model; when updating the layered parameters, calculate the loss function based on the difference between the model's answer and the correct answer, and update the low-rank matrices A and B through the back propagation algorithm to minimize the loss function; iteratively update the layered parameters until the performance of the large model reaches the predetermined standard or the training reaches a preset number of iterations.

[0037] Furthermore, the original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model, including: Define the original large model parameters as After completing the parameter layered Lora adjustment for different tasks, the task The corresponding large model The lora parameters of the layer are ,satisfy: ; in, and are two low-rank matrices; The original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model that can handle multiple tasks simultaneously. The parameters of the large model after parameter merging are , calculated as: ; That is, the lora parameters of different tasks are merged into the parameters of the basic model according to the preset ratio; among them, is the total number of tasks; The proportion of the Lora parameters corresponding to each task in the entire large model parameter adjustment. The larger it is, the more important the corresponding task is; are the original large model parameters.

[0038] Furthermore, in an embodiment of the present invention, the model performance evaluation of the multi-task joint large model is performed according to the preset task indicators, including: For classification tasks, accuracy, precision, recall and F1 score are used to evaluate the performance of large models; for question-answering tasks, the C-Eval evaluation suite is used to evaluate the performance of the model; for machine translation tasks, the BLEU score is used to evaluate the performance of the model.

[0039] In the embodiment of the present invention, the performance of the large model obtained after the parameter merging is evaluated to ensure that it meets the requirements of multiple tasks. The model that meets the requirements is deployed to the actual application environment for users to call downstream tasks.

[0040] For classification tasks, we use accuracy, precision, recall, F1 score and other indicators to evaluate model performance. For question-answering tasks, we use C-Eval to evaluate the performance of large models. For machine translation tasks, we use BLEU (Bilingual Evaluation Understudy) scores for evaluation.

[0041] Furthermore, the classification performance indicators include accuracy, which refers to the proportion of samples predicted correctly by the model to the total number of samples; precision, which refers to the proportion of samples predicted by the model to be of a certain type that are actually of that type; recall, which focuses on the proportion of samples of a certain type that are accurately identified; and the F1 score, which is the harmonic mean of recall and precision.

[0042] Furthermore, the C-Eval is a comprehensive Chinese model evaluation suite containing 13,948 multiple-choice questions covering 52 different subjects and four difficulty levels to assess the Chinese comprehension ability of large models.

[0043] Furthermore, the BLEU score is a metric used to evaluate the quality of machine translation, measuring how close the machine translation is to a set of high-quality human translations, with a value between 0 and 1, where 1 indicates that the result of the machine translation is completely consistent with the result of the human translation. The BLEU score is calculated by comparing the output of the machine translation with one or more reference translations, and mainly measures the accuracy, relevance and fluency of the translation.

[0044] In the embodiment of the present invention, the multi-task joint large model hierarchical parameter adjustment method has the following characteristics: 1. The parameter merging technology is used to realize multi-task joint parameter adjustment, so that the large model can learn the feature representation of multiple related tasks at the same time, which promotes the large model's understanding of broader knowledge and thus improves the large model's ability to perform multiple tasks.

[0045] 2. A hierarchical parameter adjustment method is adopted to reduce the resource requirements for large model parameter adjustment, allowing differentiated learning strategies for parameters at different levels to improve the efficiency and effect of parameter adjustment, enhance the overall performance of the model, and accelerate the model iteration cycle.

[0046] Example 2: Reference Figure 3 As shown, an embodiment of the present invention provides a multi-task joint large model hierarchical parameter adjustment system, the system comprising: A hierarchical parameter adjustment module is used to iteratively adjust the hierarchical parameters of the large model according to the task type and parameter adjustment data set executed by the large model, and obtain the Lora parameters corresponding to each task type by using the Lora fine-tuning method; the parameter adjustment data set includes a question data set, a question-answering data set, and a translation data set; the task types include classification tasks, question-answering tasks, and machine translation tasks; The parameter merging module is used to merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance evaluation module is used to evaluate the model performance of the multi-task joint large model according to the preset task indicators, and deploy the multi-task joint large model whose model performance evaluation results meet the multi-task requirements to the actual application environment.

[0047] Further, refer to Figure 3 As shown, the system of the embodiment of the present invention further includes a data set preparation module, and the data set preparation module specifically includes: A data collection unit, used for collecting a variety of model parameter adjustment data, and storing the various model parameter adjustment data in an object database; A data preprocessing unit performs data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data; A data segmentation unit, used for segmenting the preprocessed data to obtain multiple segments of preprocessed data; The question data set combination unit is used to input each section of preprocessed data into the preset large model, generate multiple first question texts related to model parameter adjustment, and set the labels of the first question texts as professional questions; extract part of the questions as second question texts based on the first open source data set, and set the labels of the second question texts as non-professional questions; combine the first question texts, the second question texts and the labels corresponding to the texts to obtain the question data set; The question-answer data set combination unit inputs each segment of preprocessed data into a preset large model, generates a plurality of first question-answer pairs related to model parameter adjustment as professional question-answer pairs; extracts some question-answer pairs based on the first open source data set as non-professional question-answer pairs, combines the professional question-answer pairs with the non-professional question-answer pairs, and obtains a question-answer data set; The translation data set combination unit is used to input each section of pre-processed data into a preset large model, extract multiple sentences and translate the multiple sentences into sentences in a preset language to obtain professional translation data; extract part of the translation data as non-professional translation data based on the second open source data set, combine the professional translation data with the non-professional translation data to obtain a translation data set.

[0048] The system of the embodiment of the present invention collects relevant information through multiple channels; pre-processes the collected information and converts it into a unified text format; generates multi-task data such as questions and labels, question-answer pairs, and translation for the collected information to support subsequent model parameter adjustment; performs layered parameter adjustment for different tasks such as classification, question-answering, and machine translation, freezes the parameters of other layers in turn, and adjusts specific layers, thereby reducing the number of resources required for parameter adjustment and improving parameter adjustment efficiency; after completing the large model parameter adjustment for different tasks, different lora parameters are obtained and merged, so that the large model can handle multiple tasks at the same time; and the performance of the large model obtained after the parameter merging is evaluated to ensure that it meets the requirements of multiple tasks.

[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-task joint large model hierarchical parameter adjustment method, characterized in that: include: According to the task type and parameter adjustment data set executed by the large model, the hierarchical parameters of the large model are iteratively adjusted respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type; the parameter adjustment data set includes a question data set, a question-answering data set and a translation data set; the task types include classification tasks, question-answering tasks and machine translation tasks; Merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance of the multi-task joint large model is evaluated according to the preset task indicators, and the multi-task joint large model whose model performance evaluation results meet the multi-task requirements is deployed to the actual application environment.

2. The multi-task joint large model hierarchical parameter adjustment method according to claim 1 is characterized in that: It also includes the process of obtaining the parameter adjustment data set: Collecting multiple model parameter adjustment data, and storing the multiple model parameter adjustment data in an object database; Performing data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data; Segment the preprocessed data to obtain multiple segments of preprocessed data; Input each segment of preprocessed data into the preset large model, generate multiple first question texts related to model parameter adjustment, and set the labels of the first question texts as professional questions; extract some questions as second question texts based on the first open source data set, and set the labels of the second question texts as non-professional questions; Combine the first question text, the second question text, and the labels corresponding to the texts to obtain a question data set; Input each segment of preprocessed data into a preset large model, generate multiple first question-answer pairs related to model parameter adjustment as professional question-answer pairs; extract some question-answer pairs based on the first open source data set as non-professional question-answer pairs, combine the professional question-answer pairs with the non-professional question-answer pairs, and obtain a question-answer data set; Input each segment of pre-processed data into a preset large model, extract multiple sentences, and translate the multiple sentences into sentences in a preset language to obtain professional translation data; Based on the second open source data set, part of the translation data is extracted as non-professional translation data, and the professional translation data and the non-professional translation data are combined to obtain a translation data set.

3. The multi-task joint large model hierarchical parameter adjustment method according to claim 1 is characterized in that: The task type and parameter adjustment data set executed by the large model are used to iteratively adjust the hierarchical parameters of the large model respectively by Lora fine-tuning to obtain the Lora parameters corresponding to each task type, including: Determine the task type performed by the large model. If the task type is a classification task, fine-tune the hierarchical parameters of the large model based on the problem data to obtain the classification Lora parameters; the large model includes an embedding layer, a position encoding layer, an attention layer, and a feedforward layer; If the task type is a question-answering task, the hierarchical parameter Lora of the large model is fine-tuned based on the question-answering dataset to obtain the question-answering Lora parameters; If the task type is a machine translation task, the hierarchical parameter Lora of the large model is fine-tuned based on the translation data set to obtain the translation Lora parameters.

4. The multi-task joint large model hierarchical parameter adjustment method according to claim 3 is characterized in that: The Lora fine-tuning process of the layered parameters includes: First, freeze the other layers of the large model and fine-tune the parameters of the embedding layer. Then freeze the other layers except the position encoding layer in the large model, fine-tune the parameters of the position encoding layer, and assign a position code to the position of each element in the input sequence; freeze the other layers except the attention layer in the large model, fine-tune the parameters of the attention layer, calculate the similarity between the elements in the input sequence, assign a weight to each element, and capture the dependency and importance between different elements according to the weight of the element; then freeze the other layers except the feedforward layer in the large model, fine-tune the parameters of the feedforward layer, map the input sequence to a higher dimensional space than the original dimension through a linear transformation, apply the ReLU activation function, and map the data back to the original dimension through a linear transformation; finally, freeze the other layers except the output layer in the large model, fine-tune the parameters of the output layer, and output the final result generated by the model.

5. The multi-task joint large model hierarchical parameter adjustment method according to claim 4 is characterized in that: The parameter Lora fine-tuning process is specifically as follows: fix the weight parameters of the original large model, define two low-rank matrices A and B as new parameters to participate in the operation, and sum the results of the two links as the output of this layer in the large model; when updating the layered parameters, calculate the loss function based on the difference between the model's answer and the correct answer, and update the low-rank matrices A and B through the back propagation algorithm to minimize the loss function; iteratively update the layered parameters until the performance of the large model reaches the predetermined standard or the training reaches the preset iteration rounds.

6. The multi-task joint large model hierarchical parameter adjustment method according to claim 1 is characterized in that: The original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model, including: Define the original large model parameters as After completing the parameter layered Lora adjustment for different tasks, the task The corresponding large model The lora parameters of the layer are ,satisfy: ; in, and are two low-rank matrices; The original large model parameters are merged with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model that can handle multiple tasks simultaneously. The parameters of the large model after parameter merging are , calculated as: ; That is, the lora parameters of different tasks are merged into the parameters of the basic model according to the preset ratio; among them, is the total number of tasks; The proportion of the Lora parameters corresponding to each task in the entire large model parameter adjustment. The larger it is, the more important the corresponding task is; are the original large model parameters.

7. The multi-task joint large model hierarchical parameter adjustment method according to claim 1, characterized in that: The model performance evaluation of the multi-task joint large model based on the preset task indicators includes: For classification tasks, accuracy, precision, recall and F1 score are used to evaluate the performance of large models; for question-answering tasks, the C-Eval evaluation suite is used to evaluate the performance of the model; for machine translation tasks, the BLEU score is used to evaluate the performance of the model.

8. A multi-task joint large model hierarchical parameter adjustment system, characterized in that: include: A hierarchical parameter adjustment module is used to iteratively adjust the hierarchical parameters of the large model according to the task type and parameter adjustment data set executed by the large model, and obtain the Lora parameters corresponding to each task type by using the Lora fine-tuning method; the parameter adjustment data set includes a question data set, a question-answering data set, and a translation data set; the task types include classification tasks, question-answering tasks, and machine translation tasks; The parameter merging module is used to merge the original large model parameters with the Lora fine-tuning parameters of multiple task types to generate a multi-task joint large model; The model performance evaluation module is used to evaluate the model performance of the multi-task joint large model according to the preset task indicators, and deploy the multi-task joint large model whose model performance evaluation results meet the multi-task requirements to the actual application environment.

9. The multi-task joint large model hierarchical parameter adjustment system according to claim 8, characterized in that: It also includes a data set preparation module, which specifically includes: A data collection unit, used for collecting a variety of model parameter adjustment data, and storing the various model parameter adjustment data in an object database; A data preprocessing unit performs data preprocessing operations on various model parameter adjustment data in the object database to obtain preprocessed data; A data segmentation unit, used for segmenting the preprocessed data to obtain multiple segments of preprocessed data; The question data set combination unit is used to input each section of preprocessed data into the preset large model, generate multiple first question texts related to model parameter adjustment, and set the labels of the first question texts as professional questions; extract part of the questions as second question texts based on the first open source data set, and set the labels of the second question texts as non-professional questions; combine the first question texts, the second question texts and the labels corresponding to the texts to obtain the question data set; The question-answer data set combination unit inputs each segment of preprocessed data into a preset large model, generates a plurality of first question-answer pairs related to model parameter adjustment as professional question-answer pairs; extracts some question-answer pairs based on the first open source data set as non-professional question-answer pairs, combines the professional question-answer pairs with the non-professional question-answer pairs, and obtains a question-answer data set; The translation data set combination unit is used to input each section of pre-processed data into a preset large model, extract multiple sentences and translate the multiple sentences into sentences in a preset language to obtain professional translation data; extract part of the translation data as non-professional translation data based on the second open source data set, combine the professional translation data with the non-professional translation data to obtain a translation data set.

Citation Information

Patent Citations

  • Multi-task large model fine tuning method based on adapters and low-rank adaptation

    CN116822611A

  • Database parameter tuning method and device, equipment and medium

    CN118210775A

  • Parameter update apparatus, classification apparatus, recording medium, and parameter update method

    US20210256308A1

Cited By

  • General information extraction method based on continuous low-rank adaptation

    CN120338087A

  • A general information extraction method based on continuous low rank adaptation

    CN120338087B