Instruction fine tuning data selection method and device for multi-mode large model

By using reward model and low-rank adapter to optimize the scoring formula in the multimodal large model fine-tuning process, combined with matrix variance analysis, the problem of efficient selection of high-quality fine-tuning data is solved, and efficient in the multimodal large model fine-tuning process is achieved Data selection and model performance improvement.

CN119004099APending Publication Date: 2024-11-22INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410992374.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the fine-tuning process of multimodal large models, how to efficiently select high-quality instruction fine-tuning data to accelerate training speed while ensuring fine-tuning effect.

Method used

The generation quality of multimodal large models is evaluated by introducing the output score of the reward model, adjust the scoring formulas in combination with the low-rank adapter and the Adam optimizer, obtain a representative data set, and select diverse instruction fine-tuning data from it based on matrix ANOVA.

Benefits of technology

It solves the deviation problem when directly using cross entropy loss values ​​to evaluate the quality of multimodal large models, reduces the calculation amount of score calculation, obtains representative and diverse fine-tuning data during the model fine-tuning process, and improves data selection Efficiency and model accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004099A_ABST
    Figure CN119004099A_ABST
Patent Text Reader

Abstract

The invention provides a selection method and device for instruction fine tuning data of a multi-modal large model, and the method comprises the steps: training a reward model based on manual feedback, and enabling the maximization of an output score of the reward model to serve as a target optimization multi-modal large model, so as to obtain a first scoring formula of a multi-modal data set, the output score of the reward model is used for evaluating the quality of the output result of the multi-modal large model; adjusting the first scoring formula according to a low-rank adapter and an Adam optimizer to obtain a second scoring formula; acquiring a representative data set from the multi-modal data set according to a second scoring formula; and performing diversity selection from the representative data set to obtain representative and diversified instruction fine tuning data of the multi-modal large model. By means of the method, when the multi-modal large model is subjected to specific task training, high-quality fine adjustment data can be obtained, and the training speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence, and in particular to a method and device for selecting instruction fine-tuning data for a multi-modal large model. Background Art

[0002] The training of a large multimodal model consists of two parts: one is pre-training, which enables it to learn general knowledge and reasoning capabilities; the other is fine-tuning, which enables it to learn specialized knowledge and capabilities for specific tasks. In the early days, researchers and technical developers tended to construct larger and more diverse instruction fine-tuning datasets when fine-tuning large models. However, related studies have found that in the model fine-tuning stage, the data quality of instruction fine-tuning data is more important than the data quantity. When a large multimodal model is trained for a specific task, a small amount of high-quality instruction fine-tuning data may produce higher quality fine-tuning results than a larger and more diverse instruction fine-tuning dataset.

[0003] Therefore, for specific tasks, how to efficiently select high-quality instruction fine-tuning data for large multimodal models so as to accelerate the training speed of large multimodal models while ensuring the fine-tuning effect has become an urgent problem that needs to be solved. Summary of the invention

[0004] The present invention provides a method and device for selecting instruction fine-tuning data for a multimodal large model, so as to solve the problem of how to select high-quality fine-tuning data for a specific task fine-tuning process of a multimodal large model in the related art.

[0005] The present invention provides a method for selecting instruction fine-tuning data for a multi-modal large model, comprising the following steps: Constructing a first scoring formula for the multimodal dataset based on the target output score of the reward model, wherein the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model; Adjust the first scoring formula according to the low-rank adapter and the Adam optimizer to obtain a second scoring formula; According to the second scoring formula, a representative data set is obtained from the multimodal data set; Instruction fine-tuning data for a large multimodal model with diversity is selected from the representative dataset.

