Abstract
Vision-Language Models (VLMs) like CLIP have transformed image classification, yet their reliance on simple class-name prompts often limits performance due to ambiguity and visual hallucinations in LLM-generated descriptions. This paper introduces a training-free framework that employs Large Language Models (LLMs) as "evolutionary agents" to iteratively refine visual descriptors. By integrating "visual feedback" from VLMs via confusion matrices, the system evolves highly accurate, discriminative, and human-readable descriptors. Our method achieves a state-of-the-art average improvement of +6.40% across nine diverse benchmarks, with gains as high as +19.45% on specialized datasets like EuroSAT.
Introduction
The effectiveness of Vision-Language Models (VLMs) in zero-shot image classification is heavily dependent on the quality of text prompts. While using detailed descriptors instead of simple class names can improve accuracy, standard "single-turn" LLM generation often fails. LLMs, primarily trained on text, frequently hallucinate incorrect visual features or generate generic descriptions that lack the discriminative power needed to distinguish between similar classes (e.g., different bird species).
To address these challenges, we propose a framework that treats prompt engineering as a combinatorial optimization problem. By closing the loop between text generation and visual verification, we enable LLMs to act as grounded visual explainers.
Methods: Iterative Optimization with Visual Feedback
The core of our approach is an evolutionary loop that iteratively refines class descriptors without updating the underlying model weights.
The process consists of five key stages:
- Initialization: The LLM generates initial descriptors. To maintain efficiency on large datasets, classes are clustered using K-means, allowing the LLM to focus on groups of visually similar, "confusing" classes.
- Visual Feedback: Current descriptors are evaluated using a VLM (e.g., CLIP) on a validation set. We utilize an Improved Confusion Matrix (iCM) to pinpoint specific misidentifications and failing descriptors.
- Mutation & Crossover: The LLM serves as an intelligent editor. In the Mutation phase, it replaces underperforming descriptors with new candidates based on feedback. In Crossover, it recombines the most effective descriptors from different sets to create superior "offspring."
- Natural Selection: Candidates are ranked by classification accuracy (the fitness function), and only the best-performing sets proceed to the next iteration.
- Memory Banks: To avoid redundant errors, the system tracks "positive" and "negative" descriptor histories.
Experimental Results
We evaluated our framework across nine diverse image classification benchmarks, ranging from general datasets (ImageNet, CIFAR-10) to fine-grained (CUB, Flowers102) and specialized domains (EuroSAT, DTD).
Our method consistently outperformed vanilla CLIP and existing LLM-based prompt generation techniques like DCLIP and CuPL. Notably, we observed an average accuracy boost of +6.40%. The most significant improvements occurred in specialized domains, such as a +19.45% jump on EuroSAT (satellite imagery) and +8.69% on DTD (textures). These results demonstrate the framework's ability to evolve highly specific descriptors that capture subtle visual nuances.
Discussion and Conclusion
The success of this framework highlights the importance of "closing the loop" between LLMs and VLMs. By providing LLMs with visual feedback, they transition from blind text generators to grounded explainers capable of understanding inter-class relationships. Furthermore, the evolved descriptors are human-readable, providing inherent interpretability to the classification process.
While the method requires a small amount of labeled data for the feedback loop and involves higher computational costs due to iterative LLM calls, its ability to produce "universal" visual knowledge that transfers across different model backbones marks a significant step forward in automated prompt engineering for computer vision.
Summary updated