LLaVa - Visual Instruction Tuning: 수정중

2025. 10. 5. 02:01·Paper

Key Point

  • Flamingo나 BLIP2 에 비해서 어떤 더 좋은 instruction을 만들고자 했는지 알아야 한다.
  • 이 visual Instruction tuning 방법의 동기, 이전 연구와 비교했을 때 어떤 방법으로 처리한 것인지, 어떤 효과가 있는지
  • 왜 이 구조를 사용했는지, 모델을 선택했는지 유의하면서 읽어볼 것

 

Summary

  • 기존의 instruction tuning → visual instruction tuning을 제안
  • Multimodal (language-image) instruction-following data using GPT-4
  • LLaVA(Larage Language and Vision Assistant)
  • CLIP(vision encoder) + Projection Layer(차원 연결) + VIcuna(LLM; Decoder-only) + visual instruction-tuning data로 visual instruction tuning
  • LLaVA-Bench
  • LLaVA + GPT-4와의 앙상블 → Science QA 멀티모달 추론 데이터셋으로 SOTA 달성

Abstract

  • machine-generated instruction-following data를 사용한 LLM Instruction tuning은 새로운 과제에 대한 zero shot capabilites를 향상시키는 것으로 입증
  • → 근데 multimodal field에서는 연구가 덜 되었다.
  • GPT4를 이용해서 Multimodal (language-image) instruction-following data를 만들었다.
  • LLaVA: Large Language and Vision Assistant→ end-to-end trained large multimodal model (구조는 2개인데, 학습 방식은 하나로 통합된..!)
  • → Vision encoder와 LLM!
  • → 위와 같은 방식으로 생성된 데이터로 instruction tuning을 한 model
  • 실험을 위해 2개의 evaluation benchmarks를 구성→ GPT-4와 유사한 성능
  • → 실험 결과, LLaVA는 multimodal 채팅 능력에서 뛰어난 성능

Introduction

  • 최근 language-agumented foundation vision models 개발에 대한 관심이 급격히 증가
    1. Language는 오직 image content를 설명하는 용도로 사용(단순)
  • → 그러나 대부분 1) 각 task마다 one single large vision model을 사용(별도 모델 사용)
  • 한편 LLM은 Instruction을 잘 따르지만(resoning이 가능) text 전용 작업에 한정

✅ instruction tuning을 language-image multimodal space로 확장한 visual instruction-tuning을 제안

(a) Multimodal instruction-following data → Key point

  • vision-language instruction-following data의 부족을 해결
  • chatGPT/GPT4를 사용하여 기존의 image-text pair를 instruction-following format으로 변환하는 pipeline 설계

(b) Large multimodal models

  • CLIP: open-set visual encoder (이미지 인코딩)
  • Vicuna: LLaMa 기반의 open-source LLM(텍스트 생성)
  • 이 둘을 연결해서 생성한 instuction vision-language data로 end-to-end로 fine-tuning(학습)

(c) Multimodal instruction-following benchmark

  • 우리가 benchmark 만들었다~

(d) Open-source

Related work

  1. Multimodal Instruction-following Agents
  • Computer Vision 분야에서 instruction-following agent 만드는 방법을 크게 2개의 class로 분류

(a) End-to-End trained model

→ 특정 specific research topic별로 개별적으로 탐구됨

→ EX)

vision-language navigation task & Habitat (자연어 지시 → 움직임)은

AI agent가 visual enviornment에서 목표를 달성하기 위해, natural language instructions에 따라 일련의 행동을 취하도록 요구하도록 학습

Image editing domain (e.g InstructPix2Pix)는

given input image와 written instruction을 받아서 image 수정되도록 학습

(b) A system that coordinates various model

→ LangChain이나 LLM을 이용하여 위와 같이 각각의 topic을 가지고 학습된 모델을 조정해서 하나의 작업으로 수행하게 만드는 시스템을 연구

EX) Visual ChatGPT, X-GPT, MM-REACT, VisProg, and ViperGPT

