arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.09454cs.CVcs.LG
收藏

多模态LLM中的计算跳过

Skipping Computations in Multimodal LLMs

Sorbonne University(索邦大学)

Mustafa Shukor, Matthieu Cord

AI总结:

本文研究多模态LLM推理时的计算冗余,提出跳过或并行化特定层的方法,发现可大幅减少计算且保持性能,甚至小模型经适当训练可媲美大模型。

摘要:

大型语言模型(LLMs)在文本和多模态领域均展现出卓越的成功。然而,这种成功往往伴随着巨大的计算成本,尤其是在处理长序列多模态输入时。这引发了众多致力于提升训练和推理效率的研究。在本研究中,我们调查了多模态大型语言模型(MLLMs)在推理过程中的计算冗余。我们提出了多种跳过计算的方法,例如跳过整个块、FFN或自注意力(SA)层。此外,我们还探索了某些层(如FFN和SA层)的并行化。我们的发现验证了:(1) 在推理时可以避免大量计算,特别是在视觉问答(VQA)等任务中。(2) 在训练期间跳过计算可以恢复97%的原始性能,即使跳过一半的块或移除70%的权重。(3) 或者,使用较小的LLMs进行适当训练可以获得与2或3倍大的LLMs相当的性能。最后,我们将研究扩展到最近的MLLMs,如LLaVA-1.5,显示出相似的观察结果。我们的工作表明MLLMs内部存在冗余计算,从而具有在不牺牲性能的情况下显著改善推理成本的潜力。代码在此处可用:https://github.com/mshukor/ima-lmms。

英文摘要:

Large Language Models (LLMs) have demonstrated remarkable success in both textual and multimodal domains. However, this success often comes with substantial computational costs, particularly when handling lengthy sequences of multimodal inputs. This has sparked many efforts focusing on enhancing efficiency during training and inference. In this study, we investigate the computation redundancy in Multimodal Large Language Models (MLLMs) during inference. We propose different methods to skip computations, such as skipping entire blocks, FFN or self-attention (SA) layers. Additionally, we explore parallelizing certain layers, such as FFN and SA layers. Our findings validate that (1) significant amount of computations can be avoided at inference time, especially for tasks such as Visual Question Answering (VQA). (2) Skipping computations during training can recover 97% of the original performance, even when skipping half of the blocks or removing 70% of the weights. Alternatively, (3) properly training with smaller LLMs can yield comparable performance to LLMs 2 or 3 times larger. To conclude, we extend our investigation to recent MLLMs, such as LLaVA-1.5, showing similar observations. Our work show that there is redundant computations inside MLLMs and thus the potential for significantly improving inference costs without sacrificing performance. The code is available here: https://github.com/mshukor/ima-lmms.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