Source-linked AI summary

A simple neural network module for relational reasoning

Adam Santoro, David Raposo, David G. T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, Timothy Lillicrap

arXiv:1706.01427v1cs.CLcs.LG

TL;DR

Relational reasoning is central to intelligent behavior but difficult for neural networks to learn. This paper adds Relation Networks as plug-and-play modules, achieving 95.5% on CLEVR and solving 18/20 bAbI tasks.

  • Problem

    Neural networks have struggled with relational questions, despite relational reasoning being central to generally intelligent behavior.

  • Method

    The paper augments neural architectures with Relation Networks whose computations explicitly and flexibly model relations among entities.

  • Results

    RN-augmented models succeeded across visual, text-based, and physical reasoning tasks, including 95.5% overall on CLEVR and 18/20 bAbI subtasks.

  • Takeaways & Limitations

    Relation Networks can induce useful object-like representations and support structured relational reasoning from unstructured inputs and outputs.

  • Takeaways & Limitations

    The evaluated bAbI model used a single validation-selected seed, so performance variation across replicated runs was not measured.

Abstract

from arXiv · show

Relational reasoning is a central component of generally intelligent behavior, but has proven difficult for neural networks to learn. In this paper we describe how to use Relation Networks (RNs) as a simple plug-and-play module to solve problems that fundamentally hinge on relational reasoning. We tested RN-augmented networks on three tasks: visual question answering using a challenging dataset called CLEVR, on which we achieve state-of-the-art, super-human performance; text-based question answering using the bAbI suite of tasks; and complex reasoning about dynamic physical systems. Then, using a curated dataset called Sort-of-CLEVR we show that powerful convolutional networks do not have a general capacity to solve relational questions, but can gain this capacity when augmented with RNs. Our work shows how a deep learning architecture equipped with an RN module can implicitly discover and learn to reason about entities and their relations.

1 Introduction

Relational reasoning about entities and their properties is central to generally intelligent behavior but difficult for standard neural-network architectures. The paper explores Relation Networks as a general solution and reports strong results across visual, textual, and physical reasoning tasks.

  • Motivation: Reasoning about relations between entities and their properties is central to generally intelligent behavior.Examples include comparing pairwise distances between trees and integrating clues in a murder-mystery novel.
  • Background: Symbolic methods explicitly represent and reason about relations but face symbol grounding and robustness limitations.Statistical-learning approaches avoid some symbolic assumptions but remain difficult for powerful CNN and MLP architectures on relational problems.
  • Approach: Relation Networks are introduced as architectures whose computations focus explicitly on relational reasoning.The paper presents RNs as a general solution for relational reasoning in neural networks.
  • Results: RN-augmented networks achieved state-of-the-art, super-human performance on CLEVR and vastly outperformed the best generally-applicable visual QA architectures.They also solved CLEVR from state descriptions, demonstrating versatility across input forms.
  • Results: 18/20 bAbI subtasks were solved using an RN-based architecture for text-based question answering.The paper also trained an RN for challenging relational inferences about complex physical systems.

2 Relation Networks

Relation Networks (RNs) constrain neural-network computation so relational reasoning is built into the architecture. They process object sets with shared, learnable functions that infer pairwise relations while providing data efficiency and order-invariant outputs.

  • RNs bake relational-computation capacity into their architecture rather than requiring it to be learned.This design parallels how CNNs build in spatial, translation-invariant reasoning capacity.
  • An RN applies learnable MLP functions to object pairs, making the module end-to-end differentiable and enabling relation inference.The function gθ outputs a relation, inferring how two objects are related or whether they are related at all.
  • RNs operate on a set of objects: The RN’s summation makes both its input handling and output invariant to object order, producing information representative of relations in the object set.This set-based operation respects the order invariance of sets.
  • RNs learn to infer relations: RNs consider potential relations between all object pairs without being given which relations exist or what they mean.Their all-to-all form corresponds to a complete directed graph, though the definition can be adjusted to consider selected object pairs.
  • RNs are data efficient: A shared function gθ computes every relation, encouraging generalization across object pairs and avoiding an MLP’s need to learn separate pair-specific functions.For n objects, an MLP would require n^2 relation functions, whereas an RN learns one relation function and performs n^2 feedforward passes per object set.

3 Tasks

The paper evaluates RN-augmented networks across visual question answering, text-based question answering, and dynamic physical systems. These tasks are designed to test relational reasoning across distinct domains, including CLEVR and Sort-of-CLEVR visual reasoning benchmarks.

  • Visual question answering: Visual question answering requires complex spatial and non-spatial relational reasoning over visual features, language inputs, and their conjunction.CLEVR was developed to control for underspecified vocabularies and distill the core challenges of visual QA.
  • Visual question answering: CLEVR contains 3D-rendered-object images paired with questions spanning attribute and comparison categories, many of which are explicitly relational.The paper uses both pixel and factored state-description representations, with object features including coordinates, color, shape, material, and size.
  • Sort-of-CLEVR: Sort-of-CLEVR separates relational from non-relational questions using visually simple images of six colored 2D shapes and fixed-length binary questions.Each image generates 10 relational and 10 non-relational questions, reducing confounding difficulty from natural-language parsing.
  • Text-based question answering: bAbI provides 20 text-based QA tasks covering reasoning types such as deduction, induction, and counting, with each question linked to supporting facts.A task is considered successful above 95%; under joint training with 10K examples per task, Memory Networks pass 14/20, DNC 18/20, Sparse DNC 19/20, and EntNet 16/20.
  • Dynamic physical systems: The physical-systems task uses simulated mass-spring scenes with 10 colored balls, requiring inference about invisible connections from relative positions and velocities across frames.Stable distances can indicate a connection, while the tasks make these inferences either explicit or implicit.

