A hallucination mitigation method and device of a multi-modal large language model

By employing fine-grained expert integration and specialized alignment strategies, multiple visual experts from a multimodal large language model are integrated, solving the problems of illusion and computational overhead, and achieving efficient and accurate visual understanding tasks.

CN121661442BActive Publication Date: 2026-04-24SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
Filing Date
2026-02-02
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Multimodal large language models suffer from illusion in visual understanding tasks. Existing methods fail to efficiently integrate the advantages of multiple experts, resulting in information redundancy and high computational cost, and they cannot fully leverage the unique advantages of experts.

Method used

Employing a fine-grained expert integration and specialization alignment strategy, this approach integrates multi-expert visual tokens through complementary clustering guided by cross-modal queries and complementary rejection fine-tuning anchored by CLIP. It merges redundant information and retains complementary visual evidence, thereby providing targeted training for auxiliary experts to compensate for the visual deficiencies of anchored experts.

Benefits of technology

It effectively reduces hallucination phenomena, improves model inference efficiency, reduces computational costs, and enhances the accuracy and efficiency of multimodal large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661442B_ABST
    Figure CN121661442B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of artificial intelligence and multi-modal large language model, and particularly relates to a hallucination reduction method and device for multi-modal large language model. The method comprises the following steps: obtaining multi-expert visual tokens of an original image and text tokens of a text prompt, and inputting the connection of the two into a multi-modal large language model; calculating a similarity matrix of the multi-expert visual tokens and an adaptive clustering threshold, performing hierarchical clustering on the multi-expert visual tokens, merging redundant tokens and retaining complementary visual evidence; constructing a negative sample pool and distributing it to an auxiliary expert with the largest feature difference through a CLIP anchored complementary rejection fine-tuning strategy, and performing specialized training on the corresponding projectors of each expert; and inputting the clustered and fused visual tokens and the text tokens into the multi-modal large language model to generate target text output. The present application solves the problems of information redundancy, large computational overhead and insufficient exertion of expert advantages in the existing multi-expert multi-modal large language model hallucination reduction method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of artificial intelligence and multimodal large language models, and more specifically, relates to a method and apparatus for alleviating hallucinations of multimodal large language models (MLLMs). Background Technology

[0002] In recent years, multimodal large language models (such as LLaVA, Qwen-vl, Eagle, and Gemini) have made significant progress in tasks such as visual understanding, instruction following, and multimodal reasoning. These models, by combining a visual encoder with a large language model (LLM) backbone network, are able to understand images and respond to task instructions. However, despite their excellent performance, multimodal large language models still suffer from a core problem—the illusion phenomenon, which generates text content inconsistent with the input image. This problem severely hinders their deployment in scenarios with high factual requirements and critical security.

[0003] One of the main causes of hallucinations is the inherent visual defects in the single CLIP-based encoder used by most multimodal large language models. Although the single CLIP encoder is good at achieving global semantic alignment between images and text through large-scale contrastive pre-training, it lacks fine-grained cross-modal supervision and has difficulty capturing precise visual details such as object relationships and spatial positioning, resulting in insufficient visual understanding and thus triggering hallucinations.

[0004] To overcome this limitation, related research has shifted towards integrating multiple visual experts, but existing multi-expert fusion methods have significant shortcomings:

[0005] 1. Coarse-grained integration leads to information redundancy and computational overhead: Existing methods mostly adopt simple integration methods such as direct splicing, without in-depth exploration of multi-expert feature distribution, which easily introduces redundant information, resulting in low effective token utilization and high computational cost;

[0006] 2. Non-specialized alignment strategies fail to fully leverage the unique advantages of experts: Existing methods either directly use the original features or rely solely on large-scale data to align the multi-expert space, which is prone to feature conflicts or convergence to similar representations, and cannot fully utilize the unique perspectives of multiple experts to alleviate illusions.

[0007] In summary, existing technologies lack a technical solution that can efficiently integrate heterogeneous vision experts and fully retain the complementary advantages of multiple experts. There is an urgent need for a refined and professional multi-expert fusion framework to reduce illusions while ensuring model inference efficiency. Summary of the Invention