[0006] According to the instruction fine-tuning data selection method for a multimodal large model provided by the present invention, the first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain the second scoring formula, including: Use the low-rank adapter to preheat the initial multimodal large model on the preheat dataset to obtain the preheat model parameters; Input each subtask set in the validation set into the multimodal large model corresponding to the preheated model parameters to obtain the average gradient of each subtask set; Input each multimodal data in the multimodal data set into the multimodal large model corresponding to the preheating model parameters to obtain the gradient of each multimodal data; input the gradient of each multimodal data into the Adam optimizer for iteration to obtain the iteration step length of each multimodal data; Obtaining the iteration step length of each multimodal data after random mapping; and obtaining the random mapping average gradient of the average gradient of each subtask set after random mapping; According to the iteration step of each multimodal data and the random mapping gradient of each subtask set, the first scoring formula is adjusted to obtain a second scoring formula.

[0007] According to the method for selecting instruction fine-tuning data for a multi-modal large model provided by the present invention, the steps further include: A preset proportion of data is randomly acquired from the multimodal data set to obtain a preheating data set.

[0008] According to the method for selecting instruction fine-tuning data for a multimodal large model provided by the present invention, the step of selecting instruction fine-tuning data for a multimodal large model having diversity from the representative data set comprises: Based on matrix variance analysis, instruction fine-tuning data of a multimodal large model with diversity is screened from the representative data set.

[0009] According to the method for selecting instruction fine-tuning data for a multimodal large model provided by the present invention, the instruction fine-tuning data for a multimodal large model with diversity is screened from the representative data set based on matrix variance analysis, including: Acquire multiple modality features in the representative data set; Perform singular value decomposition on the covariance matrix composed of multiple modal features to obtain the eigenvalues ​​and corresponding eigenvectors of the covariance matrix; Sort the eigenvalues ​​from large to small, obtain the eigenvalues ​​and corresponding eigenvectors within the preset ranking, and obtain the dimension reduction matrix of multiple modal features; The row variance of each row of the dimension reduction matrix is ​​sorted from large to small, and the target modal features corresponding to the row variance of a preset proportion are obtained from large to small in the sorting results; According to the target modality characteristics, instruction fine-tuning data of a multimodal large model with diversity is obtained from the representative dataset.

[0010] According to the method for selecting instruction fine-tuning data for a multi-modal large model provided by the present invention, the steps further include: The reward model is trained to obtain the reward model, wherein the model parameter amount of the preset reward model is less than the preset model parameter amount.

[0011] According to the instruction fine-tuning data selection method for a multimodal large model provided by the present invention, the first scoring formula is used to characterize the similarity between the data in the multimodal data set and the training data of the reward model.

[0012] The present invention also provides a device for selecting instruction fine-tuning data for a multi-modal large model, comprising the following modules: A first scoring module constructs a first scoring formula for the multimodal dataset based on a target output score of the reward model, wherein the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model; A second scoring module, configured to adjust the first scoring formula according to a low-rank adapter and an Adam optimizer to obtain a second scoring formula; A first data acquisition module, configured to acquire a representative data set from a multimodal data set according to the second scoring formula; The second data acquisition module is used to select instruction fine-tuning data of a multimodal large model with diversity from the representative data set.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the program.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the methods described above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, any of the above-described methods is implemented.

[0016] The present invention provides a method and device for selecting instruction fine-tuning data for a multimodal large model. The output score of a reward model is introduced to evaluate the generation quality of the multimodal large model, which can solve the problem of deviation when the cross entropy loss value is directly used to evaluate the quality of text generated by the multimodal large model. At the same time, a low-rank adapter and an Adam optimizer are combined to optimize the scoring formula, reduce the amount of calculation during the scoring calculation, and obtain instruction fine-tuning data of the multimodal large model with diversity from the obtained representative data set, so that high-quality fine-tuning data can be obtained in the model fine-tuning process of the multimodal large model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of a method for selecting instruction fine-tuning data for a multi-modal large model provided by the present invention.

[0019] Figure 2 It is a flow chart provided by the present invention for adjusting a first scoring formula according to a low-rank adapter and an Adam optimizer to obtain a second scoring formula.

[0020] Figure 3 It is a structural schematic diagram of an instruction fine-tuning data selection device for a multi-modal large model provided by the present invention.

