SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.04901 · 2023

GENOME: GenerativE Neuro-symbOlic visual reasoning by growing and reusing ModulEs

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 6 have no contract verdict; 2 failures of our instrument; 1 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/2311.04901.json · badge: /api/ran/2311.04901.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
umass-foundation-model/genome community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
create_module_instance Ran
ran on a synthesized input
umass-foundation-model/genome/engine/interpreter.py
code served (permissive licence) · get_code("193417c3f2d50d05")
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 1, 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class StepInterpreter:
    def __init__(self):
        self.step_interpreters = {}
    
    def add_step_interpreter(self, name, module):
        self.step_interpreters[name] = module

module_program = """
class test_module:
    def __init__(self):
        self.value = 42
"""

module_dict = {
    'module_name': 'test_module',
    'module_program': module_program
}

args = []
interpreter = StepInterpreter()

ARGS = {
    'args': args,
    'interpreter': interpreter,
    'module_dict': module_dict
}
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 tuple, ndim 1, 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
fix_boxes Ran
ran on a synthesized input
umass-foundation-model/genome/engine/api.py
code served (permissive licence) · get_code("bf0c8b050a9ad5db")
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 list, ndim 2, 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
from math import ceil, floor

# Construct boxes as a list of lists with float values
# Each box is [x1, y1, x2, y2] format
boxes = [
    [10.3, 20.7, 100.2, 150.8],
    [-5.1, 15.4, 95.6, 140.3]
]

max_x = 200
max_y = 180

ARGS = {
    "boxes": boxes,
    "max_x": max_x,
    "max_y": max_y
}
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 list, ndim 2, 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
format_prompt Ran
ran on a synthesized input
umass-foundation-model/genome/engine/prompt.py
code served (permissive licence) · get_code("8a2d342cd5ddce4c")
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

torch.manual_seed(0)

class Args:
    def __init__(self, stage):
        self.stage = stage

# Stage 1 test case
args_stage_1 = Args(stage=1)
prompt_stage_1 = "The question is: __INSERT_NEW_QUESTION__"
ann_stage_1 = {
    'question': 'What color is the sky?',
    'answer': 'blue',
    'high_level_program': 'query_color(sky)'
}
module_stage_1 = None
message_stage_1 = None
pred_answer_stage_1 = None
type_stage_1 = 'default'

# Stage 1.5 test case
args_stage_1_5 = Args(stage=1.5)
prompt_stage_1_5 = "Question: __INSERT_NEW_QUESTION__ and module: __MODULE_NAME__ with head: __MODULE_HEAD_HALF__"
ann_stage_1_5 = {
    'question': 'What is this object?',
    'answer': 'cat',
    'high_level_program': 'identify(object)'
}
module_stage_1_5 = {
    'module_name': 'ObjectIdentifier',
    'module_head': 'forward(x)',
    'module_head_half': 'extract_features(x)'
}
message_stage_1_5 = None
pred_answer_stage_1_5 = None
type_stage_1_5 = 'default'

# Stage 2 default test case
args_stage_2 = Args(stage=2)
prompt_stage_2 = "Module: __MODULE_NAME__ with head: __MODULE_HEAD__"
ann_stage_2 = {
    'question': 'Test question',
    'answer': 'test answer',
    'high_level_program': 'test_program()'
}
module_stage_2 = {
    'module_name': 'TestModule',
    'module_head': 'def forward(self, x)'
}
message_stage_2 = None
pred_answer_stage_2 = None
type_stage_2 = 'default'

# Stage 2 debug_init test case
args_stage_2_debug = Args(stage=2)
prompt_stage_2_debug = "Module: __MODULE_NAME__ head: __MODULE_HEAD__ error: __DEBUG_MESSAGE__"
ann_stage_2_debug = {
    'question': 'Debug question',
    'answer': 'debug answer',
    'high_level_program': 'debug_program()'
}
module_stage_2_debug = {
    'module_name': 'DebugModule',
    'module_head': 'def process(self, data)'
}
message_stage_2_debug = 'Variable not defined'
pred_answer_stage_2_debug = None
type_stage_2_debug = 'debug_init'

# Stage 2 debug_execute_error test case
args_stage_2_exec_error = Args(stage=2)
prompt_stage_2_exec_error = "Module: __MODULE_NAME__ head: __MODULE_HEAD__ error: __DEBUG_MESSAGE__ program: __HIGH_LEVEL_PROGRAM__"
ann_stage_2_exec_error = {
    'question': 'Error question',
    'answer': 'error answer',
    'high_level_program': 'execute_with_error()'
}
module_stage_2_exec_error = {
    'module_name': 'ErrorModule',
    'module_head': 'def run(self, x)'
}
message_stage_2_exec_error = 'Index out of bounds'
pred_answer_stage_2_exec_error = None
type_stage_2_exec_error = 'debug_execute_error'

