---
title: "CLOSURE — paper by Bahdanau et al. (2019)"
description: "CLOSURE tests whether systems trained on CLEVR can answer visual questions that combine familiar language and reasoning in new ways."
canonical: "https://research.elamur.ai/free/en/papers/bahdanau-2019-closure-assessing-systematic-generalization-clevr/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bahdanau-2019-closure-assessing-systematic-generalization-clevr/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/) / CLOSURE: Assessing Systematic Generalization of CLEVR Models

# CLOSURE: Assessing Systematic Generalization of CLEVR Models

Paper · 2019 · Dzmitry Bahdanau, Harm de Vries, Timothy J. O’Donnell et al.

**Authors:** [Dzmitry Bahdanau](https://md.research.elamur.ai/free/en/authors/dzmitry-bahdanau/), [Harm de Vries](https://md.research.elamur.ai/free/en/authors/harm-de-vries/), [Timothy J. O’Donnell](https://md.research.elamur.ai/free/en/authors/timothy-j-o-donnell/), [Shikhar Murty](https://md.research.elamur.ai/free/en/authors/shikhar-murty/), Philippe M. Beaudoin, [Yoshua Bengio](https://md.research.elamur.ai/free/en/authors/yoshua-bengio/) and Aaron C. Courville · **Year:** 2019 · **Venue:** arXiv (Cornell University) · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**33** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2995479498) · [Cited by **34** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/bahdanau-2019-closure-assessing-systematic-generalization-clevr/cited-by/) · [arXiv (Cornell University)](https://openalex.org/S4306400194) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1912.05783)
- [arXiv 1912.05783](https://arxiv.org/abs/1912.05783)
- [OpenAlex](https://openalex.org/W2995479498)

Citations: OpenAlex, 2026-10-14.

## Summary

If a system can find an object by its color and compare the colors of objects it finds, can it compare objects described through a color match? CLEVR is a benchmark for visual [question answering](https://md.research.elamur.ai/free/en/topics/question-answering/) with computer-rendered scenes. Its questions already require several steps of [reasoning](https://md.research.elamur.ai/free/en/topics/reasoning/), and published accuracies of around 97-99% suggest that the task is mostly solved under the usual evaluation. CLOSURE asks what happens when the scene still looks like CLEVR but the question puts a familiar operation somewhere it could never appear in CLEVR training. The test is whether knowledge of the parts carries over to the new whole. [CLEVR](https://md.research.elamur.ai/free/en/papers/johnson-2016-clevr-diagnostic-dataset-compositional-language/)

The authors focus on descriptions that find objects by comparing one of their properties with an example. A question might identify a cylinder through its material by describing the other object whose material it shares. CLOSURE puts such descriptions inside spatial descriptions, uses them to identify objects in comparison questions, and combines them with other descriptions using “and” or “or.” Its 7 tests reuse CLEVR’s images and symbolic operations. For each test, performance on the nearest CLEVR-style questions provides a target that helps distinguish difficulty with the unfamiliar combination from difficulty with the familiar task.

Most tested systems lose accuracy on most CLOSURE families. For systems that first translate a question into a program, part of the loss comes from generating the wrong program. Yet supplying the correct program still leaves the original Tensor-NMN executor below its CLEVR target in 6 tests out of 7. The authors develop Vector-NMN, whose components pass compact vectors and can each consult the image. With correct programs, it comes much closer to its CLEVR targets, although the conjunction of spatial and matching descriptions remains difficult. Additional comparisons point to spatial max pooling and the resulting vector interface as important to the improvement.

The authors also find that exposure to 36 examples per family can substantially improve performance. Systems that use programs recover much of the gap when the training process finds the appropriate programs. For the hardest conjunction family, answer feedback alone rarely leads the program generator to sample the required structure. MAC, which learns directly from questions and answers, improves on that family but typically retains a gap to its own CLEVR targets across the benchmark. CLOSURE therefore separates several abilities that a high score on familiar questions can conceal, including recognizing a new question structure, carrying out the corresponding reasoning, and learning the structure from a small set of examples.

## Deep dive: CLOSURE: Assessing Systematic Generalization of CLEVR Models

CLOSURE tests whether systems trained on CLEVR can answer visual questions that combine familiar language and reasoning in new ways. · about 38 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### From answering questions to reusing what they mean

In visual question answering, a system examines an image and responds to a question about it, usually with a brief answer. A question can call for a property such as material, a count, or a judgment about whether something exists. The answer alone tells us little about how it was reached. If one answer is unusually frequent for a type of question, the system can benefit from recognizing the question type even when it extracts very little from the image. The original VQA dataset helped establish the task at scale, and subsequent analysis identified biases of this kind as an obstacle to interpreting performance on naturally collected questions. [VQA](https://md.research.elamur.ai/free/en/papers/agrawal-2015-vqa-visual-question-answering/) · [Analyzing the Behavior of Visual Question Answering Models](https://md.research.elamur.ai/free/en/papers/agrawal-2016-analyzing-behavior-visual-question-answering/)

CLEVR was designed to make the underlying abilities easier to study. Its scenes are rendered from descriptions of objects whose attributes and positions are available to the question generator. Questions can be made to depend on a sequence of decisions, such as locating a reference object, finding objects in a particular spatial relation to it, and counting the remaining candidates. Because the generator has access to the scene description, it can determine the intended answer and exert control over the kinds of question and answer it produces. This makes CLEVR a diagnostic setting for both visual and linguistic reasoning.

A generator also imposes boundaries. It can produce considerable variation within one kind of expression and leave entire combinations outside the dataset. Consider a reference based on a shared shape. A training set may use that description in an existence question while reserving spatial references for comparisons. A system then receives evidence about shared shape and about comparisons without ever having to use a shared-shape description to find an object for comparison. Ordinary evaluation on more questions from that generator leaves the same boundary in place.

CLOSURE studies systematic generalization, the ability to interpret unfamiliar combinations of familiar parts. The authors treat the meaning of a referring expression as something that should survive a change of context. An expression that selects objects by matching a property should still do that work when a larger expression uses its result, or when a comparison uses it to identify one of the objects being compared. A collection of examples can teach both operations separately while leaving open how the system will behave when one feeds into the other.

The difference is about where the uncertainty lies. For an ordinary CLEVR validation question, the attributes and arrangement may be new while the kind of computation belongs to the training distribution. For CLOSURE, a question can use familiar vocabulary and ask for a familiar kind of answer while requiring a combination unavailable in that distribution. The image distribution stays within CLEVR. This lets the authors ask whether a change in the structure of the question is enough to defeat performance on an otherwise familiar visual task.

#### Which kind of generalization is being tested

Earlier [evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/) for visual reasoning altered different aspects of the task. CLEVR’s Compositional Generalization Test, or CoGenT, places restrictions on the colors of cubes and cylinders during training and reverses the restrictions at test time. The change concerns what appears in the image. ShapeWorld’s generalization splits, as described by the authors, also concentrate on shifts in the images. Both approaches can test whether familiar visual constituents remain usable in new combinations. CLOSURE keeps the visual setting and moves the change into the question.

CLEVR-Humans varies the language by having people ask questions about CLEVR scenes. A person can ask about all members of a group, introducing quantification beyond the reasoning operations of standard CLEVR questions. Such a question may require extending what the system can express internally. CLOSURE is built around operations that the original task already expresses. The comparison asks whether those operations travel across contexts within the same language of reasoning. [Inferring and Executing Programs for Visual Reasoning](https://md.research.elamur.ai/free/en/papers/johnson-2017-inferring-executing-programs-visual-reasoning/)

C-VQA, a compositional split of VQA, supplies another distinction. The CLOSURE authors describe that split as putting similar questions with different answers on opposite sides of the train–test boundary while keeping the overall distributions of questions similar. CLOSURE changes which combinations of expressions can occur in the questions themselves. A split organized around answers and a split organized around allowable question structures can consequently put pressure on different aspects of generalization.

SQOOP is closer to the design of CLOSURE. Its questions ask whether an object of one kind stands in a spatial relation to an object of another kind. Training omits most pairings of the object words, and evaluation asks whether the remaining combinations can be handled. There, the pair of object terms varies within a relatively simple question form. CLOSURE instead varies how a property-matching operation connects to other operations in a richer question. A system may have to apply a match within a nested expression or combine its output with a second expression before answering. [Systematic Generalization: What Is Required and Can It Be Learned?](https://md.research.elamur.ai/free/en/papers/bahdanau-2018-systematic-generalization-required-learned/)

The paper also places the language-to-program part of the task alongside SCAN and related work on sequence transduction. Sequence transduction turns an input sequence into an output sequence, such as a command into a sequence of actions. In CLOSURE the input is a question and the output of interest at this stage is a program. A system can learn to emit each program operation and still face a test when it has to place those operations in an unfamiliar order or dependency structure. The visual setting adds another question beyond whether the sequence can be produced. It asks whether the resulting arrangement of computations works on an image. [Rearranging the Familiar](https://md.research.elamur.ai/free/en/papers/loula-2018-rearranging-familiar-testing-compositional-generalization/) · [SCAN both left and right](https://md.research.elamur.ai/free/en/papers/bastings-2018-jump-better-conclusions-scan-both/)

#### Why the architecture matters to the question

CLEVR encouraged several approaches to visual reasoning. A system can process image features under the guidance of a question representation, making all of its decisions through continuous numerical states. Another approach translates the question into a program with named operations and uses that program to specify the computation. Some program-based systems execute fixed rules over an explicit scene description. Others learn an individual neural component for each operation and wire those components together as the program directs. The paper’s comparison asks where each kind of machinery can come apart when the language is recombined.

A Neural Module Network makes the question especially concrete. Its program can request a shape match and then send the resulting representation into a comparison. Every named operation has a place in the computation, and the program explicitly specifies the connections between them. Whether the learned representation produced by one component has the meaning the receiving component needs is a further matter. Training can make their outputs and inputs fit the connections that routinely occur, while leaving their behavior on an unfamiliar connection undetermined. The CLOSURE setup allows the authors to supply that connection explicitly and see how well the numerical computation carries it out. [Neural Module Networks](https://md.research.elamur.ai/free/en/papers/andreas-2015-neural-module-networks/)

### The method, step by step

#### Find the expressions that do the referring

The dataset construction starts with a distinction between finding an object and asking something about it. In a question about the material of a large sphere, the description picks out the sphere and the question asks for its material. The authors call the description a referring expression, abbreviated RE. Its referent can be a single object or a set. An existence question can use a description to produce a set and ask whether it contains anything. A comparison has separate descriptions for the things it compares.

A simple RE uses a noun with any accompanying adjectives. A phrase describing small metallic spheres is simple in this sense, even though finding its referents takes several filters. Each modifier adds a condition on an individual object. In a complex RE, a relative clause brings a second reference into the description. To find a cube behind a yellow sphere, the system first has to determine which sphere the clause refers to and then use its position. The inner description can in turn contain another clause.

The authors distinguish a spatial relation from a matching relation by what the outer description takes from its reference object. In a spatial description it uses location. In a matching description it uses a property such as color, shape, size, or material. Finding spheres made of the same material as a given cube requires identifying the cube, obtaining its material, and finding the spheres that share it. The word “material” specifies what to compare. The image determines which material is actually involved.

A logical RE combines conditions with “and” or “or.” Its meaning can be expressed through set operations. In a conjunction, a candidate must satisfy both conditions and therefore belong to their intersection. In a disjunction, the answer uses the union. An object that qualifies through both branches is still one member of that union. CLEVR uses these logical constructions with spatial predicates, giving CLOSURE a familiar surrounding structure in which a matching predicate can take the place of a spatial one.

These classifications describe different levels of a question. A comparison can contain a description that itself relies on matching. An attribute question can ask for the color of an object selected through a conjunction. An existence question can contain nested references even though its final answer only indicates whether the selected set is empty. This is what makes a change to the reference informative. The rest of the question can ask the same kind of thing after the authors vary how the relevant objects are identified.

How CLOSURE builds a test family The steps in order.

#### Place property matches in unfamiliar contexts

The authors use substitution to design question templates. They start from configurations in which CLEVR allows a spatial predicate and identify positions where a property match could express a well-formed reference. They retain cases that are close to existing questions but outside the original generator’s distribution. The name CLOSURE refers to this idea of building new questions by substituting descriptions into contexts, with a deliberate restriction to combinations that stay close to CLEVR.

The nested families vary which relation occurs inside the other. In `embed_spa_mat`, a spatial description identifies the reference object for a match. Imagine asking whether there is a cylinder made of the same material as the object left of a blue item. The blue item helps find the object on its left. That object supplies the material for the match. In the original CLEVR generation scheme, the description embedded within a matching expression is simple. CLOSURE gives it a spatial relation of its own.

In `embed_mat_spa`, the direction of the dependency changes. An inner expression can find a cube by the color it shares with a ball. The question then asks whether an object lies behind that cube. The match now has to return the reference needed by the spatial operation. Both nested families ask about existence. The order in which matching and relative position contribute to the reference is part of what distinguishes their computations.

The comparison families move a match into a question with separate top-level descriptions. In `compare_mat`, a typical question selects one cylinder through a material match and identifies the other object with a simple description. It can then ask whether their colors agree. The property used to locate an object and the property compared in the final answer can differ. A system must determine where the material criterion stops and where the color comparison begins.

In `compare_mat_spa`, the other top-level description is spatial instead of simple. An object selected through a shared material can be compared in size with a metal object identified through its position relative to a small cube. The reasoning has separate branches whose results meet at the comparison. CLEVR already has comparison questions with spatial references. The new combination introduces a match along one of the paths the comparison depends on.

Two more families use disjunction and ask for a count. In `or_mat`, one branch can identify objects of a given shape, and the other can find objects that share a property with a reference. For instance, the counted set could include cubes and any cylinders of the reference object’s size. In `or_mat_spa`, the other branch is complex too, supplying a spatial description alongside the matching description. The system has to assemble the set from both descriptions before counting.

The remaining family, `and_mat_spa`, uses conjunction in a question about an attribute. A question might ask for the color of the object that satisfies a location constraint relative to one item and matches the size of another. Those constraints identify a common member of their sets. The property queried at the end can be distinct from the property used to select that member. For instance, size can determine eligibility while color supplies the answer. The conjunction is therefore inside the object description, with the attribute query operating on its result.

The tests span distinct kinds of reuse. In the nested cases, one relation consumes the object obtained through another. In comparisons, the objects reached through separate expressions become arguments of an equality operation. In the logical cases, sets are merged or intersected before the answer is computed. Every family brings a property match into a new context, while the contexts differ in what they require the result of the match to represent.

#### Generate questions and compute their answers

The authors write templates with slots for different kinds of words. The symbol `⟨A⟩` is the name of a property used to refer to objects, and `⟨Q⟩` is the name of a property queried by the question. The slots `⟨Z⟩`, `⟨C⟩`, `⟨M⟩`, and `⟨S⟩` allow descriptions of size, color, material, and shape, respectively, and can be left empty when appropriate. A slot labeled `⟨R⟩` takes a spatial relation. Templates can also include optional wording, which the generator discards with 50% probability.

Generation happens in stages because CLEVR’s code expects the property being queried or matched to be fixed by the template. CLOSURE first chooses the properties for `⟨A⟩` and `⟨Q⟩`, effectively giving the original code a template with those choices resolved. The CLEVR generator then instantiates the remaining parts using a scene. A referring expression can thus vary in the words and objects it uses while occupying the same structural position in its family.

Every question has a corresponding program in CLEVR’s functional domain-specific language. An object in the symbolic scene has shape, color, size, material, and spatial information. A filter retains members of a set that have a specified property value. A spatial relation returns other objects that stand in the requested relation to its reference. A matching relation returns other objects that share the named property with the reference. The program can apply filters to the resulting sets. Union and intersection give explicit meanings to the logical constructions.

Where an operation needs an individual object, a `unique` operation checks that the set contains a single member and raises an exception otherwise. For a composite description, this lets the program express the point at which an inner set must determine a particular reference. An outer operation can then use that object. At the end of the program, the answer operation acts on what the references have picked out. It can count members, check for existence, retrieve a property, or compare values.

The program clarifies the structural novelty of a question. A `same_size` operation already has a meaning in CLEVR, as does `equal_color`. A CLOSURE question can place both in the same program, with the size match contributing to the choice of an object whose color will be compared. The novelty lies in where the result flows. The generator can still obtain the correct answer by executing the program on the scene information, since the meanings of the operations are already defined.

The paper makes a change to which counting questions it accepts. It restricts their answers to 1, 2 or 3 and uses rejection sampling to make those answers equally likely. Rejection sampling discards some generated candidates so that the accepted distribution has the desired balance. CLEVR counts are skewed, and 4 and larger answers are uncommon. For the relevant original constructions combining logical “or” with a complex spatial RE, an implementation detail rules out 0. CLOSURE uses the same modified generator to make the closest questions for the disjunction tests, so those comparisons use the same restrictions on answers.

The authors also extend a check for degenerate questions. The original generator applies this check to programs with spatial relations. CLOSURE applies it to matching relations as well. In a diagnostic question, the relation in the description is supposed to contribute to locating the referent. Applying the check to property matches brings the new relation into the same kind of screening that the original generator applies to spatial relations.

The released data includes validation and test splits, each with 3600 questions per CLOSURE family. Their images come from non-overlapping portions of the CLEVR validation images. The small training split contains 36 questions per family and uses CLEVR training images. These choices keep the study within the same visual domain and give the adaptation experiment questions about images from the training side. The authors make the dataset available through Zenodo.

#### Answer with continuous image features

The systems without explicit programs give the authors a comparison in which the interpretation of the question and the reasoning over the image are learned jointly. FiLM, short for Feature-wise Linear Modulation, encodes the question and uses that encoding to change how a convolutional network processes image features. Consider the visual feature tensor as an array indexed by location and feature channel. A question about material can affect how channels are weighted without having to produce a discrete command corresponding to a material comparison. [FiLM](https://md.research.elamur.ai/free/en/papers/perez-2017-film-visual-reasoning-general-conditioning/)

FiLM obtains a set of multipliers and offsets from a recurrent question encoder. The paper gives the transformation as follows.

```
[γ; β] = W · LSTM(q) + b
```

Here `q` is the question and `LSTM(q)` is the vector returned by the long short-term memory recurrent network after processing it. The dot is matrix–vector multiplication. `W` is a learned weight matrix and `b` a learned bias vector. `γ` holds multipliers, `β` holds offsets, and the brackets with a semicolon represent their concatenation. The two kinds of coefficient let the question change both how strongly a feature responds and the level around which it responds.

Within a residual block, convolutions first transform the incoming image features.

```
h̃ = BN(W₂ * R(W₁ * hᵢₙ ⊕ b₁) ⊕ b₂)
```

The block input is `hᵢₙ` and its intermediate tensor is `h̃`. `W₁` and `W₂` are learned convolutional weights, and `b₁` and `b₂` are learned bias vectors. The star denotes convolution of a filter tensor with a feature tensor. The operator `⊕` adds the bias by channel, repeating the same vector at every spatial location. `R` is the rectified linear unit, which passes positive values and sets negative values to zero. `BN` is batch normalization.

```
hₒᵤₜ = R(hᵢₙ + γ ⊙ h̃ ⊕ β)
```

The output tensor is `hₒᵤₜ`. `γ ⊙ h̃` multiplies each channel of `h̃` by its corresponding question-dependent coefficient at each spatial location. The broadcast addition `⊕ β` shifts each channel by its corresponding offset. The ordinary plus sign adds the block input tensor `hᵢₙ` to that modulated result, giving the block its residual connection. `R` is again the rectifying activation. Several such blocks act on the image feature tensor produced by earlier convolutions, some of which are pretrained. [Deep Residual Learning for Image Recognition](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/)

MAC, short for Memory-Attention-Composition, also uses continuous states. It obtains a sequence of control vectors `cᵢ` from the question `q`, with `i` indicating the reasoning step. The image `x` is preprocessed into a representation `hₓ`. At each step a visual read operation is guided by the current control vector and by `mᵢ`, a memory of the results of earlier reads. The read can thus depend on what the system has already processed. A sequence of attention and memory updates provides a way to carry out several dependent computations without a supervised program specifying the operation at each step. [Compositional Attention Networks for Machine Reasoning](https://md.research.elamur.ai/free/en/papers/hudson-2018-compositional-attention-networks-machine-reasoning/)

#### Translate the question into a program

The program-based approaches treat the interpretation of the question as an instance of [semantic parsing](https://md.research.elamur.ai/free/en/concepts/semantic-parsing/). The program generator receives the sequence of words and emits a sequence representing the question in the CLEVR language. It uses an attention-based sequence-to-sequence network. In this setting, attention lets the decoder draw on the encoded parts of the question as it outputs tokens for the program. The program can specify, for example, a selection by shape followed by a spatial relation, rather than leaving those stages implicit in an answer predictor. [Sequence to Sequence Learning with Neural Networks](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/) · [Neural Machine Translation by Jointly Learning to Align and Translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/)

Neural-Symbolic VQA, abbreviated NS-VQA, executes programs symbolically. Its design calls for the image to be represented as a scene with objects and properties, and the question as a program over that scene. With both representations available, a symbolic executor applies the defined operations. A set intersection in the program then has the same fixed meaning regardless of which descriptions supplied the sets. In the authors’ CLOSURE comparison, training and adaptation for NS-VQA concern the program generator. The question-to-program step is where the authors locate the systematicity issue for this approach. [Neural-Symbolic VQA](https://md.research.elamur.ai/free/en/papers/yi-2018-neural-symbolic-vqa-disentangling-reasoning/)

The Neural Module Network, abbreviated NMN, also has an explicit program but learns how to realize the operations numerically. Each function token selects a neural module, and the program determines which earlier outputs the module should receive. The paper treats a specialized function such as filtering for a particular color as a token in its own right. Thus a name indicating a brown filter can select the associated computation directly. The program fixes the arrangement, and training determines how that arrangement acts on the image representations.

The paper represents an ordered program as a triple.

```
(P, L, R)
```

`P` is the sequence of function tokens, while `L` and `R` hold the positions of their left and right arguments. For a program of length `T`, the entries at position `i` are `pᵢ`, `lᵢ`, and `rᵢ`. An argument position refers to the preceding computation that produces the required input. A function with fewer than two arguments has no right argument, and a function with no arguments has neither. Here `R` names the sequence of right argument positions. In the neural computation equations it also appears, as `R(…)`, to denote the rectifying activation.

```
hᵢ = ⎧ Mₚᵢ(hₓ),                 arity(pᵢ) = 0
     ⎨ Mₚᵢ(hₓ, hₗᵢ),            arity(pᵢ) = 1
     ⎩ Mₚᵢ(hₓ, hₗᵢ, hᵣᵢ),       arity(pᵢ) = 2
```

`hᵢ` is the result at program position `i`, and `Mₚᵢ` is the module associated with token `pᵢ`. The image feature tensor is `hₓ`. The notation `hₗᵢ` refers to the output at position `lᵢ`, and `hᵣᵢ` to the output at position `rᵢ`. The expression `arity(pᵢ)` is the number of program arguments required by that function. The three cases show how the module receives zero, one, or two results from earlier positions, in addition to the image representation in the general formulation. Concrete module designs vary in where they use that image input.

The final output `hₜ`, where the subscript denotes the last position `T`, goes to a classifier that predicts the answer. Backpropagating the classifier’s loss trains the modules jointly. The question specifies a tree of computations, while the answer loss provides the signal used to adjust the modules that carry them out. The architecture described by the authors can use a generator initialized with a seed set of question–program pairs and refine it from answers. In the reported base experiments, the generators instead receive the question–program pairs from all 700k CLEVR examples.

#### Pass tensors or vectors between modules

The earlier architecture, called Tensor-NMN in the paper, passes feature tensors between modules. These tensors have a spatial layout and channels at each location. As an example, a two-argument operation such as a conjunction receives the feature tensors from both branches. It first joins them along their feature axis and applies a convolution.

```
h̃ = R(W₁ * [hₗᵢ; hᵣᵢ])
```

`h̃` is the intermediate feature tensor. The inputs `hₗᵢ` and `hᵣᵢ` come from the positions referenced by the left and right argument indices of operation `i`. The brackets and semicolon indicate concatenation along the last axis. `W₁` supplies the learned convolutional filters, `*` applies those filters, and `R` is the rectifying activation.

```
hᵢ = R(W₃ * R(W₂ * h̃ ⊕ b₂) ⊕ b₃ + h̃)
```

`hᵢ` is the outgoing tensor. `W₂` and `W₃` contain learned convolutional filters and `b₂` and `b₃` are learned biases. The stars are convolutions and `⊕` repeats each bias at all spatial locations. The inner `R` rectifies an intermediate result, while the outer `R` rectifies the sum after the ordinary plus sign adds the skip connection from `h̃`. The `scene` module introduces the image representation in Tensor-NMN. Subsequent modules of the illustrated kind work with their incoming tensors.

The authors hypothesize that a rich tensor interface makes it easy for modules to develop ways of communicating that work in familiar arrangements. A receiving module may see tensors generated by a limited range of upstream operations during training. An unfamiliar predecessor can supply a tensor with the expected dimensions but a pattern that the receiver has learned to interpret differently. Vector-NMN reduces the capacity of what is passed between modules and provides every module with direct access to the image features.

Each Vector-NMN operation starts by assembling the information that determines how it will process the image.

```
h꜀ = [e(pᵢ); hₗᵢ; hᵣᵢ]
```

`h꜀` is the combined conditioning vector for program position `i`. The embedding `e(pᵢ)` is a learned vector associated with the function token. The remaining terms are the left and right argument vectors `hₗᵢ` and `hᵣᵢ`. Brackets with semicolons join them end to end. When an argument is absent, a zero vector takes its place. A module can therefore use the shared computation with input of the same form whether the program function needs two arguments, one, or none.

The module uses a multilayer perceptron with a single hidden layer to turn its conditioning vector into the coefficients needed to modulate image features.

```
[βₖ, γ̃ₖ] = W₂ᵏ(R(W₁ᵏ h꜀ + b₁ᵏ) + b₂ᵏ)
```

The index `k` selects the modulation stage. `W₁ᵏ` and `W₂ᵏ` are trainable matrices for that stage, and `b₁ᵏ` and `b₂ᵏ` are trainable bias vectors. Juxtaposing a matrix and a vector denotes multiplication. The plus signs add the indicated biases, and `R` is the rectifier. The paired outputs are the offset vector `βₖ` and a preliminary multiplier vector `γ̃ₖ`. Because `h꜀` contains both the token embedding and its incoming arguments, the coefficients can vary with the requested function and with what earlier modules found.

```
γₖ = 2 tanh(γ̃ₖ) + 1
```

`γₖ` is the multiplier used by stage `k`. The hyperbolic tangent `tanh` acts element by element on the preliminary vector `γ̃ₖ`. The scalar `2` rescales each resulting element and `1` shifts it. The authors report needing the hyperbolic tangent for stable training. This transformation concerns the coefficient values. The module still applies them to spatially organized visual features.

The paper illustrates the processing with a 1-block version of the architecture.

```
h̃₁ = R(U₁ * (γ₁ ⊙ hₓ ⊕ β₁))
```

`hₓ` is the image feature tensor and `h̃₁` is the first intermediate tensor. `γ₁` and `β₁` are the multiplier and offset vectors produced for the first stage. The operator `⊙` multiplies each channel by the corresponding coefficient, and `⊕` adds the offset in every spatial position. `U₁` is a learned filter tensor shared across modules. The star applies its convolution, and `R` rectifies the result.

```
h̃₂ = R(U₂ * (γ₂ ⊙ h̃₁ ⊕ β₂) + hₓ)
```

`h̃₂` is the next intermediate tensor. The channel multipliers `γ₂` and offsets `β₂` modulate `h̃₁` through the same broadcast operations `⊙` and `⊕`. The shared filters `U₂` then act by convolution, denoted by the star. The plus sign adds the original image features `hₓ` through the residual connection, and the rectifier `R` produces the new feature tensor.

```
hᵢ = maxpool(h̃₂)
```

`hᵢ` is the vector sent out from program position `i`. The operation `maxpool` takes the maximum over spatial locations separately for each feature channel of `h̃₂`. A large activation survives as a feature value, while its location is no longer an axis in the result. A receiving module uses that vector to generate its own modulation coefficients and can apply them to the full image representation. The architecture can stack several residual blocks before the pooling step. The main experiments use the 2-block version, chosen after preliminary CLEVR experiments favored it over the 1-block version.

The important design distinction is between the spatial computation inside a module and the information it passes along. Vector-NMN can still perform convolutions on a spatial tensor and access the underlying image at each operation. Its outgoing representation has one value per pooled channel. The function token and argument vectors control the work done by convolutional filters reused across modules. Accordingly, the new architecture changes image access, parameter sharing, and the representation of arguments together. The paper’s additional comparisons examine which changes account for the generalization difference.

#### Train the systems and vary what the executor receives

The authors use the original FiLM and Tensor-NMN implementations with the recommended settings and a close reimplementation of MAC for the main comparisons. The program-based systems use a standard attention-based sequence-to-sequence generator trained on the CLEVR question–program pairs. When a neural executor is evaluated with the resulting predicted program, its name carries `PG`. When it is evaluated with the correct program supplied, it carries `GT`. The second condition removes the need for the language parser to produce the right structure for that evaluation.

Training uses Adam. The paper gives the common optimizer settings as follows.

```
(β₁, β₂, ε) = (0.9, 0.999, 10⁻⁸)
```

Here `β₁` and `β₂` are the coefficients that control the decay of the running estimates used by Adam, and `ε` is its numerical stabilizer. These beta symbols belong to the optimizer and are separate from the offsets used in the modulation equations. Other settings, including learning rate, weight decay, and batch size, vary across systems. [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/)

The few-shot experiment starts from CLEVR-trained systems and mixes the new training questions into the CLEVR training data. The pool has 252 CLOSURE questions, with 36 from each family. The authors oversample the new questions 300 times for this mixed training procedure. This keeps the diversity of the new examples fixed while making them much more prominent during updates.

For the systems that generate programs, the authors vary the supervision on the new examples. With strong supervision, the correct program is given along with the question and answer. With weak supervision, the program has to be inferred. A REINFORCE-based procedure samples candidate programs and uses answer feedback to adjust the generator. Getting the program into the sample is consequential. If the generator assigns very little probability to a useful series of operations, the answer feedback may rarely be available for that series.

### Experiments and results

#### A target for each new kind of question

The experiments measure answer accuracy, the proportion of questions answered correctly. The authors report numbers averaged over 5 or 10 runs, with standard deviations where relevant. They use separate CLOSURE families because each introduces a different composition. They also pair each family with the closest CLEVR-style questions. This produces a target for each system and each family, allowing the comparison to account for how well that system does on the familiar construction.

For `embed_spa_mat`, the CLOSURE question has a spatial reference inside a matching reference. The closest CLEVR existence questions put a spatial reference inside another spatial reference. The two kinds of question both have nested reference and the same kind of final answer. All evaluated systems score above 98% on those baseline CLEVR questions. The comparison is therefore demanding in a specific way. A system must preserve familiar competence when the outer operation uses a property of its reference object in place of its position.

The targets for `or_mat` and `or_mat_spa` use newly generated questions from the closest original CLEVR templates, with the same modified count generation used for CLOSURE. This detail matters because accuracy on a restricted and balanced set of count answers can differ from accuracy under the original count distribution. Applying the modified procedure on both sides helps the authors attribute the performance comparison to the change in the referring expression.

Before these family-specific comparisons, the paper gives previously reported overall CLEVR accuracies to establish the level of performance already attained on the original task. These historical figures are overall CLEVR results. They do not give the split-specific targets used in the CLOSURE comparisons, and the paper cites them without naming a split in the discussion of the architectures.

Previously reported overall CLEVR answer accuracy The symbolic execution approach has the higher of these reported CLEVR accuracies.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| FiLM | 97.7 |
| NS-VQA (this paper) | 99.8 |

The historical comparison includes systems with different amounts of prior knowledge. FiLM receives a question and image and processes them through learned representations. NS-VQA can exploit a symbolic scene representation and exact definitions of the program operations. The high scores show what the two approaches had achieved under original CLEVR evaluation. The matched targets make it possible to ask whether either kind of competence transfers to the unfamiliar constructions.

#### Zero-shot performance

The zero-shot experiment evaluates systems trained on CLEVR before exposure to any CLOSURE training questions. Most systems perform worse on most CLOSURE families than on the corresponding CLEVR questions. The `embed_spa_mat` family is an exception in the overall pattern. Systems generally handle the introduction of a spatial description inside a matching one better than they handle the other changes. This matters because the families all concern property matching. The results differ according to the context in which the match is used.

Among the continuous approaches, MAC consistently fares better than FiLM. In spite of this, the authors report that MAC’s accuracy fell by 15% to 35% relative to its baseline in six of the seven tests. The reference here is each family’s closest CLEVR questions. A system can preserve its relative position among the continuous approaches and still leave a substantial gap to what it can do on the familiar version of the task.

NS-VQA performs particularly poorly on the tests with logical references and also drops relative to baseline on other families. The symbolic meanings of operations such as union or intersection are fixed in that system. The difficulty therefore places attention on the program produced for a question. A parser can know how to emit instructions for matching and for logical combination while assigning low probability to their assembly in the particular way the new question requires.

The predicted-program versions of Tensor-NMN and Vector-NMN also suffer from errors in the generator. The sequence of operations is consequential for both executors. If the question parser leaves a required operation out or connects it to the wrong arguments, even a module that performs its own calculation well can be called on the wrong input. An answer from the complete pipeline reflects both the generator and the executor, which is why the authors run the latter with correct programs too.

With ground-truth programs, Tensor-NMN still falls short of its own CLEVR targets on 6 tests out of 7. The executor is now given the intended layout, including the operations and their connections. The remaining gap shows that the layout alone cannot guarantee that the learned modules implement their roles in the new configuration. This is the strongest test in the paper of the assumption that a modular structure will automatically make its computations reusable.

GT-Vector-NMN comes much closer to the matched CLEVR targets and usually attains them. `and_mat_spa` remains the notable exception. The executor is generally better able to use the supplied structure than the tensor-based executor, while a separate language-to-program problem remains for PG-Vector-NMN. Supplying the program isolates the part of the system affected by the architectural change and gives a clearer interpretation of the improvement. It also keeps the ground-truth result distinct from what a deployed question-to-answer pipeline could achieve with its own predicted programs.

#### Adaptation with a small number of examples

The few-shot study tests MAC alongside PG-Vector-NMN and NS-VQA after additional training on the mixed dataset. It puts the same new question pool into systems with different ways of responding to a training example. In MAC, the answer loss can directly adjust the continuous computation through back-propagation. In the program-based systems, the result also depends on how the program generator learns the required structure. Correct programs provide direct evidence for that structure. Answer feedback alone depends on candidate programs generated during training.

Across the study, 36 new questions from a family often improve results substantially. Systems using symbolic programs reach the corresponding CLEVR targets in 6 tests out of 7 when the appropriate programs can be learned. The few-shot result is therefore much stronger than their zero-shot result on the unfamiliar arrangements. A small number of examples can teach how to assemble operations whose basic roles were already established in CLEVR training.

The hard case in weak supervision is `and_mat_spa`. For this family, the generator typically assigns very low probability to the required program. The authors find that the REINFORCE-based search then fails to sample it. This explains why providing answer feedback on more instances of the construction may do little within the experiment. The search has to try an appropriate program before an answer can reinforce the relevant sequence of decisions. A correct program supplied with the example bypasses that search problem.

MAC improves on `and_mat_spa`, the family that gives weakly supervised program induction particular trouble. Across the other families, its adaptation generally leaves a gap of 5% to 20% between CLOSURE accuracy and the CLEVR target, with `embed_spa_mat` as the exception among the 7 families. MAC already handled that nested case well before adaptation. The remaining gaps measure how incompletely its continuous training procedure closes the distance to its own familiar-task performance under this budget of distinct questions.

The authors also report comparable absolute performance for MAC and PG-Vector-NMN on `or_mat` and `or_mat_spa` after adaptation. That comparison answers a different question from whether each has reached its CLEVR target. Systems with similar CLOSURE scores can start with different performance on the baseline questions and can improve by different amounts. The matched targets express how much of each system’s familiar capability transfers, while absolute accuracy describes how frequently it answers the new questions correctly.

The juxtaposition of strong and weak program supervision with continuous training accounts for the paper’s main adaptation result. A program-based system has a structure it can reuse effectively once the learning procedure identifies the new arrangement. The same system can improve little if its generator rarely explores that arrangement. A continuous system receives a training gradient on the new questions without sampling a discrete program, which helps on the conjunction. Under the same few-shot regime, that path to learning still leaves gaps across much of the benchmark.

### What the ablations show

#### Image access and shared weights account for only part of the difference

Vector-NMN changes several features of the original executor. It gives each module direct access to the image, shares convolutional weights, and replaces spatial feature tensors passed between modules with pooled vectors. The main result compares complete architectures. To understand the source of the difference, the authors introduce variants that retain tensor-valued outputs while adopting some features of Vector-NMN.

Tensor-NMN-Shortcut modifies Tensor-NMN so that each module receives the image representation directly. This tests whether later operations mainly struggle because they have to recover the visual information they need from the intermediate output of an earlier module. With a direct image connection, a receiving operation can use image features alongside the predecessor’s tensor. The variant still falls short of its matched targets on CLOSURE, so access to the image alone is insufficient to reproduce Vector-NMN’s result.

Tensor-NMN-FiLM shares more of the new design but omits max pooling at the module output. Its outputs remain spatial tensors. To pass an earlier result to a downstream module, it concatenates that result with the image representation, as in the shortcut design. In Vector-NMN, the pooled vector from an earlier module instead contributes to the downstream modulation coefficients. Tensor-NMN-FiLM also falls short of its targets. Sharing weights in a design that still passes spatial outputs does not reproduce the improvement.

These comparisons support the paper’s explanation that spatial pooling and the vector interface play a key role. The module output preserves feature responses while discarding a separate index for each location. Because the next operation has access to the image, the pooled representation can guide new spatial work without carrying a full spatial feature map from the previous operation. This is consistent with the authors’ hypothesis that the interface changes how much the executor can depend on arrangements specific to training.

The comparison between Tensor-NMN-FiLM and Vector-NMN also changes how the following module receives the output. One concatenates a spatial tensor with visual features. The other uses a vector to compute channel-wise modulation. The evidence therefore favors the pooled-vector design as implemented. It does not isolate pooling from every consequence of giving the next module a different kind of input. In particular, the paper’s experiments leave open how other spatial summaries or other methods of using the vector would behave.

#### Correct programs expose errors inside the executor

The distinction between predicted and ground-truth programs is a controlled diagnostic of the full pipeline. In the predicted setting, both failure to produce the correct structure and failure to execute it can lower answer accuracy. With the correct program supplied, the generator’s error is removed for the evaluation. A persistent gap to the nearest CLEVR questions then concerns what the executor can do with the unfamiliar program and its visual inputs.

This is particularly revealing for Tensor-NMN. One reason to build a computation from modules is to use each component in different arrangements. The program provides the arrangement explicitly in the ground-truth condition. Performance still declines on most families, so the result points to a learned interface or computation that does not transfer as intended. Vector-NMN performs better under the same kind of diagnostic. The contrast supports an improvement in execution independently of improvements that might come from training a better parser.

The paper’s program-induction analysis exposes a different failure. Weak supervision provides outcomes and asks the generator to discover the intermediate program. For `and_mat_spa`, the authors examine the generator and find that the correct kind of program gets very little probability. This accounts for a search that rarely encounters a useful candidate. The conjunction can remain hard even though its operations are all available and the answers identify successful behavior at the end of the pipeline.

Taken together, these diagnostics locate failures at different stages. A symbolic executor can apply its given operations exactly and still receive the wrong program. A learned executor can receive the right program and still answer incorrectly. An adaptation procedure can have enough labeled answers to improve other families and still fail to explore a particular structure. Each finding depends on changing what is supplied or observed at the relevant stage.

#### Wording and implementation checks

The authors examine minor differences in wording between the new and familiar templates. In the comparison families, “another” can appear in a context where CLEVR would omit it. They tried handling that word more precisely and found no change in the zero-shot results in their preliminary experiments. They also tried dropping an instance of “is” in the conjunction template to bring it closer to the phrasing of familiar CLEVR conjunctions. They report no effect on the zero-shot results from that change either. These checks address specific surface differences that the authors noticed when constructing the templates.

The main MAC experiment uses a reimplementation. The authors also run the original implementation 10 times with its default configuration to see whether the comparison depends on that choice. They observe some statistically significant accuracy differences, including for `or_mat`, but conclude that the original implementation gives the same overall interpretation of the CLOSURE results. The reimplementation is convenient for the comparison because it uses the same software framework as the other systems. The reference implementation check separates that convenience from the broader conclusion about systematic generalization.

The choice of the 2-block Vector-NMN follows a preliminary comparison on ordinary CLEVR, where it performed better than the 1-block version. The paper uses that choice for the main study. It therefore bases the depth setting on familiar-task performance. The comparison among the alternative executor designs addresses the novel compositions more directly by asking which interfaces preserve that kind of performance on CLOSURE.

### Limitations

#### Limits identified by the authors

The authors describe the work as a case study in systematic generalization. It focuses on property matches and on contexts where substituting such a match for a spatial relation yields a question close to CLEVR. Other ways of recombining language could produce different results. The paper contrasts CLOSURE with SQOOP, where the tensor-based module approach generalized perfectly in the reported study when its modules were connected in a tree layout. CLOSURE finds gaps for that approach even with supplied programs. The authors leave the specific reason for the discrepancy between the datasets as an open question.

The symbolic systems also benefit from knowledge supplied by the task design. NS-VQA relies on a symbolic depiction of the scene and an executor with known operation meanings. Moving that approach to another domain could demand substantial adaptation and data collection. Program-based systems more generally require some program supervision to get started and remain constrained by the available vocabulary of program operations. CLOSURE is a setting where the new questions fit that vocabulary, allowing it to test reuse of operations within the language.

The authors acknowledge minor peculiarities of the new templates. Some comparison questions retain an optional-sounding word where the original generation code would remove it. The preliminary checks address the consequences of that particular change and a particular conjunction phrasing. The authors also make explicit that the count distribution is chosen for comparability rather than reproducing CLEVR’s skew. The claims about disjunction apply to the controlled counting task they constructed.

For adaptation, the authors identify program search as a limit of the weakly supervised method they use. Their analysis of `and_mat_spa` explains what happens when correct programs receive too little probability to appear in the sampled candidates. The result is specific to the training conditions and the search procedure in the experiment. The paper frames combining the advantages of program-based and continuous approaches as a direction for further investigation.

#### Limits that follow from the setup

CLOSURE’s questions are generated from templates and its scenes come from a controlled rendering process. This gives the benchmark a precise boundary between familiar and unfamiliar structures. It also restricts what the results can establish about everyday language or photographs. Naturally occurring questions can use other constructions and distinctions, and visual data can require a different process to obtain reliable object descriptions. The experiment provides evidence about reuse when the relevant primitives have already been specified within a controlled domain.

A matched CLEVR target is an empirical comparison with the nearest available construction. Changing a spatial predicate into a property match also changes what has to be retrieved from the image. The benchmark keeps the scene distribution, question type, and structural context close, but the altered relation can bring its own difficulty. The results show the performance of each system on these particular substitutions. The size of a gap depends on both the new family and the baseline selected for it.

Answer accuracy measures success at the end of the computation. Different programs can sometimes give the same answer on a particular scene. A correct answer from a predicted program does not by itself establish that the internal interpretation matches the annotated one. Similarly, a successful learned executor need not encode sets or object attributes in a form with a uniquely identifiable meaning. The ground-truth program condition controls the structure given to the executor. It provides a more precise test of what the executor can do without certifying the meaning of every intermediate activation.

Vector-NMN changes the dimensionality of the module interface and changes how its outputs influence the next operation. The ablations make direct image access and weight sharing less plausible as complete explanations, while leaving multiple properties of the pooled interface coupled. Its strong ground-truth performance applies to the tested program families. The continued gap on `and_mat_spa` also shows that the architectural change remains incomplete even within those families.

The few-shot result depends on the treatment of the new data as well as the number of distinct examples. The 252 new questions are repeatedly sampled alongside the CLEVR training data. A regime that gave an example a single pass, removed the original training pool, or sampled from a different mixture would pose a different adaptation task. Strong supervision also supplies more information per new question for a program-based system than answer supervision supplies. The study supports comparisons under the authors’ training procedures and helps explain their differences through the program-search analysis.

Finally, the ground-truth program results and the full pipeline results address separate practical questions. The former show what a learned executor can do when the intended interpretation is available. A user asking a question supplies language and an image, and the full pipeline must obtain the interpretation. The gains in the controlled executor setting reveal where progress was made. They leave the need for systematic program generation visible in the predicted-program results.

### What came after

[Span-based Semantic Parsing for Compositional Generalization](https://md.research.elamur.ai/free/en/papers/herzig-2021-span-based-semantic-parsing-compositional/) (2021) cites CLOSURE and takes up the compositional generalization question in semantic parsing, with a span-based approach. A span is a contiguous stretch of the input. The connection is to the language-to-program stage of CLOSURE, where a parser has to turn a question containing a new combination of familiar expressions into a correspondingly structured interpretation.

CLOSURE connects that parsing question to a separate test of execution. Its predicted-program condition shows what happens when the system has to infer the interpretation from language, and its ground-truth condition shows what a neural executor can do when that interpretation is supplied. The later work’s focus on parsing concerns the first of those stages, where the challenge is to build a meaning for the whole utterance from its familiar parts.

## Cite

Cite as Dzmitry Bahdanau, Harm de Vries, Timothy J. O’Donnell, Shikhar Murty, Philippe M. Beaudoin, Yoshua Bengio and Aaron C. Courville. 2019. CLOSURE: Assessing Systematic Generalization of CLEVR Models. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.1912.05783](https://doi.org/10.48550/arxiv.1912.05783) · [arXiv 1912.05783](https://arxiv.org/abs/1912.05783)

```bibtex
@misc{bahdanau2019closure,
  title = {{CLOSURE: Assessing Systematic Generalization of CLEVR Models}},
  author = {Dzmitry Bahdanau, Harm {de Vries}, Timothy J. O’Donnell, Shikhar Murty, Philippe M. Beaudoin, Yoshua Bengio and Aaron C. Courville},
  year = {2019},
  doi = {10.48550/arxiv.1912.05783},
  eprint = {1912.05783},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1912.05783}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