[0008] This invention aims to overcome at least one of the defects of the prior art and provide a method for mitigating illusions in multimodal large language models. By using fine-grained expert integration and specialization alignment strategies, it can effectively suppress illusions while ensuring inference efficiency, thereby solving the problems of information redundancy, large computational overhead, and underutilization of expert advantages in existing multi-expert multimodal large language model illusion mitigation methods.

[0009] The present invention also discloses an apparatus for loading a method for hallucination relief using a multimodal large language model.

[0010] The detailed technical solution of this invention is as follows:

[0011] A method for hallucination mitigation using a multimodal large language model, the method comprising:

[0012] S1. Obtain the multi-expert visual token and the text token of the text prompt of the original image, and connect the multi-expert visual token and the text token together and input them into the decoder of the multimodal large language model.

[0013] S2. Based on the complementary clustering strategy guided by cross-modal query, calculate the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch, perform hierarchical clustering of multi-expert visual tokens, merge redundant tokens and retain complementary visual evidence.

[0014] S3. Using the CLIP-anchored complementary rejection fine-tuning strategy, construct a negative sample pool and assign it to the auxiliary experts with the greatest feature differences, and perform specialized training on the projectors corresponding to each expert.

[0015] S4. Input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate the target text output without illusions.

[0016] According to a preferred embodiment of the present invention, the acquisition of the multi-expert visual token in step S1 is specifically as follows:

[0017] CLIP-ViT, DINOv2, and SAM-L are selected as heterogeneous visual experts. The original image is input into each of the three visual encoders, and the corresponding projectors are used to transform it to obtain dimensionally unified visual tokens. For the i-th image patch, its multi-expert visual token set is represented as follows: ,in, Let d represent the set of real numbers, and d be the token embedding dimension. The number of visual experts; the specific formula for calculating multi-expert visual tokens is as follows:

[0018] (1)

[0019] In equation (1), This indicates the k-th visual encoder, which can be CLIP-ViT, DINOv2, or SAM-L. This represents the projector corresponding to the k-th visual encoder. This represents the original input image.

[0020] According to a preferred embodiment of the present invention, the acquisition of the text token in step S1 is specifically as follows:

[0021] The text prompts are processed by LLaVA's tokenizer and embedding module to generate a set of text tokens. ,in This represents the number of tokens corresponding to the text length; the specific formula for calculating the text token set is as follows:

[0022] (2)

[0023] In equation (2), Tokenizer represents the tokenizer and the embedding module. This indicates the text prompt for the input.

[0024] According to a preferred embodiment of the present invention, step S2 specifically comprises the following steps:

[0025] S21: Calculate the similarity matrix of multi-expert visual tokens: For each image patch's multi-expert visual token, calculate the pairwise similarity matrix using cosine similarity. And convert it into the corresponding distance matrix. :

[0026] (3)

[0027] (4)

[0028] In equations (3) and (4), , These represent the m-th and n-th multi-expert visual tokens in the i-th image block, respectively. The smaller the distance, the more redundant the visual information; the larger the distance, the stronger the complementarity.

[0029] S22: Calculate the query-guided adaptive clustering threshold: Perform mean pooling on the multi-expert visual tokens for each image patch to obtain the expert center. Cross-modal correlation between computational expert centers and text tokens and semantic divergence :

[0030] (5)

[0031] (6)

[0032] in, Represents the expert center for the i-th image patch; This represents the j-th text token in the text token set T; Expert Center With text tokens semantic matching probability;

[0033] Based on cross-modal correlation and semantic divergence The adaptive clustering threshold is calculated using the Sigmoid function:

[0034] (7)

[0035] In equation (7), This represents the Sigmoid function. , Hyperparameters that balance correlation and divergence;

[0036] S23: Hierarchical Clustering and Token Fusion: Based on the Distance Matrix and adaptive clustering threshold A hierarchical clustering algorithm is used to perform hierarchical clustering of multi-expert visual tokens, and tokens with a pairwise distance less than the adaptive clustering threshold are assigned to the same cluster. ; Calculate the centroid of each cluster as a fusion token, and then concatenate the fusion tokens of all image patches to form the final visual token sequence. :

[0037] (8)

[0038] (9)

