Masked AutoDecoder is Effective Multi-Task Vision Generalist

Han Qiu, Jiaxing Huang, Peng Gao, Lewei Lu, Xiaoqin Zhang, Shijian Lu

Abstract

Recent advancements in unified vision generalists have largely relied on Autoregressive (AR) Transformers, which treat diverse tasks—such as object detection and image captioning—as sequential token generation problems. However, this approach is computationally expensive and misaligned with the non-sequential, spatial nature of visual data. We present Masked AutoDecoder (MAD), a high-speed generalist that replaces slow, step-by-step generation with a parallel decoding framework. By utilizing bi-directional attention and a masked reconstruction objective, MAD achieves up to a 157x inference speedup over state-of-the-art models like Pix2SeqV2 while simultaneously improving performance on core spatial vision tasks.

Introduction

The "one model to rule them all" trend in computer vision has traditionally favored the Autoregressive approach. While effective for Large Language Models, AR models face significant hurdles in vision. First, vision tasks lack the strict directional dependency of language; a bounding box coordinate depends more on spatial context than on a preceding token in an arbitrary sequence. Second, generating tokens one-by-one is computationally inefficient, requiring hundreds of forward passes for a single image, which limits real-time applicability.

Methods: Parallel Masked Autodecoding

MAD introduces a conceptually simple but powerful shift: Parallel Decoding. Unlike AR models that use causal masking (restricting a token's view to only preceding elements), MAD employs bi-directional attention. This allows every token in the task sequence to "see" every other token, capturing global context more effectively.

Comparison between the sequential step-by-step approach of Autoregressive Decoders and the one-step parallel approach of the Masked AutoDecoder.

During training, MAD utilizes a Masked Sequence Modeling objective. It takes a task sequence (e.g., bounding box coordinates), masks a random subset, and trains the decoder to reconstruct them. This approach allows the model to learn the underlying "grammar" of visual tasks—such as the relationship between the corners of a bounding box—much faster than sequential models. At inference time, MAD can generate an entire task output in a single pass, with optional refinement steps to polish results.

Experimental Results

The researchers evaluated MAD on the MS-COCO dataset across four tasks: object detection, instance segmentation, keypoint detection, and image captioning. The results demonstrate that parallel decoding is not only faster but often more accurate for spatial tasks.

Performance vs. Inference Time comparison showing MAD's massive speed advantage and superior average performance over Pix2SeqV2.

As illustrated in Figure 1, MAD (using a ViT-B backbone) is 157x faster than Pix2SeqV2, reducing inference time from approximately 40 seconds per image to just 0.26 seconds. Beyond efficiency, MAD improves accuracy; it achieved 50.1 mAP on COCO Object Detection compared to Pix2SeqV2's 46.5 mAP, and showed similar gains in instance segmentation (41.2 vs 38.2 mAP). While AR models maintain a slight edge in image captioning (34.9 vs 32.6 BLEU@4)—likely due to the inherently sequential nature of text—MAD remains a highly competitive and significantly more efficient generalist.

Conclusion

Masked AutoDecoder proves that the sequential constraints of autoregressive modeling are often unnecessary and counterproductive for computer vision. By aligning the decoding process with the spatial characteristics of visual data, MAD offers a path toward real-time, high-performance vision generalists that can handle multiple complex tasks in a single, efficient pass.

Summary updated

BibTeX
@inproceedings{qiu2024masked,
  author = {Han Qiu and Jiaxing Huang and Peng Gao and Lewei Lu and Xiaoqin Zhang and Shijian Lu},
  title = {{Masked AutoDecoder is Effective Multi-Task Vision Generalist}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure