YoojLee / paper_review

paper review archive
6 stars 2 forks source link

BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models (2023) #71

Open YoojLee opened 5 months ago

YoojLee commented 5 months ago
image

Summary

기존의 VLP는 from scratch로 학습을 시켰지만, 이는 pre-training cost가 너무 크며 기존에 잘 학습되었던 모델 (특히, LLM)에 대한 활용이 어려움. 따라서, frozen vision encoder와 frozen llm을 Q-Former (Querying Transformer)를 통해 잘 이어보는 방식으로 VLP를 수행하자고 제안함. 각 modality model은 직접 학습시키지 않고 연결하는 부분만 학습시키기 때문에 훨씬 compute-efficient (배치 사이즈도 더 키울 수 있음)함. 다양한 vision-language task에서 높은 성능을 보여주고, natural language instruction을 따르는 zero-shot image-text generation도 잘함.

Method Highlights

실제로 pre-training은 2가지 stage로 구성. 첫째는 vision-language representation learning 부분이고 둘째는 vision-to-language generation 부분.

Q-Former는 image transformer와 text transformer로 구성되어 있음. 이 두 가지의 transformer는 self-attention block을 share함. 또한, text transformer 같은 경우에는 cross-attention 모듈은 없음.

BLIP1과의 차이점 blip1 같은 경우에는 self-attention을 제외한 부분을 weight share. blip1에서는 text encoder와 decoder를 모두 학습시키기 때문에, self-attention까지 공유하게 되면 encoder, decoder 간 task gap때문에 오히려 학습에 혼란을 가중할 수 있기 때문으로 보임.

vision-language representation learning

image

vision-to-language generation

image

Q-Former가 어느 정도 text와 연관된 visual representation을 뽑을 수 있도록 학습한 후, 이를 projection해주어서 frozen LLM에 input으로 넣어주고 LM loss로 학습하는 과정. 이를 통해 Q-Former output을 LLM-interpretable한 형태로 만들어주는 것. 이때 두 가지 타입의 LLM을 활용할 수 있는데 하나는 decoder-based LLM, 나머지 하나는 encoder-decoder-based LLM임.

전자의 경우에는 Q-Former output만 LLM에 feed되고 (as soft visual prompt), 이미지에 대한 캡션 전체를 target sequence로 삼아 LM loss로 학습. 후자는 이미지에 대한 caption 중 하나만 prefix text로 visual representation과 concat되어 함께 LLM에 feed되고 나머지 문장 (suffix text)을 target sequence로 맞히는 형태로 Q-Former와 projection을 학습하게 됨.

pre-training

COCO, Visual Genome, SBU, CC-3M/12M에 추가로 LAION의 115M 이미지를 활용해서 총 129M의 이미지를 학습에 활용. 아래와 같이 CapFilt 방식을 적용.

image image

image-encoder로는 CLIP (ViT-L/14), EVA-CLIP (ViT-g/14) 두 가지를 활용. 이때, 마지막 레이어는 제거하고 penultimate layer를 활용. LLM으로는 OPT (decoder-only), Flan-T5 (encoder-decoder) 활용.

image

Experiment Highlights

table1

table2

table3

figure5

table4

table5

table6

YoojLee commented 4 months ago

fine-tuning 시 모델 하이퍼 파라미터에 대한 정보

image