让视觉语言模型推理快2.9倍,通过动态压缩视觉信息和在线训练草案模型。
SpecVLM: Fast Speculative Decoding in Vision-Language Models
- 用动态视觉压缩器按需选择降采样、卷积等策略,平衡算力与精度。
- 在LLaVA和MMMU上实现2.5~2.9倍端到端加速,且输出无损。
- 无需离线数据集,通过在线日志蒸馏训练草案模型,节省存储与预处理。
推测性解码可显著加速自回归大语言模型,但直接应用于视觉语言模型(VLMs)面临独特系统挑战:预填充阶段的视觉令牌数量随图像分辨率和视频长度增长,导致计算与内存(尤其是键值缓存)开销激增。本文研究VLMs的推测性解码,提出SpecVLM系统:(1) 构建EAGLE-2风格基线EagleVLM,实现1.5~2.3倍端到端加速;(2) 引入弹性视觉压缩器,自适应选择剪枝、池化、卷积或重采样算子,在每输入下权衡FLOPs/参数与精度。为避免昂贵的离线蒸馏数据集,提出在线日志蒸馏协议,利用实时教师日志与倒数第二层特征,结合交叉熵与Smooth L1损失训练草案模型,省去存储与预处理,且计算高效。该协议揭示训练时缩放效应:更长的在线训练单调提升草案模型平均接受长度,提高推测效率。实验证明,SpecVLM在5个训练周期内于LLaVA和MMMU上实现2.5~2.9倍加速,覆盖不同分辨率与任务难度,且保持目标模型输出分布一致(无损解码)。代码已开源。
原文摘要 · Abstract (English)
Speculative decoding is a powerful way to accelerate autoregressive large language models (LLMs), but directly porting it to vision-language models (VLMs) faces unique systems constraints: the prefill stage is dominated by visual tokens whose count scales with image resolution and video length, inflating both compute and memory, especially the key-value (KV) cache. We study speculative decoding for VLMs and introduce SpecVLM, a practical system that (1) establishes a strong EAGLE-2-style baseline, EagleVLM, delivering 1.5--2.3x end-to-end speedups over full autoregressive inference, and (2) further accelerates VLM inference with an elastic visual compressor that adaptively selects among pruning, pooling, convolution, and resampler primitives to balance FLOPs/parameters and accuracy per input. To avoid costly offline distillation corpora, we propose an online-logit distillation protocol that trains the draft model with on-the-fly teacher logits and penultimate features using a combined cross-entropy and Smooth L1 objective, eliminating storage and preprocessing while remaining compute-efficient. This protocol reveals a training-time scaling effect: longer online training monotonically increases the draft model's average accepted length, improving speculative efficiency. Empirically, SpecVLM achieves additional acceleration, culminating in 2.5--2.9x end-to-end speedups within 5 epochs across LLaVA and MMMU, consistently over resolutions and task difficulties, while preserving the target model's output distribution (lossless decoding). Our code is available at https://github.com/haiduo/SpecVLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。