SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.00928 · 2023

Learning Differentiable Logic Programs for Abstract Visual Reasoning

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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 8 have no contract verdict; 0 failures of our instrument; 4 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/2307.00928.json · badge: /api/ran/2307.00928.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
ml-research/neumann canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
FunctionStatusWhere it lives
letterbox Ran
ran on a synthesized input
ml-research/neumann/src/data_kandinsky.py
code served (permissive licence) · get_code("db89ca1b27aced79")
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 tuple. 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 cv2
import numpy as np

# Create a simple test image (3-channel BGR image)
img = np.random.randint(0, 256, (480, 640, 3), dtype=np.uint8)

ARGS = {
    "img": img,
    "new_shape": (640, 640),
    "color": (114, 114, 114),
    "auto": True,
    "scaleFill": False,
    "scaleup": True,
    "stride": 32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
load_image_yolo Ran
ran on a synthesized input
ml-research/neumann/src/data_kandinsky.py
code served (permissive licence) · get_code("b8300d8a62602ce8")
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 ndarray, ndim 3, dtype family int, shape (3, 64, 64) 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary image file for testing
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, 'test_image.jpg')

# Create a simple test image (100x100 BGR image)
test_image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
cv2.imwrite(temp_image_path, test_image)

ARGS = {
    'path': temp_image_path,
    'img_size': 64,
    'stride': 32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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 (3, 64, 64) — shape (3, 64, 64) 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
load_images_and_labels Ran
ran on a synthesized input
ml-research/neumann/src/data_kandinsky.py
code served (permissive licence) · get_code("0dac6d106821f31b")
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 tuple, ndim 2, dtype family float; 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 os
import tempfile
import shutil

# Create a temporary directory structure that mimics the kandinsky dataset
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'kandinsky', 'twopairs', 'train')
true_folder = os.path.join(data_dir, 'true')
false_folder = os.path.join(data_dir, 'false')

os.makedirs(true_folder, exist_ok=True)
os.makedirs(false_folder, exist_ok=True)

# Create dummy image files
for i in range(5):
    open(os.path.join(true_folder, f'true_image_{i}.jpg'), 'w').close()
    open(os.path.join(false_folder, f'false_image_{i}.jpg'), 'w').close()

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'dataset': 'twopairs',
    'split': 'train',
    'pos_ratio': 1.0,
    'neg_ratio': 1.0,
    'img_size': 128
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple 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
load_images_and_labels_positive Ran
ran on a synthesized input
ml-research/neumann/src/data_vilp.py
code served (permissive licence) · get_code("0b69500fd308ee7e")
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 tuple. 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 os
import tempfile
import shutil

# Create a temporary directory structure that mimics the expected data layout
temp_dir = tempfile.mkdtemp()
base_data_path = os.path.join(temp_dir, 'data', 'vilp', 'member', 'train', 'true')
os.makedirs(base_data_path, exist_ok=True)

# Create sample folder structure with images
for folder_idx in range(2):
    folder_name = f'folder_{folder_idx}'
    folder_path = os.path.join(base_data_path, folder_name)
    os.makedirs(folder_path, exist_ok=True)
    
    # Create some dummy image files
    for img_idx in range(3):
        img_file = os.path.join(folder_path, f'image_{img_idx}.jpg')
        with open(img_file, 'w') as f:
            f.write('dummy image data')

# Set the working directory to temp_dir so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'dataset': 'member',
    'split': 'train',
    'base': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
load_question_json Ran
ran on a synthesized input
ml-research/neumann/src/data_behind_the_scenes.py
code served (permissive licence) · get_code("1bd6bc221874e4c9")
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 dict. 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 json
import tempfile
import os

# Create a temporary directory and a sample question JSON file
temp_dir = tempfile.mkdtemp()
question_json_path = os.path.join(temp_dir, "question.json")

# Create a valid question JSON file
sample_question = {
    "id": 1,
    "question": "What is 2 + 2?",
    "answers": ["4", "5", "3"],
    "correct_answer": "4"
}

with open(question_json_path, 'w') as f:
    json.dump(sample_question, f)

ARGS = {
    "question_json_path": question_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
to_one_label Ran
ran on a synthesized input
ml-research/neumann/src/explain_clevr.py
code served (permissive licence) · get_code("a2b8ea7cda7a980e")
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 float, 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)

# ys: list of tensors with probabilities
# labels: list of tensors with labels
# th: threshold (default 0.7)

# Create small sample tensors
# Each y should be a 1D tensor of probabilities
y1 = torch.tensor([0.8, 0.6, 0.3, 0.9])
y2 = torch.tensor([0.5, 0.4, 0.2, 0.1])

# Each label should be a 1D tensor of the same shape as y
label1 = torch.tensor([0.0, 1.0, 0.0, 1.0])
label2 = torch.tensor([1.0, 0.0, 1.0, 0.0])

ys = [y1, y2]
labels = [label1, label2]

ARGS = {
    "ys": ys,
    "labels": labels,
    "th": 0.7
}
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 float, 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
valuation_to_attr_string Ran
ran on a synthesized input
ml-research/neumann/src/explanation_utils.py
code served (permissive licence) · get_code("c3b79d296ee7933e")
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
import numpy as np

