TL;DR
This paper introduces a modality-agnostic framework that uses a text classifier to "steer" a frozen language model during inference, ensuring generated captions align with specific semantic requirements like audibility. By optimizing the model's context cache without retraining, the authors achieve state-of-the-art results in zero-shot audio captioning and significantly improve image captioning detail.
What Problem Does This Paper Address?
Most modern captioning systems rely on large language models (LMs) pre-trained on massive text datasets or specific image-caption pairs (like those from Amazon Mechanical Turk). While powerful, these LMs often struggle to generalize to different modalities.
For instance, in audio captioning, an LM might suggest a caption like "a man walking in the park." While semantically plausible, "walking" isn't necessarily an audible action unless there's a specific sound of footsteps. Current models often fail to distinguish between what is visible and what is actually audible. This lack of modality-specific "semantic cues" limits the accuracy and relevance of captions in zero-shot settings where the model hasn't been explicitly trained on the target data distribution.
Methods
The authors propose a "Classifier-Guided Captioning" framework that operates entirely during inference, meaning the underlying captioning model remains frozen.
The system consists of two main parts:
- A Frozen Captioner: A standard architecture incorporating a language model (like GPT-2).
- A Binary Text Classifier: A lightweight model (DistilBERT) trained to recognize specific semantic traits—most notably "audibility."
The "Secret Sauce": Inference-Time Optimization Instead of fine-tuning the model weights, the framework performs a small number of optimization steps for every token generated. It adjusts the context cache (the Keys and Values in the transformer layers) to minimize a dual-loss function:
- Classifier Loss ($L_{classifier}$): Pushes the LM to select words that the classifier deems highly "audible" (or detailed, depending on the task).
- Cross-Entropy Loss ($L_{CE}$): Acts as a regularizer to ensure the LM doesn't lose its natural fluency or drift too far from its original distribution.
Datasets
The researchers evaluated their method on several standard benchmarks:
- Audio: AudioCaps (46k clips) and Clotho (5k clips).
- Images: MS-COCO, used to demonstrate the framework's modality-agnostic nature.
The Synthetic Audibility Dataset: Because no large-scale dataset existed to teach a model the nuance of "audibility," the authors used GPT-4 to generate a custom dataset of 10,000 captions. Half were "audible" (describing sounds) and half were "non-audible" (describing silent states or visual-only cues).
Key Insights and Ideas
- Guidance over Training: The most significant "aha moment" is that you don't need to retrain massive models to adapt them to new modalities. A small, specialized classifier can effectively "nudge" a general-purpose LM toward the right semantics.
- The Context Cache as a Lever: By optimizing the context cache rather than the weights, the method remains extremely flexible. It can be plugged into almost any transformer-based captioner.
- Synthetic Teachers: The work demonstrates that high-quality synthetic data from LLMs like GPT-4 is sufficient to train a "semantic guide" that improves performance on real-world sensor data (audio).
- Audibility as a Metric: The authors introduce "Audibility Accuracy" (Aud) to specifically measure how well a model captures sound-relevant information, a nuance often missed by standard metrics like BLEU or CIDEr.
Key Results
The framework achieved impressive gains, particularly in the challenging "out-of-domain" zero-shot setting (e.g., training on AudioCaps and testing on Clotho).
- Zero-Shot Audio SOTA: When added to the NoAudioCaptioning (NAC) baseline, the framework set new state-of-the-art marks. For the Clotho $\Rightarrow$ AudioCaps task, it improved CIDEr scores from 27.8 to 29.3 and Audibility Accuracy from 65.6% to a staggering 85.7%.
- Image Captioning: The method isn't just for audio. On MS-COCO, it improved the CLIP-S score (measuring semantic alignment) for both zero-shot and fully supervised models, indicating more detailed and accurate descriptions.
Limitations and Future Work
While effective, the authors acknowledge a few hurdles:
- Computational Overhead: Because optimization happens at every generation step during inference, the process is slower than standard decoding. This makes it less ideal for real-time applications without further optimization.
- Model Bias: The framework relies on pre-trained LMs (like GPT-2), which may carry inherent biases from their original training data.
- Future Directions: The team plans to extend this to video captioning and explore ways to reduce the inference-time computational cost.
Summary updated