[0039] In equation (9), This represents the fusion token of the m-th cluster in the i-th image patch. Represents clusters Any multi-expert visual token in the middle, It is the visual token of the m-th cluster of the H×W-th image patch, where H×W is the number of image patches.

[0040] According to a preferred embodiment of the present invention, step S3 specifically comprises the following steps:

[0041] S31: Construct a negative sample pool for CLIP anchoring: Using CLIP-ViT as the anchoring expert, a multimodal large language model based on CLIP-ViT is used to generate responses to the training data, and the correctness of the responses is verified by comparing them with the real labels; samples with incorrect responses are collected into a negative sample pool. These samples indicate that the visual representation of CLIP-ViT is insufficient to support correct reasoning and that complementary information from auxiliary experts is needed.

[0042] S32: Negative Sample Allocation and Specialized Fine-tuning: For each sample in the negative sample pool, calculate the image-level feature similarity between each auxiliary expert and CLIP-ViT: First, perform mean pooling on the visual token of each expert to obtain the image-level representation; calculate the cosine distance between the image-level representations of the two auxiliary experts and CLIP-ViT respectively, and allocate the sample to the training set of the auxiliary expert with the largest cosine distance for training.

[0043] According to a preferred embodiment of the present invention, in step S32, the training adopts a two-stage training paradigm:

[0044] The first phase involved independently training the projectors of three experts to learn to extract complementary visual features, with a learning rate of 1e-4.

[0045] In the second stage, all projectors and the backbone network are jointly fine-tuned with a learning rate of 2e-5 and a batch size of 64. The AdamW optimizer and cosine decay scheduling are used to achieve cross-modal alignment of multi-expert visual tokens and text tokens.

[0046] According to a preferred embodiment of the present invention, step S4 specifically comprises the following steps:

[0047] Visual tokens after clustering and fusion Connected to a text token, the input is fed into the decoder of a multimodal large language model. Cross-modal fusion is achieved through a self-attention mechanism to generate the final target text.

[0048] (10)

[0049] In equation (10), represents token chaining operation, MLLM represents multimodal large language model, and Y represents the target text output without illusions.

[0050] In another aspect of the invention, an apparatus is provided for implementing a method for alleviating hallucinations using a multimodal large language model, the apparatus comprising:

[0051] The token acquisition module is used to acquire the multi-expert visual token and the text token of the text prompt of the input image, and to connect the multi-expert visual token and the text token and input them together into the decoder of the multimodal large language model.

[0052] The complementary clustering module is used to calculate the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch based on the complementary clustering strategy guided by cross-modal queries. It performs hierarchical clustering of multi-expert visual tokens, merges redundant tokens and retains complementary visual evidence.

[0053] The complementary fine-tuning module is used to construct a negative sample pool and assign it to the auxiliary experts with the greatest feature differences through the complementary rejection fine-tuning strategy anchored by CLIP, and to perform specialized training on the projectors corresponding to each expert.

[0054] The target output module is used to input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate a non-illusion target text output.

[0055] In another aspect of the invention, an electronic device is also provided, comprising:

[0056] At least one processor; and

[0057] A memory that stores instructions that, when executed by the at least one processor, cause the at least one processor to perform the illusion mitigation method for a multimodal large language model as described above.

[0058] In another aspect of the invention, a machine-readable storage medium is also provided, which stores executable instructions that, when executed, cause the machine to perform the illusion mitigation method for a multimodal large language model as described above.

[0059] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0060] (1) This invention efficiently integrates the complementary advantages of multiple experts: through query-guided complementary clustering, redundant information is removed while the unique visual evidence of each expert is accurately preserved, which solves the problem of information waste caused by coarse-grained integration in existing methods.

[0061] (2) This invention enhances the professional capabilities of experts: through complementary rejection fine-tuning strategies, targeted training assists experts to make up for the visual defects of anchored experts, avoids multiple experts converging to homogeneous representations, and gives full play to the complementary value of heterogeneous experts. Attached Figure Description

[0062] Figure 1 This is a flowchart of the hallucination mitigation method based on a multimodal large language model as described in this invention.

[0063] Figure 2 This is a schematic diagram of the attention heatmap visualization of multi-expert complementarity in an embodiment of the present invention.