torch.manual_seed(0)

# Create a simple Atom class to represent logical atoms
class Term:
    def __init__(self, name):
        self.name = name
    
    def __str__(self):
        return self.name

class Predicate:
    def __init__(self, name):
        self.name = name

class Atom:
    def __init__(self, pred_name, terms):
        self.pred = Predicate(pred_name)
        self.terms = terms
    
    def __str__(self):
        term_strs = ','.join(str(t) for t in self.terms)
        return f"{self.pred.name}({term_strs})"

# Create sample atoms
atoms = [
    Atom('color', [Term('obj0'), Term('red')]),
    Atom('shape', [Term('obj0'), Term('cube')]),
    Atom('material', [Term('obj1'), Term('metal')]),
    Atom('size', [Term('obj1'), Term('large')]),
    Atom('color', [Term('obj2'), Term('blue')]),
]

# Create valuation vector - probabilities for each atom
v = torch.tensor([0.8, 0.6, 0.3, 0.95, 0.45], dtype=torch.float32)

# Number of entities
e = 3

# Threshold for filtering
th = 0.5

ARGS = {
    'v': v,
    'atoms': atoms,
    'e': e,
    'th': th
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
valuation_to_rel_string Ran
ran on a synthesized input
ml-research/neumann/src/explanation_utils.py
code served (permissive licence) · get_code("f0680d163806a4d7")
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
import numpy as np

torch.manual_seed(0)

# Create a simple atom class that has a pred attribute with a name
class Pred:
    def __init__(self, name):
        self.name = name
    
    def __repr__(self):
        return f"Pred({self.name})"

class Atom:
    def __init__(self, pred_name, content="atom_content"):
        self.pred = Pred(pred_name)
        self.content = content
    
    def __str__(self):
        return f"{self.pred.name}({self.content})"

# Create valuation tensor (probabilities between 0 and 1)
# Shape should be (4,) to match the number of atoms we'll create
v = torch.tensor([0.6, 0.3, 0.8, 0.2], dtype=torch.float32)

# Create atoms with different predicates
# Some should have names in attrs + ['in', '.'], some should not
atoms = [
    Atom("loves"),      # Not in attrs, v[0]=0.6 > 0.5, will be included
    Atom("color"),      # In attrs, will be skipped
    Atom("eats"),       # Not in attrs, v[2]=0.8 > 0.5, will be included
    Atom("size"),       # In attrs, will be skipped
]

ARGS = {
    'v': v,
    'atoms': atoms,
    'th': 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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_target_maps Not yet run
unverified (harvested, no recorded run)
ml-research/neumann/src/explanation_utils.py
code served (permissive licence) · get_code("69f54a31e6f166af")
How it ran

no invocation recorded.

load_image_clevr Not yet run
unverified (harvested, no recorded run)
ml-research/neumann/src/data_behind_the_scenes.py
code served (permissive licence) · get_code("31cd0d76f84177bf")
How it ran

no invocation recorded.

load_images_and_labels Not yet run
unverified (harvested, no recorded run)
ml-research/neumann/src/data_clevr.py
code served (permissive licence) · get_code("82354e6e5a5c7b89")
How it ran

no invocation recorded.

load_images_and_labels Not yet run
unverified (harvested, no recorded run)
ml-research/neumann/src/data_vilp.py
code served (permissive licence) · get_code("8117fb788ddb9093")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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
letterbox 1 other paper
1 dated earlier
2110.09383 (2021-10)
Neuro-Symbolic Forward Reasoning
load_image_clevr 1 other paper
1 dated earlier
2110.09383 (2021-10)
Neuro-Symbolic Forward Reasoning
load_image_yolo 1 other paper
1 dated earlier
2110.09383 (2021-10)
Neuro-Symbolic Forward Reasoning
valuation_to_attr_string 1 other paper
1 dated earlier
2110.09383 (2021-10)
Neuro-Symbolic Forward 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

Visual reasoning is essential for building intelligent agents that understand the world and perform problem-solving beyond perception. Differentiable forward reasoning has been developed to integrate reasoning with gradient-based machine learning paradigms. However, due to the memory intensity, most existing approaches do not bring the best of the expressivity of first-order logic, excluding a crucial ability to solve abstract visual reasoning, where agents need to perform reasoning by using analogies on abstract concepts in different scenarios. To overcome this problem, we propose NEUro-symbolic Message-pAssiNg reasoNer (NEUMANN), which is a graph-based differentiable forward reasoner, passing messages in a memory-efficient manner and handling structured programs with functors. Moreover, we propose a computationally-efficient structure learning algorithm to perform explanatory program induction on complex visual scenes. To evaluate, in addition to conventional visual reasoning tasks, we propose a new task, visual reasoning behind-the-scenes, where agents need to learn abstract programs and then answer queries by imagining scenes that are not observed. We empirically demonstrate that NEUMANN solves visual reasoning tasks efficiently, outperforming neural, symbolic, and neuro-symbolic baselines.

For agents

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

get_harvested_code_for_paper("2307.00928")
get_code_for_paper("2307.00928")
have("2307.00928")

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

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

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

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

Connect an agent — have() is free.