Skip to main content
QUICK REVIEW

[Paper Review] Language Quantized AutoEncoders: Towards Unsupervised Text-Image Alignment

Hao Líu, Wilson Yan|arXiv (Cornell University)|Feb 2, 2023
Multimodal Machine Learning ApplicationsComputer Science5 citations
TL;DR

This paper proposes Language Quantized AutoEncoders (LQAE), a method that aligns images to text tokens using a pretrained BERT codebook without requiring paired text-image data. By encoding images into discrete text tokens via vector quantization and reconstructing them through a BERT-based denoising autoencoder, LQAE enables few-shot image classification using large language models like GPT-3 with performance competitive to models trained on millions of aligned pairs.

ABSTRACT

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.

Motivation & Objective

  • To address the limitation of large language models in perceiving visual data by enabling vision-language alignment without paired training data.
  • To explore whether unaligned images can be mapped to meaningful text representations using only a pretrained language model's codebook.
  • To enable few-shot image classification by leveraging the in-context learning ability of large language models via learned text encodings of images.
  • To demonstrate that image reconstruction through a denoising autoencoder with BERT can implicitly align visual and textual modalities.

Proposed method

  • Image features are extracted using a vision encoder and split into 16×16 patches, producing 256 embeddings per image.
  • Each image embedding is vector-quantized to the nearest neighbor in a pretrained RoBERTa word embedding codebook, producing a sequence of discrete text tokens.
  • A BERT model is applied to the sequence of text tokens with random masking, and the model is trained to reconstruct the original image from the unmasked tokens.
  • The autoencoder is trained end-to-end to minimize image reconstruction loss, encouraging similar images to map to similar text token sequences.
  • The learned text token sequences are used for downstream tasks such as linear probing or few-shot prompting with GPT-3.
  • The method generalizes to other modalities by replacing the BERT component with any pretrained denoising model in the target modality.

Experimental results

Research questions

  • RQ1Can images be effectively aligned with text representations without using paired image-text data?
  • RQ2Does training a denoising autoencoder on text tokens derived from image embeddings lead to meaningful visual representation learning?
  • RQ3Can the resulting text token sequences enable few-shot image classification using large language models like GPT-3?
  • RQ4How does the masking ratio during BERT fine-tuning affect downstream performance?
  • RQ5To what extent is the learned alignment robust to data sparsity and model size variations?

Key findings

  • LQAE achieves competitive few-shot image classification accuracy on mini-ImageNet using only a handful of few-shot examples, outperforming trivial baselines and matching performance of models trained on millions of paired examples.
  • The model performs well even with a 50% masking ratio during BERT finetuning, indicating that reconstruction loss alone is sufficient for effective alignment.
  • Using 75% of the LQAE tokens preserves strong performance, suggesting redundancy in the learned code sequences.
  • Larger language models (e.g., 175B GPT-3) consistently outperform smaller ones, and LQAE with a 6.7B model performs competitively with Frozen, which uses a 6B model trained on 3M paired examples.
  • Ablations show that assigning VQ-VAE codes to the RoBERTa codebook leads to poor performance, indicating that the model leverages non-arbitrary linguistic structure in the learned text tokens.
  • The absence of BERT pretraining loss during training has minimal negative impact, confirming that image reconstruction is the primary driver of alignment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.