4 Models

The models use Relation Networks as a flexible module over object representations derived from CNN or LSTM embeddings, without specifying object semantics in advance. They adapt the module to pixels, question-conditioned visual reasoning, state descriptions, and natural-language inputs.

  • General architecture: RNs accept relatively unstructured CNN or LSTM embeddings as object sets, while learning can induce what the objects represent.The RN requires object representations, but the semantics of an object need not be specified.
  • Dealing with pixels: A CNN converts 128 × 128 images into d × d feature maps with k channels, treating each of the d2 cells as an object with an arbitrary coordinate.The model remains agnostic about which image features constitute an object.
  • Conditioning RNs with question embeddings: Question-conditioned RNs use an LSTM-derived question embedding so gθ can focus processing on object-object relations relevant to the question.The question embedding comes from the LSTM’s final state after processing word embeddings from a learnable lookup table.
  • Dealing with state descriptions: State descriptions enter the RN directly as pre-factored object representations, with the question embedding concatenated to each object pair.Questions are processed by an LSTM using learnable word embeddings before pairwise conditioning.
  • Dealing with natural language: For bAbI, the model transforms up to 20 immediately preceding support sentences into labeled objects indicating their relative positions before RN processing.This object construction differs from visual QA, where objects are spatially distinct regions in convolved feature maps.

5 Results

Relation Network-augmented models achieved strong results across visual, textual, and physical reasoning tasks. The results support dedicated relational reasoning as central to performance and show that RNs generalize across input representations and transfer to unseen motion data.

  • CLEVR: 95.5% accuracy on CLEVR exceeded the best pixel-and-question model by 27% and surpassed human performance.The model particularly solved compare-attribute and count questions, where state-of-the-art models struggle most.
  • CLEVR: 96.4% accuracy on CLEVR state-description matrices demonstrated that RNs learn object relations while remaining agnostic to input representation.This result supports the generality of the RN module beyond pixel-based object features.
  • Sort-of-CLEVR: Above 94% accuracy on both relational and non-relational Sort-of-CLEVR questions was achieved by CNN+RN, whereas CNN+MLP plateaued at 63% on relational questions.The comparison indicates that models without a dedicated relational component struggle with even simple relational reasoning.
  • Sort-of-CLEVR: 52.3% success on closest-to and furthest-from relations exposed CNN+MLP’s limited general reasoning when distances had to be compared across objects.The task required gauging and comparing distances that could vary substantially in magnitude.
  • bAbI: 18/20 bAbI tasks were solved, including basic induction with 2.1% total error versus 54% for Sparse DNC, 55.1% for DNC, and 52.1% for EntNet.The two failed supporting-facts tasks missed the 95% threshold by 3.1% and 11.5%, respectively; evaluation used one seed and no replicas.
  • Dynamic physical systems: 93% of connection-inference scenes and 95% of counting scenes were classified correctly, while a comparable-parameter MLP performed no better than chance.Learning these relations also transferred to unseen motion-capture data, where RNs predicted connections between walking-human body joints.

6 Discussion and Conclusions … Visual question answering

The paper presents Relation Networks as simple, versatile modules that substantially improve relational reasoning across visual and text-based tasks. It also situates RNs among related approaches, emphasizing their minimal oversight, broad applicability, and simpler integration with standard neural components.

  • 6 Discussion and Conclusions: 95.5% overall performance was achieved on CLEVR, while bAbI performance solved 18/20 tasks without catastrophic failures.Together, these results demonstrate the flexibility and power of the RN module for relational reasoning.
  • 6 Discussion and Conclusions: RNs improved CLEVR performance from 68.5% to 95.5% and achieved state-of-the-art, super-human performance.The RN may provide flexible relational reasoning while allowing the CNN to focus on local spatial structure.
  • 6 Discussion and Conclusions: RNs induced upstream processing to provide useful object-like representations without specified internal forms or semantics.This demonstrates structured reasoning from unstructured inputs and outputs.
  • 6 Discussion and Conclusions: Future work includes applying RNs to scene understanding in reinforcement-learning agents, social-network modeling, and abstract problem solving.Improving RN computational efficiency is another proposed direction, and available relation knowledge can be exploited when useful.
  • 6 Discussion and Conclusions: RNs are presented as a simple and powerful approach for rich, structured reasoning in complex, real-world domains.Their versatility spans visual, text-based, and state-based tasks across machine learning, computer vision, and natural language understanding.
  • Relational reasoning: Unlike approaches requiring more oversight, RNs require minimal oversight to produce object sets and can operate with relatively unstructured inputs.The related work contrasts RNs with symbolic, graph-based, and other neural approaches to relational reasoning.
  • Grounding spatial relations: Prior spatial-language research largely used rule-based representations or hand-engineered features, while spatial-template approaches were less versatile than RNs.This comparison places RNs among methods for learning spatial relations from perceptual inputs.
  • Visual question answering: CLEVR distills visual question answering challenges involving relational and multimodal reasoning, typically combining recurrent question encoders with convolutional image encoders.Compared with related CLEVR architectures requiring designed modules or ground-truth programs, RNs are conceptually simpler and combine readily with CNNs or LSTMs.

