Grounding Language Models for Visual Entity Recognition

Zilin Xiao, Ming Gong, Paola Cascante-Bonilla, Xingyao Zhang, Jie Wu, Vicente Ordonez

Abstract

We introduce AutoVER, an Autoregressive model for Visual Entity Recognition. Our model extends an autoregressive Multimodal Large Language Model by employing retrieval augmented constrained generation. It mitigates low performance on out-of-domain entities while excelling in queries that require visual reasoning. Our method learns to distinguish similar entities within a vast label space by contrastively training on hard negative pairs in parallel with a sequence-to-sequence objective without an external retriever. During inference, a list of retrieved candidate answers explicitly guides language generation by removing invalid decoding paths. The proposed method achieves significant improvements across different dataset splits in the recently proposed Oven-Wikibenchmark with accuracy on the Entity seen split rising from 32.7% to 61.5%. It demonstrates superior performance on the unseen and query splits by a substantial double-digit margin, while also preserving the ability to effectively transfer to other generic visual question answering benchmarks without further training.

Introduction

Visual Entity Recognition (VER) is a specialized task requiring models to identify highly specific entities from a massive label space—often exceeding 6 million entries in Wikipedia. While general-purpose Multimodal Large Language Models (MLLMs) like GPT-4V excel at broad reasoning, they frequently struggle with fine-grained distinctions. For example, an MLLM might correctly identify an object as a "passenger plane" but fail to distinguish between an ATR 42 and a British Aerospace 146.

Figure 1: High-level overview of the AutoVER inference pipeline, illustrating how it grounds MLLM predictions compared to standard models.

The challenges in VER are three-fold: the massive label space, the fine-grained similarity between entities, and the tendency of generative models to "hallucinate" plausible but incorrect entity names. To solve this, we propose AutoVER (Autoregressive Visual Entity Recognizer), a framework that combines retrieval-augmented generation with constrained decoding.

The AutoVER Methodology

AutoVER treats entity recognition as a sequence-to-sequence problem enhanced by three core components designed to ground the model's outputs in real-world knowledge.

Retrieval-Augmented MLLM

The model utilizes a specialized <ret> token. The hidden state of this token acts as a query embedding used to retrieve the top-$k$ (e.g., 300) most relevant entity candidates from a massive database. This retrieval step is essential for identifying "unseen" entities that the model was not explicitly exposed to during training.

Constrained Decoding via Dynamic Tries

The primary innovation of AutoVER is the use of a prefix tree (trie) to eliminate hallucinations. During inference, the model takes the retrieved candidates and constructs a dynamic trie of all valid token sequences for those specific entity names. During the autoregressive generation phase, the model is restricted to only choosing tokens that follow a path in the trie. This ensures that every output is a valid, grounded entity name.

Figure 3: Detailed view of the retrieval-augmented constrained decoding process, showing the interaction between the MLLM and the dynamic candidate trie.

Contrastive Training with Hard Negatives

To help the model distinguish between "look-alikes," we employ contrastive training with two hard-negative mining strategies:

  1. Vision-Hard: Entities that a pre-trained vision classifier identifies as visually similar.
  2. KB-Hard: Entities that share a parent category in the Wikidata hierarchy (e.g., different models of the same aircraft manufacturer).

Experimental Results

AutoVER was primarily evaluated on the Oven-Wiki benchmark, a large-scale dataset for open-domain VER.

  • Oven-Wiki (Seen Split): Accuracy rose from a baseline of 32.7% to 61.5% (and up to 63.6% with the 13B parameter version).
  • Oven-Wiki (Unseen Split): On out-of-domain entities, AutoVER reached 24.5% accuracy, significantly outperforming the 12.4% achieved by PaLI-17B.
  • Comparison to GPT-4V: On the Entity split, AutoVER-13B outperformed GPT-4V (35.6% vs 23.4% harmonic mean), proving that specialized grounding is more effective than general-purpose scale for this task.
  • Zero-Shot Generalization: The model also demonstrated effective transfer to the A-OKVQA-Ent dataset, outperforming generalist models like InstructBLIP and LLaVA-v1.5.

Conclusion and Future Work

AutoVER successfully addresses the hallucination problem in VER by constraining the MLLM's output to a retrieved set of valid candidates. While a performance gap still exists between AutoVER and human-level search capabilities, the framework provides a robust path forward for grounding large-scale multimodal models in factual, fine-grained knowledge. Future research will explore more parameter-efficient tuning methods to further refine the generative VER framework.

Summary updated

BibTeX
@inproceedings{xiao2024grounding,
  author = {Zilin Xiao and Ming Gong and Paola Cascante-Bonilla and Xingyao Zhang and Jie Wu and Vicente Ordonez},
  title = {{Grounding Language Models for Visual Entity Recognition}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=kxMgeDnoQC},
}
Figure