Object Recognition as Next Token Prediction

Multimodal Intelligence Vision-Language Pre-training FGCMA
2023年12月04日
我们提出了一种将姿态物体识别视为下一个标记预测的方法。这个想法是应用一个语言解码器,从图像嵌入中自回归地预测文本标记以形成标签。为了将这个预测过程与自回归联系起来,我们为解码器定制了一个非因果关注掩码,包括两个关键特征:将来自不同标签的标记建模为独立的,以及将图像标记视为前缀。这种掩码机制启发了一种高效的方法——一次性采样——在推理过程中同时并行采样多个标记,并通过它们的概率对生成的标签进行排名。为了进一步提高效率,我们提出了一种简单的策略,通过简单地丢弃预训练语言模型的中间块来构建一个紧凑的解码器。这种方法产生了一个与完整模型性能相匹配但明显更高效的解码器。代码可在 https://github.com/kaiyuyue/nxtp 上找到。
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 https://github.com/kaiyuyue/nxtp
许愿