Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Language Models Can See: Plugging Visual Controls in Text Generation

About

Generative language models (LMs) such as GPT-2/3 can be prompted to generate text with remarkable quality. While they are designed for text-prompted generation, it remains an open question how the generation process could be guided by modalities beyond text such as images. In this work, we propose a training-free framework, called MAGIC (iMAge-Guided text generatIon with CLIP), for plugging in visual controls in the generation process and enabling LMs to perform multimodal tasks (e.g., image captioning) in a zero-shot manner. MAGIC is a simple yet efficient plug-and-play framework, which directly combines an off-the-shelf LM (i.e., GPT-2) and an image-text matching model (i.e., CLIP) for image-grounded text generation. During decoding, MAGIC influences the generation of the LM by introducing a CLIP-induced score, called magic score, which regularizes the generated result to be semantically related to a given image while being coherent to the previously generated context. Notably, the proposed decoding scheme does not involve any gradient update operation, therefore being computationally efficient. On the challenging task of zero-shot image captioning, MAGIC outperforms the state-of-the-art method by notable margins with a nearly 27 times decoding speedup. MAGIC is a flexible framework and is theoretically compatible with any text generation tasks that incorporate image grounding. In the experiments, we showcase that it is also capable of performing visually grounded story generation given both an image and a text prompt.

Yixuan Su, Tian Lan, Yahui Liu, Fangyu Liu, Dani Yogatama, Yan Wang, Lingpeng Kong, Nigel Collier• 2022

Related benchmarks

TaskDatasetResultRank
Image CaptioningMS COCO Karpathy (test)
CIDEr0.493
682
Image CaptioningMS-COCO
CIDEr49.3
61
Image CaptioningMSCOCO
BLEU@412.9
27
Visual CaptioningMS-COCO English In-domain (test)
BLEU-412.9
17
Visual CaptioningMS-COCO English
BLEU@45.2
9
Image CaptioningFlickr30K
BLEU-46.4
8
Visual CaptioningMSR-VTT English
BLEU@45.5
5
Image CaptioningMS COCO random subset of 100 images (test)
BLEU-411.4
5
Story GenerationROCStories 2016
Repetition Score (rep-2)2.49
5
Showing 9 of 9 rows

Other info

Follow for update