SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.04212 · 2020

The Scattering Compositional Learner: Discovering Objects, Attributes, Relationships in Analogical Reasoning

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2007.04212.json · badge: /api/ran/2007.04212.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
dhh1995/SCL canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
lucidrains/scattering-compositional-learner reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
default Ran
ran, violated the contract we drafted
lucidrains/scattering-compositional-learner/scattering_transform/scattering_transform.py
pointer only (licence: NONE) · get_code("00bfb221f3305e25")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lucidrains/scattering-compositional-learner when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

expand_dim Ran
ran; our contract draft was wrong, not the code
lucidrains/scattering-compositional-learner/scattering_transform/scattering_transform.py
pointer only (licence: NONE) · get_code("270b669b4662f5c1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lucidrains/scattering-compositional-learner when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_attrs Ran
ran, honoured the contract we drafted
dhh1995/SCL/scripts/preprocess.py
code served (permissive licence) · get_code("003b21d8bf55bb13")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function extract_attrs expects a dict with keys 'Angle', 'Color', 'Size', 'Type'
# Each value should be convertible to int
data = {
    'Angle': 45,
    'Color': 2,
    'Size': 10,
    'Type': 3
}

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_center Ran
ran, honoured the contract we drafted
dhh1995/SCL/scripts/preprocess.py
code served (permissive licence) · get_code("61c7bbb3265d2bf0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 3, dtype family int, shape (16, 1, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from unittest.mock import MagicMock

# Create a mock XML structure that mimics the nested access pattern
# xml_root[0][i][0][0][0][0].attrib should return a dict with keys
# 'Angle', 'Color', 'Size', 'Type'

class MockXMLElement:
    def __init__(self, attrib):
        self.attrib = attrib
    
    def __getitem__(self, index):
        return self

# Build the nested structure: xml_root[0][i][0][0][0][0]
mock_attrib = {
    'Angle': '10',
    'Color': '20',
    'Size': '30',
    'Type': '40'
}

# Create the innermost element with attrib
innermost = MockXMLElement(mock_attrib)

# Build up the nesting: [0][0][0][0] all return the same innermost element
level_4 = [innermost]
level_3 = [level_4]
level_2 = [level_3]
level_1 = [level_2]

# Create 16 elements for the loop (xml_root[0][i] for i in range(16))
level_0_items = [level_1 for _ in range(16)]
xml_root = [level_0_items]

ARGS = {
    'xml_root': xml_root
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (16, 1, 4) — shape (16, 1, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_two_parts Ran
ran, honoured the contract we drafted
dhh1995/SCL/scripts/preprocess.py
code served (permissive licence) · get_code("e2386c815d7ba839")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 3, dtype family int, shape (16, 2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from xml.etree import ElementTree as ET

# Create a mock XML structure that matches what parse_two_parts expects
# The function accesses: xml_root[0][i][0][p][0][0].attrib
# where i ranges from 0-15, p ranges from 0-1
# Each attrib dict needs keys: 'Angle', 'Color', 'Size', 'Type'

class MockElement:
    def __init__(self, attrib):
        self.attrib = attrib
    
    def __getitem__(self, index):
        return self

# Build the nested structure: xml_root[0][i][0][p][0][0]
mock_attrib = {'Angle': '1', 'Color': '2', 'Size': '3', 'Type': '4'}
mock_element = MockElement(mock_attrib)

# Create the deepest level [0][0]
level_0_0 = [mock_element]

# Create level [p][0][0] for p in range(2)
level_p = [[mock_element]]
level_p.append([mock_element])

# Create level [i][0][p][0][0] for i in range(16)
level_i = []
for i in range(16):
    level_i.append([level_p])

# Create level [0][i][0][p][0][0]
xml_root = [level_i]

ARGS = {
    'xml_root': xml_root
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (16, 2, 4) — shape (16, 2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
expand_dim 3 other papers
3 later · 1 only as an assembly brick
2105.14850 (2021-05)
Cascaded Head-colliding Attention
2108.12630 (2021-08)
GroupFormer: Group Activity Recognition with Clustered Spatial-Temporal Transformer
2206.05379 (2022-06)
A Benchmark for Compositional Visual Reasoning
default 1 other paper
1 later
2206.05379 (2022-06)
A Benchmark for Compositional Visual Reasoning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this work, we focus on an analogical reasoning task that contains rich compositional structures, Raven's Progressive Matrices (RPM). To discover compositional structures of the data, we propose the Scattering Compositional Learner (SCL), an architecture that composes neural networks in a sequence. Our SCL achieves state-of-the-art performance on two RPM datasets, with a 48.7% relative improvement on Balanced-RAVEN and 26.4% on PGM over the previous state-of-the-art. We additionally show that our model discovers compositional representations of objects' attributes (e.g., shape color, size), and their relationships (e.g., progression, union). We also find that the compositional representation makes the SCL significantly more robust to test-time domain shifts and greatly improves zero-shot generalization to previously unseen analogies.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2007.04212")
get_code_for_paper("2007.04212")
have("2007.04212")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2007.04212.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2007.04212.svg)](https://syntology.ai/paper/2007.04212)

Connect an agent — have() is free.