하이레드: 자원 제약 환경에서 고효율 비전-언어 모델 추론을 위한 주의 안내 토큰 삭제
HiRED: Attention-Guided Token Dropping for Efficient Inference of High-Resolution Vision-Language Models in Resource-Constrained Environments
August 20, 2024
저자: Kazi Hasan Ibn Arif, JinYi Yoon, Dimitrios S. Nikolopoulos, Hans Vandierendonck, Deepu John, Bo Ji
cs.AI
초록
고해상도 비전-언어 모델(VLMs)은 세부 이미지 정보를 보존하여 정확도를 향상시키기 위해 다중 모달 작업에서 널리 사용되었습니다. 그러나 이러한 모델은 입력 이미지의 여러 파티션을 인코딩하기 때문에 과도한 시각 토큰을 생성하는 경우가 많습니다. 이러한 과도한 시각 토큰을 처리하는 것은 자원 제약이 있는 환경에서 특히 계산적으로 어려운 과제입니다. 자원 제약을 준수하면서 고해상도 이미지를 지원하기 위해 우리는 고해상도 조기 삭제(HiRED)라는 토큰 삭제 방식을 제안합니다. 이 방식은 대형 언어 모델(LLM) 단계 이전에 고정된 토큰 예산 내에서 작동합니다. HiRED는 기존의 고해상도 VLMs와 통합할 수 있으며 추가 교육이 필요하지 않으면서도 우수한 정확도를 유지합니다. 우리는 초기 레이어에서 비전 인코더의 주의를 전략적으로 활용하여 각 이미지 파티션의 시각적 내용을 평가하고 토큰 예산을 할당합니다. 그런 다음, 최종 레이어의 주의를 사용하여 할당된 예산 내에서 각 파티션에서 가장 중요한 시각 토큰을 선택하고 나머지를 삭제합니다. 경험적으로, NVIDIA TESLA P40 GPU에서 LLaVA-Next-7B에 적용한 경우, 20%의 토큰 예산을 사용하는 HiRED는 토큰 생성 처리량을 4.7배 증가시키고, 첫 번째 토큰 생성 지연 시간을 15초 단축시키며, 단일 추론에 대해 2.3GB의 GPU 메모리를 절약합니다.
English
High-resolution Vision-Language Models (VLMs) have been widely used in
multimodal tasks to enhance accuracy by preserving detailed image information.
However, these models often generate excessive visual tokens due to encoding
multiple partitions of the input image. Processing these excessive visual
tokens is computationally challenging, especially in resource-constrained
environments with commodity GPUs. To support high-resolution images while
meeting resource constraints, we propose High-Resolution Early Dropping
(HiRED), a token-dropping scheme that operates within a fixed token budget
before the Large Language Model (LLM) stage. HiRED can be integrated with
existing high-resolution VLMs in a plug-and-play manner, as it requires no
additional training while still maintaining superior accuracy. We strategically
use the vision encoder's attention in the initial layers to assess the visual
content of each image partition and allocate the token budget accordingly.
Then, using the attention in the final layer, we select the most important
visual tokens from each partition within the allocated budget, dropping the
rest. Empirically, when applied to LLaVA-Next-7B on NVIDIA TESLA P40 GPU, HiRED
with a 20% token budget increases token generation throughput by 4.7, reduces
first-token generation latency by 15 seconds, and saves 2.3 GB of GPU memory
for a single inference.Summary
AI-Generated Summary