The Role of Syntactic Planning in Compositional Image Captioning

Emanuele Bugliarello, Desmond Elliott

Abstract

Image captioning has focused on generalizing to images drawn from the same distribution as the training set, and not to the more challenging problem of generalizing to different distributions of images. Recently, Nikolaus et al. (2019) introduced a dataset to assess compositional generalization in image captioning, where models are evaluated on their ability to describe images with unseen adjective-noun and noun-verb compositions. In this work, we investigate different methods to improve compositional generalization by planning the syntactic structure of a caption. Our experiments show that jointly modeling tokens and syntactic tags enhances generalization in both RNN- and Transformer-based models, while also improving performance on standard metrics.

1. Introduction

Modern image captioning systems excel at describing familiar scenes but often fail when encountering novel combinations of known concepts—a challenge known as compositional generalization. For instance, a model trained on "white cats" and "brown dogs" may struggle to correctly describe a "white dog." This "paradigmatic gap" suggests that models often memorize specific word sequences (n-grams) rather than learning the underlying compositional logic of language. This paper explores whether explicitly planning the syntactic structure of a sentence can bridge this gap, drawing inspiration from traditional Natural Language Generation (NLG) pipelines.

2. Syntactic Planning Strategies

We investigate three primary architectural strategies for integrating syntactic planning into neural captioning models:

  • Sequential Decoder: The model generates a complete sequence of syntactic tags before generating the word sequence.
  • Interleave Decoder: The model alternates between predicting a syntactic tag and its corresponding word.
  • Multi-task Decoder: A shared image encoder supports two independent heads—one for predicting tags and another for words.
Overview of the proposed syntactic decoding strategies compared to a standard decoder.

These strategies allow the model to use syntax as a scaffold, constraining the vocabulary search space and forcing the decoder to learn abstract relationships between word categories rather than just surface-level statistics.

3. Syntactic Granularity

The effectiveness of syntactic planning was evaluated across four levels of linguistic complexity: CHUNK (phrasal groupings), POS (Part-of-Speech tags), DEP (Dependency labels), and CCG (Combinatory Categorial Grammar). Additionally, an IDLE baseline was tested, where a meaningless dummy tag is interleaved with words to test if the benefit arises from simply breaking up direct word-to-word dependencies.

4. Results and Discussion

Our experiments across RNN (BUTD) and Transformer ($M^2$-TRM) architectures demonstrate that syntactic planning consistently improves compositional generalization. Syntactic planning increased Recall@5 (the ability to mention held-out concept pairs) by approximately 2 points. The Interleave approach with POS tags proved particularly robust.

Performance comparison of the Sequential decoder across different syntactic granularities (+IDLE, +CHUNK, +POS, +DEP, +CCG).

Interestingly, even the IDLE tag improved performance over the baseline, suggesting that disrupting the model's reliance on memorized n-grams is a key mechanism for improvement. While the approach was highly effective for color-noun pairs, it faced challenges with relative concepts like size (e.g., "small plane"), which likely require external world knowledge beyond syntactic structure.

5. Conclusion

Explicit syntactic planning serves as an effective regularizer for image captioning models, enhancing their ability to generalize to unseen concept compositions. By forcing models to "plan" the grammatical structure, we reduce overfitting to training distribution n-grams. This benefit is architecture-agnostic, providing gains for both traditional RNNs and modern Transformers.

Summary updated

Abstract

Image captioning has focused on generalizing to images drawn from the same distribution as the training set, and not to the more challenging problem of generalizing to different distributions of images. Recently, Nikolaus et al. (2019) introduced a dataset to assess compositional generalization in image captioning, where models are evaluated on their ability to describe images with unseen adjective-noun and noun-verb compositions. In this work, we investigate different methods to improve compositional generalization by planning the syntactic structure of a caption. Our experiments show that jointly modeling tokens and syntactic tags enhances generalization in both RNN- and Transformer-based models, while also improving performance on standard metrics.
BibTeX
@inproceedings{bugliarello2021role,
  author = {Emanuele Bugliarello and Desmond Elliott},
  title = {{The Role of Syntactic Planning in Compositional Image Captioning}},
  booktitle = {EACL},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.48},
}
Figure