Multi-modal large language model neuron attribution method and related equipment
By identifying specific semantic regions and their contribution scores of image and text output in multi-modal large language models, the problem of semantic noise and inefficiency in the neuron attribution process in MLLMs is solved, and efficient and accurate neuron attribution is achieved. Therefore, interpretability and computational performance are improved.
Patent Information
- Application Number
- CN202411009888.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Multimodal large language models (MLLMs) have problems with semantic noise, inefficiency, and neuron mixing in the neuron attribution process, resulting in increased interpretability and computational time, and traditional methods rely on gradient calculations and causal effects, which are time-consuming and Sometimes and have high storage requirements.
By utilizing the images with specific semantics generated by the MLLMs model, obtain specific regions in the image related to specific semantics, evaluate the correlation of each dimension with the generated image, obtain contribution scores, integrate the contribution scores to identify I-neurons, and pass Neuron activation scoring identifies T-neurons, enabling efficient and accurate neuron attribution.
This method does not require gradient calculation, eliminates semantic noise, identifies key neurons efficiently and accurately, overcomes the computational time-consuming and noise problems of traditional methods, and improves the accuracy and reliability of the attribution method.
Smart Images

Figure CN118761476A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and more specifically to a multimodal large language model neuron attribution method and related equipment. Background Art
[0002] As Large Language Models (LLMs) demonstrate impressive capabilities, revealing their internal mechanisms becomes increasingly important, especially in applications that emphasize fairness, trust, and ethical decision-making. "Neural attribution" is a key method for explaining LLMs. This method reveals the knowledge and language characteristics they have learned by attributing text output to individual model components (such as neurons and hidden layers). These insights not only help with model editing and parameter optimization, but also deepen people's understanding of how LLMs recognize and store various input information. Current neuron attribution research shows that this storage capacity may mainly come from its feedforward neural networks (FFNs).
[0003] Recently, the rapid development of multimodal large-scale language models (MLLMs) has stimulated researchers' strong interest in their interpretability, especially MLLMs that can perceive and generate text and images simultaneously. This type of MLLMs usually includes two additional common components based on the basic text LLMs (base LLMs): an image encoding module and a generation module. Specifically, the image encoding module projects the input image into the representation space of the base LLMs; then, the image generation module generates image output based on the representation provided by the base LLMs. Taking the classic image generation large model (GILL) as an example, Figure 1 As shown, it adopts OPT as the base LLMs, CLIP Vit-L with mapper as the image encoding module, and uses StableDiffusion Model and another mapper as the image generation module.
[0004] Although this extensibility enables GILL to be competent for a variety of downstream tasks, it also brings challenges to its interpretation, especially in terms of neuron attribution. Specifically, we outline these challenges through the following three progressive points: First, the challenge of attributing the source: semantic noise. Figure 2 As shown in (a), Figure 2 (a) shows the neuron attribution process diagram of LLMs that only output text. In the figure, for semantics such as "dog", current methods usually attribute the output word "dog" directly to neurons in LLMs. However, in MLLMs, directly attributing the entire generated image to neurons may lead to inaccuracies. Figure 2 As shown in (b), Figure 2 (b) shows the output attribution noise map of the neuronal attribution process transferred to MLLMs. When GILL is asked to draw a dog, the generated image may contain other semantic elements, such as grass, which introduces noise and interferes with the attribution process.
[0005] Second, the challenge of attribution process: inefficiency. Current attribution methods usually rely on gradients or causal effects, which require a large number of forward and backward propagation processes, which are very time-consuming and require high storage space. In addition, the additional complexity introduced by the encoding and generation modules in MLLMs further exacerbates this challenge.
[0006] Third, the challenge of attribution results: neuron confounding. In LLMs that only output text, attributing the concept of "dog" involves identifying neurons that are crucial for outputting the word "dog", called T-neurons. In contrast, MLLMs also need to identify neurons that are crucial for image generation, called I-neurons. Figure 2 As shown in (b), T-neurons and I-neurons have different distributions even for the same concept, which can lead to complex and conflicting attribution results, making further analysis and application more difficult.
[0007] In summary, current research on MLLMs urgently needs to find a neuron attribution paradigm that can efficiently and accurately attribute the output of MLLMs. Summary of the invention
[0008] In this embodiment, a multimodal large language model neuron attribution method and related equipment are provided to solve the problems of semantic noise, inefficiency and neuron confusion that occur in the attribution process in the related art.
[0009] In a first aspect, the present invention provides a multimodal large language model neuron attribution method, the multimodal large language model neuron attribution method comprising: Using an image with specific semantics generated by the MLLMs model, obtaining a specific region in the image related to the specific semantics; Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the semantics of the image target based on the correlation; The contribution of the neuron to the final representation is obtained, and the contribution scores of each dimension are integrated, and the neuron with the highest contribution score is used as the I-neuron; the attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
[0010] In an optional embodiment, using an image with specific semantics generated by an MLLMs model, obtaining a specific region in the image related to the specific semantics includes: Inputting text information with specific semantics into the MLLMs model; According to the input text information, an image with specific semantics is generated by the MLLMs model; A pre-trained segmentation model is used to identify specific regions in the image that are associated with specific semantics.
[0011] In an optional embodiment, evaluating the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtaining the contribution score of each element in the final representation of the Lth layer of the MLLMs model with respect to the image target semantics according to the correlation includes: Using a diffusion model attribution algorithm to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtain a correlation score; The correlation scores are normalized to obtain the contribution scores of each element in the final representation of the Lth layer of the MLLMs model with respect to the image target semantics.
[0012] In an optional embodiment, obtaining the contribution of neurons to the final representation, integrating the contribution scores of each dimension, and taking the neuron with the highest contribution score as the I-neuron includes: The direct and indirect contributions of the neuron to the final representation are obtained.
[0013] In an optional embodiment, obtaining the direct contribution of the neuron to the final representation includes: Based on neuron activation, obtain the generation process of the final representation; According to the generation process of the final representation, the direct contribution of the neuron to the final representation is obtained.
[0014] In an optional embodiment, obtaining the indirect contribution of the neuron to the final representation includes: Design the maximum function in the contribution score:
[0015] in, represents the neuron contribution, Indicates neuron activation.
[0016] In an optional embodiment, obtaining the attribution score of the neuron to the text output and taking the neuron with the highest attribution score as the T-neuron includes: Get the contribution of residual flow to the output of MLLMs model; Refine the contributions of individual neurons and keep the neurons that contribute most to a single semantic concept; The final attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
[0017] Compared with the prior art, the multimodal large language model neuron attribution method of the present invention has the following beneficial effects: The present invention proposes a multimodal large language model neuron attribution method that does not rely on time-consuming and highly storage-demanding technologies such as gradient calculation and causal effects, and can eliminate the interference of semantic noise information in the generated image. For specific semantic concepts, the key neurons (T neurons and I neurons) for different output modes are found through decoupling to achieve efficient and accurate neuron attribution; it can attribute and provide explanations for various applications in predictive behaviors of multimodal large language models, and extract interpretable neurons with class-aware semantic capabilities from MLLMs, overcoming the inherent computational time consumption and noise introduction problems of traditional attribution and interpretation methods, eliminating the influence of interfering semantics irrelevant to the target semantics, and effectively improving the accuracy and reliability of the attribution method.
[0018] In a second aspect, the present invention provides a multimodal large language model neuron attribution device, comprising: An image generation module, used for obtaining a specific region related to the specific semantics in the image by using an image with specific semantics generated by the MLLMs model; The contribution score calculation module is used to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the image target semantics based on the correlation; The attribution module is used to obtain the contribution of neurons to the final representation, integrate the contribution scores of each dimension, and use the neuron with the highest contribution score as the I-neuron; obtain the attribution score of the neuron to the text output, and use the neuron with the highest attribution score as the T-neuron.
[0019] In a third aspect, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the multimodal large language model neuron attribution method as described in the first aspect is implemented.
[0020] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the multimodal large language model neuron attribution method as described in the first aspect.
[0021] Compared with the prior art, the beneficial effects of the multimodal large language model neuron attribution device, electronic device and storage medium of the present invention are the same as the multimodal large language model neuron attribution method described in the first aspect, so they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 Schematic diagram of the general paradigm of existing MLLMs; Figure 2 Schematic diagram of the semantic noise interference attribution process; Figure 3 1 is a network architecture diagram of base LLMs in a multimodal large language model according to an embodiment of the present invention; Figure 4 Schematic diagram of the neuron attribution paradigm of image output in an embodiment of the present invention; Figure 5 Schematic diagram of the neuron attribution paradigm for text output in an embodiment of the present invention; Figure 6 A distribution diagram of T / I neurons identified by ATN in an embodiment of the present invention; Figure 7 Schematic diagram of average invariance of different concepts in the embodiments of the present invention; Figure 8 is a schematic diagram of average semantic specificity of different concepts in an embodiment of the present invention; Fig. 9 Flow chart of a multimodal large language model neuron attribution method in an embodiment of the present invention; Fig.10 1 is a structural block diagram of a multimodal large language model neuron attribution device according to an embodiment of the present invention; Fig.11 1 is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0025] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0026] In an embodiment of the present invention, a multimodal large language model neuron attribution method (NeuronAttribution for MLLMs, ATN) is provided. Fig. 9 is a flowchart of the multimodal large language model neuron attribution method of the present invention, such as Fig. 9 As shown, the process includes the following steps: S100, using an image with specific semantics generated by the MLLMs model to obtain a specific region in the image related to the specific semantics; It should be noted that the MLLMs model is a multimodal large language model, which is based on the large language model LLMs. An image encoding module and a generation module are added to the LLMs. The MLLMs model can be used to generate images with semantics corresponding to the input text information.
[0027] like Figure 3 As shown, Figure 3 This is the network architecture diagram of the base LLMs in the multimodal large language model. First, the network architecture of the base LLMs in the multimodal large language model is explained: Its large language model based on autoregressive Transformer Based on vocabulary Specifically, it receives as input a sequence of tokens , and generate the probability distribution to predict the next token. Each token in Layers are represented as a series of representations ,in, Yes Mark The final output of the model is From The last representation of the layer Using the De-embedding Matrix Get. Figure 3 As shown, Figure 3 It is shown in In the The computation process within the layer. The representation of each layer is determined by the global attention , local MLP output and the representation of the previous layer The formula is: in, are the first and second linear layers in FFN, where the intermediate layer dimension is ; and is a nonlinear operation of rectification and normalization. In addition, for The first layer in FFN Neurons , consider activating neurons Simplifying the definition to: ; Based on the internal architecture of the above base LLMs, the common MLLMs paradigm is as follows Figure 3 Specifically, MLLMs are modified as follows based on the above LLMs: In addition to text prompts, enter a sequence of tokens Also included is an encoding of an input image generated by an image encoding module; The representation of the last hidden layer is used as the input of the image generation module to facilitate conditional image generation.
[0028] Based on the above, using MLLMs to generate images of specific concepts (such as dogs) often produces outputs containing redundant noise elements (such as grass). In order to mitigate the negative impact of semantic noise on neuron attribution, a two-step method is proposed to extract I-Neurons. That is, the first step focuses on attributing the output of the image generation module (i.e., the image) to the input of the image generation module. The second step is to transform the input of the image generation module attributed to specific neurons.
[0029] Specifically, using the image with specific semantics generated by the MLLMs model, obtaining specific areas in the image related to specific semantics includes: Input text information with specific semantics into the MLLMs model; for example, text information with the semantics of "dog"; Based on the input text information, the MLLMs model generates images with specific semantics; the MLLMs model generates images with the semantics of "dog"; Leverage pre-trained segmentation models to identify specific regions in an image that are associated with specific semantics.
[0030] Use a segmentation model (e.g., EVA02) to identify specific regions associated with “dog” while minimizing the interference of redundant semantics in the background (e.g., lawn).
[0031] S200, evaluating the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtaining the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the semantics of the image target according to the correlation; Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model to the semantics of the image target based on the correlation, including: The diffusion model attribution algorithm is used to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image to obtain a correlation score; Exemplarily, a diffusion model attribution algorithm (Diffuser-Interpreter) is used to evaluate the correlation between each dimension of the image generation module input of the MLLMs model and the "dog" region in the generated image; and a correlation score is obtained.
[0032] The correlation scores are normalized to obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model to the image target semantics.
[0033] Specifically, by normalizing these correlation scores to (0, 1), we get The contribution score (importance score) of each element in the output image target semantics .
[0034] It should be noted that migration to any other modality is possible by using semantic segmentation algorithms and attribution algorithms of generative modules customized for other modalities such as audio and video. After that, the subsequent attribution step is common in all Transformer-based MLLMs.
[0035] The purpose of the above steps is to attribute the image to the final representation , that is, to identify the final representation The contribution of each element in to image generation.
[0036] S300, obtaining the contribution of the neuron to the final representation, integrating the contribution scores of each dimension, and taking the neuron with the highest contribution score as the I-neuron; obtaining the attribution score of the neuron to the text output, and taking the neuron with the highest attribution score as the T-neuron.
[0037] Get the contribution of neurons to the final representation, integrate the contribution scores of each dimension, and take the neurons with the highest contribution scores as I-neurons, including: Get the direct and indirect contribution of the neuron to the final representation.
[0038] It should be noted that current contribution scoring methods usually rely on gradients, such as the product of gradient and activation or the integral of gradient. However, these methods have high computational overhead for large-scale models, especially for models with many parameters. In view of this, inspired by the study of neuronal activation, we propose a new attribution scoring method that only relies on neuronal activation. .
[0039] like Figure 4 As shown, specifically, obtaining the direct contribution of neurons to the final representation includes: Based on neuron activation, obtain the generation process of the final representation; According to the generation process of the final representation, the direct contribution of the neuron to the final representation is obtained.
[0040] First, the final representation is expanded by the following formula To decompose and derive the final representation The generation process: in is the weight matrix No. Columns, corresponding to neurons The first term in the last line of the above formula reflects the index of the neuron To the last expression The direct contribution of is the contribution of the residual flow through the basic LLMs. Therefore, using As a neuron To the final expression Contribution indicator.
[0041] In addition, by integrating the importance scores of each dimension , a complete attribution paradigm can be established (i.e., generating the target semantic region in the image → representing → Neurons ). Importance score Already indicated for the last time Each dimension in is assigned a contribution, and the neuron Contribution It can be defined as: .
[0042] Furthermore, obtaining the indirect contribution of neurons to the final representation includes: Design the maximum function in the contribution score:
[0043] in, represents the neuron contribution, Indicates neuron activation.
[0044] It should be noted that although neurons contribute Quantified neurons The final representation is through the residual flow However, it does not take into account all the influencing factors. Specifically, it ignores the indirect contribution of neurons through the attention mechanism in subsequent FFN layers. To solve this problem and to avoid complex calculations such as gradients, we further calculate the contribution of the current indicator neuron Make optimizations.
[0045] Furthermore, the relative size of neuron activation is used as another indicator to identify the possible contribution to the final representation. Neurons with significant indirect contributions, which may be contributed by neurons neglect.
[0046] In addition, considering the neuronal contribution The calculation of neuron activation ,The contributions reflected by these two indicators may overlap.,In order to avoid the redundancy caused by adding or multiplying the two metrics, the above maximum ,function is used in the final scoring design.
[0047] Among them, the normalization operation ensures that the neuron contribution and neuronal activation The fair competition between them, their complementarity makes this combined scoring method better than using the neuron contribution alone and neuronal activation More efficient. By calculating the contribution of different semantics at each level, this method identifies neurons that consistently show the highest contribution in the generated images. These neurons are designated as I-neurons responsible for specific semantics in MLLMs because of their significant role.
[0048] Furthermore, the attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is taken as the T-neuron including: Get the contribution of residual flow to the output of MLLMs model; Refine the contributions of individual neurons and keep the neurons that contribute most to a single semantic concept; The final attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
[0049] Similar to the derivation process of image output contribution score, we first focus on the output through the residual flow Specifically, Expand as follows: According to the common assumptions used to analyze the internal mechanisms of LLMs, the representation of any layer in a language model can be transformed into a distribution over the token vocabulary using the output embedding. Therefore, can be thought of as the new de-embedding matrix at the end of the residual stream, pass Output distribution of the model Contributions to the vocabulary.
[0050] Furthermore, if Figure 5 As shown, the contribution is refined to specific neurons to further decompose the above equation to refine individual neurons The contribution of to the output word. For example, let The index of "dog" in the vocabulary: in yes No. According to the above equation, the neuron For the vocabulary Contribution of the word "dog" for: In addition, the identified key neurons are semantically specific (i.e., only neurons that contribute most to a single semantic concept are retained), while ignoring other semantics. The semantics of a word, neurons Contribution It can be defined as: for
[0051] Based on this, we can get neurons For the final attribution score of the text output, those neurons that consistently showed the highest contribution were designated as T-neurons.
[0052] For example, we randomly select 1000 images from the COCO dataset based on the distribution of T / I neurons identified by ATN. Then we input each image into GILL and instruct GILL to generate similar images. Figure 6 shown.
[0053] from Figure 6 It can be seen that in MLLMs, the key neurons containing text and image outputs with specific semantics mainly appear in the middle and high levels of the basic LLMs. This observation is consistent with previous studies on the attribution of neurons within LLMs. In addition, the similar distribution of T neurons and I neurons suggests that in MLLMs, the formation time of semantic concepts of different modalities may be consistent.
[0054] Figure 6 It reveals some overlap between T neurons and I neurons. However, it also clearly shows the differences between them. This finding confirms that even with the same semantics, key neurons are modality-specific in MLLMs.
[0055] For different text / image outputs containing the same semantics, the T / I neurons identified by the attribution method should be consistent. To quantify this consistency, GILL was instructed to describe and generate images with the same semantics ten times, and each time a collection of T / I neurons was collected. Then, the proportion of neurons that appeared in all ten collections was calculated to quantify cross-sample invariance. Figure 7 Demonstrated average invariance across concepts.
[0056] according to Figure 7 It can be concluded that ATN outperforms all baselines by an average of 16.83% in terms of cross-sample invariance for all semantics. This indicates that ATN is able to extract key neurons for target semantics and effectively filter out neurons that are sensitive to sample-specific noise.
[0057] Neurons that are important for a specific semantics should not be indiscriminately important in other semantics. Therefore, in this section, we study the specificity of neurons and identify the top 500 T / I neurons for a specific semantics. Then, we show the number of neurons that are important only for a specific semantics and the number of neurons that are important for a specific semantics with probability below Here we show the results of the three best performing methods. Figure 8 shown.
[0058] according to Figure 8 The following conclusions can be drawn: ATN exceeds all baselines by an average of 19.94% in terms of cross-sample invariance for all semantics, demonstrating that the T / I neurons identified by ATN are specialized and not universally sensitive across different semantics, validating their semantic specificity.
[0059] In summary, the present invention can be used to attribute and explain the prediction behavior of multimodal large language models, and extract interpretable neurons with class-aware semantic capabilities from MLLMs. The present invention can overcome the inherent computational time consumption and noise introduction problems of traditional attribution and interpretation methods, eliminate the influence of interference semantics irrelevant to the target semantics, and effectively improve the accuracy and reliability of the attribution method.
[0060] The embodiment of the present invention also provides a multimodal large language model neuron attribution device, which is used to implement the above method embodiment, which has been described and will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware or a combination of software and hardware is also possible and conceived.
[0061] like Fig.10 As shown, Fig.10 : is a structural block diagram of a multimodal large language model neuron attribution device in the present invention, the device comprising: An image generation module, used for obtaining a specific region related to the specific semantics in the image by using an image with specific semantics generated by the MLLMs model; The contribution score calculation module is used to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the image target semantics based on the correlation; The attribution module is used to obtain the contribution of neurons to the final representation, integrate the contribution scores of each dimension, and use the neuron with the highest contribution score as the I-neuron; obtain the attribution score of the neuron to the text output, and use the neuron with the highest attribution score as the T-neuron.
[0062] Fig.11 A structural block diagram of an electronic device provided by an embodiment of the present invention, such as Fig.11 As shown, the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the following method: Using an image with specific semantics generated by the MLLMs model, obtaining a specific region in the image related to the specific semantics; Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the semantics of the image target based on the correlation; The contribution of the neuron to the final representation is obtained, and the contribution scores of each dimension are integrated, and the neuron with the highest contribution score is used as the I-neuron; the attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
[0063] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0064] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided in each of the above embodiments is implemented, for example, including: Using an image with specific semantics generated by the MLLMs model, obtaining a specific region in the image related to the specific semantics; Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the semantics of the image target based on the correlation; The contribution of the neuron to the final representation is obtained, and the contribution scores of each dimension are integrated, and the neuron with the highest contribution score is used as the I-neuron; the attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
[0065] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0066] 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 multimodal large language model neuron attribution method, It is characterized in that The multimodal large language model neuron attribution method comprises: Using an image with specific semantics generated by the MLLMs model, obtaining a specific region in the image related to the specific semantics; Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the semantics of the image target based on the correlation; The contribution of the neuron to the final representation is obtained, and the contribution scores of each dimension are integrated, and the neuron with the highest contribution score is used as the I-neuron; the attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
2. The multimodal large language model neuron attribution method according to claim 1, It is characterized in that Using an image with specific semantics generated by the MLLMs model, obtaining a specific region in the image related to the specific semantics includes: Inputting text information with specific semantics into the MLLMs model; According to the input text information, an image with specific semantics is generated by the MLLMs model; A pre-trained segmentation model is used to identify specific regions in the image that are associated with specific semantics.
3. The multimodal large language model neuron attribution method according to claim 1, It is characterized in that Evaluate the correlation between each dimension of the input of the image generation module of the MLLMs model and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model to the semantics of the image target based on the correlation, including: Using a diffusion model attribution algorithm to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtain a correlation score; The correlation scores are normalized to obtain the contribution scores of each element in the final representation of the Lth layer of the MLLMs model with respect to the image target semantics.
4. The multimodal large language model neuron attribution method according to claim 1, It is characterized in that Obtain the contribution of the neuron to the final representation, integrate the contribution scores of each dimension, and use the neuron with the highest contribution score as the I-neuron, including: The direct and indirect contributions of the neuron to the final representation are obtained.
5. The multimodal large language model neuron attribution method according to claim 4, It is characterized in that Obtaining the direct contribution of a neuron to the final representation includes: Based on neuron activation, obtain the generation process of the final representation; According to the generation process of the final representation, the direct contribution of the neuron to the final representation is obtained.
6. The multimodal large language model neuron attribution method according to claim 4, It is characterized in that Obtaining the indirect contribution of a neuron to the final representation includes: Design a maximum function in the contribution score: ; in, represents the neuron contribution, Indicates neuron activation.
7. The multimodal large language model neuron attribution method according to claim 1, It is characterized in that Get the neuron's attribution score for the text output, and take the neuron with the highest attribution score as the T-neuron including: Get the contribution of residual flow to the output of MLLMs model; Refine the contributions of individual neurons and keep the neurons that contribute most to a single semantic concept; The final attribution score of the neuron to the text output is obtained, and the neuron with the highest attribution score is used as the T-neuron.
8. A multimodal large language model neuron attribution device, It is characterized in that include: An image generation module, used for obtaining a specific region related to the specific semantics in the image by using an image with specific semantics generated by the MLLMs model; The contribution score calculation module is used to evaluate the correlation between each dimension of the input of the MLLMs model image generation module and a specific area in the generated image, and obtain the contribution score of each element in the final representation of the Lth layer of the MLLMs model relative to the image target semantics based on the correlation; The attribution module is used to obtain the contribution of neurons to the final representation, integrate the contribution scores of each dimension, and use the neuron with the highest contribution score as the I-neuron; obtain the attribution score of the neuron to the text output, and use the neuron with the highest attribution score as the T-neuron.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the multimodal large language model neuron attribution method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the multimodal large language model neuron attribution method as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Knowledge injection and training method and system for knowledge enhancement pre-training language model
CN116450839A
Automated data analytics methods for non-tabular data, and related systems and apparatus
WO2021167998A1
Multi-path parallel text-to-image generation method and system
WO2024130753A1
Cited By
Large language model knowledge editing method and system
CN119886073A
A Method and System for Knowledge Editing of Large Language Models
CN119886073B
