通过注意力分析筛选关键层,用极少量参数提升多模态模型图像理解能力。
Optimizing Multimodal Language Models through Attention-based Interpretability
- 基于注意力分数识别关注图像关键物体的神经头
- 仅微调0.01%参数即可显著提升图像描述性能
- 适合需要高效优化多模态模型的研究者
现代大语言模型已具备多模态能力,可处理文本与图像等多种数据。尽管微调能有效适应下游任务,但全量微调计算成本高。参数高效微调(PEFT)仅训练少量参数以缓解此问题。然而,多模态语言模型难以解释,难以确定哪些组件对训练最有效,从而平衡效率与性能。本文提出一种基于注意力的可解释性方法,通过分析注意力分数与图像标记的关系,识别聚焦于图像关键物体的注意力头。利用该信息选择最优模型组件用于PEFT。贡献包括:一种识别与图像关键物体相关的注意力头的方法、在图像描述任务中应用该方法进行PEFT、构建包含图像、关键物体掩码及文本描述的新数据集。在20-30亿参数的多模态语言模型上进行实验验证。通过计算注意力头影响(HI)分数量化其对关键物体的关注程度,反映其在图像理解中的重要性。实验表明,微调具有最高HI分数的层带来的指标提升最为显著,优于预训练模型、随机选择或低HI分数层。这说明仅微调约0.01%的参数在关键层即可显著影响图像理解能力。
原文摘要 · Abstract (English)
Modern large language models become multimodal, analyzing various data formats like text and images. While fine-tuning is effective for adapting these multimodal language models (MLMs) to downstream tasks, full fine-tuning is computationally expensive. Parameter-Efficient Fine-Tuning (PEFT) methods address this by training only a small portion of model weights. However, MLMs are difficult to interpret, making it challenging to identify which components are most effective for training to balance efficiency and performance. We propose an attention-based interpretability method for MLMs by analyzing attention scores relative to image tokens. The core idea is to identify attention heads that focus on image key objects. We utilize this information to select optimal model components for PEFT in multimodal models. Our contributions include a method for identifying attention heads associated with image key objects, its application to PEFT for image captioning, and the creation of a new dataset containing images, key object masks, and their textual descriptions. We conducted experiments on MLMs with 2-3 billion parameters to validate the method's effectiveness. By calculating Head Impact (HI) scores we quantify an attention head's focus on key objects, indicating its significance in image understanding. Our fine-tuning experiments demonstrate that adapting layers with the highest HI scores leads to the most significant shifts in metrics compared to pre-trained, randomly selected, or lowest-HI-score layers. This indicates that fine-tuning a small percentage (around 0.01%) of parameters in these crucial layers can substantially influence image understanding capabilities.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。