Multi-modal reasoning model self-evolution method based on autonomous instruction generation tuning
Through the content-related module and comparative learning module, the visual relevance of the multi-modal reasoning model is improved when generating instruction fine-tuning data, solving the problem of the model's over-reliance on language knowledge and limited generalization ability during the training process, and realizing the autonomy of the model. Evolution and high-quality data generation.
Patent Information
- Application Number
- CN202410740106.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-27
AI Technical Summary
Existing multi-modal reasoning models over-rely on language knowledge and ignore visual information when generating instruction fine-tuning data, and the training process focuses on reasoning capabilities rather than data generation, resulting in limited generalization capabilities when no samples are seen, and there is 'exposure' bias' problem.
The content-related module is used to calculate the corresponding score of the image instruction to enhance the content correlation between the instruction fine-tuning data and the image, and a contrastive learning module is introduced to use high-quality and low-quality data samples for training to maximize the similarity between positive and pseudo labels and minimize Reduce negative pseudo-label similarity and improve the data generation ability of the model.
It improves the quality of data generated by multi-modal inference models, enhances the model's responsiveness to images, realizes autonomous evolution of the model, and achieves performance comparable to the most advanced models.
Smart Images

Figure CN118551844A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language-image multimodal fusion, and in particular to a multimodal reasoning model self-evolution method. Background Art
[0002] In recent years, significant progress has been made in the field of natural language processing, and large language models have emerged, which has completely changed the landscape of this field. Taking advantage of the powerful reasoning capabilities of large language models, researchers have proposed combining visual encoders with large language models to build multimodal perception and reasoning systems. This integration enables large language models to have the ability to perceive and process visual information, thereby promoting significant progress in multimodal reasoning models. In practice, existing multimodal reasoning models usually adopt a two-stage training paradigm. The first stage uses a large number of image-text pairs to pre-train the multimodal reasoning model, usually using an image-text comparison method. The goal of this pre-training stage is to cultivate the basic cross-modal alignment capabilities of the multimodal reasoning model.
[0003] In the second stage, the model no longer relies on specific data for individual downstream tasks, but is fine-tuned using high-quality visual-language instruction fine-tuning data. The main approach to generating instruction fine-tuning data is to use closed-source large models to reduce the need for manual annotation. As the capabilities of open-source multimodal reasoning models improve, researchers are increasingly applying these models to generate instruction fine-tuning data, thereby overcoming the limitations of limited accessibility to closed-source large models.
[0004] Despite significant progress, this paradigm still faces the following challenges: 1) Multimodal models have long had a problem of over-reliance on prior language knowledge, causing them to ignore visual content. Therefore, when using a multimodal reasoning model to generate instruction fine-tuning data, the model often fails to effectively focus on visual information and instead over-relies on prior language knowledge. 2) The training process of current multimodal reasoning models mainly focuses on developing strong reasoning capabilities rather than their ability to serve as data generators. In fact, a straightforward way to address this problem is to introduce an additional training phase to train the model with high-quality instruction fine-tuning data as ground truth labels, but models that are only exposed to correct samples will suffer from the "exposure bias" problem, which will limit the model's generalization ability when encountering unseen samples. Therefore, this training paradigm limits the effectiveness of turning the model into a data generator. Summary of the invention
[0005] In order to overcome the shortcomings of the prior art, the present invention provides a method for self-evolution of a multimodal reasoning model based on autonomous instruction generation and tuning. The present invention effectively improves the quality of data generated by the multimodal reasoning model, and further uses the data to fine-tune the multimodal reasoning model itself, thereby achieving self-evolution of the multimodal reasoning model.
[0006] The main modules of the technical solution of the present invention are as follows: the first part is a content-related module, and the second part is a contrastive learning module. In the first part, the content relevance between the instruction fine-tuning data and the image is enhanced by calculating the image-instruction correspondence score. In the second part, the instruction fine-tuning data generation capability of the multimodal reasoning model is further improved through the contrastive learning framework.
[0007] The technical solution adopted by the present invention to solve its technical problem is:
[0008] Step 1: Given an image Where W×H×3 represents the size of the image. represents a real number set, and the instruction fine-tuning data is expressed as [Q j , A j ], j∈{1, 2, …, N j}, where Q j and A j Respectively represent the image I i The jth question and answer, N j Represents the image I i The number of instruction fine-tuning data; first, the multimodal reasoning model is used to generate the initial instruction fine-tuning data. Due to the influence of language prior knowledge, the initial data set contains data samples with low correlation with image content; next, for any given data sample [Q j , A j ], Q j and the corresponding image as the input of the model. After obtaining the model output, each answer label A is calculated j The probability value of the output Where t represents the text tag at the tth moment output by the model, and v represents the given image as the model input; then, the probability value of the answer tag at each moment is obtained Finally, the rate values are connected along the time dimension to obtain the visual answer score S(A|V). The S(A|V) score measures the response of the multimodal reasoning model to the specific instruction fine-tuning data under the premise of a given image; similarly, the probability value of the model output is calculated without giving the model an image. Where t represents the text tag at the tth moment output by the model, and d means that the image is not used as the input of the model, but only Q j As the input of the model, and obtain the output of the model; and the obtained answer score is called the direct answer score S(A), the S(A) score quantifies the model's response to the given instruction fine-tuning data without an image, and the final score S(I 2 C) Calculated by using KL divergence;
[0009] S(I 2 The C) score measures the difference in the model's response with or without the image. According to the properties of the KL divergence, a lower S(I 2 C) means that the difference between S(A|V) and S(A) is small, indicating that the content correlation between the data sample and the image is low. After obtaining S(I 2 C) score, all instruction fine-tuning data samples are divided into S(I 2 C) values, and use S(I 2 C) The higher 10% of data samples are used as true labels to train the model, and the cross entropy loss L is used during training. r , the calculation formula of cross entropy loss is:
[0010]
[0011] where i∈[1,N] represents the i-th word output by the model, c∈[1,M] represents the c-th word in the vocabulary, M represents the vocabulary size, and y ic represents the label corresponding to the i-th word in the model output and the c-th word in the vocabulary, p ic represents the probability of the model output corresponding to the i-th word and the c-th word in the vocabulary, and log(·) represents the logarithmic function;
[0012] Step 2: Since there is an “exposure bias” problem when only using high-quality instruction fine-tuning data as true labels for model training, in order to solve this problem, an additional contrastive learning module is introduced to enable the model to learn from low-quality data samples in the initial instruction fine-tuning dataset; following the contrastive learning framework, by maximizing the similarity between the anchor and the positive pseudo-label, while minimizing the similarity between the anchor and the negative pseudo-label; specifically, given an image I i , select the one with the highest S(I 2 C) data sample [Q j , A j ] as the positive pseudo label, and [Q j , A j ] and use the text encoder in the multimodal reasoning model to embed the sequence s into a dimension d 1 ×l vector space, that is, vector space Where l represents the length of the sequence, d 1 represents the dimension of the text encoder; e is transformed using an affine transformation ξ with ReLU and AvgPool. s Projection to latent vector This process is represented as:
[0013] e s=Embedding(Q j , A j )
[0014] h s =ξ(e s )
[0015] Where ξ(·)=AvgPool(ReLU(·)); Embedding(Q j , A j ) indicates that Q j and A j They are embedded into dimensions d 1 ×l in the vector space;
[0016] Similarly, select the image I i The corresponding remaining data samples S represents the image I i The corresponding data sample set, and the remaining data samples are used as negative pseudo labels to calculate represents the latent vector calculated with the negative pseudo-label as input, and then an instruction is combined with the image I i Input them into the model together, obtain the anchor data y, and calculate the contrast loss;
[0017] After training with instruction fine-tuning data and low-quality samples from the initial dataset, the final fine-tuning data is generated using an enhanced multimodal reasoning model.
[0018] In step 1, the final score S(I 2 C) Calculated by using KL divergence:
[0019]
[0020] Among them, D KL represents the KL divergence, and || represents relative to .
[0021] In step 2, finally, the contrast loss L is calculated as follows C :
[0022]
[0023] where sim(·, ·) is the cosine similarity function; log(·) and exp(·) are logarithmic and exponential functions, respectively; τ represents the temperature coefficient, hs represents the latent vector corresponding to the positive pseudo label, and hy represents the latent vector corresponding to the true label.
[0024] The beneficial effect of the present invention is that a new self-evolution method of multimodal reasoning model is proposed through autonomous instruction generation and tuning. Different from previous methods, a new content relevance module is first designed to improve the correlation between instruction fine-tuning data and images. At the same time, a contrastive learning module is proposed to enhance the data generation capability of the multimodal reasoning model by using the generated samples as pseudo-labels. By combining these two modules, the model itself can be used to generate instruction fine-tuning data with high correlation to the image, and used to fine-tune the model itself, thereby completing the self-evolution of the multimodal reasoning model. According to automatic evaluation, the multimodal reasoning model fine-tuned using the data generated by the method of the present invention achieved performance comparable to that of the most advanced model on four benchmark tests, realizing the autonomous evolution of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The present invention is a flow chart of the self-evolution method of a multimodal reasoning model based on autonomous instruction generation and optimization.
[0026] Figure 2 It is the self-evolution result of the multimodal reasoning model of the image one of the present invention that is optimized based on autonomous instruction generation.
[0027] Figure 3 It is the self-evolution result of the multimodal reasoning model optimized based on autonomous instruction generation in the second image of the present invention. DETAILED DESCRIPTION
[0028] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0029] The present invention provides a new self-evolution method for a multimodal reasoning model, which realizes the self-evolution of a multimodal reasoning model by improving the quality of data generated by the multimodal reasoning model and further using the data to fine-tune the multimodal reasoning model itself. Figure 1 This is a flow chart of the multimodal reasoning model self-evolution method based on autonomous instruction generation and optimization of the present invention. The specific process is as follows:
[0030] 1. Extraction of image features;
[0031] Given a picture in a natural scene Where W×H×3 represents the size of the image. The entire image is resized to 336×336×3 and input into the feature extraction network for forward propagation. The “classification tag” in ViT-B and CLIP is used to obtain image features, and then a set of lightweight and simple multi-layer perceptrons is used to convert the image features into The dimension size c = 4096, the image sequence length S = 1, and finally the visual features of 1×16×16×4096 are obtained.
[0032] 2. Extraction of instruction generation template features;
[0033] Given a set of instruction templates for generating instruction fine-tuning data tk represents the kth instruction template, where the subscript k represents the sequence number of the kth template, K = 10. For the instruction template T, it is mapped to the corresponding word embedding through the pre-trained image description model et represents the word embedding corresponding to the tth word in the instruction template.
[0034] 3. Feature fusion using cross-modal attention;
[0035] The image features and the instruction-generated template information are fused to obtain the image and template sequence features R = [V, T].
[0036] 4. Generate initial instruction data using a multimodal reasoning model;
[0037] The obtained image and template sequence features R = [V, T] are fed into the multimodal reasoning model and generate initial instruction fine-tuning data. Due to the influence of language prior knowledge, the initial data set contains data samples with low relevance to the image content.
[0038] 5. Calculation of probability distribution of a given image;
[0039] For any given data sample [Q j , A j ], Q j and the corresponding picture I i As the input of the model. After obtaining the model output, calculate each answer label A j The probability value of the output Where t represents the t-th moment text tag output by the model, and these probability values are concatenated to obtain the visual answer score S(A|V). The S(A|V) score measures the response of the multimodal reasoning model to the specific instruction fine-tuning data given the premise of the image.
[0040] 6. Calculation of probability distribution of missing images;
[0041] For any given data sample [Q j , A j ], only Q j As the input of the model. After obtaining the model output, calculate each answer label A j The probability value of the output Where t represents the text token at the tth moment output by the model, and these probability values are concatenated to obtain the direct answer score S(A), which quantifies the model's response to the given instruction fine-tuning data without images.
[0042] 7. Visual correlation calculation of instruction fine-tuning data
[0043] Final score S(I 2 C) By using the KL divergence calculation: S(I 2 C)=D KL (S(A|V)||S(A)). S(I 2 The C) score measures the difference in the model's response with or without the image. According to the properties of the KL divergence, a lower S(I 2 C) means that the difference between S(A|V) and S(A) is small, indicating that the content correlation between the data sample and the image is low.
[0044] 8. Use highly visually relevant instructions to fine-tune data for model training
[0045] After obtaining all the initial instruction fine-tuning data samples S(I 2 C) score, all instruction fine-tuning data samples are divided into S(I 2 C) values, and use S(I 2 C) The higher 10% of data samples are used as true labels to train the model, and the cross entropy loss L is used during training. r , the calculation formula of cross entropy loss is:
[0046]
[0047] where i∈[1,N] represents the i-th word output by the model, c∈[1,M] represents the c-th word in the vocabulary, M represents the vocabulary size, and y ic represents the label corresponding to the i-th word in the model output and the c-th word in the vocabulary, p ic represents the probability of the model output corresponding to the i-th word and the c-th word in the vocabulary, and log(·) represents the logarithmic function;
[0048] 9. Use visual correlation scores to construct positive and negative pseudo labels
[0049] Since only using high-quality instruction fine-tuning data as true labels for model training has the problem of "exposure bias", in order to solve this problem, we first use the visual correlation score S(I 2 C) Construct positive and negative pseudo labels. Specifically, given an image I i , select the one with the highest S(I 2 C) data sample [Q j , A j ] as positive pseudo labels, and the rest of the data samples as negative pseudo labels.
[0050] 10. Contrastive learning using positive and pseudo labels
[0051] Following the contrastive learning framework, the similarity between the anchor points and the positive pseudo labels is maximized in the following way. Specifically, given an image I i , select the one with the highest S(I 2 C) data sample [Q j , A j ] as the positive pseudo label, and [Q j , A j ] and use the text encoder in the multimodal reasoning model to embed the sequence s into a dimension d 1 ×l in the vector space: Where l represents the length of the sequence, d 1 Represents the dimension of the text encoder. Use the affine transformation ξ with ReLU and AvgPool to transform e s Projection into latent space
[0052] 11. Contrastive Learning with Negative Pseudo-Labels
[0053] Following the contrastive learning framework, the similarity between the anchor and the negative pseudo-label is minimized in the following way. Specifically, given an image I i , select the image I i The corresponding remaining data samples And use it as a negative pseudo label, [Q j , A j ] and use the text encoder in the multimodal reasoning model to embed the sequence s into a dimension d 1 ×l in the vector space: Where l represents the length of the sequence, and an affine transformation ξ with ReLU and AvgPool is used to transform Projection into latent space
[0054] 12. Contrastive learning training based on positive and negative pseudo labels
[0055] Combine an instruction with image I i Input them into the model together and obtain the anchor data y. Finally, calculate the contrast loss where sim(·,·) is the cosine similarity function.
[0056] 13. Generation of instruction fine-tuning data
[0057] After training with high-quality instruction fine-tuning data and low-quality samples in the initial dataset, the enhanced multimodal reasoning model is used to generate the final 5,000 instruction fine-tuning data.
[0058] like Figure 2 As shown, without the method of the present invention, Q: What is the purpose of a fire hydrant? A: The purpose of a fire hydrant is to provide a reliable and easily accessible source of water for firefighting operations. When using the method of the present invention, Q: How does the color of the main object in the image affect its visibility? A: The fire hydrant is the main object in the image, and the bright pink color of the fire hydrant makes it more eye-catching and easy to identify, which is very important because you need to be able to easily find the fire hydrant in an emergency.
[0059] Figure 3 In the example of the present invention, when the method of the present invention is not used, the question is: What is the surfer surfing on? Answer: The surfer is surfing on a surfboard, which is a specially designed board with the function of surfing. Surfboards come in various shapes, sizes and materials, each suitable for a specific type of wave and surfing style. When the method of the present invention is used, the question is: What is the pose of the person in the image? Answer: The man in the image is a surfer who is squatting on the surfboard. At the same time, when surfing, the surfer leans forward on the surfboard, which helps to maintain balance and control when surfing.
[0060] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention are within the protection scope of the present invention.
Claims
1. A multimodal reasoning model self-evolution method based on autonomous instruction generation and tuning, characterized by The steps include: Step 1: Given an image Where W×H×3 represents the size of the image. represents a real number set, and the instruction fine-tuning data is expressed as [Q j , A j ], j∈{1, 2, ..., Nj} where Q j and A j Respectively represent the image I i The jth question and answer, N j Represents the image I i The number of instruction fine-tuning data; first, the multimodal reasoning model is used to generate the initial instruction fine-tuning data. Due to the influence of language prior knowledge, the initial data set contains data samples with low correlation with image content; next, for any given data sample [Q j , A j ], Q j and the corresponding image as the input of the model. After obtaining the model output, each answer label A is calculated j The probability value of the output Where t represents the text tag at the tth moment output by the model, and v represents the given image as the model input; then, the probability value of the answer tag at each moment is obtained Finally, the rate values are connected along the time dimension to obtain the visual answer score S(A|V). The S(A|V) score measures the response of the multimodal reasoning model to the specific instruction fine-tuning data under the premise of a given image; without giving the model an image, the probability value of the model output is calculated. Where t represents the text tag at the tth moment output by the model, and d means that the image is not used as the input of the model, but only Q j As the input of the model, and obtain the output of the model; and the obtained answer score is called the direct answer score S(A), the S(A) score quantifies the model's response to the given instruction fine-tuning data without an image, and the final score S(I 2 C) Calculated by using KL divergence; After obtaining all the initial instruction fine-tuning data samples S(I 2 C) score, all instruction fine-tuning data samples are divided into S(I 2 C) values, and use S(I 2 C) The higher 10% of data samples are used as true labels to train the model, and the cross entropy loss L is used during training. r ; Step 2: Introduce an additional contrastive learning module to enable the model to learn from low-quality data samples in the initial instruction fine-tuning dataset; follow the contrastive learning framework by maximizing the similarity between the anchor and the positive pseudo-label while minimizing the similarity between the anchor and the negative pseudo-label; Similarly, select the image I i The corresponding remaining data samples S represents the image I i The corresponding data sample set, and the remaining data samples are used as negative pseudo labels to calculate represents the latent vector calculated with the negative pseudo-label as input, and then an instruction is combined with the image I i Input them into the model together, obtain the anchor data y, and calculate the contrast loss; After training with instruction fine-tuning data and low-quality samples from the initial dataset, the final fine-tuning data is generated using an enhanced multimodal reasoning model.
2. The multimodal reasoning model self-evolution method based on autonomous instruction generation and tuning according to claim 1 is characterized by: In step 1, the final score S(I 2 C) Calculated by using KL divergence: Among them, D KL represents the KL divergence, and || represents relative to .
3. The multimodal reasoning model self-evolution method based on autonomous instruction generation and tuning according to claim 1 is characterized by: In step 2, given an image I i , select the one with the highest S(I 2 C) data sample [Q j , A j ] as the positive pseudo label, and [Q j , A j ] and use the text encoder in the multimodal reasoning model to embed the sequence s into a vector space with a dimension of d1×l, that is, the vector space Where l represents the length of the sequence, d represents the dimension of the text encoder; an affine transformation ξ with ReLU and AvgPool is used to transform e s Projection to latent vector This process is represented as: e s =Embedding(Q j ,A j ) h s =ξ(e s ) Where ξ(·)=AvgPool(ReLU(·)); Embedding(Q j ,A j ) represents the combination of Qj and A j They are respectively embedded into a vector space of dimension d1×l.
4. The multimodal reasoning model self-evolution method based on autonomous instruction generation and tuning according to claim 3 is characterized by: In step 2, finally, the contrast loss L is calculated as follows C : where sim(·,·) is the cosine similarity function; log(·) and exp(·) are logarithmic and exponential functions, respectively; τ represents the temperature coefficient, h s represents the latent vector corresponding to the positive pseudo label, h y Represents the latent vector corresponding to the true label.
5. The multimodal reasoning model self-evolution method based on autonomous instruction generation and tuning according to claim 1 is characterized by: Cross entropy loss L r The calculation formula is: where i∈[1,N] represents the i-th word output by the model, c∈[1,M] represents the c-th word in the vocabulary, M represents the vocabulary size, and y ic represents the label corresponding to the i-th word in the model output and the c-th word in the vocabulary, p ic represents the probability of the model output corresponding to the i-th word and the c-th word in the vocabulary, and log(·) represents the logarithmic function.
