SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.08351 · 2019

Compositionality decomposed: how do neural networks generalise?

arXiv · PDF · Open in the Atlas

Code that ran

6 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 6 have no contract verdict; 0 failures of our instrument; 1 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/1908.08351.json · badge: /api/ran/1908.08351.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
i-machine-think/am-i-compositional canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
count_functions Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/plot_pcfg_statistics.py
code served (permissive licence) · get_code("e9559d69a1b5367f")
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 int, ndim 0, dtype family int, shape () 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

def count_functions(seq):
    functions = ['swap_first_last', 'echo', 'copy', 'repeat', 'shift', 'reverse', 'append', 'prepend', 'remove_first', 'remove_second']
    n = 0
    seq = seq.split()
    for w in seq:
        if w in functions:
            n += 1
    return n

ARGS = {
    'seq': 'swap_first_last echo copy unknown_word repeat shift'
}
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 int, ndim 0, dtype family int, shape () — shape () 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
depth Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/plot_pcfg_statistics.py
code served (permissive licence) · get_code("78ef9e4d235536d3")
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 int, ndim 0, dtype family int, shape () 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.

# Analyzing the function `depth`, I can see it takes a single parameter `seq`
# which should be either a string or a sequence of tokens.
# The function processes tokens related to functional operations with brackets.

# Let me construct valid test cases:

ARGS = {
    'seq': 'append x y , copy z'
}

# Alternative valid inputs to understand the function:
# - String with operations: 'append x y , copy z' or 'reverse x , echo y , prepend a b'
# - List of tokens: ['append', 'x', 'y', ',', 'copy', 'z']

# The function parses sequences of functional programming operations:
# - one-place operations: copy, reverse, shift, echo, swap_first_last, repeat (take 1 arg)
# - two-place operations: append, prepend, remove_first, remove_second (take 2 args)
# - commas separate arguments
# - END is implicit and marks end of sequence

# Using a simple string input that exercises the logic:
ARGS = {
    'seq': 'append x y , copy z , reverse w'
}
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 int, ndim 0, dtype family int, shape () — shape () 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
depth Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/plot_productivity_statistics.py
code served (permissive licence) · get_code("d7c806a14e763121")
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 int, ndim 0, dtype family int, shape () 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.

# Analyze the function to understand what it needs
# The function takes 'seq' which can be either:
# 1. A string (gets split into tokens)
# 2. A list/sequence of tokens

# The function processes tokens like 'append', 'prepend', 'remove_first', 'remove_second', 
# 'copy', 'reverse', 'shift', 'echo', 'swap_first_last', 'repeat', ',', and 'END'

# It builds a nested structure tracking bracket depth and returns the maximum depth

# Create test sequences - both string and list forms
test_string = "append item1 , item2 copy item3"
test_list = ['append', 'item1', ',', 'item2', 'copy', 'item3']

# Test with a more complex nested structure
complex_sequence = "append item1 , copy item2 , reverse item3"

ARGS = {
    'seq': "append item1 , item2 copy item3"
}
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 int, ndim 0, dtype family int, shape () — shape () 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
interpret Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/plot_overgeneralisation.py
code served (permissive licence) · get_code("1e755f5ef00044c8")
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 numpy as np

# Create sample log lines that contain 'Sequence Accuracy' information
# The function expects lines to parse, looking for 'Sequence Accuracy' followed by a float value
lines = [
    "Epoch 1 Sequence Accuracy: 0.85",
    "Epoch 1 Sequence Accuracy: 0.90",
    "Epoch 2 Sequence Accuracy: 0.87",
    "Epoch 2 Sequence Accuracy: 0.92",
    "Epoch 3 Sequence Accuracy: 0.88",
    "Epoch 3 Sequence Accuracy: 0.93",
    "Epoch 4 Sequence Accuracy: 0.89",
    "Epoch 4 Sequence Accuracy: 0.94",
    "Epoch 5 Sequence Accuracy: 0.91",
    "Epoch 5 Sequence Accuracy: 0.95",
    "Epoch 6 Sequence Accuracy: 0.86",
    "Epoch 6 Sequence Accuracy: 0.91",
    "Epoch 7 Sequence Accuracy: 0.84",
    "Epoch 7 Sequence Accuracy: 0.89",
]

ARGS = {
    "lines": lines
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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_results Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/plot_productivity_statistics.py
code served (permissive licence) · get_code("87e48f490224559a")
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 tempfile
import os

# Create temporary files for testing
temp_dir = tempfile.mkdtemp()

# Create prediction file
prediction_file = os.path.join(temp_dir, "predictions.txt")
with open(prediction_file, 'w') as f:
    f.write("1\n")
    f.write("1\n")
    f.write("0\n")

# Create source file
source_file = os.path.join(temp_dir, "source.txt")
with open(source_file, 'w') as f:
    f.write("copy reverse\n")
    f.write("append x\n")
    f.write("echo\n")

# Create target file
target_file = os.path.join(temp_dir, "target.txt")
with open(target_file, 'w') as f:
    f.write("1\n")
    f.write("1\n")
    f.write("0\n")

ARGS = {
    'prediction_files': [os.path.basename(prediction_file)],
    'source_file': os.path.basename(source_file),
    'target_file': os.path.basename(target_file),
    'mode': 'depth',
    'folder': temp_dir + '/'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
p_test Ran
ran on a synthesized input
i-machine-think/am-i-compositional/src/evaluate/significance_testing.py
code served (permissive licence) · get_code("d0345ff062d64d50")
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 float64, ndim 0, 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 numpy as np
from scipy import stats

# Generate two sets of results for independent samples t-test
np.random.seed(0)
results1 = np.array([1.2, 2.3, 1.8, 2.1, 1.9])
results2 = np.array([2.5, 3.1, 2.8, 3.3, 2.9])

ARGS = {
    "results1": results1,
    "results2": results2,
    "one_sided": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_results Not yet run
unverified (harvested, no recorded run)
i-machine-think/am-i-compositional/src/evaluate/plot_pcfg_statistics.py
code served (permissive licence) · get_code("dc6487c8e0261792")
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-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

Despite a multitude of empirical studies, little consensus exists on whether neural networks are able to generalise compositionally, a controversy that, in part, stems from a lack of agreement about what it means for a neural model to be compositional. As a response to this controversy, we present a set of tests that provide a bridge between, on the one hand, the vast amount of linguistic and philosophical theory about compositionality of language and, on the other, the successful neural models of language. We collect different interpretations of compositionality and translate them into five theoretically grounded tests for models that are formulated on a task-independent level. In particular, we provide tests to investigate (i) if models systematically recombine known parts and rules (ii) if models can extend their predictions beyond the length they have seen in the training data (iii) if models' composition operations are local or global (iv) if models' predictions are robust to synonym substitutions and (v) if models favour rules or exceptions during training. To demonstrate the usefulness of this evaluation paradigm, we instantiate these five tests on a highly compositional data set which we dub PCFG SET and apply the resulting tests to three popular sequence-to-sequence models: a recurrent, a convolution-based and a transformer model. We provide an in-depth analysis of the results, which uncover the strengths and weaknesses of these three architectures and point to potential areas of improvement.

For agents

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

get_harvested_code_for_paper("1908.08351")
get_code_for_paper("1908.08351")
have("1908.08351")

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

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

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

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

Connect an agent — have() is free.