Abstract
TPCap introduces a highly efficient image captioning framework that replaces external retrieval databases with the Large Language Model (LLM) itself as a built-in knowledge bank. By prompting the LLM to generate initial entity descriptions and then "purifying" that text using visual cues, TPCap achieves state-of-the-art zero-shot captioning among lightweight models. The system utilizes less than 1 million trainable parameters and can be trained on a single consumer GPU.
Introduction
Modern image captioning systems often rely on Large Language Models (LLMs) to generate fluent text. To incorporate specific, detailed knowledge, researchers frequently employ Retrieval-Augmented Generation (RAG). In a standard RAG setup, an input image is compared against a massive external database of image-text pairs to retrieve relevant hints for the LLM.
However, external retrieval banks are computationally expensive to maintain and search. They can also mislead the LLM if the retrieved text is noisy or poorly matched. More importantly, relying on external databases overlooks the vast zero-shot knowledge already present in the LLM's weights. TPCap addresses this by asking: Can we trigger the LLM to act as its own retrieval bank?
Methodology
The TPCap (Trigger-Augmented and Multi-Modal Purification Captioning) architecture is remarkably lightweight, keeping most of the pipeline frozen. It operates through a two-step prompting phase:
- Trigger-Augmented Module 1 (TA1): Instead of querying an external database, compressed visual features are fed into a frozen LLM (Vicuna-7B) with the prompt: "What are they?" The LLM generates a coarse-grained list of entities recognized in the image.
- Multi-Modal Purification (MP): To mitigate LLM hallucinations, the MP module uses a frozen Q-Former with 8 learnable query tokens to cross-attend the generated entity text with actual visual features. This filters the text, stripping out hallucinations that do not appear in the image.
- Trigger-Augmented Module 2 (TA2): The original visual features and the purified entity features are concatenated and fed back into the LLM with the prompt: "Describe this image in detail."
- The Trigger Projector: To align visual features with the LLM's text space, TPCap uses a frozen pre-trained projection layer (from LLaVA) prepended with a tiny learnable linear layer. This "trigger" layer adapts features with only 0.82M trainable parameters.
Experiments and Results
The model was trained exclusively on the COCO dataset (Karpathy split) for a single epoch. Evaluation was conducted across several benchmarks including COCO Test, NoCaps Val, Flickr30k, and WHOOPS (a dataset of commonsense-violating images).
Key Findings
- Extreme Efficiency: TPCap features only 0.82M trainable parameters—significantly fewer than competitors like MiniGPT-4. It was trained on a single NVIDIA RTX 4090.
- State-of-the-Art Performance: It outperforms other lightweight models, achieving 138.6 CIDEr on COCO and 118.2 CIDEr on NoCaps.
- Open-World Reasoning: On the WHOOPS dataset, TPCap achieved a 121.8 CIDEr score, outperforming BLIP-2 by 28.7 points. This demonstrates that the model prioritizes visual evidence over statistical language biases.
Conclusion
TPCap demonstrates that LLMs can effectively serve as their own knowledge source for image captioning. By grounding self-generated entity lists against visual features, the model achieves high accuracy and efficiency. While performance is currently bounded by the underlying LLM (Vicuna-7B), the modular design allows for future scaling with more powerful open-weight models like Llama-3 or Mistral.
Summary updated