탄력적 캐시를 활용한 비전 명령어 수행 모델의 효율적 추론
Efficient Inference of Vision Instruction-Following Models with Elastic Cache
July 25, 2024
저자: Zuyan Liu, Benlin Liu, Jiahui Wang, Yuhao Dong, Guangyi Chen, Yongming Rao, Ranjay Krishna, Jiwen Lu
cs.AI
초록
명령어 수행 대형 시각-언어 모델(LVLMs) 분야에서, 이러한 모델의 효율적인 배포는 특히 키-값(KV) 캐시의 높은 메모리 요구로 인해 어려움에 직면해 있습니다. 기존의 LLM 캐시 관리 전략은 캐시 제거에 초점을 맞추고 있어, 다중모달 명령어 수행 모델의 특수한 요구를 충족시키지 못하는 경우가 많습니다. 이러한 격차를 인식하여, 본 논문에서는 명령어 인코딩과 출력 생성 단계에 각기 다른 가속 방법을 적용함으로써 이점을 얻는 새로운 접근 방식인 Elastic Cache를 소개합니다. 우리는 다양한 단계에서의 중요도 지표를 조사하고, 중요도 기반 캐시 병합 전략을 제안하여 중복 캐시를 정리합니다. 중요도가 낮은 캐시를 단순히 버리는 대신, 우리의 전략은 중요한 키/값 벡터를 앵커 포인트로 식별합니다. 그런 다음 중요도가 낮은 주변 캐시를 이러한 앵커와 병합함으로써 KV 캐시의 문맥 정보 보존을 강화하면서도 임의의 가속 비율을 달성합니다. 명령어 인코딩의 경우, 캐시의 중요도를 평가하기 위해 빈도를 활용합니다. 출력 생성에 관해서는, 오프셋과의 거리를 기준으로 토큰의 우선순위를 정하여 초기 토큰과 가장 최근 토큰을 모두 보존합니다. 다양한 LVLM에 대한 실험 결과, Elastic Cache는 효율성을 향상시킬 뿐만 아니라 다양한 작업에서 기존의 정리 방법을 뛰어넘는 언어 생성 성능을 보여줍니다. 코드는 https://github.com/liuzuyan/ElasticCache에서 확인할 수 있습니다.
English
In the field of instruction-following large vision-language models (LVLMs),
the efficient deployment of these models faces challenges, notably due to the
high memory demands of their key-value (KV) caches. Conventional cache
management strategies for LLMs focus on cache eviction, which often fails to
address the specific needs of multimodal instruction-following models.
Recognizing this gap, in this paper, we introduce Elastic Cache, a novel
approach that benefits from applying distinct acceleration methods for
instruction encoding and output generation stages. We investigate the metrics
of importance in different stages and propose an importance-driven cache
merging strategy to prune redundancy caches. Instead of discarding less
important caches, our strategy identifies important key/value vectors as anchor
points. Surrounding less important caches are then merged with these anchors,
enhancing the preservation of contextual information in the KV caches while
yielding an arbitrary acceleration ratio. For instruction encoding, we utilize
the frequency to evaluate the importance of caches. Regarding output
generation, we prioritize tokens based on their distance with an offset, by
which both the initial and most recent tokens are retained. Results on a range
of LVLMs demonstrate that Elastic Cache not only boosts efficiency but also
notably outperforms existing pruning methods in language generation across
various tasks. Code is available at https://github.com/liuzuyan/ElasticCacheSummary
AI-Generated Summary