Text-based question answering

The RN module has capabilities similar to the memories used by neural text-based question-answering architectures. On bAbI, a dataset testing reasoning capabilities, it reaches very competitive results.

  • Text-based question answering: The RN module has capabilities similar to the memories used by neural text-based question-answering architectures.Neural-based approaches to text-based question answering commonly rely on “memories.”
  • Text-based question answering: Very competitive results were achieved on bAbI, a dataset that tests reasoning capabilities in text-based question answering models.The passage characterizes bAbI as a benchmark for reasoning capabilities.

B CLEVR from pixels

The CLEVR model was trained on 70,000 scenes and 699,989 questions, using augmented 128 × 128 pixel inputs. Training used 10 distributed workers that synchronously updated a central parameter server.

  • 70,000 scenes and 699,989 questions from CLEVR were used to train the model.
  • Images were down-sampled to 128 × 128, padded to 136 × 136, randomly cropped to 128 × 128, and randomly rotated between −0.05 and 0.05 rads.
  • 10 distributed workers synchronously updated a central parameter server during training.Each worker used mini-batches of size 64; the passage also states that Adam was used, but the optimizer description is truncated.

Failure cases

Although the model answers most CLEVR questions correctly, its failures reveal architectural limitations, especially under heavy occlusion or when precise object-position representations are required.

  • Failure cases: The model fails especially when objects are heavily occluded.The authors identify heavy occlusion as a hypothesized limitation of the architecture.
  • Failure cases: The architecture also struggles when questions require high-precision object-position representations.This limitation is based on the authors’ examination of observed CLEVR failure cases.
  • Failure cases: Table 2 presents CLEVR questions the model answers incorrectly alongside their ground-truth answers.These examples support the authors’ examination of the model’s failure cases.

C CLEVR from state descriptions · D Sort-of-CLEVR · E bAbI model for language understanding

The paper specifies model designs for state-description CLEVR, Sort-of-CLEVR, and bAbI, while defining Sort-of-CLEVR’s relational and non-relational question structure. Sort-of-CLEVR contains 10,000 images and balances relational with non-relational questions for evaluating relational reasoning.

  • D Sort-of-CLEVR: Sort-of-CLEVR contains 10,000 75 × 75 images, with 200 withheld for validation and 20 questions per image.Each image generated 10 relational and 10 non-relational questions.
  • D Sort-of-CLEVR: Non-relational questions query a single uniquely color-identified entity’s shape, horizontal position, or vertical position.These questions can be answered from that entity’s attributes alone.
  • D Sort-of-CLEVR: Relational questions ask about the object closest to or furthest from a reference object, or count objects sharing its shape.Answering them requires reasoning about attributes defined relative to one or more objects.
  • D Sort-of-CLEVR: The Sort-of-CLEVR RN model applies four convolutional layers and passes fixed-length binary question embeddings directly to the RN alongside object pairs.The CNN uses 32, 64, 128, and 256 kernels with ReLU nonlinearities and batch normalization.
  • D Sort-of-CLEVR: The comparable CNN+MLP baseline replaces the RN with an equally deep and wide MLP while retaining the same CNN and LSTM trained end-to-end.Its input layer connects to the full CNN image embedding, giving it more parameters.
  • E bAbI model for language understanding: For bAbI, each of 20 support sentences is encoded by a 32-unit LSTM, while separate 32-unit question processing feeds RN MLPs producing answer-vocabulary logits.The RN uses a four-layer 256-unit-per-layer gθ MLP; fφ uses 256, 512, and 159 units, with a linear final layer and cross-entropy optimization.

F Dynamic physical system reasoning

The dynamic physical-system reasoning tasks represented each object across 16 consecutive time frames and evaluated relational structure through connection-inference and counting targets. The connection-inference model used multilayer perceptrons for relational processing and output prediction, optimized with cross-entropy and Adam.

  • Task targets: Connection inference predicted binary vectors encoding whether each ball pair was connected, while counting predicted a one-hot vector for the number of connected-ball systems.For 10 objects, connection targets were 102-length vectors, and counting targets had length 10.
  • Dynamic physical system inputs: Each object’s state description included coordinate position and color information across 16 consecutive time frames.A state-description row represented one ball and contained its object properties over time.
  • Connection-inference model: The connection-inference RN used a four-layer gθ MLP and a three-layer fφ MLP whose linear output produced connection-existence logits.The model was optimized with cross-entropy using Adam at a 1e−4 learning rate and batch size 50.
Loading 1706.01427v1…