✅ 기존 연구는 모두 instruction-following agent를 구축한다는 같은 목표를 가지지만, 해당 논문은 여러 작업을 처리할 수 있는 end-to-end 학습 방식의 multi-modal model을 개발하는데 초점

→ 여러 task를 처리하기 위해서는 instruction tuning이 필요!

  1. Instruction tuning
  • Natural Language processing에서 LLM이 natural language instructions을 따르고 real-word task를 수행할 수 있도록 LLM instruction-tuning에 대한 method가 연구가 활발→ 이는 LLM의 zero and few shot generalization abilities를 효과적으로 향상
  • → EX) InstructGPT, ChatGPT, FLAN-T5, FLAN-PaLM, OPT-IML 같은 튜닝된 모델들이 등장
  • NLP에서 CV쪽으로 아이디어 차용→ image classification과 같은 다른 Vision 연구 주제로 쓰임
  • → foundation model을 이용한 teacher-student distillation idea
  • Multimodal 모델의 등장: multimodal domain에서 GPT-3 급의 전환점.→ BLIP-2, FROMAGe, KOSMOS-1, PaLM-E 같은 모델들은 image-text pair로 학습된 멀티모달 모델들: 오픈소스 LLM LLaMA를 기반으로, OpenFlamingo, LLaMA-Adapter는 LLaMA가 multimodal LLM으로서 image 입력 기능이 추가되도록 시도된 사례!
  • → LLaMA도 multimodal LLM으로서 시도
  • : zero-shot task와 in-context-learning에서 강한 performance를 보였기 때문!
  • → Flamingo
  • Problem→ multimodal task들에서의 성능은 여전히 language-only task와 비교했을 때 떨어짐…<aside> 💡
    • 일반 instruction tuning: (지시, 응답) 쌍만 있음
    • 비전-언어 튜닝: (이미지, 지시, 응답) 삼중 구조 필요→ 모델은 지시를 받아도 어떻게 이미지 정보를 활용할지를 모름
    • → 이걸 제대로 학습하지 않으면
    </aside>
  • (Multi Modal에서도 resoning이 가능하지만!! text only 보다는 부족! )
  • → 위의 모델들은 task transfer generalization performance(다양한 task 처리 가능)에서는 뛰어나지만 vision-language instruction data로 명시적으로 튜닝되지 않았다…

✅ 이 GAP을 줄이자!!!

즉 Multi Modal을 잘 처리하지만, 이걸 지시하는 tuning에 대해서는 잘 학습되어 있지 않다..

  • QuestionA. Instruction tuning이 없어서, 단순히 image 설명 수준에서만 잘한다.일종의reasoning(추론) 능력을 키우는 과정
  • A. 여기서 Instruction은 instruction을 해석하고 → 그에 맞는 작업을 판단(의도 파악) → 수행
  • Q. MultiModal 처리는 잘하면서 왜 instruction은 못 해?

참고) visual instruction tuning은 visual prompt tuning과는 다르다.

→ Visual instruction tuning:

: 모델이 자연어 지시를 따를 수 있도록 능력을 향상시키는 학습 방식

→ Visual prompt tuning:

: 모델 전체를 튜닝하지 않고, 작은 파라미터만 조정해 효율적으로 적응시키는 방식(parameter-efficient tuning in model adaptation)

 

GPT-assisted Visual instruction Data Generation

  1. Instruction-following Data Example
    • top-block : GPT에게 instruction을 생성하도록 주어지는 정보들
      • captions, boxes
    • bottom-block: GPT가 생성한 3가지의 response
    • image는 prompt로 사용하지 않고 오직 caption과 box 정보만 보고 응답 생성
  1. 왜 ChatGPT/GPT4를 multimodal instruction-following data collection으로 사용?
  • 기존의 multimodal data(image-text pairs)는 양이 충분.
  • 그러나 multimodal instruction following data는 사용할 수 있는 양이 제한
  • → WHY? 사람이 직접 만들기엔 time-consuming과 less well-defined (기준 모호)문제

