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

Dynamic-LLaVA:通过动态视觉-语言上下文稀疏化实现高效多模态大语言模型

Dynamic-LLaVA: Efficient Multimodal Large Language Models via Dynamic Vision-language Context Sparsification

East China Normal University(华东师范大学);Xiamen University(厦门大学);Xiaohongshu Inc.(小红书公司);Nanjing University(南京大学)

Wenxuan Huang, Zijie Zhai, Yunhang Shen, Shaosheng Cao, Fei Zhao, Xiangfeng Xu, Zheyu Ye, Yao Hu, Shaohui Lin

AI总结:

针对多模态大语言模型解码阶段效率收益衰减的问题,提出动态视觉-语言上下文稀疏化框架Dynamic-LLaVA,针对不同推理模式定制稀疏方案,在大幅降低计算与内存开销的同时几乎不损失模型性能。

摘要:

多模态大语言模型(MLLMs)已在视觉理解、推理和交互领域取得显著成功。然而,推理过程中的计算量和内存会随着解码阶段输出token的生成逐步增加,直接影响MLLMs的效能。现有方法尝试减少视觉上下文冗余以实现高效MLLMs,但遗憾的是,预填充阶段视觉上下文缩减带来的效率收益会在解码阶段逐渐衰减。\n为解决这一问题,我们提出了动态视觉-语言上下文稀疏化框架Dynamic-LLaVA,该框架可在预填充阶段动态降低视觉上下文冗余,同时减少解码阶段生成的语言上下文的内存与计算开销。Dynamic-LLaVA针对不同推理模式——即预填充、带KV缓存的解码、不带KV缓存的解码——设计了定制化的稀疏化推理方案,以实现MLLMs的高效推理。\n实际应用中,Dynamic-LLaVA可在预填充阶段降低约75%的计算消耗。同时,在MLLMs的整个生成过程中,得益于视觉-语言上下文稀疏化,Dynamic-LLaVA在无KV缓存解码时可减少约50%的计算消耗,而在有KV缓存解码时可节省约50%的GPU内存开销。大量实验还表明,与全上下文推理基线相比,Dynamic-LLaVA在实现MLLMs高效推理的同时,理解与生成能力的退化可忽略不计,甚至能带来性能提升。代码可在https://github.com/Osilly/dynamic_llava 获取。

英文摘要:

Multimodal Large Language Models (MLLMs) have achieved remarkable success in vision understanding, reasoning, and interaction. However, the inference computation and memory increase progressively with the generation of output tokens during decoding, directly affecting the efficacy of MLLMs. Existing methods attempt to reduce the vision context redundancy to achieve efficient MLLMs. Unfortunately, the efficiency benefits of the vision context reduction in the prefill stage gradually diminish during the decoding stage. To address this problem, we proposed a dynamic vision-language context sparsification framework Dynamic-LLaVA, which dynamically reduces the redundancy of vision context in the prefill stage and decreases the memory and computation overhead of the generated language context during decoding. Dynamic-LLaVA designs a tailored sparsification inference scheme for different inference modes, i.e., prefill, decoding with and without KV cache, to achieve efficient inference of MLLMs. In practice, Dynamic-LLaVA can reduce computation consumption by $\sim$75\% in the prefill stage. Meanwhile, throughout the entire generation process of MLLMs, Dynamic-LLaVA reduces the $\sim$50\% computation consumption under decoding without KV cache, while saving $\sim$50\% GPU memory overhead when decoding with KV cache, due to the vision-language context sparsification. Extensive experiments also demonstrate that Dynamic-LLaVA achieves efficient inference for MLLMs with negligible understanding and generation ability degradation or even performance gains compared to the full-context inference baselines. Code is available at https://github.com/Osilly/dynamic_llava .

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

↑