[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the descriptions used in this way can be interchanged where appropriate, so that the embodiments can be implemented in a sequence other than that illustrated or described in the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of the steps that appear in the present application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of modules in this application is a logical division. There may be other division methods when it is implemented in actual applications. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between units can be electrical or other similar forms, which are not limited in this application. In addition, the modules or submodules described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed in multiple circuit units, and some or all of the units may be selected according to actual needs to achieve the purpose of the present application.

[0024] The present invention provides a method and device for selecting instruction fine-tuning data for a multimodal large model, so as to solve the problem in the related art of how to obtain high-quality fine-tuning data during the model fine-tuning process of the multimodal large model.

[0025] Combine the following Figure 1-Figure 4 The specific contents of the present invention are described.

[0026] It should be noted that, in the present invention, the principle of measuring the representativeness of each sample data in the multimodal dataset is as follows: for each task, a small amount of example sample data is prepared in advance. (non-test samples and training samples) as a reference for sample data selection. The inventor believes that the basis for measuring whether the sample data is representative is that the data that has a gradient effect similar to the sample data during training is more similar to the sample data and more representative of the multimodal large model.

[0027] In a possible implementation, the evaluation index of the sample data is the cross entropy loss between the output text and the label text.

[0028] In the present invention, the inventors noticed that if the sample data can be used Directly train the multimodal large model, then through the gradient descent optimization process, the multimodal large model is The cross entropy loss value of the predicted output on will reach a minimum. Therefore, if a multimodal large model is trained with a certain training sample data, the direction of the parameter gradient descent of the multimodal large model is the same as that of the sample data. The direction of gradient descent is consistent during training, so during the training process, the model is more accurate in the example samples The cross entropy loss value of the predicted output will also continue to decrease. And this type of sample data also well represents the task corresponding to the example sample data. Based on the above invention concept, the present invention provides a method and device for selecting instruction fine-tuning data for a multi-modal large model.

[0029] Example Sample Dataset It consists of multiple tasks as subsets, such as: , ..., , example sample data set Only a small number of examples per downstream task The training data selected as training data, , D is a multimodal dataset. During training, we first perform a representative search, and assume that the representative dataset is , and then perform diversity search to remove redundant data to obtain the final data set that can be used for training , that is, instruction fine-tuning data.

[0030] It should be noted that the method for selecting instruction fine-tuning data for a multimodal large model in the present invention can be specifically applied to, but not limited to, the following fields: medical imaging, such as pathological images, X-rays, or MRI scans, where collecting a large amount of labeled data may be difficult and expensive; financial fields, especially stock price predictions, where obtaining labeled data may involve financial reports, news, and market data; legal fields, including a large amount of labeled legal document data, etc. In different application scenarios, the types of specific tasks corresponding to the multimodal large model may be different, resulting in differences in the types of instruction fine-tuning data to be selected.

[0031] Figure 1 A flow chart of a method for selecting instruction fine-tuning data for a multimodal large model provided by the present invention is applied in a server and includes steps S101-S104.

[0032] Step S101, constructing a first scoring formula for the multimodal data set based on the target output score of the reward model, where the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model.

[0033] In an embodiment of the present invention, the multimodal large model is used in the example sample data The cross entropy loss value of the predicted output cannot accurately reflect the ability of the multimodal large model, especially for some tasks that need to output long text. To address this problem, the present invention trains a reward model with a smaller number of parameters to evaluate the quality of the output results of the multimodal large model to obtain a more accurate evaluation result, and uses the target output score of the reward model to Use it as the loss function for subsequent calculations.

[0034] In the present invention, the process of obtaining the reward model refers to the relevant content in step S105 in the embodiment of the present invention.

[0035] In the present invention, there are multiple rounds of model training processes for the model fine-tuning process of the multimodal large model. Each round is performed in multiple steps, so that in each step, sample data in part of the multimodal data set is used for training. The following describes one round of the model fine-tuning process of the multimodal large model.

[0036] Specifically, the principle of measuring the representativeness of sample data can be explained as follows: The loss function value on the first-order Taylor expansion is as follows: (1)

[0037] in, is the model parameter obtained by training in the tth step, For the Model parameters after one round of training. is the cross entropy loss function of the multimodal large model, and the corresponding model gradient is , the target output score on the reward model is , the corresponding reward model gradient is . Assume that the learning rate of the model is , It is The average learning rate of the round training. The first-order moment vector in the Adam optimizer and the second-order moment vector The corresponding and is a hyperparameter.

[0038] For example, when the SGD optimizer is used to optimize the multimodal large model, and the batch size is assumed to be 1, that is, the multimodal large model only uses one training sample data per iteration. , we get the following equation: (2)

[0039] Substituting formula (2) into (1), we get the following formula: < , > (3)

[0040] Formula (3) shows that when using training sample data When training a large multimodal model, if the direction of the model gradient descent is consistent with the sample data The more similar the direction of gradient descent is during training, the better the multimodal model is at performing on the sample data. The cross entropy loss value of the predicted output on the training sample data also decreases faster, which means that The more representative.

[0041] Usually the model training process needs to go through multiple rounds, so the training sample data The impact on the gradient descent of the entire multimodal large model can be expressed by the impact on the gradient descent of the model in all rounds, that is, the accumulation of formula (3): (4)

[0042] In one possible implementation, the target output score of the reward model is The calculated gradient and based on the output score The calculated iteration step size of the Adam optimizer , to replace the cross entropy loss in formula (4) The above two improvements are combined to obtain the following first scoring formula: (5)

[0043] Among them, the following is the formula for Adam optimizer iteration: (6)

[0044] (7)

[0045] (8)

[0046] in, is the first-order moment vector of the Adam optimizer in the i+1th round of training; is the first-order moment vector of the Adam optimizer in the i-th round of training; is the second-order moment vector of the Adam optimizer in the i+1th round of training; is the second-order moment vector of the Adam optimizer in the i-th round of training.

[0047] In a possible implementation, the first scoring formula is used to characterize the similarity between the data in the multimodal dataset and the training data of the reward model.

[0048] Step S102, adjusting the first scoring formula according to the low-rank adapter and the Adam optimizer to obtain a second scoring formula.

[0049] Specifically, according to the first scoring formula above, if each calculation uses high-dimensional gradient features for calculation, whether it is calculating the inner product Or calculate the iteration step length This will cause great computational pressure. Therefore, in the embodiment of the present invention, a LoRA (Low-Rank Adaptation, LoRA) adapter is used, that is, a low-rank adapter preheating training is performed, and then random mapping is performed to reduce the dimension of the gradient feature. The specific process is as follows: In a possible implementation, Figure 2 As shown, the first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain the second scoring formula, including steps S201-S205.

[0050] In a possible implementation, before step S201, the method further includes: randomly acquiring a preset proportion of data from the multimodal dataset to obtain a preheating dataset.

[0051] Step S201, use a low-rank adapter to preheat the initial multimodal large model on the preheat data set to obtain preheat model parameters.

[0052] Step S202: input each subtask set in the validation set into the multimodal large model corresponding to the preheating model parameters to obtain the average gradient of each subtask set.

[0053] Exemplarily, for steps S201-S202. Use a low-rank adapter to reduce the number of parameters to be trained. Specifically, freeze the pre-trained weights and add a low-rank adapter to the fully connected layer of the entire multi-model model network. Randomly search 5% of the data from the multimodal dataset D as a warm-up dataset ; For the jth subtask set, the low-rank adapter is placed in the preheated dataset Train N rounds and save model parameters . Get the average gradient of each multimodal data after dimensionality reduction by the low-rank adapter.

[0054] By randomly obtaining a preset proportion of data from the multimodal dataset as a warm-up dataset, it is possible to quickly provide initial training data for the low-rank adapter and Adam optimizer, accelerating the adjustment process of the scoring formula. This improves the efficiency of data utilization and helps the model better adapt to the characteristics of multimodal data.

[0055] Step S203, input each multimodal data in the multimodal data set into the multimodal large model corresponding to the preheating model parameters to obtain the gradient of each multimodal data; input the gradient of each multimodal data into the Adam optimizer for iteration to obtain the iteration step size of each multimodal data.

[0056] Step S204, obtaining the iteration step length of each multimodal data after random mapping ; And, obtain the average gradient of each subtask set after random mapping to obtain the random mapping average gradient .

[0057] Specifically, in step S203, each multimodal data in the multimodal data set is input into the multimodal large model corresponding to the preheating model parameters to obtain the gradient of each multimodal data, thereby achieving gradient dimensionality reduction. In step S204, the gradient of each multimodal data after dimensionality reduction is randomly mapped to obtain the model gradient after further dimensionality reduction. and use this gradient The calculated iteration step size of the Adam optimizer ; The average gradient of each subtask set after dimension reduction is randomly mapped to obtain the average gradient of random mapping .

[0058] Step S205: According to the iteration step of each multimodal data and the random mapping gradient of each subtask set, the first scoring formula is adjusted to obtain a second scoring formula.

[0059] (9)

[0060] Among them, the calculation formula for the average gradient of random mapping corresponding to the j-th subtask set is as follows: (10)

[0061] in, It is a multimodal data in the multimodal dataset.

[0062] Step S103: acquiring a representative data set from the multimodal data set according to the second scoring formula.

[0063] Specifically, the scoring results of each subtask set according to the second scoring formula are obtained, and the scoring results are sorted from large to small; the subtask sets corresponding to the scoring results of a preset proportion are obtained from large to small in the sorted results to obtain a representative data set .

[0064] Step S104, selecting instruction fine-tuning data of a multimodal large model with diversity from the representative data set.

[0065] In a possible implementation, selecting instruction fine-tuning data of a multimodal large model with diversity from a representative data set includes: selecting instruction fine-tuning data of a multimodal large model with diversity from a representative data set based on matrix variance analysis.

[0066] Specifically, since representative selection is a linear selection that ignores the effect of multiple data points added together, the representative dataset There may be redundant data, and the diversity of the data is ensured by using the matrix variance analysis method. For the specific implementation process, please refer to the following embodiment.

[0067] In a possible implementation, based on matrix variance analysis, instruction fine-tuning data of a multimodal large model is screened from a representative data set, including steps S1041-S1045.

[0068] Step S1041, obtaining multiple modal features in a representative data set.

[0069] Step S1042, performing singular value decomposition on the covariance matrix composed of multiple modal features to obtain the eigenvalues ​​and corresponding eigenvectors of the covariance matrix.

[0070] Specifically, we first use pre-trained multimodal encoders such as CLIP (Contrastive Language-Image Pre-training) to obtain multiple modal features in a representative data set, and then concatenate the modal features after normalization to obtain a covariance matrix. We perform dimensionality reduction on the covariance matrix, calculate the covariance matrix, and perform singular value decomposition on the covariance matrix to obtain multiple eigenvalues ​​and eigenvectors.

[0071] Step S1043, sorting the eigenvalues ​​from large to small, obtaining the eigenvalues ​​and corresponding eigenvectors within a preset sorting ranking, so as to obtain a dimensionality reduction matrix of multiple modal features.

[0072] Step S1044, sorting the row variance of each row of the dimension reduction matrix from large to small, and obtaining the target modal features corresponding to the row variances of a preset proportion from large to small in the sorting results.

[0073] Step S1045, obtaining instruction fine-tuning data with diversity from the representative data set according to the target modality characteristics.

[0074] Specifically, in steps S1043-S1045, k eigenvectors corresponding to the largest k eigenvalues ​​among multiple eigenvalues ​​are selected, where k is the feature dimension after dimensionality reduction, to form a dimensionality reduction matrix of multiple modal features. After dimensionality reduction, the row variance on the dimensionality reduction matrix is ​​analyzed to identify data with significant differences. The row variance can represent the variability of the data in the reduced feature space. A high variance indicates that the data has significant position changes along this dimension, which helps to identify different data points. Since each row corresponds to a sample data point, the variance represents the representativeness of the sample data. Finally, the top N sample subsets with the highest row variance ranking are intercepted according to the set compression ratio as the final data set, thereby obtaining a fine-tuning data set for a multimodal large model that is both representative and diverse. .

[0075] By performing singular value decomposition and row variance sorting on the covariance matrix of multiple modal features, the most representative and informative modal features can be extracted, and high-quality instruction fine-tuning data can be selected from representative data sets. This can significantly reduce the impact of data redundancy and noise on the model fine-tuning effect and improve the accuracy and efficiency of large multi-modal models on specific tasks.

[0076] In a possible implementation, the method further includes step S105.

[0077] Step S105, training the reward model to obtain a reward model, wherein the model parameter amount of the preset reward model is less than the preset model parameter amount.

[0078] In an embodiment of the present invention, the output score of the reward model is used to evaluate the quality of the output results of the multimodal large model. The reward model is continuously trained and the output score of each round of training is recorded. When the output score of the reward model reaches the target output score (that is, the output score reaches a maximum value during the training process), the reward model completes the training and is used in subsequent steps.

[0079] In an embodiment of the invention, an open source multimodal evaluation data set is selected to rank and score the capabilities of the open source multimodal large model, thereby obtaining a reward model training data set with manual feedback. The reward model training data set is used to fine-tune the open source preset reward model with fewer model parameters and lower computational complexity when calculating gradients, such as deberta-v3-large-v2, electra-large-discriminator, PairRM, etc. The preset reward model is fine-tuned to obtain a reward model that can evaluate the quality of the results generated by the multimodal large model.

[0080] In an embodiment of the invention, for a plurality of existing preset reward models, a preset reward model having a model parameter amount smaller than a preset model parameter amount is preferentially selected.

[0081] By adopting the above invention, the present invention can achieve at least one of the following beneficial effects: 1. By introducing the output score of the reward model to evaluate the generation quality of the multimodal large model, the problem of deviation when directly using the cross entropy loss value to evaluate the quality of the text generated by the multimodal large model can be solved; at the same time, the low-rank adapter and Adam optimizer are combined to optimize the scoring formula, reduce the amount of calculation during the scoring calculation, and continue to select diverse data from the representative data set to obtain the instruction fine-tuning data of the multimodal large model, so that representative and diverse fine-tuning data can be obtained in the model fine-tuning process of the multimodal large model.

[0082] 2. The low-rank adapter can reduce the number of parameters required for the operation and reduce the complexity of the calculation. At the same time, it can be used on the Adam optimizer, that is, it can be used for instruction dataset search for large models. Using the preheated dataset to train the model and add a random mapping layer, as well as adjusting the scoring formula through the average iterative gradient of the subtask, can help the model more accurately evaluate the data quality in the dataset, thereby selecting more suitable fine-tuning data.

[0083] 3. In the process of obtaining instruction fine-tuning data from a representative data set, the present invention effectively reduces the redundancy of the representative data set based on the matrix variance estimation method.

[0084] 4. By training the preset reward model to obtain the reward model, it can be ensured that the reward model has sufficient evaluation capabilities to accurately evaluate the quality of the output results of the multimodal large model. At the same time, by limiting the model parameter amount of the preset reward model to be less than the preset model parameter amount, the complexity and computational cost of the reward model can be reduced, and the overall efficiency of data selection and model fine-tuning can be improved.

[0085] like Figure 3As shown, the present invention provides an instruction fine-tuning data selection device for a multi-modal large model, comprising: A first scoring module 310, configured to construct a first scoring formula for the multimodal dataset based on a target output score of the reward model, wherein the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model; A second scoring module 320, configured to adjust the first scoring formula according to the low-rank adapter and the Adam optimizer to obtain a second scoring formula; A first data acquisition module 330, configured to acquire a representative data set from the multimodal data set according to a second scoring formula; The second data acquisition module 340 is used to select instruction fine-tuning data of a multimodal large model with diversity from the representative data set.

[0086] In a possible implementation, the second scoring module 320 includes: A parameter acquisition unit, used to perform preheating training on the initial multimodal large model on the preheating dataset using a low-rank adapter to obtain preheating model parameters; The average gradient acquisition unit is used to input each sub-task set in the validation set into the multi-modal large model corresponding to the preheating model parameters to obtain the average gradient of each sub-task set; An iteration step acquisition unit is used to input each multimodal data in the multimodal data set into the multimodal large model corresponding to the preheating model parameters to obtain the gradient of each multimodal data; input the gradient of each multimodal data into the Adam optimizer for iteration to obtain the iteration step of each multimodal data; A random mapping unit, used to obtain the iteration step length of each multimodal data after random mapping; and to obtain the random mapping average gradient of the average gradient of each subtask set after random mapping; The formula adjustment unit is used to adjust the first scoring formula according to the iteration step of each multimodal data and the random mapping gradient of each subtask set to obtain a second scoring formula.

[0087] In a possible implementation, the second scoring module 320 further includes: The data acquisition unit is used to randomly acquire a preset proportion of data from the multimodal data set to obtain a preheated data set.

[0088] In a possible implementation, the second data acquisition module 340 is used to filter out instruction fine-tuning data of a multimodal large model with diversity from a representative data set based on matrix variance analysis.

[0089] In a possible implementation, the second data acquisition module 340 includes: A feature acquisition unit, used for acquiring multiple modal features in a representative data set; A feature calculation unit, used for performing singular value decomposition on a covariance matrix composed of multiple modal features to obtain eigenvalues ​​and corresponding eigenvectors of the covariance matrix; A feature dimension reduction unit is used to sort the eigenvalues ​​from large to small, obtain the eigenvalues ​​and corresponding eigenvectors within a preset sorting ranking, and obtain a dimension reduction matrix of multiple modal features; A feature sorting unit is used to sort the row variance of each row of the dimension reduction matrix from large to small, and obtain the target modal features corresponding to the row variance of a preset proportion from large to small in the sorting result; The data selection unit is used to obtain instruction fine-tuning data of a multimodal large model with diversity from a representative data set according to target modality characteristics.

[0090] In a possible implementation manner, the instruction fine-tuning data selection device for the multi-modal large model further includes: The reward model acquisition module is used to train the reward model to obtain the reward model, and the model parameter amount of the preset reward model is less than the preset model parameter amount.

[0091] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a method for selecting instruction fine-tuning data for a multi-modal large model, the method comprising: Based on the target output score of the reward model, the first scoring formula of the multimodal dataset is constructed. The target output score of the reward model is used to evaluate the quality of the output results of the multimodal large model. The first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain the second scoring formula; According to the second scoring formula, a representative data set is obtained from the multimodal data set; Instruction fine-tuning data for large multimodal models with diversity selected from representative datasets.

[0092] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0093] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute a multi-modal large model instruction fine-tuning data selection method provided by the above methods, the method includes