✅ 기존의 image-pair data를 바탕으로 GPT 사용

  1. Method
  • 1차 입력 : Promptimage content를 설명하도록 assistant에게 지시하기 위한 question 집합 $X_q$를 생성해라!
  • image $X_v$ , image에 대한 caption $X_c$이 있을 때,
  • 1차 결과 : image-text pair → instruction-following version Method
  • 즉 Xq와 Xq로 질문이 주어지면 Xc를 응답하도록 mapping

→ 한계) instruction과 response에서 다양성 부족, 깊은 resoning 부족

→ 개선 방법) GPT-4/ChatGPT를 strong teacher로 사용하여 visual content를 포함하도록 생성

  • 2차 Prompt 내용
    1. 2가지 representaion (image encoding 하기 위함)
    다음과 같은 symbolic이 존재하며, LLM-recognizable sequence로서 이미지를 encode하게 만든다.
    • Captions
    • 다양한 관점에서 장면을 설명
    • Bounding Box(객체 이름, 위치)로 구성
    • 장면에서 객체의 위치를 설명하기 위함
    1. 3가지 type의 instruction-following data각 유형에 대해서 먼저 몇 가지 예시들을 설계함
      • Conversation질문 내용은 이미지의 visual content에 대한 것
      • object types, objects 개수, object actions, object locations, object간의 상대적 위치)
      • image에 대해서 assistant와 질문하는 사람 사이의 대화
      • Detailed description각 이미지에 대해서, 질문 리스트 중 sample 하나를 GPT4한테 물어본 것
      • image에 관한 풍부하고 정교한 설명을 포함하기 위해, 의도가 담긴 질문 리스트를 만들었음.
      • Complex reasoning답변에는 일반적으로 엄격한 논리를 따르는 단계별 추론 프로세스가 필요함.
      • 위의 2가지 type의 질문들은 visual content에 집중한다, 이를 기반으로 in-depth resoning questions을 생성
      총 158K의 unique한 language-image instuction-following sample을 수집
      • 59K : conversations,
      • 23K : detail한 description
      • 77K : complex resoning
      이는 모두 spatial resoning같은 higher quality instuction-following data를 제공
    2. in-context-learning의 시드 예제로 사용
    3. COCO images를 사용

Visual Instruction Tuning

  1. Architecture
    • goal
    • pre-trained LLM과 visual model의 성능을 효과적으로 활용하는 것
    • component
      • Language Model
      • → Vicuna, 공식적으로 사용 가능한 checkpoint에서 언어 task에서 최고의 instrunction following 능력을 가짐
      • Visual Encoder→ visual feature $Z_v = g(X_v)$ 를 제공
      • → pre-trained CLIP visual encoder ViT-L/14
      1. Training

이미지에서 feature alignment를 얻기 위한 사전 학습

      • step 1 : Pre-training for Feature Alignment여기서 $W$는 Connector의 역할을 함.
      • projection matrix $W$를 학습시킴
      • step 2 : Fine-tuning End-to-End

제안된 질의응답 데이터로 재학습

    •  

GPT를 활용해 얻은 instructino-following dataset

      • Vlm

LM ← vision feture와 text feature를 함께

    •  

이때 projection matrix를 통해서 이미지 embedding vector를 얻는다.

    •  

VIsion에서는 Resoning이 떨어짐….

  •  

'Paper' 카테고리의 다른 글

What are the limitations of current Vision-Language Models?  (0) 2025.10.05
Qwen2.5-VL Technical Report [수정중]  (0) 2025.10.05
'Paper' 카테고리의 다른 글
  • What are the limitations of current Vision-Language Models?
  • Qwen2.5-VL Technical Report [수정중]
GoGoDDubi
GoGoDDubi
  • GoGoDDubi
    LetsGoDDubi
    GoGoDDubi
  • 전체
    오늘
    어제
    • 분류 전체보기 (12)
      • AI & ML (6)
        • LLM (6)
        • Vision (0)
      • Data (0)
      • Paper (3)
      • DevOps (3)
        • MLOps (0)
        • Airflow (3)
      • Infra (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    vlm
    Airflow
    mlops
    AI/ML
    DevOps
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
GoGoDDubi
LLaVa - Visual Instruction Tuning: 수정중
상단으로

티스토리툴바