The Role of Syntactic Planning in Compositional Image Captioning
Paper · 2021 · Emanuele Bugliarello and Desmond Elliott
Summary
An image captioner can learn to describe white objects and to identify dogs without learning to say that a particular dog is white. This paper asks whether giving the system a way to plan the grammar of its caption helps it put familiar concepts together in unfamiliar ways. The authors use a version of the English COCO captioning dataset in which selected combinations of a noun with an adjective or a verb are withheld from training. The individual concepts can still appear separately. At evaluation, a caption has to connect the right words in the right grammatical relationship. Mentioning the color and the animal somewhere in the same sentence is insufficient. The task sits at the intersection of vision and language. Vision & language
The authors compare several ways to teach a captioner about sentence structure. It can predict all the grammatical labels before writing the caption, alternate between a label and its word, or practice predicting labels as a separate task. An alternating captioner, for instance, predicts that the next word will be an adjective and then chooses the adjective itself. The labels are removed from the finished caption. Alternating words with part-of-speech tags gives the strongest validation result in the initial comparison with a recurrent captioner. Even alternating words with a repeated, meaningless marker helps on that test, suggesting that some of the benefit comes from changing how the caption is generated.
The authors then try the part-of-speech method with a recurrent captioner, a recurrent captioner that reorders its candidates using their fit to the image, and a Transformer captioner. Test recall among the top candidates improves in all three comparisons. The strongest test result comes from the recurrent captioner with a revised ranking component. Its average Recall@5 rises from 13.5 to 15.4 when it predicts part-of-speech tags alongside words. There is a tradeoff within that system. Adding tags harms image–text retrieval, and the authors find that letting the ranker learn how much weight to give each position recovers some of that lost performance.
The gains are uneven across what the images depict. Colors of inanimate objects respond particularly well, while descriptions of the size of living things remain difficult. Ordinary caption scores can also favor a different system from the one that best recovers the missing combinations. The Transformer scores strongly on standard caption metrics, but adding tags lowers its BLEU score and sometimes leaves its captions unfinished. The experiments show how an explicit grammatical prediction can help a captioner express an unfamiliar combination, while exposing separate difficulties in recognizing the scene, choosing which detail to mention, and completing a usable sentence.
Deep dive: The Role of Syntactic Planning in Compositional Image Captioning
The paper tests whether planning a caption's grammar helps image captioners describe new combinations of familiar objects, properties, and actions. · about 37 minutes to read
The problem and its context
Knowing the parts and expressing the whole
A caption has to convey something about the arrangement of the things it names. When several objects appear in a picture, an adjective needs to describe the intended object. A verb needs to be connected to the person, animal, or thing taking part in the action. A captioner that can name the relevant objects has solved part of the task. It still has to turn its visual evidence into a sentence that tells the reader how those objects, properties, and actions fit together.
The paper studies this problem through compositional generalization, the ability to handle a new combination of components encountered separately before. As the authors use the term, the novelty belongs to the combination under examination. The captioner can have seen dogs described with other properties and white used for other objects. A description of a white dog then tests whether it can bring those experiences together for the pictured animal. This use of compositionality draws on earlier work that asks what happens when familiar elements appear in arrangements missing from training. Rearranging the Familiar
An ordinary train and test split can evaluate captions for images the system has never seen. A new picture can nevertheless show a combination that is familiar from the training captions. A split built around missing combinations asks a more specific question. It withholds image examples whose descriptions use a designated pairing and checks whether the captioner can recover that pairing from images in the evaluation set. An image need not introduce a new word to make the test difficult. The challenge is to use known words together in response to the scene.
The paper adopts a benchmark from Nikolaus and colleagues, who set aside combinations of adjectives and nouns and of verbs and nouns. Their investigation pointed to the language generation component as an important source of difficulty for recurrent captioners. They also showed that an image–sentence ranker could help. A captioner generates candidates, and the ranker changes their order according to how well they fit the image. Bugliarello and Elliott retain this idea for part of their study while asking what can be done earlier, as the captioner decides which words to produce.
The related work situates this test among other ways to examine unfamiliar visual combinations. Earlier studies posed such combinations as classification problems, asked systems to predict triples, or investigated captioning with unseen objects. Here the noun itself can be familiar. The desired output is also a sentence, so recognizing that a combination is present and choosing a grammatical way to express it both matter. The evaluation can identify a failure to express the pair, while the reason behind that failure remains a separate question.
Where sentence planning fits
The authors draw on a traditional account of text generation that divides the work into stages. Text planning selects and organizes what to communicate. Sentence planning decides how to package that material into sentences, including how to combine information, which words to use, and how to refer to entities. Linguistic realization produces the final wording with the appropriate grammar, word forms, and orthography. Captioning a single scene puts the emphasis on the passage from selected visual content to the structure and wording of a sentence.
The paper also cites studies of how people describe visual scenes. The account it takes from this work distinguishes choosing something to talk about, deciding how to say it, and speaking. This gives the authors a reason to consider an intermediate prediction between extracting image features and writing a caption. Their experiment translates that idea into outputs a captioner can be trained to predict. It asks whether predicting grammatical labels helps with recombination. The labels give a concrete, testable meaning to sentence planning in this setting.
The proposal has precedents in captioning. MIDGE started from visual detections and used phrase structure to put material together. TreeTalk assembled tree fragments by integer linear programming, an optimization procedure for selecting a combination of discrete options. Another system discussed in the paper began with a skeleton sentence expressing the main objects and relations, then decided which attributes to add. In each case there was an identifiable intermediate decision about how to organize a description.
Many neural captioners discussed in the paper take the image representation directly into a word-generating decoder. This follows the encoder–decoder pattern, in which one part represents the input and another part produces the output sequence. The image can be represented at different granularities. The decoder can maintain a recurrent state as it writes, or use a Transformer whose attention operations determine which information to use. The common feature for this study is that the decoder is trained to predict words from visual features and the preceding words. Sequence to Sequence Learning with Neural Networks, Show and Tell, Show, Attend and Tell
There were also neural systems with explicit syntax predictions before this study. One captioning system used a recurrent decoder for both words and grammatical categories, with separate output layers, and also trained on object classification. Another assembled captions from noun phrases drawn from a fixed pool and predetermined connectors. For the authors, a pool assembled from training examples raises a practical question about how readily the system can construct a missing phrase. Building a caption one word at a time leaves the grammar free to recur with a different lexical combination.
Other work used a limited collection of part-of-speech patterns to generate diverse captions. It predicted a pattern conditioned on the image and used that pattern to guide the decoder. A video captioning study also paired words with grammatical tags. In the description given by Bugliarello and Elliott, its tag predictions did not depend on previous tags, and its word predictions used the current tag and the video. These are distinct ways to give syntax a role. The present study makes the timing and context of the syntax prediction variables in the experiment.
Why change what the captioner predicts?
Training rewards a captioner for assigning high probability to the human captions it sees. A word that often follows a particular preceding word is a good prediction in many training examples. For a held-out combination, the desired continuation can be a word the captioner knows well but has never been rewarded for using in that context. The image provides evidence for the combination, while the distribution of words in the training captions can favor a different continuation.
A grammatical category gives the decoder another way to organize its choices. If it has decided that the next position is for a noun, it can reuse that decision across descriptions with different nouns and properties. A tag that encodes a grammatical relationship can give a more specific cue about the role the word should play. These are reasons to try predicting tags. Their practical effect depends on whether the decoder learns to use the intermediate prediction and whether a tag form contains the information needed at the point where it is supplied.
The authors therefore vary both the kind of syntax and the arrangement of the predictions. A full plan exposes the outline before the first word. An alternating plan makes each tag immediately available before the word it describes. A separate syntax task asks the shared decoder to learn structure without placing a predicted label inside the caption’s word sequence. These alternatives make it possible to compare the effects of adding a planning stage, supplying local grammatical cues, and learning from extra supervision.
The method, step by step
From the image to a training target
The input to the captioner is a set of visual features. The authors use Bottom-Up attention to extract features for 36 regions of interest per image. The region feature extractor was trained on Visual Genome. A region provides a vector, a list of numerical features the captioner can use when it chooses what to say. The recurrent captioner described in detail later in the paper attends to these features during generation. The grammatical labels come from the captions, through a separate preparation process.
The text data come from English Microsoft COCO. The authors adopt the earlier benchmark’s 24 concept pairs and organize the experiments around four splits, with six pairs held out in each. For the designated pairs, validation and test images are selected by the presence of a pairing in at least one of their captions. The complementary training data allow the constituents to appear independently. Assignment at the image level matters because an image can have several descriptions. Once a caption identifies the held-out combination, the split keeps that image and its other descriptions out of the corresponding training set.
The training and validation images come from COCO’s train2014, and the test images come from val2014. These identifiers name the original COCO collections. In the paper, validation determines when to stop training and provides the initial comparison of planning approaches. The test results are reported separately for the approaches carried forward. The evaluation datasets also preserve the multiple human captions associated with each image, which the authors later use to examine agreement about whether the target pair is worth mentioning.
The authors lower-case captions and remove punctuation. StanfordNLP divides the resulting text into tokens, identifies lemmas, and supplies lexical categories and dependency relations. Tokenization establishes the units at which the captioner predicts words and tags. Lemmatization identifies the underlying word form, which lets the evaluation deal with a verb whose surface form changes according to its grammatical use. Dependency parsing identifies relationships such as an adjective modifying a particular noun. Those relationships are useful both as possible training labels and as part of the criterion for finding a target pair in a caption. Universal Dependency Parsing from Scratch
Shallow phrase labels are obtained with a classifier-based chunk tagger trained on CoNLL2000 data using NLTK. Its tagging scheme identifies positions inside and outside chunks and marks their beginnings. For the categories used in combinatory categorial grammar, the authors apply an A* CCG parser with ELMo representations. These processing routes supply different annotations of a caption. The captioner is trained with the chosen representation for the corresponding experiment. Introduction to the CoNLL-2000 Shared Task Chunking, Deep Contextualized Word Representations
Training and using a syntax-aware captioner
The steps in order.
The word prediction objective
The starting point is a captioner that predicts the next word from the image representation and the words already written. A candidate caption is a succession of such decisions. A system can give high probability to an early part and low probability to a later word, making the entire caption less likely under its learned distribution. The authors use this standard maximum-likelihood objective to explain why it might be useful to put an explicit structural decision into the generation process.
L = ∏ᵀₜ₌₁ P(yₜ | y₍₍ₜ, v)
In this expression, L is the likelihood of the target sequence given the image features v. The product sign ∏ multiplies the conditional probabilities over positions indexed by t, beginning at 1 and ending at T, the length of the target sequence. P denotes the probability assigned by the captioner, yₜ is the target at position t, and the history written after the conditioning bar as y₍₍ₜ denotes y at positions before t. The conditioning bar means that the probability is evaluated given that history and the visual features. The paper allows v to stand for a feature vector or a set of them.
For the standard captioner, the target history contains surface tokens, the written forms of words. In training, teacher forcing supplies the expected previous outputs as context, so a wrong prediction early in training does not replace the target that the next prediction receives. At inference, the system generates from its own preceding outputs. The planning variants change what those targets and histories contain. The recurrent and Transformer captioners keep their respective ways of processing the image and the generated sequence.
Predicting structure before, during, or alongside words
In SEQUENTIAL, the target contains an entire run of grammatical labels followed by an entire run of words. There are T tag positions and T corresponding surface positions for a caption of length T. For example, an adjective and noun label would both be produced during the planning run. The matching adjective and noun would be generated during the following word run. When the captioner starts writing words, its earlier tag sequence is available to it as context. It has already committed to that sequence in the candidate it is currently extending.
This arrangement makes the plan visible as a complete sequence. It also separates each word from its corresponding tag by the length of the caption. The decoder has to find or retain the relevant part of the plan as it proceeds through the word segment. If an earlier word choice changes what the remainder of the sentence calls for, the previously generated plan stays in the sequence. That is a consequence of its position in the output order, and one reason the authors test a more local form of planning.
INTERLEAVE places the label immediately before its word. The decoder predicts the category for the next position, predicts the surface form, and repeats that pattern. Suppose a caption has reached the beginning of a description of a dog. The decoder can emit an adjective tag and then choose a color word. It can then predict a noun tag in the context of that word as well as of the earlier labels and words. Its next structural decision can respond to the surface form it actually generated. The relationship between each label and its realization is also local in the sequence.
The authors motivate this format in terms of word-to-word dependencies. Predicting a tag between words gives the decoder an immediate cue that can narrow the range of plausible next words. The tag is an output the decoder learns to use through training. The paper does not describe a grammar that filters out all words outside the predicted category. Earlier words also remain part of the history, so a tag between two words changes their adjacency without erasing the evidence the earlier word provides.
MULTI-TASK puts the choice at the start of the sequence. A start-of-sentence marker, <S>, requests the caption words. A start-of-syntax marker, <T>, requests the grammatical labels. Both tasks use the same decoder, so learning to read the image and produce a label sequence can shape the representations used to generate words. When asked for a caption, the decoder follows its word prediction task. It does not first need to run the syntax task and consume its results as a plan.
In terms of training workload, the sequential and alternating formats increase the length of an individual example because both forms appear in it. The separate-task format keeps each example at its original length and doubles the number of examples in a training epoch. The sequential format places the corresponding tag and word a caption length apart. The alternating format puts them next to each other. In the separate-task format the distance is undefined because the tag and word belong to different target sequences. These differences affect what the decoder can see when predicting a word and how much work is organized into each training sequence.
What the labels tell the decoder
CHUNK represents shallow phrase structure. Its labels can indicate that a token belongs to a noun phrase or a verb phrase and where it falls in the chunk. A phrase category groups different words by their contribution to a larger unit. It can mark the span of a noun phrase without spelling out the distinct grammatical role each word plays in that phrase.
POS marks the lexical category of the individual word, such as noun or adjective. When a POS tag immediately precedes a word, the information is directly relevant to choosing among word types. A sequence of such tags also sketches the order of categories in a caption. POS by itself leaves open which noun a modifier attaches to or which other phrase a verb requires.
DEP uses the dependency relation associated with a token. An adjective can receive the adjectival modifier label when it modifies a noun. A dependency label therefore gives information about the word’s role relative to other words. The target in this study is the label for each token. Reconstructing the full dependency tree would also require information about which particular word each token attaches to. That distinction matters when comparing DEP as training supervision with the dependency check used to score a finished caption.
CCG assigns a grammatical category that can encode how a word combines with neighboring phrases. The authors illustrate it with the category (S\NP)/NP for a transitive use of the verb sees. S is a sentence and NP is a noun phrase. The forward slash indicates that the verb takes a noun phrase to its right. The remaining S\NP combines with a noun phrase to its left to form a sentence. A category like this supplies more about the expected surroundings of the verb than the information that the word is a verb.
For a control, the authors also put the same artificial <IDLE> tag before every word in the alternating format. This preserves the new rhythm of tag and word predictions. An adjective, noun, or verb all have the same preceding marker, so the marker cannot explicitly name a category or relationship. Comparing this arrangement with ordinary words and with meaningful tags helps distinguish changes associated with inserting a new prediction position from changes associated with what that position conveys.
The captioners and the ranking component
The initial planning sweep uses Bottom-Up and Top-Down attention, abbreviated BUTD. It is a recurrent captioner with two long short-term memory layers. An LSTM is a recurrent component that carries a state forward through the sequence. In the authors’ account, the first layer encodes the sequence of generated forms, and the second uses attention to integrate visual features and generate the next output. With alternating tags, the recurrent sequence contains the tags along with the words.
BUTR extends this captioner with an image–sentence ranking task. The image and a candidate sentence are projected into a shared space in which the ranking network can compare them. This gives the system a way to reorder the captions it has generated according to their fit to the image. The paper uses BUTR to refer to the version of the earlier system that includes this reordering step. The ranker’s original sentence representation is a projection of the final state of the first recurrent layer.
s = W hˡₜ₌ₜₘₐₓ
Here s is the sentence vector, W is the learned projection, and hˡₜ₌ₜₘₐₓ is the hidden state h of the first recurrent layer l at the final position. The subscript uses t for the step and tₘₐₓ for the last step, denoted T in the paper. In this expression the ranker receives a projection of that last state, which has to summarize the whole generated sequence.
The authors compare this representation with two ways of gathering information from all positions. The mean variant averages the hidden states before projection, giving each state the same weight. The weighted variant learns a score for every state and turns the collection of scores into weights. It then builds its sentence representation from the weighted states. This gives the ranker a way to emphasize whichever positions carry the most useful information for image matching. It is an attention operation over the sequence used for ranking, separate from the caption decoder’s attention to image regions.
ωₜ = Wᵅ hˡₜ
Here ωₜ is the unnormalized importance score for step t, Wᵅ is the learned linear scoring map, and hˡₜ is the hidden state of layer l, the first LSTM layer, at step t. The superscript α on the map designates its role in learning the weights. This operation is applied across the states in the sequence.
α = softmax(ω)
Here ω is the collection of position scores ωₜ, and α is the collection of resulting attention weights. The softmax operation makes the weights positive and normalizes them over the positions, keeping a higher weight for a higher score. Each component αₜ can then be applied to the state at the corresponding position.
s = W ∑ᵀₜ₌₁ αₜ hˡₜ
Here s is the sentence representation in the shared image–sentence space and W projects the pooled states into that space. The sum ∑ runs over the steps t from 1 through the final step T. At every step, attention weight αₜ scales state hˡₜ from the first layer l. The resulting sentence vector reflects states from across the sequence, with their contributions determined by the learned weights. The authors call this variant BUTR weight.
The Transformer in the study is the Meshed-Memory Transformer, abbreviated M²-TRM. It supplies a different architecture for generating captions from visual features. The authors test it with and without the selected alternating part-of-speech format. The same target arrangement can therefore be examined in a recurrent generator, a recurrent generator with an image–sentence ranker, and a Transformer generator. Attention Is All You Need
Training and candidate generation
The authors follow the training procedures of the respective captioners and use Adam. BUTD and BUTR start with a learning rate reported as 1e − 4. Their Adam settings are 0.9 and 0.999 for the first and second decay parameters, and gradients are clipped when they exceed 10.0. In BUTR, GradNorm adjusts the relative weights of the training losses. The appendix reports a learning rate of 0.01 for this procedure and a default asymmetry setting of 2.5. It also reports tuning that setting when adding syntax and taking the absolute value of the loss weights during renormalization for more stable training.
The Transformer begins with a learning rate of 1 and Adam decay parameters of 0.9 and 0.98. Its warm-up lasts 10, 000 iterations. During optimization with CIDEr-D, its learning rate is fixed to 5e − 6. The Transformer uses batches of 50 examples. The recurrent captioners use batches of 100 without syntax, and batches of 50 when syntactic forms are added because of memory limits. The experiments ran on a single NVIDIA TitanX GPU in a shared cluster.
For model selection, training stops after validation BLEU fails to increase for five consecutive epochs. The score is computed on words after stripping out any grammatical tags. The procedure therefore uses the usual caption output to select a checkpoint, even when the experiment evaluates how frequently the checkpoint recovers a designated new combination. BLEU score
At evaluation, the output length limit is 20 when generating only words and 40 when the sequence contains grammatical labels as well. The captioners run beam search with a width of 100. Beam search retains several promising partial sequences as it generates, making more alternatives available than a search that keeps only its leading continuation. In the ranking variants, the image–sentence ranker can change which candidates end up near the top. The authors make the experiment’s code and data publicly available through their syncap project.
Experiments and results
What counts as a successful caption?
Each evaluation set brings together images selected for held-out pairs. A caption counts towards the recall of a pair when it expresses the designated concepts and connects the adjective or verb to the intended noun according to the dependency analysis. This is stricter than checking whether the relevant words occur. If a candidate mentions the right property but assigns it to a different object, it supplies the vocabulary without expressing the requested combination.
The evaluation gives the captioner several opportunities per image. It asks whether any of the top candidates meets the criterion for the pair. The following formula writes the image-counting rule with the image index in the set being counted.
Recall@K = |{m : ∃ k ∈ {1, …, K}, sₖᵐ ∈ C}| / M
Here K is the number of generated captions considered per image, M is the number of images in the evaluation set for the pair, and m indexes those images. The index k runs from the first candidate through candidate K, and sₖᵐ is candidate k for image m. C is the set of captions that contain the expected pair with the required dependency relation. The expression ∃ k asks whether at least one eligible candidate belongs to C. The braces describe the set of image indices satisfying that condition, and the vertical bars count them. Division by M gives the share of evaluation images for which the captioner succeeds. The paper’s main compositional score, R@5, uses K equal to 5 and is averaged over the concept pairs.
This measure gives credit when a useful caption makes the shortlist, even if a different caption comes first. The distinction matters for a system with a ranker. It can move a candidate into the evaluated set by improving its position, while improvements to the captioner can make a suitable sentence available in the first place. In this benchmark, an equally plausible description that omits the designated property or action still leaves the recall outcome for that image unchanged.
For ordinary caption evaluation, the paper reports METEOR, SPICE, CIDEr, BLEU, and multi-reference BERTScore. These are reference-based ways to assess the generated wording or content. The authors use pycocoeval for the first group and average those scores across the four splits. The multi-reference BERTScore aggregate is an average over captions. The study treats those caption metrics and the held-out-pair metric as separate outcomes. METEOR, SPICE, CIDEr
How the splits put the question to the test
The designated pairs span colors, sizes, and actions. One split includes a black cat, a red bus, and a pairing of eating with a man. Another includes a brown dog, a white truck, and a pairing of riding with a woman. Within a split, the same collection of missing combinations is relevant to both validation and test. Each split creates a different gap in the captioner’s experience. A setting that helps only with a particular often generated phrase has less scope to improve the average over the benchmark.
The appendix reports the following image counts. These are counts of images assigned to each partition for a split, with the original COCO collections determined before the evaluation of particular captioners.
| Split | Training images | Validation images | Test images |
|---|---|---|---|
| 1 | 79, 847 | 2, 936 | 1, 349 |
| 2 | 79, 823 | 2, 960 | 1, 355 |
| 3 | 79, 922 | 2, 861 | 1, 459 |
| 4 | 79, 627 | 3, 156 | 1, 501 |
The paper reports slightly different partition sizes from the earlier benchmark implementation in spite of using the same target pairs. The authors attribute the difference to the tools used for tokenization and parsing. Whether a caption is identified as containing a pair can affect whether its image qualifies for an evaluation partition. The tool choice therefore affects both the generated-caption check and the make-up of the dataset used to measure it.
The initial comparison on recurrent captioning
The first experiment varies the placement and content of tags while keeping BUTD as the captioner. The ordinary word-only system has an average validation R@5 of 9.5. DEP is strongest among the sequential settings, POS is strongest among the alternating settings, and DEP leads the separate-task settings. The chart compares those leading settings with the baseline and the alternating marker control. The authors use the result to select INTERLEAVE with POS for the experiments across architectures.
Selected BUTD planning settings on English COCO validation Recall@5
Alternating part-of-speech tags with words gives the highest recall in the initial planning comparison.
The numbers
| System or setting | Recall@5 |
|---|---|
| Word-only BUTD | 9.5 |
| Sequential DEP | 11.1 |
| Interleave IDLE | 10.5 |
| Interleave POS (this paper) | 11.8 |
| Multi-task DEP | 11.4 |
The standard metrics give a different view of the same sweep. Sequential DEP, which improves recall of held-out pairs, has a validation CIDEr of 89.7 and BLEU of 30.8. The word-only baseline records 92.7 and 32.3 on those validation metrics. The alternating POS setting records 94.4 for validation CIDEr and 32.7 for validation BLEU. Hence, the position of the syntactic predictions matters for ordinary caption quality as well as for the chances of recovering a particular pair.
The best separate-task setting for compositional recall uses DEP, but CCG gives particularly strong ordinary caption scores in that format. On validation, MULTI-TASK with CCG reaches 95.6 CIDEr and 42.0 BERTScore. Its validation R@5 is 10.8. A separate syntax task can therefore yield substantial gains in reference-based scores while an alternating task does better at moving held-out pairs into the shortlist. The choice of metric affects which configuration looks strongest.
Recovery of unseen combinations on the test data
With POS tags placed before words, the average test R@5 increases in every architecture comparison. The largest values in the chart come from BUTR weight with tags. The gain for the Transformer matters to the authors’ broader claim because the initial choice of tagging arrangement was made with a recurrent captioner. The Transformer supplies a test of whether that choice is useful beyond the system used for the sweep.
Word-only and alternating POS captioners on English COCO test Recall@5
The alternating POS format improves each captioner, and the weighted ranker with POS has the highest test recall.
The numbers
| System or setting | Recall@5 |
|---|---|
| BUTD | 9.2 |
| BUTD with POS | 11.1 |
| BUTR weight | 13.5 |
| BUTR weight with POS (this paper) | 15.4 |
| M²-TRM | 10.1 |
| M²-TRM with POS | 12.1 |
The validation comparisons have the same direction. BUTD goes from 9.5 to 11.8 on validation R@5, BUTR weight goes from 14.9 to 16.4, and M²-TRM goes from 10.6 to 13.2. These are comparisons of configurations within each architecture. Across architectures, the ranker with POS leads on the held-out-pair task, while the Transformer with POS leads some of the standard caption measures.
For BUTD, the test CIDEr rises from 94.4 to 96.3, and test BLEU rises from 32.4 to 32.9. Test METEOR stays at 25.4. For BUTR weight, test CIDEr remains 91.0, while BLEU moves from 28.6 to 28.7 and SPICE moves from 20.1 to 20.0. These modest movements alongside the recall gains indicate that the two evaluations are sensitive to different aspects of the caption.
The Transformer illustrates that separation more sharply. Test CIDEr stays at 115.7 and test BERTScore rises from 44.5 to 44.9, while test BLEU declines from 36.5 to 35.0. On validation, its BLEU score declines from 37.2 to 35.4. The authors inspect examples and find prematurely terminated captions whose last words introduce a phrase that never arrives. They discuss this in connection with reward hacking, where an optimization objective can favor behavior that works against part of the intended outcome. Concrete Problems in AI Safety
A captioner can consequently do better at the designated compositional task without improving all aspects of the final wording. The baseline Transformer already produces high standard caption scores while its validation compositional recall is close to BUTD’s. The ranking captioner has the reverse advantage in these comparisons. It recovers held-out pairs more often, including after both systems receive the same alternating syntax treatment. The experiment gives standard caption evaluation and generalization to missing pairs distinct roles.
What happens when the ranker reads tags
The ranking experiment compares the original final-state representation with uniform averaging and learned weighting. With the original BUTR ranker, inserting POS tags lowers validation caption R@5 from 15.0 to 12.0. Image–text retrieval also falls in both directions. For text retrieval, the query is the image and the desired result is the associated text. For image retrieval, the query is the text and the desired result is the image. The retrieval scores concern the match between the two modalities. Caption R@5 concerns recovery of a particular held-out pair in a generated shortlist.
BUTR sentence representations on English COCO validation text retrieval Recall@5
Learned weighting gives the strongest text retrieval, and alternating tags weaken retrieval for both rankers compared with their own word-only settings.
The numbers
| System or setting | Text retrieval Recall@5 |
|---|---|
| Final state | 45.4 |
| Final state with POS | 39.3 |
| Mean pooling with POS | 47.7 |
| Learned weighting (this paper) | 51.7 |
| Learned weighting with POS | 48.6 |
The image retrieval results follow the same broad pattern. The original final-state ranker records 35.1 on validation image retrieval R@5 and 31.0 with POS. Learned weighting records 40.9 with word-only generation and 40.2 with POS. The authors report that the corresponding validation caption recall is 14.9 without POS and 16.4 with POS. This is the combination they carry into the test evaluation. The ranker can draw on the recurrent sequence without suffering the same loss the original final-state ranker exhibits when tags appear.
Mean pooling with POS reaches 14.2 on validation caption R@5. Its validation text and image retrieval R@5 scores are 47.7 and 38.6. Providing access to intermediate states through averaging is therefore enough to improve retrieval over the original ranker with POS. Learned weighting with POS raises both retrieval scores in this comparison and also gives the stronger caption result. The gap between caption and retrieval measurements matters here. For the weighted ranker, POS benefits caption recall even as retrieval moves below the corresponding word-only score.
What the ablations show
Changing the order and meaning of tags
The planning sweep compares distinct ways of making structure available. It shows that the result depends on what the decoder predicts and when it sees that prediction. Sequential POS has a validation R@5 of 9.5, the same value as standard BUTD. Sequential DEP reaches 11.1 and sequential CCG reaches 10.6. The authors suggest that a complete plan is more useful when its labels describe how words relate or combine. A sequence of lexical categories alone may give too little information once the decoder has to choose the words at a distance from the plan.
POS is strongest in the alternating setting. The tag immediately before the word indicates its category at the moment it is needed, and the next tag can respond to the word already chosen. CHUNK reaches 9.7 on validation R@5 with INTERLEAVE, while CCG reaches 10.5. A coarse phrase label can leave more open about the kind of word to predict next. A richer tag carries more structural detail, whose usefulness still depends on how easily the captioner can apply it in this particular output arrangement.
The separate-task comparison shows another way for supervision to help. With MULTI-TASK, DEP reaches 11.4 on validation R@5, while POS and CHUNK both reach 10.3. Because word generation under this format has no adjacent predicted grammatical label, these gains can occur through what the shared decoder learns from practicing both tasks. The design also changes how many target sequences are seen in an epoch. It offers evidence about the effect of this training recipe and leaves room for more than one explanation of the improvement.
Across the initial comparison, some finer tag set outperforms CHUNK in each planning format. The strongest tag type varies with the format and the outcome being considered. For instance, the same CCG supervision that gives strong standards-based caption results in MULTI-TASK is surpassed by DEP on that format’s validation R@5. The interaction supports examining the function of a tag where the decoder uses it. Granularity on its own does not order the captioners consistently.
The artificial marker sharpens the interpretation. INTERLEAVE with IDLE reaches 10.5 on validation R@5, whereas standard BUTD reaches 9.5. The authors had expected an attention-based generator to learn to ignore the repeated marker. Its improvement suggests that changing the structure of the output sequence can be beneficial even without labeling particular words as nouns, adjectives, or verbs. The intervention breaks up consecutive word positions, which changes how the next-word objective is presented. Meaningful POS tags at those positions yield the strongest result in the alternating comparison, consistent with an additional benefit from their content.
In the paper’s account, the dummy result supports the idea that reliance on familiar local word sequences can contribute to the generalization problem. The comparison also changes the number and order of prediction steps. All preceding words are still available to the decoder. As a result, the control shows that adding a structural prediction position can matter, while leaving the exact internal use of that position unresolved.
Which combinations benefit?
The analysis divides held-out pairs by color and size, by whether the object is animate, and by whether the verb is transitive or intransitive. A transitive verb involves an object in its construction, while an intransitive use lacks a direct object. The categories separate cases that can look similar in the overall average. Describing the color of a bus and judging the size of an animal both call for an adjective, but the visual and contextual evidence needed for the two descriptions can be very different.
In the initial sweep, the authors find DEP helpful across several color and size groupings and planning formats. They point to the notable gains for inanimate colors with alternating POS. In the final architecture comparison, the validation R@5 for inanimate colors rises from 10.4 to 20.2 for BUTD. It rises from 24.9 to 30.4 for BUTR weight and from 11.9 to 17.9 for M²-TRM. These are category averages over the specified held-out pairs. The result is consistent with the authors’ conclusion that the tag intervention is particularly effective for colors of inanimate objects.
The appendix allows a closer look at specific pairs. For the red bus pair, validation R@5 for BUTD goes from 16.1 to 24.0, while M²-TRM goes from 13.3 to 24.9. For the blue bus pair, BUTD goes from 6.5 to 22.7 and BUTR weight goes from 21.3 to 33.2. A benefit that appears in several such comparisons can still vary within the category. For the black cat pair, BUTD moves from 16.1 to 15.3 while the weighted ranker moves from 26.0 to 29.1. The overall color results therefore admit individual reversals.
The size results stay near the floor of the evaluation, especially for animate objects. For animate size pairs, the final validation R@5 averages for BUTD are 0.9 with word-only generation and 0.4 with POS. BUTR weight records 0.8 without POS and 0.9 with POS. M²-TRM records 0.2 and 0.1. The appendix reports 0.0 for the big cat pair in every displayed architecture and tag comparison. The authors relate the difficulty to the knowledge needed to judge a size relative to other members of the same class. The captioner has to decide whether the pictured dog is big for a dog, a judgment for which a grammatical pattern provides little evidence.
For action pairs the pattern is more favorable. Validation R@5 for the transitive group rises from 21.8 to 24.1 for BUTD and from 29.1 to 32.3 for M²-TRM. In the intransitive group, M²-TRM rises from 16.6 to 20.6. These averages show that the benefits of the alternating format extend to some links between nouns and actions as well as to color modification. The pair-level results also show mixed behavior. On the eat horse pair, for instance, the Transformer rises from 49.3 to 56.3 on validation R@5, while the weighted recurrent ranker moves from 44.6 to 39.4.
The authors attribute the stronger action performance of their BUTD baseline relative to the earlier study partly to a wider beam. Their validation comparison gives BUTD an R@5 of 7.8 with beam size 5 and 9.5 with beam size 100. Final architecture comparisons use the same beam size across systems. This check establishes that search affects the opportunity to recover the held-out pair. A wider search can leave more plausible descriptions available, and the syntax comparison takes place on top of that search choice.
How agreement among annotators changes the result
COCO annotators were given a relatively open task. A scene can reasonably be described by emphasizing its objects, their properties, their actions, or a more general setting. The authors use agreement among the references as an indication of the importance of a pair. When more descriptions of the image use the designated combination, the combination is more consistently selected by people given the same scene. The paper measures test recall as the minimum level of this agreement rises.
The test curves show higher recall for each captioner as the analysis considers pairs with stronger agreement. The authors also find increasing gains from incorporating syntax. The Transformer’s word-only system trails BUTD on pairs that more annotators choose, and alternating POS partly remedies that gap. At higher agreement, the authors observe that BUTD with POS becomes as effective as the word-only weighted ranking captioner. The result concerns the subset of images in that part of the agreement analysis. Over the full test setting, the weighted ranker combined with POS records the strongest average recall.
This analysis qualifies the interpretation of a missed pair. Some pairs occur in one reference among several legitimate descriptions of a scene. Recovering a pair under those conditions can require choosing a detail another annotator might omit. Where the references converge, missing the pair is a stronger signal that the captioner has overlooked or failed to verbalize a prominent detail. The agreement analysis draws on human descriptions already in the benchmark and gives another view of the role of content choice in the recall score.
Output variety, grammatical accuracy, and individual captions
The authors compare vocabulary diversity as well as benchmark recall. A word type is a distinct form, and a token is an occurrence in the produced text. A type–token ratio describes how many distinct forms occur relative to the amount of text. The paper reports segmented versions alongside counts of types, a percentage of novel captions, average sentence length, coverage of learnable words, and local recall of content words important to an image. These measures give different views of repetition and of the words a captioner can use.
In validation, the word-only Transformer uses 580 word types and has 80.1% novel captions. With alternating POS it uses 601 types and has 88.4% novel captions. The word-only BUTD has 463 types and 69.2% novel captions, compared with 466 types and 70.3% when it alternates POS. The Transformer’s segmented type–token ratios remain below BUTD’s in spite of the larger overall vocabulary and higher proportion of novel captions. This is why the authors distinguish the number of different words used across the corpus from how many distinct forms appear relative to length within the segments used for the ratio.
BUTR weight produces longer captions in this comparison. Its validation average sentence length is 10.3 with or without POS. The word-only weighted ranker reaches 783 types and 97.2% novel captions, and its coverage is 0.20. The word-only Transformer has validation coverage of 0.15 and a local recall score of 0.83, the same local recall score it attains with POS. The weighted ranker has a local recall score of 0.78 with or without POS. A system that uses a larger share of the learnable vocabulary across the dataset can thus coexist with another system that retrieves important content words more effectively for a given image.
The authors also examine whether BUTD produces tags that agree with the annotations. On validation, their sequence agreement measure for SEQUENTIAL and INTERLEAVE ranges from 95% to 99%. The comparison uses the StanfordNLP annotations as its reference as described in the paper. The appendix restricts this check to the settings that produce tags and words together in a sequence. MULTI-TASK generates them separately, so a tag sequence from that branch need not be the analysis of the caption generated by the word branch. The tag agreement result shows that the sequence formats generally produce usable tags by this criterion. It is a separate outcome from choosing the right word or recovering the target pair.
Individual captions clarify the distinction between recognizing objects and joining concepts. For an image with a woman on a bicycle, the paper shows a plain BUTD caption that locates the woman on the floor without mentioning the bicycle. The planning variants describe the bicycle and the woman’s action, with differences in which details they emphasize. In another example, a plain caption places a woman and child by a bench, while the tag-aware caption identifies a girl standing on a skateboard. Such cases show how an improvement can affect the core description rather than just add a modifier to an otherwise unchanged sentence.
The appendix also illustrates errors that persist with the syntax treatment. In a scene with a dog and a cat, several outputs identify different animals, including sheep or bears. Another output repeats the laptop mention in a caption involving a person on a bed. The comparison of an aircraft scene is more favorable, with several tag-aware captions using the colors of the aircraft that the corresponding word-only caption omits. These examples make clear why the image representation, the choice of content, and sentence generation all still matter once the captioner has a way to predict grammatical categories.
Limitations
Limits identified by the authors
Size descriptions remain a substantive weakness. The authors emphasize the difficulty of knowing whether an object is large or small relative to others of its kind. This is particularly visible for animals in the benchmark. The tag methods change the decoder’s access to grammatical structure. The comparison gives little evidence that the same intervention supplies the knowledge needed for a relative size judgment. The authors identify size–noun compositions as a direction for further work.
The paper also reports the Transformer’s prematurely terminated captions. Its higher recall with POS comes with lower BLEU, and the sample endings show a visible cost for the reader when a phrase stops before supplying its complement. The authors relate this behavior to the optimization phase and leave open whether proposed ways to mitigate it would work in their setup. Across the experiments, the strongest compositional recall is compatible with degradations on particular standard measures and with errors in individual captions.
Image–sentence retrieval presents a different tradeoff. POS reduces retrieval scores with the original ranker, and the paper’s learned weighting reduces that penalty while improving caption recall. Some retrieval scores still fall when POS is added to the weighted ranker. The adaptive ranker therefore improves the combination of generation and ranking for this benchmark while leaving a measurable cost on the ranking task itself.
The authors also qualify the scope of the tag accuracy analysis in their appendix. Their check covers SEQUENTIAL and INTERLEAVE, where the generated words and tags can be compared position by position. In MULTI-TASK, the outputs are separate, so the same comparison would not have the same meaning. The reported accuracy concerns agreement with automatic annotations. It gives the study a check on the generated forms under those conditions.
Limits visible in the experimental setup
The evaluation is built around selected pairs in English COCO. The strength of the design is that it makes missing combinations identifiable while their components remain available in training. The range of those combinations defines the scope of the evidence. Describing an unfamiliar pairing of a color and object or a verb and noun leaves open how the same captioners would handle longer chains of unfamiliar relations, different kinds of sentences, or a dataset with different images and annotation practices. The main comparison across architectures also uses one selected planning format and one selected tag set. The initial sweep gives evidence about the alternatives in BUTD.
The split is defined through language annotations. An image may depict a property or an action its annotators chose to omit, so the absence of a pairing in training captions establishes a gap in caption supervision. The setup cannot establish that the captioner has never received visual evidence for that combination. The features were extracted using a system trained on Visual Genome, and the reported split is constructed within COCO. The procedure does not establish a corresponding exclusion across the feature extractor’s training data. The conclusion is strongest when framed as generalization in caption production under the designated split.
Both split membership and candidate scoring depend on automatic text processing. The authors’ observation that partition sizes differ slightly from the earlier study makes the dependence concrete. A relevant pair could be missed by preprocessing or by a dependency analysis. Conversely, an output can match the required lexical and dependency pattern while remaining an imperfect description of the image overall. Standard caption metrics and qualitative examples broaden the assessment, but the benchmark still answers a targeted question about the expression of particular pairs.
The shortlist evaluation also leaves a gap between recovering a combination and choosing the single caption a reader would receive. Recall@5 gives credit regardless of where a successful candidate sits within the evaluated group. The beam comparison shows that the metric is responsive to search, and the ranker comparisons show that ordering contributes to it as well. A higher result establishes that the captioner and its selection procedure place more qualifying captions among the candidates considered. It does not establish the corresponding improvement for a user-facing caption chosen solely from the top position.
The controls do not isolate a unique explanation for the gains. The dummy marker shows that grammar is not required for all of the observed benefit. Meaningful labels add information, while changes to the sequence also alter the training problem. Some variants change sequence length, others change the number of training examples, and the recurrent comparisons change batch size when syntax is added. The experiments compare complete strategies for incorporating tags. A claim about the decoder’s exact use of each tag, or about equivalence to the planning that people do before speaking, would require evidence beyond the output comparisons.
Finally, the qualitative cases and the agreement analysis help interpret the scores without adjudicating every generated description. Some images allow several accurate captions, and some images appear to lead the captioners to misidentify what they depict. Whether a missing pairing is due to an error of recognition, a defensible decision to discuss something else, or a failure to combine words correctly remains unresolved for many individual cases. This distinction sets the boundary between the benchmark result and a broader claim about visual understanding.
What came after
ANCHOR cites the paper and studies language-driven subject conditioning for text-to-image synthesis. Its title places the use of linguistic information on the other side of the vision–language task. Bugliarello and Elliott begin with an image and ask how grammatical predictions affect the caption. ANCHOR begins with text and addresses how subject information conditions the image to be synthesized. The citation connects the work across those settings. The available account establishes the later paper’s topic and citation, while leaving the role of this paper’s tagging or ranking methods in ANCHOR unspecified.
Cite
Cite as Emanuele Bugliarello and Desmond Elliott. 2021. The Role of Syntactic Planning in Compositional Image Captioning. Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume.
@inproceedings{bugliarello2021role,
title = {{The Role of Syntactic Planning in Compositional Image Captioning}},
author = {Emanuele Bugliarello and Desmond Elliott},
booktitle = {Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume},
year = {2021},
doi = {10.18653/v1/2021.eacl-main.48},
url = {https://doi.org/10.18653/v1/2021.eacl-main.48}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bugliarello-2021-role-syntactic-planning-compositional-image/