[0094] Based on the target output score of the reward model, the first scoring formula of the multimodal dataset is constructed. The target output score of the reward model is used to evaluate the quality of the output results of the multimodal large model. The first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain the second scoring formula; According to the second scoring formula, a representative data set is obtained from the multimodal data set; Instruction fine-tuning data for large multimodal models with diversity selected from representative datasets.

[0095] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute a method for selecting data for fine-tuning instructions of a multi-modal large model provided by the above methods, the method comprising:

[0096] Based on the target output score of the reward model, the first scoring formula of the multimodal dataset is constructed. The target output score of the reward model is used to evaluate the quality of the output results of the multimodal large model. The first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain the second scoring formula; According to the second scoring formula, a representative data set is obtained from the multimodal data set; Instruction fine-tuning data for large multimodal models with diversity selected from representative datasets.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0098] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0099] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for selecting instruction fine-tuning data for a multimodal large model. It is characterized in that include: Constructing a first scoring formula for the multimodal dataset based on the target output score of the reward model, wherein the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model; Adjust the first scoring formula according to the low-rank adapter and the Adam optimizer to obtain a second scoring formula; According to the second scoring formula, a representative data set is obtained from the multimodal data set; Instruction fine-tuning data for a large multimodal model with diversity is selected from the representative dataset.

