A method, device and terminal for reducing hallucinations based on multimodal contrast decoding
By performing multimodal perturbation processing and comparative decoding on the initial data of the multimodal large model, the problem that the comparison decoding method in the prior art requires an additional model and cannot utilize the multimodal characteristics is solved, and more efficient hallucination suppression and model perception ability are achieved.
Patent Information
- Application Number
- CN202411463649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-21
AI Technical Summary
The comparative decoding method in the prior art requires the introduction of additional models and cannot fully utilize the multimodal characteristics, resulting in increased computing resource overhead and reduced performance.
By obtaining the target initial data, performing multimodal perturbation processing on it, generating the target disturbance data, and input the target initial data and the target disturbance data into a large visual language model, and performing comparison and decoding to generate the target output.
It effectively reduces the risk of misinformation, significantly alleviates the hallucination problems in large-scale multimodal models, and improves the overall perception ability of the model.
Smart Images

Figure CN118966387B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multimodal large models, and in particular to a method, device and terminal for alleviating hallucinations of contrast decoding based on multimodality. Background Art
[0002] In the prior art, contrastive decoding usually requires the introduction of additional models for comparison and verification. This means that in addition to the original large model, additional computing resources and storage space are required to run these auxiliary models. This not only increases the complexity of the system, but also leads to increased computing resource overhead, thereby reducing overall performance. In addition, contrastive decoding was originally proposed as a technology in the field of natural language processing, and is often limited to a single modality (such as text modality). When dealing with the hallucinations of multimodal large models, the unimodal contrastive decoding method cannot fully utilize the characteristics of multimodality. Therefore, a more efficient and professional way is needed to solve this problem.
[0003] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0004] In view of the above-mentioned defects of the prior art, the present invention provides a method, device and terminal for reducing hallucinations based on multimodal contrast decoding, aiming to solve the problem that the contrast decoding method in the prior art needs to introduce additional models and cannot fully utilize the multimodal characteristics.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0006] A first aspect of the present invention provides a method, device and terminal for reducing illusion of contrast decoding based on multi-modality, the method comprising:
[0007] Acquire target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and a corresponding target text prompt word;
[0008] Inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model;
[0009] The initial output and the hallucination output are compared and decoded to obtain a target output.
[0010] In one implementation, performing multimodal disturbance processing on the target initial data to obtain target disturbance data includes:
[0011] Performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data;
[0012] Performing language perturbation on the text portion of the target initial data to obtain target language perturbation data;
[0013] The target disturbance data is obtained based on the target visual disturbance data and the target language disturbance data.
[0014] In one implementation, performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data includes:
[0015] Replacing the target high-definition image in the target initial data with a completely white image to obtain a target disturbed image;
[0016] The target disturbance image is combined with the target text prompt word in the target initial data to obtain the target visual disturbance data.
[0017] In one implementation, performing language perturbation on the text portion of the target initial data to obtain target language perturbation data includes:
[0018] Replacing the target part of the target text prompt word in the target initial data with a mask mark to obtain a target perturbation text;
[0019] The target perturbation text is combined with the target high-definition image in the target initial data to obtain the target language perturbation data.
[0020] In one implementation, inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output includes:
[0021] The visual encoder in the target model extracts high-level visual features based on the images in the target initial data, the target visual perturbation data and the target language perturbation data, respectively, to obtain an initial visual vector, a visual perturbation visual vector and a language perturbation visual vector;
[0022] Inputting the initial visual vector, the visual perturbation visual vector and the language perturbation visual vector into the language model in the target model respectively, to obtain the initial output, the visual hallucination output and the language hallucination output;
[0023] The hallucination output is obtained based on the visual hallucination output and the language hallucination output.
[0024] In one implementation, the comparative decoding of the initial output and the hallucination output includes:
[0025] Obtaining a first hyperparameter and a second hyperparameter, wherein the first hyperparameter is a weight corresponding to the visual hallucination output, and the second hyperparameter is a weight corresponding to the language hallucination output;
[0026] The initial output and the hallucination output are comparatively decoded based on the first hyperparameter and the second hyperparameter.
[0027] In one implementation, the comparative decoding of the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter includes:
[0028] The initial output and the hallucination output are compared and decoded based on a target formula, and the target formula is:
[0029] ;
[0030] in, X is the initial output, Output for the target, Outputting the visual illusion, Output for the language hallucination, and is a hyperparameter.
[0031] A second aspect of the present invention provides a device for alleviating hallucinations based on multimodal contrast decoding, comprising:
[0032] A disturbance module is used to obtain target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and its corresponding target text prompt word;
[0033] An output module, used for inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model;
[0034] The comparison and decoding module is used to compare and decode the initial output and the hallucination output to obtain a target output.
[0035] According to a third aspect of the present invention, a terminal is provided, comprising a processor and a computer-readable storage medium communicatively connected to the processor, wherein the computer-readable storage medium is suitable for storing a plurality of instructions, and the processor is suitable for calling the instructions in the computer-readable storage medium to execute the steps of implementing any one of the above-mentioned methods for reducing the multi-modal contrast decoding illusion.
[0036] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any of the above-mentioned multi-modal contrast decoding illusion reduction methods.
[0037] Compared with the prior art, the present invention provides a method, device and terminal for hallucination reduction based on multimodal contrast decoding. The method for hallucination reduction based on multimodal contrast decoding obtains target initial data, performs multimodal perturbation processing on the target initial data, and obtains target perturbation data. The target initial data includes a target high-definition image and its corresponding target text prompt word. Then, the target initial data and the target perturbation data are input into a target model to obtain an initial output and a hallucination output. The target model is a large visual language model. Finally, the initial output and the hallucination output are contrastively decoded to obtain a target output. The method for hallucination reduction based on multimodal contrast decoding proposed by the present invention injects noise into the multimodal input to generate negative samples, and compares them with the original output to calibrate the model output, thereby effectively reducing the risk of generating erroneous information. The hallucination problem in large-scale multimodal models is significantly alleviated, and its great potential in improving the overall perception ability of the model is demonstrated. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of an embodiment of a method for alleviating illusions of contrast decoding based on multi-modality provided by the present invention;
[0039] Figure 2 A diagram of the reasoning process of an embodiment of the method for alleviating hallucinations based on multi-modality contrast decoding provided by the present invention;
[0040] Figure 3 Experimental results of an embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention Figure 1 ;
[0041] Figure 4 Experimental results of an embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention Figure 2 ;
[0042] Figure 5 Experimental results of an embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention Figure 3 ;
[0043] Figure 6 Experimental results of an embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention Figure 4 ;
[0044] Figure 7 Experimental results of an embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention Figure 5 ;
[0045] Figure 8 A structural principle diagram of an embodiment of a device for alleviating illusion based on multi-modal contrast decoding provided by the present invention;
[0046] Fig. 9 A schematic diagram of the principles of an embodiment of a terminal provided by the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0048] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0050] The multi-modal contrast decoding illusion reduction method provided by the present invention can be applied to a terminal with computing capability, and the terminal can execute the multi-modal contrast decoding illusion reduction method provided by the present invention to solve the travel time of seismic waves.
[0051] Embodiment 1
[0052] This embodiment is a method for reducing hallucinations based on contrastive decoding technology for a large multimodal model. The method can add noise to visual input and language input to make the model produce outputs that are more likely to contain hallucinations, and compare them with the initial outputs, thereby calibrating the model's predictions and reducing the possibility of producing erroneous information.
[0053] The hallucination problem has long been a prominent technical challenge in the exploration of large-scale visual language models. Current research focuses on the language level of the model, using a series of strategies to alleviate this problem, including correction mechanisms, model uncertainty assessment, the use of high-quality training data, and contrastive decoding techniques. The following is a detailed explanation of these methods:
[0054] Correction mechanism: The correction mechanism aims to reduce the hallucination phenomenon by introducing an additional correction step. This involves using external knowledge bases or fact verification systems to identify and correct incorrect information in the generated content. The advantage of this method is that it can enhance the accuracy of the model output with the help of external information sources, thereby improving the trustworthiness of the generated content.
[0055] Model uncertainty: Model uncertainty methods focus on quantifying the uncertainty of the model during the generation process to identify possible hallucination content. Techniques such as Bayesian methods or Monte Carlo sampling are used to estimate the confidence level of the model output. This approach allows researchers to lock in the uncertain areas in the model output, which helps to gain deeper insight into model behavior and perform targeted optimization.
[0056] High-quality training data: Using high-quality training data to train the model is another effective way to mitigate the hallucination problem. This means using a dataset that is accurately annotated by humans to reduce noise and errors in the training material. Although it is expensive to build such a dataset, high-quality data can significantly improve the performance and reliability of the model.
[0057] Contrastive decoding: Contrastive decoding is a search-based decoding method that penalizes the generation of bad patterns by optimizing a novel contrast objective function. This method adjusts model predictions by comparing the difference between the true output and the wrong output, thereby reducing the occurrence of hallucinations.
[0058] The above points outline the main technical means to solve the hallucination problem of large-scale visual language models, and highlight the industry's professional efforts to improve the accuracy and reliability of models.
[0059] However, contrastive decoding usually requires the introduction of additional models for comparison and verification. This means that in addition to the original large model, additional computing resources and storage space are required to run these auxiliary models. This not only increases the complexity of the system, but also leads to increased computing resource overhead, thereby reducing overall performance. In addition, contrastive decoding was originally proposed as a technology in the field of natural language processing, and is often limited to a single modality (such as text modality). When dealing with the hallucinations of multimodal large models, unimodal contrastive decoding methods cannot fully utilize the characteristics of multimodality. Therefore, a more efficient and professional way is needed to solve this problem.
[0060] In this embodiment, a method for reducing hallucinations based on multimodal contrastive decoding is proposed, which aims to stimulate visual and language input data through noise injection, stimulate the visual and language modules in the multimodal large model to produce potential hallucinations, and use the contrastive decoding mechanism to eliminate these bad generated contents. Compared with traditional unimodal contrastive decoding, the method provided in this embodiment can comprehensively deal with the hallucination problems of multimodal large models in the visual and language fields, and achieve more efficient hallucination suppression.
[0061] In addition, the multimodal contrast decoding based hallucination mitigation method generates hallucination-containing content by adding noise to the input data without relying on additional auxiliary models, thus significantly saving computing resources. Overall, multimodal contrast decoding not only improves the efficiency of hallucination removal, but also reduces the complexity of the system and the demand for computing resources, showing a new hallucination processing strategy that is both efficient and resource-saving.
[0062] Specifically, Figure 1 As shown, in one embodiment of the method for alleviating hallucinations based on multi-modal contrast decoding provided by the present invention, the method for alleviating hallucinations based on multi-modal contrast decoding includes the steps of:
[0063] S 100. Acquire target initial data, and perform multimodal disturbance processing on the target initial data to obtain target disturbance data, wherein the target initial data includes a target high-definition image and a corresponding target text prompt word.
[0064] This embodiment mainly focuses on LLaVA 1.5、 QWL and InternVL Application of multimodal contrastive decoding to reduce hallucinations in large visual-language models such as CNNs. In the process of processing multimodal data, such models often produce descriptions that seem semantically correct but actually do not match the image content. This phenomenon is widely known as the "hallucination problem". In order to effectively alleviate this problem, we propose a multimodal contrastive decoding method based on perturbation and contrastive decoding. This method applies perturbations to the visual and language inputs and compares the initial output with the perturbed output to identify and reduce hallucination information.
[0065] Specifically, the perturbation operation can be achieved by randomly masking specific areas in the visual input or text fragments in the language input to reveal the hallucination effects that the model tends to produce. When applying this method, the system first receives visual and language inputs and generates an initial output result. Subsequently, by perturbing the input, the system generates a perturbed output. Then, by comparing the initial output with the perturbed output, the system adjusts its predictions to reduce the generation of hallucinatory information. This process enables the system to generate more accurate descriptions or answers when performing multimodal tasks. This article will then elaborate on the specific technical steps and parameter settings.
[0066] like Figure 2 As shown, Figure 2 Schematic diagram of the reasoning process. First, the original input, that is, the target initial data, is perturbed. The target initial data is a high-quality target HD image and its corresponding target text prompt word, which represents the input data of the model under normal circumstances. For example, in a visual question-answering task, the original input consists of a picture and a question text for the picture content. In this embodiment, these original inputs need to be perturbed, and this process can be divided into two parts: visual perturbation and language perturbation.
[0067] Specifically, performing multimodal disturbance processing on the target initial data to obtain target disturbance data includes:
[0068] S 110. Perform visual perturbation on an image portion of the target initial data to obtain target visual perturbation data.
[0069] The step of performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data includes:
[0070] Replacing the target high-definition image in the target initial data with a completely white image to obtain a target disturbed image;
[0071] The target disturbance image is combined with the target text prompt word in the target initial data to obtain the target visual disturbance data.
[0072] Specifically, in visual perturbation, by comparing multiple methods, in this embodiment, it is finally chosen to replace the image with a completely white image, that is, the values of all pixels are set to 0 to minimize the amount of information the model obtains from the visual input.
[0073] Then, the replaced all-white image is combined with the target text prompt word in the target initial data to obtain the target visual disturbance data.
[0074] S120. Perform language perturbation on the text portion of the target initial data to obtain target language perturbation data.
[0075] The performing language perturbation on the text portion of the target initial data to obtain target language perturbation data includes:
[0076] Replacing the target part of the target text prompt word in the target initial data with a mask mark to obtain a target perturbation text;
[0077] The target perturbation text is combined with the target high-definition image in the target initial data to obtain the target language perturbation data.
[0078] In language perturbation, part of the target text prompt word is randomly replaced with a mask token, such as BERT In [ MASK ] mark. Although the modified text has some semantic differences from the original description, it still maintains overall comprehensibility while reducing the amount of available information. In this way, the target perturbation text is obtained. Then the target perturbation text is combined with the target high-definition image in the target initial data to obtain the target language perturbation data.
[0079] S 130. Obtain the target disturbance data based on the target visual disturbance data and the target language disturbance data.
[0080] The target disturbance data is composed of the target visual disturbance data and the target language disturbance data.
[0081] In this way, by adding noise, three types of inputs are obtained: original input, input with added visual noise, and input with added text noise. In this embodiment, the original input is the target initial data, the input with added visual noise is the target visual disturbance data, and the input with added text noise is the target language disturbance data.
[0082] Then, the effectiveness of the selected perturbation method will be verified by comparing the model performance for these three inputs.
[0083] S 200. Input the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model.
[0084] The step of inputting the target initial data and the target perturbation data into the target model to obtain an initial output and a hallucination output comprises:
[0085] Inputting the target initial data into the target model to obtain the initial output;
[0086] Inputting the target visual perturbation data into the target model to obtain a visual illusion output;
[0087] Inputting the target language perturbation data into the target model to obtain a language hallucination output;
[0088] The hallucination output is obtained based on the visual hallucination output and the language hallucination output.
[0089] Specifically, the target initial data is input into the target model to obtain the initial output; the target visual perturbation data is input into the target model to obtain the visual hallucination output; the target language perturbation data is input into the target model to obtain the language hallucination output, specifically including:
[0090] The visual encoder in the target model extracts high-level visual features based on the images in the target initial data, the target visual perturbation data and the target language perturbation data, respectively, to obtain an initial visual vector, a visual perturbation visual vector and a language perturbation visual vector;
[0091] Inputting the initial visual vector, the visual perturbation visual vector and the language perturbation visual vector into the language model in the target model respectively, to obtain the initial output, the visual hallucination output and the language hallucination output;
[0092] The hallucination output is obtained based on the visual hallucination output and the language hallucination output.
[0093] Specifically, in the model generation stage, the target model is first used to perform preliminary reasoning on the target initial data and the target perturbation data to obtain the initial output and the hallucination output.
[0094] Specifically, the target initial data, the target visual perturbation data and the target language perturbation data are firstly input into the target model respectively, and the visual encoder and language model of the target model respectively process the visual input and language input corresponding to the target initial data, the target visual perturbation data and the target language perturbation data.
[0095] The visual encoder and the language model in the target model have been pre-trained on large-scale data sets and have strong feature extraction and understanding capabilities. Among them, the visual encoder is responsible for extracting high-level visual features from the image, such as the shape, color, texture and other information of the object. Specifically, the high-definition images of various input data are first processed into a series of visual feature vectors, which represent the different parts of the image and their features. Subsequently, these feature vectors are passed to the language model as the basis for generating text descriptions. The language model is responsible for generating text descriptions related to the image content. These descriptions are based on the features extracted by the visual encoder and the semantic understanding ability of the language model itself. The input text description is processed through a series of word embeddings and context to generate an initial text output related to the image content.
[0096] In the absence of noise, the target model generates an unaffected initial output, which is the initial output. However, when noise is added to the input data, the behavior of the target model will be different. The target visual perturbation data with added visual noise will interfere with the visual encoder, making it unable to obtain sufficient information, resulting in the reasoning of the target model being able to rely more on the language model, using its inherent knowledge and preferences to generate output in the absence of visual information. On the contrary, the target language perturbation data with added text noise will make it difficult for the language model to accurately parse the text content, forcing the target model to rely more on the visual encoder and use more visual information to generate output.
[0097] In this stage, the initial output of the model under different noise conditions, that is, the initial output, the visual illusion output, and the language illusion output, are obtained. These initial outputs may contain illusions or misleading information because visual or language disturbances have been introduced into the input data. In this way, in the next stage, the initial output, the visual illusion output, and the language illusion output will be used for correction.
[0098] S 300. Compare and decode the initial output and the hallucination output to obtain a target output.
[0099] The comparing and decoding the initial output and the hallucination output comprises:
[0100] Obtaining a first hyperparameter and a second hyperparameter, wherein the first hyperparameter is a weight corresponding to the visual hallucination output, and the second hyperparameter is a weight corresponding to the language hallucination output;
[0101] The initial output and the hallucination output are comparatively decoded based on the first hyperparameter and the second hyperparameter.
[0102] The comparative decoding of the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter includes:
[0103] The initial output and the hallucination output are compared and decoded based on a target formula, and the target formula is:
[0104] ;
[0105] in, X is the initial output, Output for the target, Outputting the visual illusion, Output for the language hallucination, and is a hyperparameter and .
[0106] In this embodiment, the multimodal contrast decoding method is used in the contrast decoding stage to calibrate the output distribution of the target model by comparing the initial output and the hallucination output generated by the target model to reduce the hallucination phenomenon and improve the overall performance.
[0107] Specifically, after the model generation phase is completed, the target model will generate the initial output data according to the target initial data, the target visual perturbation data and the target language perturbation data. X , the language hallucination output is more likely to contain hallucinations originating from language components , the visual hallucination output is more likely to contain hallucinations originating from visual components These outputs are generated by the neural network of the target model and are in the form of log-odds.
[0108] Then, comparative decoding is performed on the log odds of the initial output, the visual hallucination output, and the verbal hallucination output.
[0109] Specifically, two hyperparameters are set. The first hyperparameter and the second hyperparameter , respectively corresponding to the weights of the visual part and the language part in multimodal contrast decoding. Specifically, in this embodiment, set For the logarithmic probability of the output, the initial output and the hallucination output are compared and decoded based on the target formula, and the target formula is:
[0110] ;
[0111] in, X is the initial output, Output for the target, Outputting the visual illusion, Output for the language hallucination, and is a hyperparameter.
[0112] Of these, two are more likely to contain hallucination outputs and It plays the role of negative samples.
[0113] For example, when the target model is asked: "How many birds are there in the picture?" without inputting a picture, the target model will make inferences based on the parameters obtained through its own training; in actual applications, the target model may also ignore the content of the picture and make inferences based on the parameters, thereby causing visual hallucinations.
[0114] Based on this, in this embodiment, by explicitly interfering with the input, the target model is forced to use its own parameters for inference, thereby revealing the model's own tendency to produce hallucinations.
[0115] Multimodal contrastive decoding then corrects the model output by down-weighting potential hallucinations and up-weighting correct answers by performing a subtraction on the log odds.
[0116] Still taking "How many birds are there in the picture?" as an example, when processing the query "How many birds are there in the picture?", suppose the question is asked about a picture containing 10 birds. Based on the information that the target model may have learned during the training phase, the picture most likely contains 1 bird, so when generating the answer, the number 1 is assigned the highest log probability. The multimodal contrast decoding method adjusts the log probability to reduce the log probability of the answer 1 and increase the log probability of the correct answer 10, thereby accurately correcting the output result of the target model. Finally, the target model uses softmax The function corrects the log-odds, samples and decodes to the final output.
[0117] Specifically, in this embodiment, multiple experiments were conducted. POPE , AMBER and MME Experiments are conducted on three widely used test benchmarks to verify the effectiveness of the multimodal contrastive decoding hallucination mitigation method in reducing hallucinations and improving the overall perception ability of the model.
[0118] Specifically, in POPE The experimental results on the benchmark are:
[0119] POPE The benchmark is used to evaluate object hallucination in large visual language models. It uses a binary classification task to determine whether a specific object exists in a given image, including three sampling strategies: random, popular, and adversarial. The experimental results are shown in Figure 2. Figure 3 shown.
[0120] It can be seen that the multi-modal contrast decoding illusion reduction method provided in this embodiment is the multi-modal contrast decoding method ( MCD ) shows significant improvement across different models and settings. Specifically, compared to the baseline method ( Vanilla ) and visual contrast decoding methods ( VCD ) compared to the multimodal contrastive decoding method ( MCD ) has a significant improvement in the accuracy of object recognition, especially under the adversarial sampling strategy. The multimodal contrastive decoding method ( MCD ) effectively reduces the hallucinations produced by the model when processing complex visual information. This improvement not only improves the accuracy of the model in object recognition tasks, but also enhances its robustness in complex tasks.
[0121] exist AMBER The experimental results on the benchmark are:
[0122] AMBER The benchmark is used for hallucination evaluation of low-level visual models. It contains high-quality images and detailed annotations, covering four hallucination types: existence, attribute, relationship, and description. The experimental results are shown in Figure 4 shown.
[0123] It can be seen that the multimodal contrast decoding method provided in this embodiment ( MCD ) significantly outperforms the baseline method in terms of attributes and relations ( Vanilla ) and the visual contrast decoding method ( VCD ). Specific data show that the multimodal contrast decoding method ( MCD ) has significantly improved accuracy in these two subtasks, indicating that the multimodal contrastive decoding method ( MCD ) has an advantage in processing complex visual and language information.
[0124] exist MME The experimental results on the benchmark are:
[0125] MME The benchmark evaluates the perceptual and cognitive capabilities of large-scale vision-language models on 14 subtasks. Experimental Results Figure 5 shown.
[0126] Furthermore, in this embodiment, the multimodal contrast decoding method is also compared in detail ( MCD ) and the baseline method ( Vanilla ) on 14 subtasks, such as Figure 6 shown.
[0127] The multimodal contrast decoding method ( MCD ) brings continuous improvement in perception tasks while maintaining the recognition ability of the model. Specifically, the multimodal contrastive decoding method ( MCD )exist MME The performance of 12 out of 14 subtasks was improved, especially in the perception task. This shows that the multimodal contrastive decoding method ( MCD ) can not only reduce hallucinations, but also enhance the performance of the model in various tasks. For example, in image description and question answering tasks, the multimodal contrastive decoding method ( MCD ) significantly improved the accuracy and consistency of the model, demonstrating its great potential in practical applications.
[0128] Finally, in this embodiment, an ablation experiment is also conducted. Specifically, in order to verify the effectiveness of using contrastive decoding in the multimodal field, a single-modal ablation experiment is designed to compare the multimodal contrastive decoding method ( MCD ) were compared with contrastive decoding methods that modified either visual or verbal input alone.
[0129] By POPE Used on the dataset LLaVA 1.5 Model ablation experiment, the results are as follows Figure 7 shown.
[0130] It can be seen that the contrastive decoding methods that modify the visual or language input alone can bring performance improvements to the baseline model, and multimodal contrastive decoding achieves the best performance, exceeding the method that modifies a single modality. This proves that hallucinations may occur in both the language component and the visual component, and the multimodal contrastive decoding method can simultaneously reduce the impact of hallucinations in both components, thereby achieving better performance. The ablation experiment results further verify the effectiveness of the multimodal contrastive decoding method.
[0131] In this embodiment, by combining contrastive decoding with multimodal input, an effective contrast target is designed to address the hallucination problem of the visual component and language component of a large multimodal model, and the model's prediction is optimized by comparing the initial output and the hallucinatory output. The "multimodal contrastive decoding" method is the focus of this method, which generates negative samples by perturbing the visual input or language input to calibrate the model's output. In addition, this embodiment uses the "fixed hyperparameter" method to ensure the consistency of the experiment; uses the "multi-benchmark test" method to verify the versatility of the model; and combines the "single modal ablation study" technique to further verify the effectiveness of multimodal contrastive decoding.
[0132] Through these innovative methods and techniques, the hallucination problem in modal large models is significantly alleviated and their potential to enhance the overall perception ability of modal large models is demonstrated.
[0133] This method generates hallucination output by perturbing visual or language input and compares it with the initial output, thereby calibrating the output distribution of the model and reducing the occurrence of hallucinations.
[0134] Specifically, the multimodal contrastive decoding strategy proposed in this embodiment covers a wider range of hallucination types and improves the overall performance of the model by simultaneously perturbing visual and language inputs;
[0135] An adaptive rationality constraint is given and the adaptive rationality constraint mechanism is applied to further improve the accuracy of the decoding process;
[0136] Finally, through multi-benchmark evaluation, POPE , AMBER and MME A comprehensive evaluation is conducted on three benchmarks to verify the effectiveness of the method.
[0137] In summary, this embodiment provides a method for reducing hallucinations based on contrastive decoding of multimodality, by acquiring target initial data, performing multimodal perturbation processing on the target initial data, and obtaining target perturbation data, wherein the target initial data includes a target high-definition image and its corresponding target text prompt word, and then inputting the target initial data and the target perturbation data into the target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model, and finally, performing contrastive decoding on the initial output and the hallucination output to obtain a target output. The method for reducing hallucinations based on contrastive decoding of multimodality proposed in this embodiment injects noise into the multimodal input to generate negative samples, and compares them with the original output to calibrate the model output, thereby effectively reducing the risk of generating erroneous information. It significantly alleviates the hallucination problem in large-scale multimodal models and proves its great potential in improving the overall perception ability of the model.
[0138] It should be understood that, although the various steps in the flowcharts given in the accompanying drawings of the present specification are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory ( ROM ), programmable ROM ( PROM ), electrically programmable ROM ( EPROM ), electrically erasable programmable ROM ( EEPROM ) or flash memory. Volatile memory may include random access memory ( RAM ) or external cache memory. By way of illustration and not limitation, RAM Available in various forms, such as static RAM ( SRAM ),dynamic RAM ( DRAM ),synchronous DRAM ( SDRAM ), Double Data Rate SDRAM ( DDRSDRAM ), Enhanced SDRAM ( ESDRAM ), Synchronous Link ( Synchlink ) DRAM ( SLDRAM )、Memory Bus( Rambus )direct RAM ( RDRAM ), Direct Memory Bus Dynamics RAM ( DRDRAM ), and memory bus dynamics RAM ( RDRAM )wait.
[0140] Embodiment 2
[0141] Based on the above embodiments, the present invention also provides a device for alleviating illusion of contrast decoding based on multi-modality, such as Figure 8 As shown, the multi-modality-based contrast decoding illusion reduction device includes:
[0142] A disturbance module is used to obtain target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and a corresponding target text prompt word, as described in the first embodiment;
[0143] An output module, used for inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model, as specifically described in the first embodiment;
[0144] The comparison and decoding module is used to compare and decode the initial output and the hallucination output to obtain a target output, as described in the first embodiment.
[0145] Embodiment 3
[0146] Based on the above embodiments, the present invention also provides a terminal, such as Fig. 9 As shown, the terminal includes a processor 10 and a memory 20. Fig. 9 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0147] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card ( Smart Media Card , SMC ), Safety Numbers ( Secure Digital , SD ) card, flash memory card ( Flash Card ) etc. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software installed in the terminal and various data. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a multi-modal contrast decoding illusion reduction program 30, which can be executed by the processor 10, thereby realizing the multi-modal contrast decoding illusion reduction method in the present application.
[0148] In some embodiments, the processor 10 may be a central processing unit (CPU). Central Processing Unit , CPU ), a microprocessor or other chip, used to run the program code or process data stored in the memory 20, such as executing the multi-modality-based contrast decoding illusion reduction method, etc.
[0149] In one embodiment, when the processor 10 executes the multi-modality based contrast decoding hallucination reduction program 30 in the memory 20, the following steps are implemented:
[0150] Acquire target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and a corresponding target text prompt word;
[0151] Inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model;
[0152] The initial output and the hallucination output are compared and decoded to obtain a target output.
[0153] Embodiment 4
[0154] The present invention also provides a computer-readable storage medium, wherein one or more programs are stored, and the one or more programs can be executed by one or more processors to implement the steps of the multi-modality-based contrast decoding illusion reduction method as described above.
[0155] 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 alleviating hallucinations based on multimodal contrast decoding, characterized in that: The multimodal contrast decoding illusion reduction method comprises: Acquire target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and a corresponding target text prompt word; Inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model; Comparatively decoding the initial output and the hallucination output to obtain a target output; The performing multimodal disturbance processing on the target initial data to obtain target disturbance data includes: Performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data; Performing language perturbation on the text portion of the target initial data to obtain target language perturbation data; Obtaining the target disturbance data based on the target visual disturbance data and the target language disturbance data; The step of inputting the target initial data and the target perturbation data into the target model to obtain an initial output and a hallucination output comprises: The visual encoder in the target model extracts high-level visual features based on the images in the target initial data, the target visual perturbation data and the target language perturbation data, respectively, to obtain an initial visual vector, a visual perturbation visual vector and a language perturbation visual vector; Inputting the initial visual vector, the visual perturbation visual vector and the language perturbation visual vector into the language model in the target model respectively, to obtain the initial output, the visual hallucination output and the language hallucination output; Obtaining the hallucination output based on the visual hallucination output and the language hallucination output; The comparing and decoding the initial output and the hallucination output comprises: Obtaining a first hyperparameter and a second hyperparameter, wherein the first hyperparameter is a weight corresponding to the visual hallucination output, and the second hyperparameter is a weight corresponding to the language hallucination output; Perform comparative decoding on the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter; The comparative decoding of the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter includes: The initial output and the hallucination output are compared and decoded based on a target formula, and the target formula is: ; in, Output for the target, X is the initial output, Outputting the visual illusion, Output for the language hallucination, and is a hyperparameter.
2. The method for reducing hallucination based on multi-modality contrast decoding according to claim 1, characterized in that: The step of performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data includes: Replacing the target high-definition image in the target initial data with a completely white image to obtain a target disturbed image; The target disturbance image is combined with the target text prompt word in the target initial data to obtain the target visual disturbance data.
3. The method for reducing hallucination based on multi-modality contrast decoding according to claim 1, characterized in that: The performing language perturbation on the text portion of the target initial data to obtain target language perturbation data includes: Replacing the target part of the target text prompt word in the target initial data with a mask mark to obtain a target perturbation text; The target perturbation text is combined with the target high-definition image in the target initial data to obtain the target language perturbation data.
4. A device for alleviating hallucinations based on multimodal contrast decoding, characterized in that: include: A disturbance module is used to obtain target initial data, perform multimodal disturbance processing on the target initial data, and obtain target disturbance data, wherein the target initial data includes a target high-definition image and its corresponding target text prompt word; An output module, used for inputting the target initial data and the target perturbation data into a target model to obtain an initial output and a hallucination output, wherein the target model is a large visual language model; A comparison and decoding module, used for comparing and decoding the initial output and the hallucination output to obtain a target output; The performing multimodal disturbance processing on the target initial data to obtain target disturbance data includes: Performing visual perturbation on the image portion of the target initial data to obtain target visual perturbation data; Performing language perturbation on the text portion of the target initial data to obtain target language perturbation data; Obtaining the target disturbance data based on the target visual disturbance data and the target language disturbance data; The step of inputting the target initial data and the target perturbation data into the target model to obtain an initial output and a hallucination output comprises: The visual encoder in the target model extracts high-level visual features based on the images in the target initial data, the target visual perturbation data and the target language perturbation data, respectively, to obtain an initial visual vector, a visual perturbation visual vector and a language perturbation visual vector; Inputting the initial visual vector, the visual perturbation visual vector and the language perturbation visual vector into the language model in the target model respectively, to obtain the initial output, the visual hallucination output and the language hallucination output; Obtaining the hallucination output based on the visual hallucination output and the language hallucination output; The comparing and decoding the initial output and the hallucination output comprises: Obtaining a first hyperparameter and a second hyperparameter, wherein the first hyperparameter is a weight corresponding to the visual hallucination output, and the second hyperparameter is a weight corresponding to the language hallucination output; Perform comparative decoding on the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter; The comparative decoding of the initial output and the hallucination output based on the first hyperparameter and the second hyperparameter includes: The initial output and the hallucination output are compared and decoded based on a target formula, and the target formula is: ; in, Output for the target, X is the initial output, Outputting the visual illusion, Output for the language hallucination, and is a hyperparameter.
5. A terminal, characterized in that: The terminal includes: a processor, and a computer-readable storage medium communicatively connected to the processor, wherein the computer-readable storage medium is suitable for storing a plurality of instructions, and the processor is suitable for calling the instructions in the computer-readable storage medium to execute the steps of the multi-modal contrast decoding illusion reduction method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the multi-modality-based contrast decoding illusion reduction method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Image processing method and device
CN117972130A