In-context learning$\unicode{x2013}$the ability to configure a model's behavior with different prompts$\unicode{x2013}$has revolutionized the field of natural language processing, alleviating the need for task-specific models and paving the way for generalist models capable of assisting with any query. Computer vision, in contrast, has largely stayed in the former regime: specialized decoders and finetuning protocols are generally required to perform dense tasks such as semantic segmentation and depth estimation. In this work we explore a simple mechanism for in-context learning of such scene understanding tasks: nearest neighbor retrieval from a prompt of annotated features. We propose a new pretraining protocol$\unicode{x2013}$leveraging attention within and across images$\unicode{x2013}$which yields representations particularly useful in this regime. The resulting Hummingbird model, suitably prompted, performs various scene understanding tasks without modification while approaching the performance of specialists that have been finetuned for each task. Moreover, Hummingbird can be configured to perform new tasks much more efficiently than finetuned models, raising the possibility of scene understanding in the interactive assistant regime.
翻译:上下文学习——即通过不同提示配置模型行为的能力——已彻底改变了自然语言处理领域,减少了对特定任务模型的需求,并为能够协助任何查询的通用模型铺平了道路。相比之下,计算机视觉大多仍停留在前一种范式:执行语义分割和深度估计等密集任务通常需要专门的解码器和微调协议。在这项工作中,我们探索了一种用于此类场景理解任务的简单上下文学习机制:从带注释特征的提示中进行最近邻检索。我们提出了一种新的预训练协议——利用图像内部和跨图像的注意力——该协议产生的表示在这种范式下尤其有用。由此产生的Hummingbird模型,在适当提示下,无需修改即可执行各种场景理解任务,同时接近为每个任务微调过的专家模型的性能。此外,Hummingbird可以配置为比微调模型更高效地执行新任务,这为交互式助手范式下的场景理解提供了可能性。