Abstract
Standard vision-language models often struggle with compositional generalization—the ability to understand novel combinations of familiar concepts. We present Composer, a recursive neural network that explicitly models the linguistic structure of sentences through a Concept and Relation Graph (CRG). By grounding constituent parts and recursively composing their meanings, Composer demonstrates superior robustness to distribution shifts and improved performance on out-of-domain compositional benchmarks compared to flat, sequence-based models.
Introduction
Current state-of-the-art vision-language models, such as ViLBERT or UNITER, typically treat text as a flat sequence of tokens. While effective for in-distribution data, these models often fail when encountering novel compositions of known objects and relations. For example, a model might recognize a "dog" and a "car" individually but fail to ground "a dog sitting on a car" if that specific interaction was absent from its training set. This limitation stems from a lack of explicit structural priors. To address this, we propose a framework that mimics human cognitive processes by hierarchically composing sentence meaning from its constituent parts.
Methods: The Composer Framework
The core of our approach is the Concept & Relation Graph (CRG), a hierarchical representation derived from a constituency parse tree. In this graph, nodes represent concepts ranging from individual words (primitives) to complex phrases. Predicates act as $n$-ary functions (e.g., [NP] running on [NP]) that define the compositional logic.
The Composer model processes the CRG through a recursive architecture:
- Primitive Encoding: Individual words are grounded in image regions using cross-attention.
- Modulation: Child concept embeddings are transformed via FiLM (Feature-wise Linear Modulation) based on their syntactic role in a predicate.
- Composition Transformer (CT): This module recursively integrates modulated embeddings with visual features to build the final sentence representation.
Training is guided by three objectives: standard image-text alignment, Multi-level Visual-Semantic Alignment (MVSA) for intermediate phrases, and an Order-preserving loss to ensure fine-grained concepts achieve higher alignment scores than their components.
Experimental Setup
We evaluated Composer on the Flickr30K and MS-COCO datasets. To rigorously test compositional generalization, we introduced a Maximum Compound Divergence (MCD) split. This evaluation method algorithmically selects test cases where the combinations of predicates and concepts differ significantly from the training distribution, challenging the model's ability to generalize beyond seen patterns.
Results and Discussion
Composer demonstrates significant advantages in scenarios requiring structural understanding. In zero-shot transfer tasks (training on Flickr30K and testing on COCO), Composer achieved an 11% relative improvement in Recall@1 over ViLBERT.
On the MCD splits, the performance gap between Composer and sequence-based baselines widens as the structural divergence increases. This confirms that explicit hierarchical modeling serves as a powerful inductive bias, preventing the model from relying on simple keyword matching. Furthermore, the recursive nature of the model provides inherent interpretability, allowing researchers to trace errors back to specific primitive misidentifications.
Limitations and Future Work
Despite its strengths, Composer's performance is dependent on the accuracy of the underlying constituency parser. Additionally, recursive processing introduces a computational overhead, making the model approximately 50% less efficient in terms of FLOPs compared to flat Transformers. Future work will focus on scaling the model's capacity for high-density datasets and adapting the framework to languages with non-English syntactic structures.
Summary updated