# Stage 2 debug_execute_wrong test case
args_stage_2_wrong = Args(stage=2)
prompt_stage_2_wrong = "Module: __MODULE_NAME__ head: __MODULE_HEAD__ answer: __ANSWER__ output: __OUTPUT__ program: __HIGH_LEVEL_PROGRAM__"
ann_stage_2_wrong = {
    'question': 'Wrong question',
    'answer': 'correct_answer',
    'high_level_program': 'execute_wrong()'
}
module_stage_2_wrong = {
    'module_name': 'WrongModule',
    'module_head': 'def compute(self, x)'
}
message_stage_2_wrong = None
pred_answer_stage_2_wrong = 'incorrect_answer'
type_stage_2_wrong = 'debug_execute_wrong'

ARGS = {
    'args': args_stage_1,
    'prompt': prompt_stage_1,
    'module': module_stage_1,
    'ann': ann_stage_1,
    'message': message_stage_1,
    'pred_answer': pred_answer_stage_1,
    'type': type_stage_1
}
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_module_list Ran
ran on a synthesized input
umass-foundation-model/genome/engine/util.py
code served (permissive licence) · get_code("2532192495c60124")
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 list, ndim 1, 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 json
import tempfile
import shutil

# Create a temporary directory for module files
temp_dir = tempfile.mkdtemp()

# Create sample module JSON files
module_data_1 = {
    "module_name": "module_a",
    "module": "def forward(x): return x",
    "test_accuracy": 0.95
}

module_data_2 = {
    "name": "module_b",
    "module": "def forward(x): return x * 2",
    "test_accuracy": 0.87
}

module_data_3 = {
    "module_name": "module_c",
    "module": "def forward(x): return x + 1",
    "test_accuracy": 0.75
}

# Write module files to temp directory
with open(os.path.join(temp_dir, "MODULE_1.json"), "w") as f:
    json.dump(module_data_1, f)

with open(os.path.join(temp_dir, "MODULE_2.json"), "w") as f:
    json.dump(module_data_2, f)

with open(os.path.join(temp_dir, "data.json"), "w") as f:
    json.dump(module_data_3, f)

# Create a simple args-like object
class Args:
    def __init__(self, use_new_module, module_save_dir, threshold):
        self.use_new_module = use_new_module
        self.module_save_dir = module_save_dir
        self.threshold = threshold

ARGS = {
    "args": Args(
        use_new_module=True,
        module_save_dir=temp_dir,
        threshold=0.80
    )
}
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 list, ndim 1, dtype family float — 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
get_prompt Ran
ran on a synthesized input
umass-foundation-model/genome/engine/prompt.py
code served (permissive licence) · get_code("04269c1b860b83ab")
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 tempfile
import os

# Create temporary prompt files for each stage
temp_dir = tempfile.mkdtemp()

# Create stage 1 prompt file
stage1_prompt_path = os.path.join(temp_dir, "stage1_prompt.txt")
with open(stage1_prompt_path, 'w') as f:
    f.write("Stage 1 prompt with __NEW_MODULE_HEAD_LIST__ and __NEW_MODULE_LIST__")

# Create stage 1.5 prompt file
stage15_prompt_path = os.path.join(temp_dir, "stage15_prompt.txt")
with open(stage15_prompt_path, 'w') as f:
    f.write("Stage 1.5 prompt with __NEW_MODULE_HEAD_LIST__ and __NEW_MODULE_LIST__")

# Create stage 2 prompt files
stage2_default_path = os.path.join(temp_dir, "stage2_default.txt")
with open(stage2_default_path, 'w') as f:
    f.write("Stage 2 default prompt")

stage2_debug_init_path = os.path.join(temp_dir, "stage2_debug_init.txt")
with open(stage2_debug_init_path, 'w') as f:
    f.write("Stage 2 debug init prompt")

stage2_debug_execute_error_path = os.path.join(temp_dir, "stage2_debug_execute_error.txt")
with open(stage2_debug_execute_error_path, 'w') as f:
    f.write("Stage 2 debug execute error prompt")

stage2_debug_execute_wrong_path = os.path.join(temp_dir, "stage2_debug_execute_wrong.txt")
with open(stage2_debug_execute_wrong_path, 'w') as f:
    f.write("Stage 2 debug execute wrong prompt")

# Create stage 3 prompt file
stage3_prompt_path = os.path.join(temp_dir, "stage3_prompt.txt")
with open(stage3_prompt_path, 'w') as f:
    f.write("Stage 3 prompt with __NEW_MODULE_EXAMPLE_LIST__ and __NEW_MODULE_LIST__")

# Create args class with all required attributes
class Args:
    def __init__(self):
        self.stage = 1
        self.online_prompt_path = stage1_prompt_path
        self.merge_prompt_path = stage15_prompt_path
        self.module_make_prompt_path = stage2_default_path
        self.module_debug_init_prompt_path = stage2_debug_init_path
        self.module_debug_execute_error_prompt_path = stage2_debug_execute_error_path
        self.module_debug_execute_wrong_prompt_path = stage2_debug_execute_wrong_path
        self.inference_prompt_path = stage3_prompt_path

