Skip to content

Transformer: Attention is all you need ViT: 16 * 16 image DeiT, Swin Transformer, MAE, DINO, DINOv2, SAM, CLIP, BLIP-2, Flamingo, LLaVA

ViT becomes the foundation of Multimodal. image -> tokens and then let transformer process it. Everything is tokens.


Linear: nn.Linear(1024, 4096) 1024d vision feature -> 4096d LLM embedding vision feature, LLM embedding

essence: transform the coordinate


MLP: Multi-Layer Perception multi-layer + non-linear activate

MLP(x)=W2σ(W1x+b1)+b2 Linear, GELU, Linear

Combination of Linear is still Linear, doesn't add the ability of expression for example: W2(W1x)=Wx

Why MLP > Linear: MLP introduces activation (ReLU, GELU, SiLU) adds the non-linear so MLP can fit complex function

In multimodal, MLP learns vision semantics to language semantics

many projector: ViT -> MLP -> LLM


Projector = the module that project vision feature to language space Linear, MLP, Transformer, Q-Former


Q-Former comes from BLIP-2 means Querying Transformer

Q-Former = actively extract information and cross-modal interaction

模块能力非线性Attention信息选择压缩能力
Linear
MLP
Q-Former

数学:

Attention(Qquery,Kvision,Vvision)

即:

  • Query:
    learnable tokens
  • K/V:
    visual features

和 normal self-attention:

Q=K=V

different

Learnable queries

trending:

Perceiver
Cross attention
Q-Former
Resampler