← Back to Multimodal Mind Map
👁️ MultimodalID: clip-architecture

CLIP Two-Tower Architecture

CLIP 双塔架构
🎯Core Definition
CLIP (Contrastive Language-Image Pretraining) is OpenAI's contrastive multimodal model with a two-tower design: an image encoder (ViT such as ViT-B/32, or ResNet) and a text encoder (Transformer), jointly trained on 400M image-text pairs (WIT) to embed images and texts into a shared contrastive space — pulling matched pairs (positives) closer in cosine similarity while pushing other in-batch samples (negatives) apart, with the InfoNCE loss computed symmetrically in both image→text and text→image directions.
💡Use Cases
zero-shot image classification (76.2% top-1 on ImageNet with no fine-tuning), image-text retrieval, the text-conditioning encoder of text-to-image models (Stable Diffusion reuses CLIP's text tower), and the visual-tower backbone of many VLMs.
⚡Key Problems Solved
classic classifiers require a fixed, hand-labeled label set and retraining for every new class; CLIP turns categories from a finite set into an open language space — at inference you fill candidate labels into prompt templates (“a photo of a {label}”), encode them as text features, and pick the class with the highest similarity to the image feature, enabling zero-shot transfer to arbitrary new datasets from a single pretraining.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of CLIP Two-Tower Architecture.
Use Cases
In production engineering, what are the primary use cases for CLIP Two-Tower Architecture and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Which encoders do CLIP's two towers use, and how do both towers share one contrastive space?
2
CLIP vs VLM: CLIP only aligns embeddings, why can't it directly chat?
3
The full zero-shot classification pipeline of CLIP? Role of the prompt template (“a photo of a {label}”)?
4
Why does CLIP use a symmetric loss (image→text + text→image)? What would one-directional training lose?
5
CLIP's role in Stable Diffusion: which tower is used, frozen or trainable?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "CLIP Two-Tower Architecture"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
Next Card →InfoNCE Contrastive Loss

🔗 More Multimodal Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/Multimodal/card/clip-architecture
中文速览与面试要点

CLIP 双塔架构 (CLIP Two-Tower Architecture)

定义: CLIP (Contrastive Language-Image Pretraining) 是 OpenAI 的多模态对比预训练模型, 采用「图像塔 + 文本塔」双塔结构: 图像塔用 ViT (如 ViT-B/32) 或 ResNet, 文本塔用 Transformer, 在 4 亿图文对 (WIT) 上联合训练, 把图像与文本编码进同一个对比空间——训练时拉近同对图文 (正对) 的余弦相似度、推远 batch 内其他样本 (负对), 对称地计算图像→文本与文本→图像两个方向的 InfoNCE 损失。 使用场景: 零样本图像分类 (ImageNet 76.2% top-1, 无需微调)、图文检索、文生图的条件编码器 (Stable Diffusion 复用 CLIP 文本塔)、以及各种 VLM 的视觉塔底座。 解决的问题: 传统分类器需要固定的标注类别集合, 新类别必须重训模型; CLIP 把类别从「有限集合」变成「无限语言空间」——推理时把候选类别填入 prompt 模板 (“a photo of a label”) 编码成文本特征, 与图像特征算相似度取最高者, 从而零样本迁移到任意新数据集, 一次预训练覆盖检索/分类/排序多个下游。

核心要点

  • CLIP 双塔分别用什么编码器?两个 tower 如何共享同一个对比空间?
  • CLIP 和 VLM 的区别?CLIP 只会做嵌入对齐, 为什么不能直接对话?
  • CLIP 零样本分类的完整流程?prompt 模板 (“a photo of a label”) 的作用?
  • 为什么 CLIP 用对称损失 (图→文 + 文→图双向)?只算单向会怎样?
  • CLIP 在 Stable Diffusion 里扮演什么角色?用的是哪一塔、冻结还是可训练?