Introduction
Standard image captioning models often lack controllability, typically producing a single "average" description regardless of user needs. Furthermore, most models are autoregressive, generating text word-by-word, which leads to a computational bottleneck as caption length increases. This research introduces a method to control caption length and detail using "length level embeddings" and proposes LaBERT, a non-autoregressive model that accelerates the generation of detailed descriptions.
Methodology
The proposed approach consists of two primary components:
- Length Level Embeddings: Training data is categorized into discrete length levels (e.g., Level 1: 1-9 words, Level 2: 10-14 words). A specific embedding vector is created for each level. During inference, providing the desired length level vector guides the model's output detail.
- LaBERT (Length-aware BERT): To address latency, the authors developed a non-autoregressive (NAR) model based on the BERT architecture. LaBERT predicts all words in a sequence simultaneously through an iterative "mask-predict-update" process.
To prevent the model from using filler words to satisfy length constraints, an [EOS] decay factor is applied, penalizing the "End of Sentence" token early in the generation process for longer targets.
Experimental Results
The models were evaluated on the MS COCO dataset using the Karpathy split. Key findings include:
- Controllability: The models achieved over 95% control precision across requested length ranges.
- Detail Scaling: Increasing the length level naturally forces the model to incorporate more visual concepts and attributes, as reflected in improved SPICE scores for longer captions.
- Efficiency: LaBERT demonstrated a 2.5x speedup over autoregressive baselines for long captions due to its parallel generation nature.
Conclusion
By treating length as a proxy for detail, this work provides a simple yet effective mechanism for controllable image captioning. While performance slightly dips at extreme lengths due to data scarcity in MS COCO, the combination of length embeddings and non-autoregressive architectures like LaBERT represents a significant step toward efficient, high-fidelity AI descriptions.
Summary updated