[Paper Review] Visually-Augmented Language Modeling
This paper proposes VaLM, a visually-augmented language modeling framework that enhances pre-trained language models with retrieved images to improve visual commonsense reasoning. By using a CLIP-based image retrieval module and a visual knowledge fusion layer for joint text-image attention, VaLM achieves state-of-the-art performance on visual knowledge-intensive tasks, with gains of +14.50%, +17.80%, and +11.68% on MemoryColor, RelativeSize, and ObjectShape, respectively.
Human language is grounded on multimodal knowledge including visual knowledge like colors, sizes, and shapes. However, current large-scale pre-trained language models rely on text-only self-supervised training with massive text data, which precludes them from utilizing relevant visual information when necessary. To address this, we propose a novel pre-training framework, named VaLM, to Visually-augment text tokens with retrieved relevant images for Language Modeling. Specifically, VaLM builds on a novel latent text-image alignment method via an image retrieval module to fetch corresponding images given a textual context. With the visually-augmented context, VaLM uses a visual knowledge fusion layer to enable multimodal grounded language modeling by attending to both text context and visual knowledge in images. We evaluate VaLM on various visual knowledge-intensive commonsense reasoning tasks, which require visual information to excel. The experimental results illustrate that VaLM outperforms all strong language-only and vision-language baselines with substantial gains in reasoning object commonsense including color, size, and shape. Our code is available at https://github.com/Victorwz/VaLM.
Motivation & Objective
- To address the hallucination problem in large language models that lack visual grounding by integrating visual knowledge during pre-training.
- To enable pre-trained language models to effectively utilize visual information without requiring paired image-text data during inference.
- To design a flexible, on-the-fly mechanism for aligning text tokens with relevant images to enhance contextual understanding.
- To improve reasoning over object properties such as color, size, and shape through multimodal fusion.
Proposed method
- A CLIP-based image retrieval module is used to retrieve k nearest neighbor images for each token in the pre-training text corpus, creating a visual augmentation of the text context.
- A visual knowledge fusion layer enables joint self-attention between textual tokens and retrieved images, using separate linear projections for image-specific attention keys and values.
- The model employs a shared contextual weight matrix for attention projection, with only image-specific bias added for efficiency and performance.
- The framework supports end-to-end pre-training and fine-tuning, allowing the model to dynamically incorporate visual knowledge during inference.
- The image retrieval is performed using cached image embeddings from CLIP, enabling scalable and efficient retrieval in a unified text-image embedding space.
- The architecture is compatible with autoregressive language models and can be extended to encoder-only or encoder-decoder backbones.
Experimental results
Research questions
- RQ1Can a language model be effectively augmented with retrieved images to improve reasoning about visual commonsense properties like color, size, and shape?
- RQ2How does on-the-fly image retrieval compare to supervised vision-language pre-training in terms of zero-shot reasoning performance?
- RQ3What is the optimal way to fuse visual features into the attention mechanism of a language model without introducing excessive parameters?
- RQ4Does the integration of visual knowledge reduce hallucination in language model predictions?
- RQ5Can the proposed framework improve both visual commonsense reasoning and general natural language understanding tasks?
Key findings
- VaLM achieves a +14.50% absolute accuracy gain on the MemoryColor dataset compared to strong baselines, demonstrating significant improvement in reasoning about object color.
- On the RelativeSize benchmark, VaLM improves by +17.80%, showing strong performance in reasoning about relative object sizes.
- On the ObjectShape dataset, VaLM achieves a +11.68% improvement, indicating effective modeling of shape-related commonsense knowledge.
- Ablation studies confirm that introducing image-specific bias in attention projection yields better performance than sharing weights or using full image-specific projections.
- The model outperforms both language-only and vision-language pre-trained models across multiple visual knowledge-intensive reasoning tasks.
- VaLM also improves performance on general natural language understanding tasks, indicating broader benefits beyond visual commonsense.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.