Image captioning models traditionally face a stark trade-off between generation speed and linguistic quality. Autoregressive (AR) models produce high-quality, coherent sentences by generating words sequentially, but their word-by-word nature creates a significant latency bottleneck. Conversely, Non-Autoregressive (NAR) models generate all words in parallel, offering high speed but often resulting in "word salad"—sentences plagued by repetitions and omissions due to a lack of sequential understanding. This paper introduces SATIC (Semi-Autoregressive Transformer for Image Captioning), a hybrid approach that achieves the "Goldilocks zone" of high-speed generation without sacrificing caption quality.
The Semi-Autoregressive Framework
SATIC operates by generating captions in "chunks" or groups of size $K$. While words within a single group are generated in parallel, the model remains globally autoregressive: each new group of $K$ words is conditioned on all previously generated groups. This allows the model to maintain long-range dependencies while significantly reducing the number of decoding steps required.
As shown in the conceptual comparison above, the SAIC (SATIC) decoder bridges the gap between the slow, step-by-step AIC and the fast but error-prone NAIC by processing multiple tokens ($Y1, Y2, ...$) simultaneously within a structured sequence.
Architecture and the Relaxed Mask
The core technical innovation of SATIC is the Relaxed Mask. In a standard Transformer, a causal mask prevents the model from attending to future tokens during training. SATIC modifies this into a block-diagonal structure that allows tokens within the same group of size $K$ to be generated in parallel while still masking future groups.
This architecture, illustrated above, utilizes a Relaxed Masked Multi-Head Self-Attention layer. By shifting the output by $K$ steps, the model learns to predict a block of words at once, effectively utilizing GPU parallelism more efficiently than standard AR models.
Training Strategies
To ensure the semi-parallel generation remains coherent, the authors employ two critical training techniques:
- Sequence Knowledge Distillation (SeqKD): The SATIC "student" model is trained to mimic the outputs of a pre-trained AR "teacher" model. This provides a cleaner, more structured target than raw human captions, which helps the model learn linguistic patterns more effectively in a parallel setting.
- Self-Critical (SC) Training: Using reinforcement learning, the model is directly optimized for the CIDEr score. This stage is vital for reducing the word repetitions that often occur when multiple tokens are predicted simultaneously.
Experimental Results
Evaluated on the MSCOCO benchmark, SATIC demonstrates a remarkable balance of performance and efficiency. With a group size of $K=6$, the model achieves a latency of 35ms on an NVIDIA Tesla T4, representing an 8.69x speedup over traditional AR models (304ms).
Crucially, this speedup comes with minimal impact on quality. The CIDEr score only decreases from 129.7 (AR) to 126.2 ($K=6$). The $K$ parameter serves as a tunable dial for developers; lower values of $K$ prioritize quality, while higher values maximize throughput.
Conclusion and Future Work
SATIC proves that semi-autoregressive decoding is a viable path for real-time image captioning applications. While the model occasionally struggles with minor repetitions at very high $K$ values (e.g., "two oranges and a orange"), it significantly outperforms fully non-autoregressive alternatives. Future research directions include developing adaptive group sizes, where the model dynamically adjusts $K$ based on the complexity of the visual scene or the linguistic structure of the sentence being generated.
Summary updated