# Create module list for testing
module_list_stage1 = [
    {
        'module_head': 'def module_1():',
        'module_name': 'module_1'
    },
    {
        'module_head': 'def module_2(x, y):',
        'module_name': 'module_2'
    }
]

module_list_stage3 = [
    {
        'module_name': 'detect_object',
        'annotations': [
            {
                'question': 'What is in the image?',
                'high_level_program': 'detect_object(image)'
            }
        ]
    },
    {
        'module_name': 'count_objects',
        'annotations': [
            {
                'question': 'How many objects?',
                'high_level_program': 'count_objects(detections)'
            }
        ]
    }
]

ARGS = {
    'args': Args(),
    'module_list': module_list_stage1,
    'type': 'default'
}
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 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
nms Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
umass-foundation-model/genome/engine/nms.py
code served (permissive licence) · get_code("ca6a88a4dee2025a")
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 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 numpy as np

# Construct valid arguments for the nms function
# The function performs Non-Maximum Suppression on bounding boxes

# Create sample bounding boxes in format [start_x, start_y, end_x, end_y]
bounding_boxes = [
    [10, 20, 50, 60],
    [15, 25, 55, 65],
    [100, 100, 150, 150],
    [105, 105, 155, 155]
]

# Create confidence scores corresponding to each bounding box
confidence_score = [0.9, 0.8, 0.85, 0.75]

# Set IoU threshold for NMS
threshold = 0.3

ARGS = {
    "bounding_boxes": bounding_boxes,
    "confidence_score": confidence_score,
    "threshold": threshold
}
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 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
parse_step Ran
ran; our contract draft was wrong, not the code
umass-foundation-model/genome/engine/step_interpreters.py
code served (permissive licence) · get_code("ce7cf6bf130423fc")
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 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 io
import tokenize

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Test case 1: simple step with arguments
step_str_1 = "output = step_name(arg1=value1, arg2=value2)"

# Test case 2: simple step without arguments (partial=True)
step_str_2 = "result = my_step()"

ARGS = {
    "step_str": step_str_1,
    "partial": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
strip_dict Ran
ran on a synthesized input
umass-foundation-model/genome/engine/util.py
code served (permissive licence) · get_code("c12aa6bd7e7aeb47")
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 torch

# Construct a dictionary with string values that have leading/trailing whitespace
test_dict = {
    "key1": "  hello  ",
    "key2": "world\n",
    "key3": "\t\tpadded\t",
    "key4": "no_spaces",
    "number_key": 42,
    "nested": {"inner": "  nested_string  "}
}

ARGS = {
    "dict": test_dict
}
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 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
parse_response Not yet run
unverified (harvested, no recorded run)
umass-foundation-model/genome/engine/gpt.py
code served (permissive licence) · get_code("c949723a39704cc2")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
parse_step 2 other papers
2 dated earlier
2211.11559 (2022-11)
Visual Programming: Compositional visual reasoning without training
2310.08446 (2023-10)
Towards Robust Multi-Modal Reasoning via Model Selection
nms 1 other paper
1 later
2403.01404 (2024-03)
What Is Missing in Multilingual Visual Reasoning and How to Fix It

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

Recent works have shown that Large Language Models (LLMs) could empower traditional neuro-symbolic models via programming capabilities to translate language into module descriptions, thus achieving strong visual reasoning results while maintaining the model's transparency and efficiency. However, these models usually exhaustively generate the entire code snippet given each new instance of a task, which is extremely ineffective. We propose generative neuro-symbolic visual reasoning by growing and reusing modules. Specifically, our model consists of three unique stages, module initialization, module generation, and module execution. First, given a vision-language task, we adopt LLMs to examine whether we could reuse and grow over established modules to handle this new task. If not, we initialize a new module needed by the task and specify the inputs and outputs of this new module. After that, the new module is created by querying LLMs to generate corresponding code snippets that match the requirements. In order to get a better sense of the new module's ability, we treat few-shot training examples as test cases to see if our new module could pass these cases. If yes, the new module is added to the module library for future reuse. Finally, we evaluate the performance of our model on the testing set by executing the parsed programs with the newly made visual modules to get the results. We find the proposed model possesses several advantages. First, it performs competitively on standard tasks like visual question answering and referring expression comprehension; Second, the modules learned from one task can be seamlessly transferred to new tasks; Last but not least, it is able to adapt to new visual reasoning tasks by observing a few training examples and reusing modules.

For agents

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

get_harvested_code_for_paper("2311.04901")
get_code_for_paper("2311.04901")
have("2311.04901")

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

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

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

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

Connect an agent — have() is free.