ChatPaper.aiChatPaper

p-MoD: Построение смеси моделей многоуровневых языковых моделей с помощью прогрессивного уменьшения коэффициента.

p-MoD: Building Mixture-of-Depths MLLMs via Progressive Ratio Decay

December 5, 2024
Авторы: Jun Zhang, Desen Meng, Ji Qi, Zhenpeng Huang, Tao Wu, Limin Wang
cs.AI

Аннотация

Несмотря на выдающуюся производительность мультимодальных крупных языковых моделей (MLLMs) в различных задачах, значительные затраты на обучение и вывод затрудняют их развитие. Большая часть вычислений происходит из-за огромного объема визионных токенов, обрабатываемых декодером трансформера. В данной статье мы предлагаем создать эффективные MLLMs, используя механизм Смеси Глубин (MoD), где каждый слой декодера трансформера выбирает важные визионные токены для обработки, пропуская избыточные. Однако интеграция MoD в MLLMs является нетривиальной. Для решения проблем стабильности обучения и вывода, а также ограниченности обучающих данных, мы адаптируем модуль MoD с двумя новыми дизайнами: тангенсальной нормализацией весов (TanhNorm) и симметричным перевзвешиванием токенов (STRing). Более того, мы замечаем, что визионные токены проявляют более высокую избыточность в более глубоких слоях, и поэтому разрабатываем стратегию прогрессивного уменьшения коэффициента удержания токенов (PRD), которая постепенно уменьшает соотношение удержания токенов слой за слоем, используя сдвинутое косинусное расписание. Этот ключевой дизайн полностью раскрывает потенциал MoD, значительно повышая эффективность и производительность наших моделей. Для проверки эффективности нашего подхода мы проводим обширные эксперименты с двумя базовыми моделями на 14 бенчмарках. Наша модель, p-MoD, соответствует или даже превосходит производительность базовых моделей, используя всего 55.6% TFLOPs и 53.8% кэш-памяти KV во время вывода, и 77.7% часов GPU во время обучения.
English
Despite the remarkable performance of multimodal large language models (MLLMs) across diverse tasks, the substantial training and inference costs impede their advancement. The majority of computation stems from the overwhelming volume of vision tokens processed by the transformer decoder. In this paper, we propose to build efficient MLLMs by leveraging the Mixture-of-Depths (MoD) mechanism, where each transformer decoder layer selects essential vision tokens to process while skipping redundant ones. However, integrating MoD into MLLMs is non-trivial. To address the challenges of training and inference stability as well as limited training data, we adapt the MoD module with two novel designs: tanh-gated weight normalization (TanhNorm) and symmetric token reweighting (STRing). Moreover, we observe that vision tokens exhibit higher redundancy in deeper layer and thus design a progressive ratio decay (PRD) strategy, which gradually reduces the token retention ratio layer by layer, employing a shifted cosine schedule. This crucial design fully unleashes the potential of MoD, significantly boosting the efficiency and performance of our models. To validate the effectiveness of our approach, we conduct extensive experiments with two baseline models across 14 benchmarks. Our model, p-MoD, matches or even surpasses the performance of the baseline models, with only 55.6% TFLOPs and 53.8% KV cache storage during inference, and 77.7% GPU hours during training.

Summary

AI-Generated Summary

PDF72December 6, 2024