2. The instruction fine-tuning data selection method for a multimodal large model according to claim 1, It is characterized in that The first scoring formula is adjusted according to the low-rank adapter and the Adam optimizer to obtain a second scoring formula, which includes: Use the low-rank adapter to preheat the initial multimodal large model on the preheat dataset to obtain the preheat model parameters; Input each subtask set in the validation set into the multimodal large model corresponding to the preheated model parameters to obtain the average gradient of each subtask set; Input each multimodal data in the multimodal data set into the multimodal large model corresponding to the preheating model parameters to obtain the gradient of each multimodal data; input the gradient of each multimodal data into the Adam optimizer for iteration to obtain the iteration step length of each multimodal data; Obtaining the iteration step length of each multimodal data after random mapping; and obtaining the random mapping average gradient of the average gradient of each subtask set after random mapping; According to the iteration step of each multimodal data and the random mapping gradient of each subtask set, the first scoring formula is adjusted to obtain a second scoring formula.

3. The instruction fine-tuning data selection method for a multimodal large model according to claim 2, It is characterized in that Also includes: A preset proportion of data is randomly acquired from the multimodal data set to obtain a preheating data set.

4. The method for selecting instruction fine-tuning data for a multimodal large model according to claim 1, It is characterized in that The step of selecting instruction fine-tuning data of a multimodal large model with diversity from the representative data set includes: Based on matrix variance analysis, instruction fine-tuning data of a multimodal large model with diversity is screened from the representative data set.

