Pixel Aligned Language Models

Jiarui Xu, Xingyi Zhou, Shen Yan, Xiuye Gu, Anurag Arnab, Chen Sun, Xiaolong Wang, Cordelia Schmid

TL;DR

PixelLLM is a novel vision-language model that achieves fine-grained spatial understanding by densely aligning every generated word to a specific pixel location. By regressing coordinates directly from language features and training on human attention trajectories, it achieves state-of-the-art performance across tasks like referring localization, dense object captioning, and location-conditioned reasoning.

What Problem Does This Paper Address?

While Large Language Models (LLMs) have become adept at describing images and answering questions, they often lack a precise "sense of space." Most existing vision-language models treat the image as a global input and produce text-only outputs. When they do attempt localization, they typically use "spatial bin tokens"—discretizing coordinates into text tokens—which is computationally expensive, increases sequence length, and limits resolution.

The authors ask: Can we equip LLMs with the ability to "point" while they "speak"? They aim to bridge the gap between high-level semantic description and low-level pixel grounding, allowing a model to either focus on a specific region provided as input or tell you exactly where each word in its output is located in the image.

Methods

The core innovation of PixelLLM is its per-token localization head. Instead of adding new tokens to the vocabulary, the researchers added a small Multi-Layer Perceptron (MLP) in parallel with the LLM's standard word-prediction head.

As the LLM generates a word, the MLP takes the hidden features of that word and regresses a corresponding $(x, y)$ pixel coordinate. This allows the model to produce a "trajectory" of points that trace the objects being described.

Overview of the PixelLLM architecture, showing the image and prompt encoders feeding into the LLM, which then outputs both text and pixel coordinates via a parallel MLP head.

Key Architectural Components: * Visual Backbones: A dual-encoder setup using a frozen ViT-H (from Segment Anything Model) for strong localization features and a tunable ViT-L (EVA02) for semantic understanding. * Prompt Encoder & Extractor: A SAM-style prompt encoder allows the model to take points or boxes as inputs. A Q-Former-style extractor then pulls region-specific features from the image. * Language Model: An instruction-tuned T5-XL model, adapted using Low-Rank Adaptation (LoRA) to maintain efficiency while learning spatial tasks. * Training Objective: A joint loss function combining standard cross-entropy for text generation with an $L_1$ regression loss for the pixel coordinates.

Datasets

  • Localized Narratives (LN): The primary training source. This unique dataset contains human-annotated captions where each word is synchronized with a mouse trace, providing a direct signal for "pointing and naming."
  • WebLI: Used for initial large-scale image-caption pre-training.
  • RefCOCO / RefCOCO+ / RefCOCOg: Used to evaluate referring localization (finding a box for a query) and segmentation.
  • Visual Genome: Used for dense object captioning and location-conditioned captioning.
  • GoldG: A curated mix of datasets used for training the referring localization task.

Key Insights and Ideas

  • Regression > Discretization: Directly regressing coordinates is more efficient than using discrete tokens. It avoids bloating the sequence length and allows the model to learn spatial relationships for all words, including verbs and relations (like "holding"), not just nouns.
  • Language Features are Spatially Aware: The fact that an MLP can extract accurate coordinates from the LLM's hidden states suggests that modern LLMs naturally develop internal spatial representations when trained on visual tasks.
  • Human Attention as a Gold Mine: Training on mouse trajectories from the Localized Narratives dataset effectively teaches the model to mimic human visual attention, leading to more intuitive grounding.
  • LoRA is Essential: The authors found that using LoRA to fine-tune the LLM provided an 8-10 point boost in localization accuracy compared to keeping the LLM frozen, proving that the language model needs to adapt its internal weights to master spatial reasoning.

Key Results

PixelLLM achieved state-of-the-art (SOTA) results across multiple benchmarks:

  • Referring Localization: On RefCOCO, it reached 89.8 [email protected], outperforming previous 7B-parameter models despite using a smaller 4B-parameter backbone.
  • Dense Object Captioning: On Visual Genome, it achieved 17.02 mAP, significantly outperforming the previous best model, GRiT (15.48 mAP).
  • Location-Conditioned Captioning: It showed superior performance on RefCOCOg and Visual Genome, proving it can generate better descriptions when prompted with a specific bounding box.
Qualitative results showing PixelLLM's ability to generate captions with aligned traces (top), perform referring segmentation (middle), and dense object captioning (bottom).

Limitations and Future Work

  • Noise in Supervision: The mouse traces in the Localized Narratives dataset can be "noisy" (e.g., the mouse might not perfectly follow the object), which can limit the precision of the dense grounding.
  • Detection Dependency: For dense captioning, the model currently relies on an external proposal head (like CenterNet) to find objects first. Integrating this more natively into the LLM architecture is a potential next step.
  • Temporal Dynamics: The current work focuses on static images. Extending this dense word-pixel alignment to video—where both text and pixels move through time—is a promising future direction.

Summary updated

BibTeX
@misc{xu2023pixel,
  author = {Jiarui Xu and Xingyi Zhou and Shen Yan and Xiuye Gu and Anurag Arnab and Chen Sun and Xiaolong Wang and Cordelia Schmid},
  title = {{Pixel Aligned Language Models}},
  year = {2023},
  eprint = {2312.09237},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.09237},
}
Figure