SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.10650 · ACL · 2024

SPOR: A Comprehensive and Practical Evaluation Method for Compositional Generalization in Data-to-Text Generation

Houfeng Wang, Ziyao Xu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 3 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/2405.10650.json · badge: /api/ran/2405.10650.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
xzy-xzy/SPOR community
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
Benchmark Ran
ran on a synthesized input
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("fb379c167758d8aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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 xml.etree.ElementTree as Et
from collections import defaultdict
import json
from xml.dom import minidom
import copy

class Entry:

    def __init__(self, e, mr=False):
        self.data = e
        self.triples = []
        if not mr:
            for x in e.modifiedtripleset.triples:
                self.triples.append((x.s, x.p, x.o))
        else:
            for x in e.modifiedtripleset.triples:
                self.triples.append(('None', x.p, x.o))
        self.texts = []
        for x in e.lexs:
            self.texts.append(x.lex)

class Benchmark:

    def __init__(self):
        self.entries = []

    def fill_benchmark(self, fileslist):
        """
        Parse xml files and fill Benchmark with Entry instances.
        :param fileslist: [(path_to_file, filename.xml), (), ... ()]
        :return:
        """
        for file in fileslist:
            myfile = file[0] + '/' + file[1]
            tree = Et.parse(myfile)
            root = tree.getroot()
            for xml_entry in root.iter('entry'):
                entry_id = xml_entry.attrib['eid']
                category = xml_entry.attrib['category']
                size = xml_entry.attrib['size']
                shape = None
                shape_type = None
                entry = Entry(category, size, entry_id, shape, shape_type)
                for child in xml_entry:
                    if child.tag == 'originaltripleset':
                        entry.fill_originaltriple(child)
                    elif child.tag == 'modifiedtripleset':
                        entry.fill_modifiedtriple(child)
                    elif child.tag == 'lex':
                        entry.create_lex(child)
                    elif child.tag == 'dbpedialinks':
                        entry.create_dbpedialinks(child)
                    elif child.tag == 'links':
                        entry.create_links(child)
                self.entries.append(entry)

    def total_lexcount(self):
        count = [entry.count_lexs() for entry in self.entries]
        return sum(count)

    def unique_p_otriples(self):
        properties = [triple.p for entry in self.entries for triple in entry.originaltripleset[0].triples]
        return set(properties)

    def unique_p_mtriples(self):
        properties = [triple.p for entry in self.entries for triple in entry.modifiedtripleset.triples]
        return set(properties)

    def entry_count(self, size=None, cat=None):
        """
        calculate the number of entries in benchmark
        :param size: size (should be string)
        :param cat: category
        :return: entry count
        """
        if not size and cat:
            entries = [entry for entry in self.entries if entry.category == cat]
        elif not cat and size:
            entries = [entry for entry in self.entries if entry.size == size]
        elif not size and (not cat):
            return len(self.entries)
        else:
            entries = [entry for entry in self.entries if entry.category == cat and entry.size == size]
        return len(entries)

    def lexcount_size_category(self, size, cat):
        """Calculate the number of lexicalisations."""
        counts = [entry.count_lexs() for entry in self.entries if entry.category == cat and entry.size == size]
        return sum(counts)

    def property_map(self):
        """Approximate mapping between modified properties and original properties.
        Don't extract all mappings!"""
        mprop_oprop = defaultdict(set)
        for entry in self.entries:
            for tripleset in entry.originaltripleset:
                for i, triple in enumerate(tripleset.triples):
                    m_property = entry.modifiedtripleset.triples[i].p
                    m_subj = entry.modifiedtripleset.triples[i].s
                    m_obj = entry.modifiedtripleset.triples[i].o
                    if m_subj == triple.s and m_obj == triple.o:
                        mprop_oprop[m_property].add(triple.p)
                    if not mprop_oprop[m_property]:
                        mprop_oprop[m_property].add(triple.p)
        return mprop_oprop

    def filter(self, size=[], cat=[]):
        """
        Filter set of entries in the benchmark wrt size and category.
        :param size: list of triple sizes (str) to extract; default empty -- all sizes
        :param cat: list of categories to extract; default empty -- all categories
        :return: copied benchmark object with filtered size and categories;
                if no entry is left, return None
        """
        bench_filtered = copy.deepcopy(self)
        for entry in self.entries:
            deleted = False
            if cat:
                if entry.category not in cat:
                    bench_filtered.entries.remove(entry)
                    deleted = True
            if size and (not deleted):
                if entry.size not in size:
                    bench_filtered.entries.remove(entry)
        if bench_filtered.entries:
            return bench_filtered
        return None


INIT_ARGS = {}

ARGS = {
    'size': [],
    'cat': []
}

METHOD = 'filter'

if __name__ == '__main__':
    benchmark = Benchmark()
    result = benchmark.filter(**ARGS)
    print(f"Filter result: {result}")
    print(f"Benchmark entries count: {len(benchmark.entries)}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Entry Ran
ran on a synthesized input · constructed an object; no result was computed
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("ddb0c8dc40d57260")
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 an instance of its own class, Entry: the run constructed the object and did not call it, so no result was computed. 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

class Triple:
    def __init__(self, s, p, o):
        self.s = s
        self.p = p
        self.o = o

class ModifiedTripleSet:
    def __init__(self, triples):
        self.triples = triples

class Lex:
    def __init__(self, lex):
        self.lex = lex

class EntryData:
    def __init__(self, modifiedtripleset, lexs):
        self.modifiedtripleset = modifiedtripleset
        self.lexs = lexs

# Construct a sample entry object with modifiedtripleset and lexs
triples = [
    Triple('subject1', 'predicate1', 'object1'),
    Triple('subject2', 'predicate2', 'object2'),
    Triple('subject3', 'predicate3', 'object3'),
]

modified_triple_set = ModifiedTripleSet(triples)

lexs = [
    Lex('text1'),
    Lex('text2'),
    Lex('text3'),
]

entry_data = EntryData(modified_triple_set, lexs)

ARGS = {
    'e': entry_data,
    'mr': False,
}
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 Entry — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Entry 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
coefficient Ran
ran, honoured the contract we drafted
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("35ccb7763668f558")
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 float, ndim 0, dtype family float, 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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - Takes parameters a and b
# - Both a and b are indexed with keys from a (so they're dict-like)
# - a[x] and b[x] are numeric values that can be summed and divided
# - The function computes a coefficient based on these values

# Create two dictionaries with numeric values
a = {
    'key1': 2.0,
    'key2': 3.0,
    'key3': 5.0,
    'key4': 1.0
}

b = {
    'key1': 1.5,
    'key2': 2.5,
    'key3': 4.0,
    'key4': 0.5
}

ARGS = {
    'a': a,
    'b': b
}
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 float, ndim 0, dtype family float, 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
delete_comp Ran
ran; our contract draft was wrong, not the code
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("e383b4596e28bf60")
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 torch
import numpy as np

class Triple:
    def __init__(self, s, p, o):
        self.s = s
        self.p = p
        self.o = o

class ModifiedTripleSet:
    def __init__(self, triples):
        self.triples = triples

class Entity:
    def __init__(self, modifiedtripleset):
        self.modifiedtripleset = modifiedtripleset

# Create training data with some triples
train_entity_1 = Entity(ModifiedTripleSet([
    Triple("subject1", "predicate1", "object1"),
    Triple("subject2", "predicate2", "object2"),
]))

train_entity_2 = Entity(ModifiedTripleSet([
    Triple("subject3", "predicate3", "object3"),
    Triple("subject1", "predicate1", "object1"),
]))

train = [train_entity_1, train_entity_2]

# Create test data with some overlapping and some non-overlapping triples
test_entity_1 = Entity(ModifiedTripleSet([
    Triple("subject1", "predicate1", "object1"),
    Triple("subject2", "predicate2", "object2"),
]))

test_entity_2 = Entity(ModifiedTripleSet([
    Triple("subject1", "predicate1", "object1"),
    Triple("subject_new", "predicate_new", "object_new"),
]))

test_entity_3 = Entity(ModifiedTripleSet([
    Triple("subject3", "predicate3", "object3"),
    Triple("subject1", "predicate1", "object1"),
]))

test = [test_entity_1, test_entity_2, test_entity_3]

mr = False

ARGS = {
    "train": train,
    "test": test,
    "mr": mr,
}
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 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
select_files Ran
ran; our contract draft was wrong, not the code
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("4724d167ece786a6")
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 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 temporary directory structure with mock XML files
tmpdir = tempfile.mkdtemp()

# Create subdirectories matching the expected pattern: {number}triples
for i in range(1, 8):
    subdir = os.path.join(tmpdir, f"{i}triples")
    os.makedirs(subdir, exist_ok=True)
    
    # Create some mock XML files with different categories
    for j in range(3):
        filename1 = f"category_a_file_{j}.xml"
        filename2 = f"category_b_file_{j}.xml"
        open(os.path.join(subdir, filename1), 'w').close()
        open(os.path.join(subdir, filename2), 'w').close()

ARGS = {
    'topdir': tmpdir,
    'category': 'category_a',
    'size': (1, 8)
}
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 2, 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
select_tfile Ran
ran; our contract draft was wrong, not the code
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("2b3ae0adb7304cc9")
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 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 numpy as np

ARGS = {
    "topdir": "/tmp/test_dir",
    "filename": "test_file.txt"
}
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 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
deal_sys Not yet run
unverified (harvested, no recorded run)
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("971cfe0a65a8d4fe")
How it ran

no invocation recorded.

get_benchmark_e2e Not yet run
unverified (harvested, no recorded run)
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("211c4cf9603bb7db")
How it ran

no invocation recorded.

get_entries Not yet run
unverified (harvested, no recorded run)
xzy-xzy/SPOR/code/construction/systematicity.py
code served (permissive licence) · get_code("6af49ab40e5e3341")
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, 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 9 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

Compositional generalization is an important ability of language models and has many different manifestations. For data-to-text generation, previous research on this ability is limited to a single manifestation called Systematicity and lacks consideration of large language models (LLMs), which cannot fully cover practical application scenarios. In this work, we propose SPOR, a comprehensive and practical evaluation method for compositional generalization in data-to-text generation. SPOR includes four aspects of manifestations (Systematicity, Productivity, Order invariance, and Rule learnability) and allows high-quality evaluation without additional manual annotations based on existing datasets. We demonstrate SPOR on two different datasets and evaluate some existing language models including LLMs. We find that the models are deficient in various aspects of the evaluation and need further improvement. Our work shows the necessity for comprehensive research on different manifestations of compositional generalization in data-to-text generation and provides a framework for evaluation.

For agents

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

get_harvested_code_for_paper("2405.10650")
get_code_for_paper("2405.10650")
have("2405.10650")

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

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

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

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

Connect an agent — have() is free.