[0064] Figure 3 This is a schematic diagram of the query-guided complementary clustering framework structure in an embodiment of the present invention.

[0065] Figure 4 This is a schematic diagram of the workflow of the complementary rejection fine-tuning strategy in this embodiment of the invention.

[0066] Figure 5This is a qualitative comparison diagram of the LLaVA-1.5 benchmark model in an embodiment of the present invention. Detailed Implementation

[0067] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0068] Example 1

[0069] like Figure 1 This embodiment provides a hallucination mitigation method based on a multimodal large language model, the method comprising:

[0070] S1. Obtain the multi-expert visual token and the text token of the text prompt of the original image, and connect the multi-expert visual token and the text token together and input them into the decoder of the multimodal large language model.

[0071] The multi-expert visual token is obtained as follows:

[0072] In this embodiment, CLIP-ViT-L / 14, DINOv2-base and SAM-L are selected as heterogeneous vision experts. The original image is input into the three vision encoders respectively and converted into a unified visual token with dimension d=512 by the corresponding MLP projector.

[0073] For the i-th image patch, its multi-expert visual token set is represented as ,in For visual tokens from CLIP-ViT, For visual tokens from DINOv2, The visual token comes from SAM-L; the specific calculation formula for the multi-expert visual token is as follows:

[0074] (1)

[0075] In equation (1), Let k be the k-th encoder, where... It is CLIP-ViT-L / 14. For DINOv2-base, SAM-L This represents the projectors corresponding to the three visual encoders. The projectors are all 2-layer MLP structures with input dimensions of 768, 768, and 256, respectively, and a uniform output dimension of 512. This represents the original input image.

[0076] The text token is obtained as follows:

[0077] In this embodiment, the text prompts are processed by LLaVA's tokenizer and embedding module to generate a set of text tokens. ,in The number of tokens corresponding to the text length. This represents the set of real numbers with 512 dimensions; the specific calculation formula is as follows:

[0078] (2)

[0079] In equation (2), the Tokenizer uses the LLaVA-1.5 tokenizer and embedding module. Provide text prompts for the input, such as "Please describe this image" or "Is there a zebra in the image?".

[0080] Based on the multi-expert visual tokens and text tokens obtained above, they are concatenated and input into a multimodal large language model decoder with Vicuna-v1.5-7B as the backbone.

[0081] S2. Based on the complementary clustering strategy guided by cross-modal query, calculate the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch, perform hierarchical clustering of multi-expert visual tokens, merge redundant tokens and retain complementary visual evidence.

[0082] Because different vision experts possess complementary characteristics—namely, CLIP-ViT excels at global semantic alignment, DINOv2 at local structure perception, and SAM-L at boundary localization—clustering is necessary to merge redundant information and preserve complementary information. This step specifically includes:

[0083] S21. Calculate the similarity matrix of multi-expert visual tokens: For the three multi-expert visual tokens of each image patch, calculate the pairwise similarity matrix using cosine similarity. And convert it into the corresponding distance matrix. :

[0084] (3)

[0085] (4)

[0086] In equations (3) and (4), , Let m and n represent the multi-expert visual tokens in the i-th image block, respectively. The smaller the distance, the more redundant the visual information; the larger the distance, the stronger the complementarity. For example, if the token distance between CLIP-ViT and DINOv2 is 0.2, it means that the information of the two is highly redundant; if the distance between SAM-L and CLIP-ViT is 0.7, it means that the two are highly complementary.

[0087] S22. Calculate the query-guided adaptive clustering threshold: First, perform mean pooling on the three multi-expert visual tokens of the image patch to obtain the expert center. Calculate the cosine similarity between the expert center and all text tokens to obtain cross-modal correlation. and semantic divergence :

[0088] (5)

[0089] (6)

[0090] in, The expert center for the i-th image patch is obtained by average pooling of the three multi-expert visual tokens for that image patch. This represents the j-th text token in the text token set T; Expert Center With text tokens semantic matching probability;

[0091] Based on cross-modal correlation and semantic divergence The adaptive threshold is calculated using the Sigmoid function. hyperparameters , :

[0092] (7)

