SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.13917 · EMNLP · 2023

Generating Data for Symbolic Language with Large Language Models

Tao Yu, Lingpeng Kong, Jiacheng Ye, Chengzu Li

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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 7 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2305.13917.json · badge: /api/ran/2305.13917.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
hkunlp/symgen canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
HKUNLP/SymGen community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
by_length Ran
ran on a synthesized input
hkunlp/symgen/src/filters/filter_tool.py
code served (permissive licence) · get_code("bd8a61f9fef03503")
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

torch.manual_seed(0)

# Construct sample entries with candidates that have text in the specified field
entries = [
    {
        'candidates': [
            {'text': 'this is a valid candidate with enough words'},
            {'text': 'short'},
            {'text': 'this is another valid candidate with many words in it'},
        ]
    },
    {
        'candidates': [
            {'text': 'one two three four five six seven'},
            {'text': 'x'},
            {'text': 'a b c d e f g h i j k l m n o p q r s t u v w x y z one two three'},
        ]
    }
]

field = 'text'
min_len = 5
max_len = 40

ARGS = {
    'entries': entries,
    'field': field,
    'min_len': min_len,
    'max_len': max_len
}
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
deduplicate Ran
ran on a synthesized input
hkunlp/symgen/src/dataset_readers/index_dsr.py
code served (permissive licence) · get_code("46ac634191da2933")
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 pandas as pd
from unittest.mock import Mock

torch.manual_seed(0)

class MockDataset:
    def __init__(self, data):
        self.data = data
    
    def select(self, indices):
        selected_data = [self.data[i] for i in indices]
        return MockDataset(selected_data)

class MockDatasetWrapper:
    def __init__(self, dataset):
        self.dataset = dataset

# Create a small encoded dataset with some duplicates
# input_ids will be used to detect duplicates
encoded_dataset_list = [
    {'input_ids': [1, 2, 3, 4], 'metadata': {'id': 0}},
    {'input_ids': [1, 2, 3, 4], 'metadata': {'id': 1}},  # duplicate of first
    {'input_ids': [5, 6, 7, 8], 'metadata': {'id': 2}},
    {'input_ids': [9, 10, 11, 12], 'metadata': {'id': 3}},
]

class MockEncodedDataset:
    def __init__(self, data):
        self.data = data
    
    def __iter__(self):
        return iter(self.data)
    
    def __len__(self):
        return len(self.data)
    
    def select(self, indices):
        selected_data = [self.data[i] for i in indices]
        return MockEncodedDataset(selected_data)
    
    def map(self, func, with_indices=False):
        new_data = []
        for i, item in enumerate(self.data):
            if with_indices:
                new_data.append(func(item, i))
            else:
                new_data.append(func(item))
        return MockEncodedDataset(new_data)

# Create mock dataset wrapper with a basic dataset
base_dataset = MockDataset(encoded_dataset_list)
dataset_wrapper = MockDatasetWrapper(base_dataset)

# Create encoded dataset
encoded_dataset = MockEncodedDataset(encoded_dataset_list)

ARGS = {
    'dataset_wrapper': dataset_wrapper,
    'encoded_dataset': encoded_dataset,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, 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
encode_field Ran
ran on a synthesized input
hkunlp/symgen/src/dataset_readers/base_dsr.py
code served (permissive licence) · get_code("f397316309d5028b")
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 Mock. 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)

# Create a minimal tokenizer stand-in
class StandInTokenizer:
    def encode_plus(self, text, truncation=False, return_tensors=None):
        # Return a mock tokenized output with input_ids and attention_mask
        input_ids = torch.tensor([[101, 2054, 2003, 102]], dtype=torch.long)  # [1, 4]
        attention_mask = torch.tensor([[1, 1, 1, 1]], dtype=torch.long)  # [1, 4]
        return Mock(input_ids=input_ids, attention_mask=attention_mask)

tokenizer = StandInTokenizer()

# Create a minimal dataset wrapper with field_getter
class StandInFieldGetter:
    def __init__(self):
        self.functions = {
            'text_field': lambda example: example['text']
        }

class StandInDatasetWrapper:
    def __init__(self):
        self.field_getter = StandInFieldGetter()
        self.dataset = self._create_dataset()
    
    def _create_dataset(self):
        # Create a mock dataset with map method
        mock_dataset = Mock()
        mock_dataset.column_names = ['text', 'label']
        
        def mock_map(fn, with_indices=False, remove_columns=None, fn_kwargs=None):
            # Simulate the map operation
            examples = [
                {'text': 'hello world'},
                {'text': 'foo bar'}
            ]
            results = []
            for idx, example in enumerate(examples):
                result = fn(example, idx, **fn_kwargs)
                results.append(result)
            # Return a mock dataset with the results
            mock_encoded = Mock()
            mock_encoded.data = results
            return mock_encoded
        
        mock_dataset.map = mock_map
        return mock_dataset

