SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.12584 · 2019

The Neuro-Symbolic Concept Learner: Interpreting Scenes, Words, and Sentences From Natural Supervision

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/1904.12584.json · badge: /api/ran/1904.12584.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
vacancy/NSCL-PyTorch-Release canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
build_clevr_dataset Ran
ran on a synthesized input
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/definition.py
code served (permissive licence) · get_code("0e1e8fb4bf2a96d6")
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, through the batch API) and returned NSCLDataset. The image it ran in was not recorded. If your copy returns the same type 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
from pathlib import Path
import json
import tempfile
from unittest.mock import MagicMock, patch

torch.manual_seed(0)

# Create a minimal config object
class Config:
    class Data:
        image_size = (224, 224)
    data = Data()

configs = Config()

# Create temporary directories and files for the dataset
temp_dir = tempfile.mkdtemp()
image_root = temp_dir

# Create a minimal scenes JSON file
scenes_json = f"{temp_dir}/scenes.json"
scenes_data = {
    "scenes": [
        {
            "image_filename": "CLEVR_val_000000.png",
            "scene_index": 0,
            "objects": [
                {"object_id": 0, "color": "red", "shape": "cube", "size": "small"}
            ]
        }
    ]
}
with open(scenes_json, 'w') as f:
    json.dump(scenes_data, f)

# Create a minimal questions JSON file
questions_json = f"{temp_dir}/questions.json"
questions_data = {
    "questions": [
        {
            "question_index": 0,
            "image_index": 0,
            "question": "What color is the cube?",
            "answer": "red",
            "program": [{"op": "scene"}]
        }
    ]
}
with open(questions_json, 'w') as f:
    json.dump(questions_data, f)

# Create a minimal vocab JSON file
vocab_json = f"{temp_dir}/vocab.json"
vocab_data = {
    "question_token_to_idx": {"<NULL>": 0, "what": 1, "color": 2},
    "answer_token_to_idx": {"<NULL>": 0, "red": 1},
    "program_token_to_idx": {"<NULL>": 0, "scene": 1}
}
with open(vocab_json, 'w') as f:
    json.dump(vocab_data, f)

# Create args object
class Args:
    data_vocab_json = vocab_json

args = Args()

# Mock the NSCLDataset since we can't actually load images
def mock_nspl_dataset_init(self, scenes_json, questions_json, image_root=None, 
                           image_transform=None, vocab_json=None):
    self.scenes_json = scenes_json
    self.questions_json = questions_json
    self.image_root = image_root
    self.image_transform = image_transform
    self.vocab_json = vocab_json

# Patch NSCLDataset before importing
import sys
mock_module = MagicMock()
mock_module.NSCLDataset = type('NSCLDataset', (), {
    '__init__': mock_nspl_dataset_init
})
sys.modules['nscl.datasets.datasets'] = mock_module

ARGS = {
    'args': args,
    'configs': configs,
    'image_root': image_root,
    'scenes_json': scenes_json,
    'questions_json': questions_json
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jactorch, nscl, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NSCLDataset — a NSCLDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NSCLDataset output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
build_concept_quantization_clevr_dataset Ran
ran on a synthesized input
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/definition.py
code served (permissive licence) · get_code("9829bd711c3852e1")
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, through the batch API) and returned ConceptQuantizationDatasetMock. The image it ran in was not recorded. If your copy returns the same type 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

class ConfigClass:
    def __init__(self):
        self.data = Mock()
        self.data.image_size = [224, 224]

class ConceptQuantizationDatasetMock:
    def __init__(self, scenes_json, image_root=None, image_transform=None):
        self.scenes_json = scenes_json
        self.image_root = image_root
        self.image_transform = image_transform

import sys
from unittest.mock import patch

mock_module = MagicMock()
mock_module.ConceptQuantizationDataset = ConceptQuantizationDatasetMock
sys.modules['nscl.datasets.datasets'] = mock_module

mock_jactorch = MagicMock()
mock_transforms = MagicMock()
mock_bbox = MagicMock()

class ComposeTransform:
    def __init__(self, *transforms):
        self.transforms = transforms

class NormalizeBbox:
    pass

class ResizeTransform:
    def __init__(self, size):
        self.size = size

class DenormalizeBbox:
    pass

class ToTensorTransform:
    pass

class NormalizeTransform:
    def __init__(self, mean, std):
        self.mean = mean
        self.std = std