5. The instruction fine-tuning data selection method for a multimodal large model according to claim 4, It is characterized in that The method of screening instruction fine-tuning data of a multimodal large model with diversity from the representative data set based on matrix variance analysis includes: Acquire multiple modality features in the representative data set; Perform singular value decomposition on the covariance matrix composed of multiple modal features to obtain the eigenvalues ​​and corresponding eigenvectors of the covariance matrix; Sort the eigenvalues ​​from large to small, obtain the eigenvalues ​​and corresponding eigenvectors within the preset ranking, and obtain the dimension reduction matrix of multiple modal features; The row variance of each row of the dimension reduction matrix is ​​sorted from large to small, and the target modal features corresponding to the row variance of a preset proportion are obtained from large to small in the sorting results; According to the target modality characteristics, instruction fine-tuning data of a multimodal large model with diversity is obtained from the representative dataset.

6. The method for selecting instruction fine-tuning data for a multimodal large model according to claim 1, It is characterized in that The method further comprises: The reward model is trained to obtain the reward model, wherein the model parameter amount of the preset reward model is less than the preset model parameter amount.

7. The method for selecting instruction fine-tuning data for a multimodal large model according to claim 1, It is characterized in that The first scoring formula is used to characterize the similarity between the data in the multimodal dataset and the training data of the reward model.

8. A data selection device for fine-tuning instructions for a multi-modal large model, It is characterized in that include: A first scoring module constructs a first scoring formula for the multimodal dataset based on a target output score of the reward model, wherein the target output score of the reward model is used to evaluate the quality of the output result of the multimodal large model; A second scoring module, configured to adjust the first scoring formula according to a low-rank adapter and an Adam optimizer to obtain a second scoring formula; A first data acquisition module, configured to acquire a representative data set from a multimodal data set according to the second scoring formula; The second data acquisition module is used to select instruction fine-tuning data of a multimodal large model with diversity from the representative data set.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Text data set quality evaluation method and device of electric power system and computer equipment

    CN122064994A