dataset_wrapper = StandInDatasetWrapper()
field = 'text_field'

ARGS = {
    'tokenizer': tokenizer,
    'dataset_wrapper': dataset_wrapper,
    'field': field
}
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 Mock — a Mock 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
reassign_idx Ran
ran on a synthesized input
hkunlp/symgen/src/dataset_readers/index_dsr.py
code served (permissive licence) · get_code("d3e6bb8dcb712dfd")
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

torch.manual_seed(0)

# The function reassign_idx expects:
# - example: a dict with a 'metadata' key containing another dict with an 'id' key
# - index: an integer value to assign

example = {
    'metadata': {
        'id': 0
    },
    'data': torch.randn(2, 4)
}

index = 42

ARGS = {
    'example': example,
    'index': index
}
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
result_eq Ran
ran on a synthesized input
hkunlp/symgen/src/filters/break_filter.py
code served (permissive licence) · get_code("e67773e4e43cf4c1")
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 bool, 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

torch.manual_seed(0)

# result_eq simply compares two results with ==
# The results can be any Python objects that support equality comparison
# We'll test with a few different types

result1_int = 42
result2_int = 42

result1_str = "test"
result2_str = "test"

result1_list = [1, 2, 3]
result2_list = [1, 2, 3]

result1_tensor = torch.tensor([1.0, 2.0, 3.0, 4.0])
result2_tensor = torch.tensor([1.0, 2.0, 3.0, 4.0])

result1_dict = {"a": 1, "b": 2}
result2_dict = {"a": 1, "b": 2}

# Use simple integer results for the main test
ARGS = {
    "result1": 42,
    "result2": 42
}
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 bool, 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
result_eq Ran
ran on a synthesized input
hkunlp/symgen/src/filters/geoquery_filter.py
code served (permissive licence) · get_code("01f68295484d4194")
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 bool, 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)

# The function result_eq compares two results for equality.
# It returns False if either result is an empty list, otherwise returns their equality.
# The results appear to be generic comparable objects (likely lists or similar structures).

# Create two identical non-empty results to test equality
result1 = [1, 2, 3, 4, 5]
result2 = [1, 2, 3, 4, 5]

ARGS = {
    "result1": result1,
    "result2": result2,
}
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 bool, 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
text_to_field Ran
ran on a synthesized input
hkunlp/symgen/src/filters/filter_tool.py
code served (permissive licence) · get_code("57cc9ebc64606720")
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

ARGS = {
    'entries': [
        {
            'candidates': [
                {'text': 'hello world', 'other_field': 'value1'},
                {'text': 'foo bar', 'other_field': 'value2'}
            ]
        },
        {
            'candidates': [
                {'text': 'test string', 'other_field': 'value3'}
            ]
        }
    ],
    'field': 'processed_text'
}
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 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
by_a_post_process Not yet run
unverified (harvested, no recorded run)
hkunlp/symgen/src/filters/geoquery_filter.py
code served (permissive licence) · get_code("95e0731eb9afd765")
How it ran

no invocation recorded.

by_dedup Not yet run
unverified (harvested, no recorded run)
hkunlp/symgen/src/filters/filter_tool.py
code served (permissive licence) · get_code("7cee44a5faf3bf92")
How it ran

no invocation recorded.

by_exec Not yet run
unverified (harvested, no recorded run)
HKUNLP/SymGen/src/filters/filter_tool.py
code served (permissive licence) · get_code("91c673455ce64f8a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 10 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-24.

Repositories linked to this paper

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

Abstract

While large language models (LLMs) bring not only performance but also complexity, recent work has started to turn LLMs into data generators rather than task inferencers, where another affordable task model is trained for efficient deployment and inference. However, such an approach has primarily been applied to natural language tasks, and has not yet been explored for symbolic language tasks with complex structured outputs (e.g., semantic parsing and code generation). In this paper, we propose SYMGEN which utilizes LLMs for generating various annotationexpensive symbolic language data. SYMGEN consists of an informative prompt to steer generation and an agreement-based verifier to improve data correctness. We conduct extensive experiments on six symbolic language tasks across various settings. Compared with the LLMs, we demonstrate the 1%-sized task model can achieve comparable or better performance, largely cutting inference and deployment costs. We also show that generated data with only a few human demonstrations can be as effective as over 10 times the amount of human-annotated data when training the task model, saving a considerable amount of annotation effort. SYMGEN takes a step toward data generation for annotation-expensive complex tasks, and we release the code at https://github.com/HKUNLP/SymGen.

For agents

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

get_harvested_code_for_paper("2305.13917")
get_code_for_paper("2305.13917")
have("2305.13917")

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

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

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

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

Connect an agent — have() is free.