多模态大语言模型(Multimodal Large Language Models, MLLMs)以其多模态综合能力著称,已在GPT-4o、自动驾驶和机器人等众多实际应用中得到广泛使用。尽管其性能表现亮眼,但多模态输入往往会带来长上下文。长上下文下的推理需要缓存大量先前token的键值状态(KV cache),这会导致高延迟和过高的内存消耗。正因如此,在边缘设备上部署MLLMs的流式推理极具挑战性,这在很大程度上限制了MLLMs在实际应用中的效能和使用场景。\n本文提出了Inf-MLLM,一种面向MLLMs的高效推理框架,可在单GPU上实现具备无限上下文的MLLM流式推理。Inf-MLLM基于我们在LLMs和MLLMs中发现的关键注意力模式——“注意力鞍点(attention saddles)”。得益于这一新发现的注意力模式,Inf-MLLM通过动态缓存近期token和相关token,维持大小受限的KV缓存。此外,Inf-MLLM提出了注意力偏置(attention bias)这一新颖方法,使MLLMs能够捕捉长程依赖关系。\n实验结果表明,Inf-MLLM可让多种LLMs和MLLMs在单GPU上,针对400万token的长文本以及包含1小时时长视频的多轮对话实现稳定性能。此外,Inf-MLLM展现出优于StreamingLLM等现有方法的流式推理质量,且推理速度是H2O的2倍。
英文摘要:
Multimodal Large Language Models (MLLMs) are distinguished by their multimodal comprehensive ability and widely used in many real-world applications including GPT-4o, autonomous driving and robotics. Despite their impressive performance, the multimodal inputs always incur long context. The inference under long context requires caching massive Key and Value states (KV cache) of previous tokens, which introduces high latency and excessive memory consumption. Due to this reason, it is challenging to deploy streaming inference of MLLMs on edge devices, which largely constrains the power and usage of MLLMs in real-world applications. In this paper, we introduce Inf-MLLM, an efficient inference framework for MLLMs, which enable streaming inference of MLLM on a single GPU with infinite context. Inf-MLLM is based on our key observation of the attention pattern in both LLMs and MLLMs called "attention saddles". Thanks to the newly discovered attention pattern, Inf-MLLM maintains a size-constrained KV cache by dynamically caching recent tokens and relevant tokens. Furthermore, Inf-MLLM proposes attention bias, a novel approach to enable MLLMs to capture long-term dependency. We show that Inf-MLLM enables multiple LLMs and MLLMs to achieve stable performance over 4M-token long texts and multi-round conversations with 1-hour-long videos on a single GPU. In addition, Inf-MLLM exhibits superior streaming reasoning quality than existing methods such as StreamingLLM and 2x speedup than H2O.
StreamingBench: Assessing the Gap for MLLMs to Achieve Streaming Video Understanding
Tsinghua University(清华大学);Institute for AI Industry Research (AIR), Tsinghua University(清华大学人工智能产业研究院);Beijing University of Posts and Telecommunications(北京邮电大学)
Memory-Augmented Multimodal Large Language Models for Small Object Understanding in Streaming Aerial Videos
The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));University of Freiburg(弗莱堡大学);Hangzhou City University(杭州城市大学);XGRIDS(XGRIDS公司);Fudan University(复旦大学);Hong Kong Baptist University(香港浸会大学)
Scaling the Long Video Understanding of Multimodal Large Language Models via Visual Memory Mechanism
Key Laboratory of Multimedia Trusted Perception and Efficient Computing, Ministry of Education of China, Xiamen University(厦门大学多媒体可信感知与高效计算教育部重点实验室);National University of Defense Technology(国防科技大学)
Watch, Remember, Reason: Human-View Video Understanding with MLLMs
School of Intelligence Science and Technology, Peking University(北京理工大学智能科学与技术学院);Wuhan University(武汉大学);Shanghai Jiao Tong University(上海交通大学);Nanyang Technological University(南洋理工大学);CASIA(中国科学院自动化研究所);University of Tokyo(东京大学);University of Liverpool(利物浦大学);Zhejiang University(浙江大学);National University of Singapore(新加坡国立大学);UC Merced(加州大学默塞德分校)
PROSPECT: Unified Streaming Vision-Language Navigation via Semantic--Spatial Fusion and Latent Predictive Representation
Shanghai Jiao Tong University(上海交通大学);Tsinghua University(清华大学);University of Adelaide(阿德莱德大学);Wuhan University(武汉大学);Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Beijing Jiaotong University(北京交通大学);AIR Wuxi Innovation Center, Tsinghua University(清华大学无锡创新中心);Lenovo(联想集团)
FreshMem: Brain-Inspired Frequency-Space Hybrid Memory for Streaming Video Understanding
College of Future Information Technology, Fudan University, Shanghai, China(复旦大学未来信息科技学院);Shanghai Innovation Institute, Shanghai, China(上海创新研究院);Shanghai Artificial Intelligence Laboratory, Shanghai, China(上海人工智能实验室);The Chinese University of Hong Kong, Hong Kong, China(香港中文大学)
OASIS: On-Demand Hierarchical Event Memory for Streaming Video Reasoning
Sun Yat-sen University(中山大学);OPPO AI Center(OPPO人工智能中心);Shenzhen Loop Area Institute(深圳河套学院);Guangdong Key Laboratory of Big Data Analysis and Processing(广东大数据分析与处理重点实验室)
Free-MoRef: Instantly Multiplexing Context Perception Capabilities of Video-MLLMs within Single Inference
Sun Yat-sen University(中山大学);Peng Cheng Laboratory(鹏城实验室);OPPO AI Center(OPPO人工智能中心);Research Institute(研究 institute);The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳));Harbin Institute of Technology(哈尔滨工业大学);Shenzhen Key Laboratory of Digital Living Network and Content Service(深圳数字生活网络与内容服务重点实验室);Guangdong Key Laboratory of Big Data Analysis and Processing(广东省大数据分析与处理重点实验室)
Multimodal Information Fusion for Chart Understanding: A Survey of MLLMs -- Evolution, Limitations, and Cognitive Enhancement
College of Computer Science, Sichuan University(四川大学计算机科学学院);Engineering Research Center of Machine Learning(机器学习工程研究中心);China Telecom Institute of AI(中国电信人工智能研究院)
The Wolf Within: Covert Injection of Malice into MLLM Societies via an MLLM Operative
Arizona State University(亚利桑那州立大学);Michigan State University(密歇根州立大学);University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校);MIT(麻省理工学院);Harvard University(哈佛大学)
Adaptive Global and Fine-Grained Perceptual Fusion for MLLM Embeddings Compatible with Hard Negative Amplification
State Key Lab of General AI, School of Intelligence Science and Technology, Peking University(人工智能国家重点实验室,智能科学与技术学院,北京大学);Institute for Artificial Intelligence, Peking University(人工智能研究院,北京大学)