Syntax Customized Video Captioning by Imitating Exemplar Sentences

Yitian Yuan, Lin Ma, Wenwu Zhu

Standard video captioning models have a "personality" problem. If you train a model on a large dataset, it quickly learns that the safest way to describe a video is to use the most common, plain sentence structures—think "A person is doing B in a C." While accurate, these captions are repetitive and lack the linguistic flair of human speech.

In their paper "Syntax Customized Video Captioning by Imitating Exemplar Sentences," Yitian Yuan and colleagues from Tsinghua University and Meituan propose a way to inject variety into AI-generated descriptions by allowing users to provide a "syntax template."

TL;DR

The authors introduce Syntax Customized Video Captioning (SCVC), a task where a model generates a video description that matches the semantic content of a video but follows the syntactic structure of a provided "exemplar" sentence. By decoupling what is said from how it is structured, the model produces diverse, expressive captions that move beyond the monotonous "Subject-Verb-Object" defaults of traditional AI.

What Problem Does This Paper Address?

Most current video captioning models are trained using Maximum Likelihood Estimation (MLE), which encourages the model to mimic the most frequent n-grams in the training set. This leads to "generic" captions.

Previous attempts to fix this used high-level "style" labels (e.g., "romantic" or "humorous") or Part-of-Speech (POS) sequences. However, these are often too coarse or too rigid. The authors argue that exemplar sentences—any human-edited sentence—provide a much richer and more intuitive source of syntactic inspiration. The challenge lies in extracting the "skeleton" (syntax) of an exemplar sentence without accidentally copying its "flesh" (specific words) and then wrapping that skeleton around the actual events in a video.

Methods

The authors propose a framework consisting of three main components:

  1. Hierarchical Sentence Syntax Encoder: To capture the structure of the exemplar sentence, the model uses a two-level approach. A character-level LSTM captures sub-word features (like suffixes and prefixes that hint at grammar), and a word-level LSTM aggregates these into a global syntactic representation.
  2. Video Semantic Encoder: A standard combination of a pretrained CNN (Inception-Resnet-v2) and an attention-based LSTM to extract what is actually happening in the video.
  3. Syntax Conditioned Caption Decoder: This is the core innovation. It uses a two-layer LSTM.
  4. The first layer uses Conditional Layer Normalization (CLN) to modulate the LSTM gates based on the exemplar's syntax.
  5. The second layer then injects the video's semantic features.
  6. This "two-step" process ensures the syntax acts as the backbone while the video content provides the specific vocabulary.

The Training "Trick": Since there are no datasets containing (Video, Exemplar, Target Caption) triplets, the authors used a multi-task learning strategy. They trained the model to perform standard captioning (where the ground truth is its own exemplar) and sentence autoencoding (reconstructing an exemplar sentence from its own syntax and semantics).

Datasets

The model was evaluated on two major benchmarks:

  • MSRVTT: 10,000 video clips with 20 human-edited captions each.
  • ActivityNet Captions: A large-scale dataset for dense video captioning.
  • Exemplar Corpus: The authors crawled 761,582 human-edited sentences from the Shutterstock Image Description Corpus to serve as a diverse pool of syntactic templates.

Key Insights and Ideas

  • Syntactic Decoupling via Word Replacement: To prevent the syntax encoder from simply memorizing the exemplar's words, the authors implemented a "Word Replacement Mechanism." During training, words in the exemplar are randomly replaced with other words of the same POS tag. This forces the model to focus on the structure rather than the specific vocabulary.
  • Character-Level Grammar: Using a character-level LSTM is a clever way to capture syntactic cues. In English, suffixes like "-ing," "-ed," or "-ly" are strong indicators of a word's grammatical role, even if the model doesn't "know" the root word.
  • Syntax as a Modulator: Instead of just concatenating syntax vectors to the input, using Conditional Layer Normalization allows the syntax to fundamentally change how the LSTM gates process information at each timestep.

Key Results

The authors compared their model against standard Seq2Seq models and "Template" baselines. They measured performance using Tree Edit Distance (TED) for syntax and Cosine Similarity (COS) for semantics.

  • Superior Imitation: On MSRVTT, the model achieved a TED score of 5.44, significantly better than standard Seq2Seq models (~15.91), meaning the generated captions closely matched the exemplar's tree structure.
  • Maintaining Accuracy: Despite following complex new syntaxes, the model maintained a semantic COS score of 0.6892, nearly matching the performance of models that weren't constrained by syntax at all.
  • Diversity Boost: Qualitative results show the model successfully generating complex sentences like "Young man rides very fast at the snow track" when given a specific exemplar, whereas standard models stuck to "A man is riding a bike."

Limitations and Future Work

  • Fluency Trade-off: The authors noted that very complex or "weird" exemplar syntaxes can lead to higher perplexity (lower fluency). There is a natural tension between being syntactically creative and being grammatically perfect.
  • Dependency on External Tools: The system relies on the Stanford NLP toolkit for POS tagging and constituency parsing. Errors in these upstream tools can propagate through the model.
  • Future Direction: The authors suggest that this work could be extended to "fine-grained" control, where different parts of a video are described using different exemplar sentences within a single long-form caption.

Summary updated

BibTeX
@article{yuan2022syntax,
  author = {Yitian Yuan and Lin Ma and Wenwu Zhu},
  title = {{Syntax Customized Video Captioning by Imitating Exemplar Sentences}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2022},
  url = {https://openreview.net/forum?id=RIwGa1su4p},
}
Figure