mock_bbox.Compose = ComposeTransform
mock_bbox.NormalizeBbox = NormalizeBbox
mock_bbox.Resize = ResizeTransform
mock_bbox.DenormalizeBbox = DenormalizeBbox
mock_bbox.ToTensor = ToTensorTransform
mock_bbox.Normalize = NormalizeTransform

mock_transforms.bbox = mock_bbox
mock_jactorch.transforms = mock_transforms

sys.modules['jactorch'] = mock_jactorch
sys.modules['jactorch.transforms'] = mock_transforms
sys.modules['jactorch.transforms.bbox'] = mock_bbox

args = Mock()
args.dummy_arg = None

configs = ConfigClass()

image_root = "/fake/image/path"

scenes_json = "/fake/scenes.json"

ARGS = {
    'args': args,
    'configs': configs,
    'image_root': image_root,
    'scenes_json': scenes_json
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jactorch, nscl, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConceptQuantizationDatasetMock — a ConceptQuantizationDatasetMock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ConceptQuantizationDatasetMock output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
get_clevr_op_attribute Ran
ran on a synthesized input
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/program_translator.py
code served (permissive licence) · get_code("0c3d9ae18dee8195")
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, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type 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

def get_clevr_op_attribute(op):
    return op.split('_')[1]

# The function takes a single parameter 'op' which is a string
# It splits the string by '_' and returns the element at index 1
# So we need a string with at least 2 parts separated by underscores

ARGS = {
    'op': 'filter_color'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
get_clevr_pblock_op Ran
ran on a synthesized input
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/program_translator.py
code served (permissive licence) · get_code("52682558c8a4e93d")
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, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type 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

def get_clevr_pblock_op(block):
    """
    Return the operation of a CLEVR program block.
    """
    if 'type' in block:
        return block['type']
    assert 'function' in block
    return block['function']

# Test case 1: block with 'type' key
block_with_type = {
    'type': 'filter',
    'other_key': 'some_value'
}

ARGS = {
    'block': block_with_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
make_positions Ran
ran on a synthesized input
vacancy/NSCL-PyTorch-Release/nscl/nn/embedding.py
code served (permissive licence) · get_code("30208acaa5238ae7")
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, through the batch API) and returned Tensor, ndim 2, dtype family int, shape (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 torch

torch.manual_seed(0)

# Create a tensor with padding indices and token indices
# Shape: (batch_size=2, seq_len=4)
# padding_idx=0, so we use 0 for padding and 1+ for actual tokens
tensor = torch.tensor([
    [0, 1, 2, 3],
    [1, 2, 0, 3]
], dtype=torch.long)

padding_idx = 0
left_pad = False

ARGS = {
    "tensor": tensor,
    "padding_idx": padding_idx,
    "left_pad": left_pad,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family int, shape (2, 4) — shape (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
build_concept_retrieval_clevr_dataset Not yet run
unverified (harvested, no recorded run)
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/definition.py
code served (permissive licence) · get_code("b7ded7965050e458")
How it ran

no invocation recorded.

clevr_to_nsclseq Not yet run
unverified (harvested, no recorded run)
vacancy/NSCL-PyTorch-Release/nscl/datasets/clevr/program_translator.py
code served (permissive licence) · get_code("4d7c9bd38decfc39")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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.

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-23.

Repositories linked to this paper

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

Abstract

We propose the Neuro-Symbolic Concept Learner (NS-CL), a model that learns visual concepts, words, and semantic parsing of sentences without explicit supervision on any of them; instead, our model learns by simply looking at images and reading paired questions and answers. Our model builds an object-based scene representation and translates sentences into executable, symbolic programs. To bridge the learning of two modules, we use a neuro-symbolic reasoning module that executes these programs on the latent scene representation. Analogical to human concept learning, the perception module learns visual concepts based on the language description of the object being referred to. Meanwhile, the learned visual concepts facilitate learning new words and parsing new sentences. We use curriculum learning to guide the searching over the large compositional space of images and language. Extensive experiments demonstrate the accuracy and efficiency of our model on learning visual concepts, word representations, and semantic parsing of sentences. Further, our method allows easy generalization to new object attributes, compositions, language concepts, scenes and questions, and even new program domains. It also empowers applications including visual question answering and bidirectional image-text retrieval.

For agents

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

get_harvested_code_for_paper("1904.12584")
get_code_for_paper("1904.12584")
have("1904.12584")

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

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

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

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

Connect an agent — have() is free.