[0093] In equation (7), This represents the Sigmoid function. , To balance relevance and divergence hyperparameters; when text queries and images have high relevance ( When the semantic divergence is high, the threshold is lowered, and clustering becomes more rigorous to preserve key evidence; when the semantic divergence is high ( When the threshold is large, more expert perspectives are retained.

[0094] S23. Hierarchical Clustering and Token Fusion: Based on the distance matrix and threshold Hierarchical clustering algorithm is used to cluster the three multi-expert visual tokens, and tokens with a pairwise distance less than the adaptive clustering threshold are assigned to the same cluster. .like Figure 2As shown, the attention heatmap provides a visual indication of the complementarity distribution among multiple experts; darker colors indicate stronger complementarity. The complementary regions of SAM-L and CLIP-ViT (marked in red) are significantly larger than those of CLIP-ViT and DINOv2, validating the rationality of the differential token retention strategy in the clustering approach. The calculation of each cluster... The centroid is used as the fusion token, and the fusion tokens of all image patches are concatenated to form the final visual token sequence. In this embodiment, the final number of tokens is 576.

[0095] (8)

[0096] (9)

[0097] In equation (9), This represents the fusion token of the m-th cluster in the i-th image patch. Represents clusters Any multi-expert visual token in the middle, It is the visual token of the m-th cluster of the H×W-th image block, where H×W is the number of image blocks, which is 14×14=196 in this embodiment.

[0098] like Figure 3 The framework structure of query-guided complementary clustering is demonstrated, clearly presenting the complete process from multi-expert token input, cross-modal query-guided threshold calculation, to hierarchical clustering and token fusion. Among them, text queries guide the adjustment of clustering thresholds through the semantic relevance calculation module, ensuring the accuracy of redundant token merging and complementary token retention.

[0099] S3. Using the CLIP-ViT-anchored complementary rejection fine-tuning strategy, a negative sample pool is constructed and assigned to the auxiliary experts with the greatest feature differences. The projectors corresponding to each expert are then professionally trained.

[0100] To avoid homogenization in the presentations of multiple experts, the projectors of each expert need to be trained specifically. This step specifically includes:

[0101] S31. Construct a negative sample pool for CLIP anchoring: Using CLIP-ViT as the anchoring expert, the multimodal large language model LLaVA-1.5-7B based on CLIP-ViT is used to generate responses to images in the MS-COCO training set. The correctness of the responses is verified by comparing them with the real labels annotated by humans. Samples with illusions (such as objects that do not exist in the generated images) or inference errors are collected into a negative sample pool, which contains 5000 training samples. These samples indicate that the visual features of CLIP-ViT are insufficient to support correct inference and that complementary information from auxiliary experts is needed.

[0102] S32. Negative Sample Allocation and Specialized Fine-tuning: For each sample in the negative sample pool, calculate the image-level feature similarity between DINOv2-base, SAM-L, and CLIP-ViT:

[0103] First, the visual tokens of the three experts are averaged and pooled separately, using the following formula:

[0104] (10), of which Given the number of visual tokens, we obtain an image-level representation. , and ;

[0105] Calculate cosine distance and The samples are assigned to the training set of the auxiliary experts with the greatest distance, i.e. the least similarity.

[0106] like Figure 4 As shown, the workflow of the complementary rejection fine-tuning strategy clearly presents the construction process of the negative sample pool: First, the response is generated by a large language model based on CLIP. After answer verification, the incorrect samples are selected to form the negative sample pool. Then, the negative samples are assigned to the visual experts (experts A, B, and C) with the largest feature differences for specialized training by calculating the cosine similarity with the anchored experts (CLIP).

[0107] A two-stage training paradigm is adopted: In the first stage, the three projectors corresponding to CLIP-ViT, DINOv2, and SAM-L are trained independently for 3 rounds with a learning rate of 1e-4. The goal is to enable the projectors corresponding to CLIP-ViT, DINOv2, and SAM-L to learn token encodings that conform to their own expert characteristics, thereby avoiding homogenization of multi-expert representations. In other words, each expert's visual token retains its unique advantages, such as the global semantics of CLIP and the local structure of DINOv2.

[0108] In the second stage, the three projectors are jointly fine-tuned with the Vicuna-v1.5-7B backbone network for one round with a learning rate of 2e-5, a batch size of 64, an optimizer of AdamW, a weight decay of 0.01, and a cosine learning rate decay scheduling. The goal is to adapt the three projectors to the Vicuna-v1.5-7B backbone network, achieve cross-modal alignment of multi-expert visual tokens and text tokens, and ultimately improve the model's hallucination-free reasoning ability.

[0109] S4. Input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate the target text output without illusions;

[0110] Visual tokens after clustering and fusion Concatenated with a text token, it is input into the decoder of a multimodal large language model. Cross-modal information fusion is achieved through a multi-head self-attention mechanism to generate the final target text.

[0111] (11)

[0112] In equation (11), This means that 576 visual tokens and text tokens are concatenated in sequence, input into the model decoder, and then an illusion-free text response is generated through autoregression.

[0113] like Figure 5 The diagram shows a qualitative comparison between the LLaVA-1.5 baseline model and the method of this invention (Ours). For the same image of the African savanna, LLaVA-1.5 incorrectly generated a non-existent object, a "zebra" (a hallucination), while the method of this invention accurately described the behavior and environment of two giraffes, without any content inconsistent with the image, directly verifying the effectiveness of this method in hallucination suppression.

[0114] Experimental verification

[0115] Experimental Verification: This embodiment verifies the effectiveness of the method on three major hallucination assessment benchmarks: POPE, CHAIR, and MMVP. The experimental setup is as follows:

[0116] Baseline models: LLaVA-1.5-7B, LLaVA-NeXT-7B, LEO-7B, MoF-7B, etc.;

[0117] Experimental setup: Training used 8 NVIDIA A100 GPUs, and inference used 1 NVIDIA A100 GPU;

[0118] Evaluation metrics: POPE accuracy and F1 score, CHAIR_sentence (sentence-level illusion rate) and CHAIR_instance (instance-level illusion rate), MMVP pairing accuracy;

[0119] The experimental results are shown in Table 1:

[0120] Table 1. Experimental results using the three benchmark tests POPE, CHAIR, and MMVP.

[0121]

[0122] Experimental results show that the method of the present invention outperforms existing methods on all benchmarks:

[0123] The POPE accuracy rate reached 86.9%, and the F1 score was 86.5%, an improvement of 3.8% compared to LLaVA-1.5;

[0124] CHAIR_sentences = 27.1%, CHAIR_examples = 12.2%, a decrease of 8.7% compared to LLaVA-NeXT;

[0125] MMVP has a matching accuracy of 57%, which is 11% higher than LEO, and the number of visual tokens is only 1 / 6.2 of that of LEO.

[0126] This demonstrates a balance between illusion suppression and inference efficiency: achieving optimal performance in the three major benchmark tests POPE, CHAIR, and MMVP, with CHAIR accuracy as low as 27.1% and MMVP accuracy reaching 57%, while using only 576 visual tokens, resulting in computational overhead far lower than existing multi-expert methods (such as LEO, which requires 3584 tokens).

[0127] Ablation experiments verified the effectiveness of each core component:

[0128] Removing query-guided adaptive clustering (with a fixed threshold of 0.45): CHAIR_sentence accuracy rose to 34.0%, while MMVP accuracy dropped to 48%.

[0129] Removing complementary rejection for fine-tuning (using normal joint training): CHAIR_sentence accuracy increased to 36.8%, while MMVP accuracy decreased to 42%;

[0130] Using only a single expert (CLIP): MMVP accuracy was only 22%, validating the necessity of multi-expert complementarity.

[0131] Example 2

[0132] This embodiment provides an apparatus for implementing a method for alleviating hallucinations using a multimodal large language model, the apparatus comprising:

[0133] The token acquisition module is used to acquire multi-expert visual tokens and text tokens of text prompts for the input image, and to connect the multi-expert visual tokens and text tokens and input them together into the decoder of the multimodal large language model. The module includes three visual encoder interfaces (CLIP-ViT, DINOv2, SAM-L) and one text segmenter interface, which supports parallel processing of image and text input.

[0134] The complementary clustering module is used to calculate the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch based on a cross-modal query-guided complementary clustering strategy. It performs hierarchical clustering of multi-expert visual tokens, merges redundant tokens, and retains complementary visual evidence. The module has a built-in cosine similarity calculator, adaptive threshold generator, and hierarchical clustering engine, which supports real-time adjustment of the clustering strategy.

[0135] The complementary fine-tuning module is used to construct a negative sample pool and assign it to the auxiliary experts with the greatest feature differences through a CLIP-anchored complementary rejection fine-tuning strategy, and to perform specialized training on the projectors corresponding to each expert. This module includes a negative sample filter, a feature similarity calculator and a two-stage training scheduler, and supports seamless switching between independent training and joint fine-tuning.

[0136] The target output module is used to input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate the target text output without illusions. This module provides an interface with mainstream LLM backbone networks (Vicuna, Llama, etc.) and supports autoregressive text generation and result output.

[0137] Example 3

[0138] This embodiment also provides an electronic device, including:

[0139] At least one processor; and

[0140] A memory that stores instructions that, when executed by the at least one processor, cause the at least one processor to perform the illusion mitigation method for a multimodal large language model as described above.

[0141] In this embodiment, the electronic device may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, consumer electronic device, etc.

[0142] Example 4

[0143] This embodiment also provides a machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform the illusion mitigation method for a multimodal large language model as described above.

[0144] Specifically, a system or apparatus equipped with a readable storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer or processor of the system or apparatus can read and execute the instructions stored in the readable storage medium.

[0145] In this case, the program code itself, which can be read from the readable medium, can perform the functions of any of the above embodiments, and therefore the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of this specification.

[0146] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.

[0147] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.

Claims

1. A method for hallucination mitigation based on a multimodal large language model, characterized in that, The method includes: S1. Obtain the multi-expert visual token and the text token for the text prompt of the original image; S2. Based on a complementary clustering strategy guided by cross-modal queries, calculate the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch, perform hierarchical clustering of multi-expert visual tokens, merge redundant tokens, and form the final visual token sequence. To preserve complementary visual evidence; S3. Through the CLIP-anchored complementary rejection fine-tuning strategy, a negative sample pool is constructed and assigned to the auxiliary experts with the greatest feature differences. The projectors corresponding to each expert are then professionally trained. S4. Input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate the target text output without illusions; Step S2, based on the complementary clustering strategy guided by cross-modal queries, calculates the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch, specifically as follows: S21: Calculate the similarity matrix of multi-expert visual tokens: For each image patch's multi-expert visual token, calculate the pairwise similarity matrix using cosine similarity. And convert it into the corresponding distance matrix. : (3) (4) In equations (3) and (4), , These represent the m-th and n-th multi-expert visual tokens in the i-th image block, respectively. The smaller the distance, the more redundant the visual information; the larger the distance, the stronger the complementarity. S22: Calculate the query-guided adaptive clustering threshold: Perform mean pooling on the multi-expert visual tokens for each image patch to obtain the expert center. Cross-modal correlation between computational expert centers and text tokens and semantic divergence : (5) (6) in, For the number of vision experts, The number of tokens corresponding to the text length. This represents the expert center for the i-th image patch; This represents the j-th text token in the text token set T; Expert Center With text tokens semantic matching probability; Based on cross-modal correlation and semantic divergence The adaptive clustering threshold is calculated using the Sigmoid function: (7) In equation (7), This represents the Sigmoid function. , Hyperparameters that balance correlation and divergence; The specific steps of step S3 are as follows: S31: Using CLIP-ViT as the anchor expert, a multimodal large language model based on CLIP-ViT is used to generate responses to the training data, and the correctness of the responses is verified by comparing them with the real labels; samples with incorrect responses are collected into a negative sample pool. S32: For each sample in the negative sample pool, calculate the image-level feature similarity between each auxiliary expert and CLIP-ViT: First, perform mean pooling on the visual token of each expert to obtain the image-level representation; calculate the cosine distance between the image-level representations of the two auxiliary experts and CLIP-ViT respectively, and assign the samples to the training set of the auxiliary expert with the largest cosine distance for training.

2. The hallucination mitigation method based on a multimodal large language model according to claim 1, characterized in that, The acquisition of the multi-expert visual token in step S1 is as follows: CLIP-ViT, DINOv2, and SAM-L were selected as heterogeneous vision experts. The original image was input into the three vision encoders respectively, and the corresponding projectors were used to transform it to obtain a dimensionally unified visual token. For the i-th image patch, its multi-expert visual token set is represented as ,in, Let d represent the set of real numbers and d be the token embedding dimension; the specific formula for calculating the multi-expert visual token is as follows: (1) In equation (1), This indicates the k-th visual encoder, which can be CLIP-ViT, DINOv2, or SAM-L. This represents the projector corresponding to the k-th visual encoder. This represents the original input image.

3. The hallucination mitigation method based on a multimodal large language model according to claim 2, characterized in that, The acquisition of the text token in step S1 is as follows: The text prompts are processed by LLaVA's tokenizer and embedding module to generate a set of text tokens. The specific calculation formula for the text token set is as follows: (2) In equation (2), Tokenizer represents the tokenizer and the embedding module. This indicates the text prompt for the input.

4. The hallucination mitigation method based on a multimodal large language model according to claim 3, characterized in that, Step S2 involves hierarchical clustering of the multi-expert visual tokens, merging redundant tokens, and forming the final visual token sequence. To preserve complementary visual evidence, specifically as follows: S23: Hierarchical Clustering and Token Fusion: Based on the Distance Matrix and adaptive clustering threshold A hierarchical clustering algorithm is used to perform hierarchical clustering of multi-expert visual tokens, and tokens with a pairwise distance less than the adaptive clustering threshold are assigned to the same cluster. ; The centroid of each cluster is calculated as a fusion token, and then the fusion tokens of all image patches are concatenated to form the final visual token sequence. : (8) (9) In equation (9), This represents the fusion token of the m-th cluster in the i-th image patch. Represents clusters Any multi-expert visual token in the middle, It is the visual token of the m-th cluster of the H×W-th image patch, where H×W is the number of image patches.

5. The hallucination mitigation method based on a multimodal large language model according to claim 1, characterized in that, In step S32, the training adopts a two-stage training paradigm: The first phase involved independently training the projectors of three experts to learn to extract complementary visual features, with a learning rate of 1e-4. In the second stage, all projectors and the backbone network are jointly fine-tuned with a learning rate of 2e-5 and a batch size of 64. The AdamW optimizer and cosine decay scheduling are used to achieve cross-modal alignment of multi-expert visual tokens and text tokens.

6. The hallucination mitigation method for a multimodal large language model according to claim 4, characterized in that, The specific steps of step S4 are as follows: Visual tokens after clustering and fusion Connected to a text token, the input is fed into the decoder of a multimodal large language model. Cross-modal fusion is achieved through a self-attention mechanism to generate the final target text. (10) In equation (10), represents token chaining operation, MLLM represents multimodal large language model, and Y represents the target text output without illusions.

7. An apparatus for implementing the hallucination relief method of a multimodal large language model as described in any one of claims 1-6, characterized in that, The device includes: The token acquisition module is used to acquire multi-expert visual tokens and text tokens for text prompts from the input image. The complementary clustering module is used for a complementary clustering strategy guided by cross-modal queries. It calculates the similarity matrix and adaptive clustering threshold of multi-expert visual tokens in each image patch, performs hierarchical clustering of multi-expert visual tokens, merges redundant tokens, and forms the final visual token sequence. To preserve complementary visual evidence; The complementary fine-tuning module is used to construct a negative sample pool and assign it to the auxiliary experts with the greatest feature differences through the complementary rejection fine-tuning strategy anchored by CLIP, and to perform specialized training on the projectors corresponding to each expert. The target output module is used to input the clustered and fused visual tokens and text tokens into the multimodal large language model to generate a non-illusion target text output.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the illusion mitigation method for a multimodal large language model as described in any one of claims 1 to 6.

9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores executable instructions that, when executed, cause the machine to perform the illusion mitigation method for a multimodal large language model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Learning situation report generation method and system based on large language model

    CN118428348A

  • DDD architecture service code examination and evaluation method based on multi-expert LLM

    CN120276960A