Object Recognition as Next Token Prediction

Kaiyu Yue, Borchun Chen, Jonas Geiping, Hengduo Li, Tom Goldstein +1 more
2/14/2026

No official code found. Best implementation: kaiyuyue/nxtp (180 stars, MIT, last commit 2025-05-01).

Abstract

We present an approach to pose object recognition as next token prediction. The idea is to apply a language decoder that auto-regressively predicts the text tokens from image embeddings to form labels. To ground this prediction process in auto-regression, we customize a non-causal attention mask for the decoder, incorporating two key features: modeling tokens from different labels to be independent, and treating image tokens as a prefix. This masking mechanism inspires an efficient method - one-shot sampling - to simultaneously sample tokens of multiple labels in parallel and rank generated labels by their probabilities during inference. To further enhance the efficiency, we propose a simple strategy to construct a compact decoder by simply discarding the intermediate blocks of a pretrained language model. This approach yields a decoder that matches the full model's performance while being notably more efficient. The code is available at github.com/kaiyuyue/nxtp.

View on arXivView PDF

Code Implementations(1)

kaiyuyue/nxtpCommunity100%
MIT

PyTorch Implementation of Object Recognition as Next Token Prediction [CVPR'24 Highlight]

1807Shell, PythonDec 4, 20231 years agoMIT
auto-regressionopen-vocabularyrecognition

Similar Papers

Cite this paper

@article{yue2026object,
  title  = {Object Recognition as Next Token Prediction},
  author = {Kaiyu Yue and Borchun Chen and Jonas Geiping and Hengduo Li and Tom Goldstein and Ser-Nam Lim},
  year   = {2026},
  eprint = {2312.02142},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2312.02142},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.02142.svg)](https://codeofpaper.com/paper/2312.02142)

Discussion