Towards Unifying Reference Expression Generation and Comprehension

Duo Zheng, Tao Kong, Ya Jing, Jiaan Wang, Xiaojie Wang

Abstract

Reference Expression Generation (REG) and Reference Expression Comprehension (REC) are fundamental tasks in vision-and-language research that represent two sides of the same coin: describing a specific object and locating an object based on a description. Despite their conceptual symmetry, most existing models treat them as distinct problems due to the inherent asymmetry in their input modalities. This paper introduces UniRef, a unified transformer-based framework that bridges this gap. By utilizing a novel Image-Region-Text Fusion (IRTF) layer and a region prediction mechanism, UniRef achieves a unified representation space for both tasks. Experimental results demonstrate that UniRef sets new state-of-the-art benchmarks on RefCOCO, RefCOCO+, and RefCOCOg, significantly outperforming previous specialized and unified models.

1. Introduction

In human communication, the ability to refer to objects in a visual scene is seamless. Whether we are generating a description ("the cat on the left") or comprehending one, we rely on a shared mental mapping between visual regions and linguistic tokens. In computer vision, these tasks are formalized as Reference Expression Generation (REG) and Reference Expression Comprehension (REC).

Historically, these tasks have been approached with separate architectures. REG is typically framed as an image-to-text task (Input: Image + Region $\rightarrow$ Output: Text), while REC is framed as a text-to-region task (Input: Image + Text $\rightarrow$ Output: Region). This "modality gap" has hindered the development of truly unified models. While some recent efforts have shared parameters across tasks, they often fail to align the underlying representation space. UniRef addresses this by treating image regions and text as interchangeable inputs within a single fusion architecture.

2. The UniRef Architecture

The UniRef framework consists of three primary components: a Vision Encoder, a Language Encoder, and a specialized Fusion Encoder.

2.1 Vision and Language Encoders

UniRef leverages high-quality pre-trained encoders to extract foundational features. The model uses CLIP-ViT as the vision backbone to capture robust visual representations and BERT as the language encoder to process textual input.

2.2 The Image-Region-Text Fusion (IRTF) Layer

The core innovation of UniRef is the IRTF layer. Unlike standard transformer decoders that utilize a single cross-attention module, the IRTF layer incorporates two distinct cross-attention mechanisms:

  • Image Cross-Attention: This module fuses global image features with the query tokens.
  • Region Cross-Attention: This module focuses specifically on object-level features corresponding to the target region.

2.3 Bridging the Gap: The Region Predictor

To achieve unification, the inputs for REC and REG must be structurally similar. In REG, the target region is provided as an input. In REC, however, the region is the target output. To resolve this, UniRef introduces a Region Predictor. During the comprehension task, the model first generates a "pseudo-region" based on the image and text. This pseudo-region is then fed into the Region Cross-Attention module, allowing the REC task to utilize the exact same computational path as the REG task. This ensures that the model learns a shared representation space where "finding" and "describing" are internally consistent.

3. Pre-training and Objectives

UniRef is pre-trained on a combination of large-scale datasets, including COCO Object Labels, Visual Genome (VG) Phrases, and the RefCOCO suite. The model is optimized using two complementary objectives:

  1. Vision-conditioned Masked Language Modeling (VMLM): Similar to standard MLM but conditioned on both the image and a specific target region. This forces the model to learn the linguistic nuances required for REG.
  2. Text-Conditioned Region Prediction (TRP): The model is tasked with predicting the bounding box of an object given a textual description, which is the primary objective for REC.

The authors observe a significant synergy between these objectives; learning to localize objects (TRP) improves the model's ability to describe them (VMLM), and vice versa.

4. Experimental Evaluation

UniRef was evaluated on the "Big Three" referring expression benchmarks: RefCOCO, RefCOCO+, and RefCOCOg.

4.1 Reference Expression Generation (REG)

UniRef demonstrated a substantial leap in generation quality. On the RefCOCOg dataset, it achieved a CIDEr score of 1.033, representing an 18.3% improvement over the previous state-of-the-art model, VL-T5 (0.873). This suggests that the unified fusion approach captures more descriptive and discriminative features than previous methods.

4.2 Reference Expression Comprehension (REC)

In comprehension tasks, UniRef outperformed specialized heavyweights like MDETR and OFA. On the RefCOCO (testA) benchmark, the model reached an accuracy of 91.21%. These results indicate that a unified model can not only match but exceed the performance of models designed specifically for a single task.

5. Discussion and Future Work

Ablation studies confirmed that both the IRTF layer and the dual pre-training objectives are critical to UniRef's success. Qualitative analysis further revealed that the model develops a sophisticated understanding of "distinguishing" features—for instance, attending to specific anatomical details when descriptions differentiate between similar objects (e.g., focusing on the ears of a sheep when the text specifies "sheep with ear not visible").

Despite its success, several avenues for future research remain. The current model is a "base" size; scaling the architecture and the pre-training data is expected to yield further gains. Additionally, while UniRef performs exceptionally well, it does not yet incorporate reinforcement learning techniques like Self-Critical Sequence Training (SCST), which could further optimize generation metrics. Future iterations may also expand the framework to handle multi-object tasks such as phrase grounding and dense captioning.

6. Conclusion

UniRef represents a significant step toward the unification of vision-and-language tasks. By treating generation and comprehension as symmetrical processes within a shared fusion architecture, the model overcomes the traditional modality gap. Its state-of-the-art performance across multiple benchmarks underscores the power of unified representations in building more capable and versatile AI systems.

Summary updated

BibTeX
@inproceedings{zheng2022towards,
  author = {Duo Zheng and Tao Kong and Ya Jing and Jiaan Wang and Xiaojie Wang},
  title = {{Towards Unifying Reference Expression Generation and Comprehension}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.442},
}
Figure