Abstract
While text-based prompt engineering has revolutionized how we interact with Large Language Models (LLMs), Vision-Language Models (VLMs) have primarily relied on textual descriptions to interpret visual data. This paper introduces "visual prompt engineering," a technique that uses simple geometric markers—specifically red circles—to direct a model's attention to specific image regions without sacrificing global context. By overlaying these markers directly onto pixels, the researchers demonstrate that models like CLIP possess an emergent ability to understand visual cues, achieving state-of-the-art zero-shot results in referring expression comprehension and keypoint localization.
Introduction
In the evolution of generative AI, the art of "prompting" has been largely confined to the linguistic domain. Users provide specific text instructions to elicit complex reasoning from models. However, Vision-Language Models (VLMs) face a unique challenge: while text is excellent for describing what an object is (semantics), it is often inadequate for describing where an object is (geometry).
Traditionally, to focus a VLM on a specific region, researchers have used "cropping." While effective at isolating pixels, cropping destroys the spatial context necessary for accurate identification—for instance, a "nose" is much harder to identify when isolated from the rest of the face. This research explores whether we can "prompt" the visual modality of a VLM using human-like annotations, such as drawing a red circle, to guide the model's focus while maintaining the integrity of the full image.
Visual Prompting via Marking
The core methodology proposed is Visual Prompting via Marking. Instead of altering the image dimensions through cropping, the authors overlay simple geometric shapes directly onto the image.
Key Methodological Components
- Zero-Shot Inference: The study utilizes CLIP "out of the box." No additional training or fine-tuning is performed, making the discovered capabilities purely emergent.
- Q/A Framework: Computer vision tasks are reformulated as Question/Answer problems. For keypoint matching, the "Question" is a text label (e.g., "left eye"), and the "Answers" are various versions of the image with different regions circled. The model then selects the image-text pair with the highest compatibility score.
- Sinkhorn-Knopp Normalization: To refine matching accuracy, the researchers apply the Sinkhorn-Knopp algorithm to normalize compatibility scores, ensuring a robust mapping between text labels and specific image regions.
- Visual Ensembling: For complex tasks like Referring Expression Comprehension (REC), the authors use an ensemble of visual prompts. This includes the standard red circle, blurring the background outside the circle, and converting the background to grayscale to further emphasize the target area.
Experimental Evaluation
The effectiveness of visual prompting was evaluated across several standard benchmarks, focusing on tasks where spatial awareness is critical.
Datasets
- Referring Expression Comprehension (REC): Evaluated on RefCOCO, RefCOCO+, and RefCOCOg.
- Keypoint Tasks: Tested on CUB-200-2011 (birds) and SPair71k (various animals). The authors notably contributed manually named keypoint annotations to the SPair71k dataset to facilitate this study.
- Training Data Analysis: To investigate the origin of this behavior, the authors analyzed a subset of the YFCC15M dataset, searching for instances of "red circles in the wild."
- Bias Testing: FaceSynthetics and MS-COCO were utilized to assess the ethical implications and potential biases triggered by visual markers.
Key Insights and Results
The Superiority of Marking
The research confirms that marking is significantly more effective than cropping. By preserving spatial context, the model understands the circled region in relation to the entire object. On the RefCOCOg benchmark, the "Red Circle" method achieved 59.4% accuracy, outperforming previous zero-shot methods like ReCLIP (57.8%). In keypoint localization on the CUB dataset, the method achieved 58.2% accuracy, nearly doubling the performance of the cropping-based baseline (25.5%).
Emergence and the "Internet Effect"
This ability to interpret visual prompts is an emergent property that scales with model size. While larger models (like ViT-L/14) reliably understand the red circle, smaller models do not. The authors trace this ability back to the training data. Although rare (~0.001%), images with red circles or similar annotations exist in web-scraped datasets. Humans frequently use red circles in news, tutorials, and social media to highlight points of interest, and CLIP successfully internalized this convention during its pre-training.
Shape and Color Sensitivity
Ablation studies revealed that red is the most effective color and circles are the most effective shape. This likely reflects the most common highlighting conventions found across the internet, suggesting that the model's "visual vocabulary" is a direct reflection of human annotative behavior.
Ethical Considerations and Limitations
Despite the technical success, the study highlights a significant "dark side" to visual prompting. Because red circles are frequently used in news media to highlight "missing persons" or "suspected criminals," applying a red circle to a person in CLIP significantly increases the probability of the model classifying that individual into negative or criminal categories. This suggests that visual prompts can inadvertently trigger deep-seated biases present in the training data.
Furthermore, the effectiveness of the method is highly dependent on the specific model architecture and training set. It is not a universal feature of all VLMs, and the exact internal mechanism of how the transformer architecture attends to these added pixels remains a subject for future research.
Conclusion
Visual prompt engineering represents a new frontier in interacting with Vision-Language Models. By leveraging simple human-centric markers like red circles, we can achieve high-precision localization and comprehension in a zero-shot manner. Future work will likely explore more diverse visual prompts—such as arrows or "highlighter" effects—and investigate the synergy between sophisticated textual and visual prompt engineering.
Summary updated