[论文解读] Language Quantized AutoEncoders: Towards Unsupervised Text-Image Alignment
本文提出语言量化自编码器(LQAE),一种通过使用预训练的 BERT 代码本将图像对齐到文本标记而无需成对图文数据的方法。通过使用向量量化将图像编码为离散文本标记,并利用基于 BERT 的去噪自编码器进行重建,LQAE 实现了使用大型语言模型(如 GPT-3)进行少样本图像分类,性能与在数百万对齐样本上训练的模型相当。
Recent progress in scaling up large language models has shown impressive capabilities in performing few-shot learning across a wide range of text-based tasks. However, a key limitation is that these language models fundamentally lack visual perception - a crucial attribute needed to extend these models to be able to interact with the real world and solve vision tasks, such as in visual-question answering and robotics. Prior works have largely connected image to text through pretraining and/or fine-tuning on curated image-text datasets, which can be a costly and expensive process. In order to resolve this limitation, we propose a simple yet effective approach called Language-Quantized AutoEncoder (LQAE), a modification of VQ-VAE that learns to align text-image data in an unsupervised manner by leveraging pretrained language models (e.g., BERT, RoBERTa). Our main idea is to encode image as sequences of text tokens by directly quantizing image embeddings using a pretrained language codebook. We then apply random masking followed by a BERT model, and have the decoder reconstruct the original image from BERT predicted text token embeddings. By doing so, LQAE learns to represent similar images with similar clusters of text tokens, thereby aligning these two modalities without the use of aligned text-image pairs. This enables few-shot image classification with large language models (e.g., GPT-3) as well as linear classification of images based on BERT text features. To the best of our knowledge, our work is the first work that uses unaligned images for multimodal tasks by leveraging the power of pretrained language models.
研究动机与目标
- 为解决大型语言模型在感知视觉数据方面的局限性,通过无需成对训练数据的方式实现视觉-语言对齐。
- 探索仅使用预训练语言模型的代码本,能否将未对齐的图像映射到有意义的文本表征。
- 通过学习图像的文本编码,利用大型语言模型的上下文学习能力,实现少样本图像分类。
- 证明通过 BERT 进行去噪自编码的图像重建,可隐式实现视觉与文本模态的对齐。
提出的方法
- 使用视觉编码器提取图像特征,并将图像划分为 16×16 的补丁,每张图像生成 256 个嵌入。
- 每个图像嵌入通过向量量化映射到预训练 RoBERTa 词嵌入代码本中最近邻的离散文本标记,生成一个离散文本标记序列。
- 将 BERT 模型应用于文本标记序列,并随机掩码部分标记,模型被训练为从未掩码的标记中重建原始图像。
- 自编码器通过端到端训练最小化图像重建损失,促使相似图像映射到相似的文本标记序列。
- 学习到的文本标记序列用于下游任务,如线性探测或使用 GPT-3 进行少样本提示。
- 通过将 BERT 组件替换为目标模态的任意预训练去噪模型,该方法可推广至其他模态。
实验结果
研究问题
- RQ1在不使用成对图文数据的情况下,能否有效实现图像与文本表征的对齐?
- RQ2在从图像嵌入中提取的文本标记上训练去噪自编码器,是否能实现有意义的视觉表征学习?
- RQ3由此产生的文本标记序列能否支持使用 GPT-3 等大型语言模型实现少样本图像分类?
- RQ4在 BERT 微调过程中,掩码比例如何影响下游性能?
- RQ5所学对齐在数据稀疏性和模型规模变化下具有多大程度的鲁棒性?
主要发现
- LQAE 仅使用少量少样本示例,在 mini-ImageNet 上实现了具有竞争力的少样本图像分类准确率,优于基线方法,并与在数百万对齐样本上训练的模型性能相当。
- 即使在 BERT 微调过程中使用 50% 的掩码比例,模型性能依然出色,表明仅靠重建损失即可实现有效对齐。
- 保留 75% 的 LQAE 标记即可维持强性能,表明学习到的代码序列中存在冗余。
- 更大的语言模型(如 175B 参数的 GPT-3)始终优于较小模型,且使用 6.7B 参数模型的 LQAE 性能可与使用 6B 参数模型并在 300 万对齐样本上训练的 Frozen 模型相媲美。
- 消融实验证明,将 VQ-VAE 代码分配给 RoBERTa 代码本会导致性能下降,表明模型利用了学习到的文本标记中非任意的语言结构。
- 训练期间缺少 BERT 预训练损失对性能影响极小,证实图像重建是实现对齐的主要驱动力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。