Overview
Researchers have developed VaLM (Visually-Augmented Language Modeling), a framework that grounds text-only language models by "looking up" relevant images during the pre-training process. By retrieving and attending to visual information on-the-fly, VaLM significantly outperforms standard language models and even dedicated vision-language models on commonsense reasoning tasks involving color, size, and shape.
The Problem: "Blind" Language Models
While large-scale pre-trained language models (PLMs) like GPT-3 are incredibly capable, they are essentially "blind." They learn about the world solely through statistical correlations in text. This leads to a lack of visual grounding, resulting in the "hallucination" problem. For example, a model might predict the sky is red simply because those words appeared together in a specific context in its training data, ignoring the fundamental physical reality that the sky is blue.
Existing Vision-Language Models (VLMs) try to bridge this gap, but they typically rely on datasets of explicit image-caption pairs. This limits their flexibility; they often struggle to perform well on pure text tasks or require an accompanying image at inference time to function correctly. The authors sought a way to give a standard language model "visual common sense" without forcing it to rely on fixed image-text pairs.
The VaLM Approach
The authors propose a novel framework called VaLM, which consists of two primary components integrated into a standard Transformer decoder architecture:
- Image Retrieval Module: Instead of using fixed captions, VaLM uses a frozen CLIP (Contrastive Language-Image Pre-training) model to perform "dense retrieval." For every text token in the training corpus, the model uses the surrounding context to query a massive database of 200 million images. It fetches the top-$k$ most relevant images to act as "visual augmentations" for that specific text.
- Visual Knowledge Fusion Layer: The model doesn't just look at the images; it integrates them. The authors inserted a special fusion layer (specifically at the second-to-last layer of the Transformer) that uses a joint-attention mechanism. This allows the model to attend to both the textual context and the visual features of the retrieved images simultaneously.
Unlike traditional VLMs that are trained on static pairs, VaLM is a "retrieval-augmented" model. It learns to dynamically choose and use visual information from a large-scale knowledge base, making it much more flexible for zero-shot reasoning.
Datasets and Evaluation
To train and evaluate VaLM, the researchers utilized a massive scale of text and image data:
- Pre-training Text: 15% of the CC-100 English monolingual corpus (approx. 8 billion tokens).
- Image Knowledge Base: 200 million images from the LAION Open Image Dataset, indexed using the faiss toolkit for efficient searching.
The model was evaluated across several benchmarks, with a specific focus on Visual Commonsense tasks (MEMORYCOLOR, COLORTERMS, OBJECTSHAPE, and RELATIVESIZE) and Physical Reasoning (PIQA).
It was also tested on standard Natural Language Understanding (NLU) tasks (SST-2, MPQA, DBPedia, AGNews) and Language Modeling benchmarks (Wikitext-103, Lambada) to ensure text capabilities were preserved.
Key Insights
- Visual Grounding Alleviates Hallucination: Providing visual context helps the model move beyond "word statistics." By seeing images of a "banana," the model is less likely to hallucinate its color as "blue."
- Retrieval vs. Alignment: Most VLMs try to align text and images in a shared space. VaLM suggests that retrieval is a more powerful paradigm for general-purpose LMs because it allows the model to access a vast "external memory" of visual facts that aren't present in the text alone.
- Relevance Matters: An ablation study showed that retrieving random images actually hurts performance. The model's success depends on the retrieval module's ability to find contextually relevant visual information.
- Efficiency in Scale: While retrieving images sounds expensive, as language models get larger, the relative cost of retrieval stays constant. For massive models, the "retrieval overhead" becomes a negligible fraction of the total computation.
Key Results
VaLM (at 124M parameters) showed substantial improvements over strong baselines like GPT-2 and BERT:
- Massive Gains in Commonsense: On the RELATIVESIZE dataset, VaLM achieved an accuracy of 85.03%, a staggering +17.8% improvement over the best baseline (VisualBERT).
- Color and Shape: It saw gains of +14.5% on MEMORYCOLOR and +11.68% on OBJECTSHAPE compared to text-only models.
- Zero-Shot Superiority: VaLM outperformed dedicated vision-language models like OSCAR and CLIP in zero-shot settings, proving that its fusion method is more effective for reasoning than simple embedding alignment.
- No "Tax" on Text: Importantly, adding visual augmentation did not degrade performance on standard text-only NLU tasks; in fact, it slightly improved results on datasets like SST-2 and MPQA.
Limitations and Future Work
Currently, introducing image retrieval increases inference time by about 2.1x compared to a text-only baseline. While the authors argue this is negligible for larger models, it remains a hurdle for real-time applications on smaller hardware. Furthermore, if the retrieval module fetches irrelevant images (noise), it can confuse the model. The authors noted a slight performance drop when retrieving too many images ($k=8$ vs $k=4$) in some tasks.
Future directions include applying this framework to different architectures (like encoder-only or encoder-decoder models) and extending the "augmentation" to other modalities beyond just images, such as audio or video.
Summary updated