SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.10475 · ACL Findings · 2022

DEEPSTRUCT: Pretraining of Language Models for Structure Prediction

U Berkeley, Jie Tang, Dawn Song, Xiao Liu, Zui Chen, Chenguang Wang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 2 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 5 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2205.10475.json · badge: /api/ran/2205.10475.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
cgraywang/deepstruct canonical (classifier label)
classifier basis not recorded on the link
11 ran · 2 no recorded run
FunctionStatusWhere it lives
FlattenList Ran
ran on a synthesized input
cgraywang/deepstruct/src/dataset_processing/datasets.py
code served (permissive licence) · get_code("c1be0c65b775ba03")
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 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 torch.nn as nn

torch.manual_seed(0)

# Analyze the function:
# FlattenList takes a parameter L which is a List
# The function recursively flattens nested lists
# It checks isinstance(x, list) and processes elements accordingly

# Create test cases with various nested list structures
test_list_1 = [1, 2, 3]
test_list_2 = [1, [2, 3], 4]
test_list_3 = [1, [2, [3, 4]], 5]
test_list_4 = [[1, 2], [3, 4], [5, 6]]
test_list_5 = [1, 2, [3, [4, 5, [6, 7]]]]

# Use one comprehensive nested list as the argument
L = [1, [2, 3], [[4, 5], 6], [[[7]]]]

ARGS = {
    "L": L
}
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 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
b_cubed Ran
ran, honoured the contract we drafted
cgraywang/deepstruct/src/dataset_processing/coreference_metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lengsicong/tell2design, is pointer only (licence: NONE) · get_code("2d71e2917845b6ac")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from lengsicong/tell2design, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

f1 Ran
ran, honoured the contract we drafted
cgraywang/deepstruct/src/dataset_processing/coreference_metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from sapienzanlp/bookcoref, is pointer only (licence: NONE) · get_code("5dc251a1bb16c94f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from sapienzanlp/bookcoref, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fix Ran
ran on a synthesized input
cgraywang/deepstruct/src/dataset_processing/datasets.py
code served (permissive licence) · get_code("6ad7e61fdd3bfef8")
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)

def fix(string):
    return string.strip('[').strip(']').replace(' ', '').replace('.', '').replace(',', '').replace('(', '').replace(')', '').lower()

ARGS = {
    'string': '[Hello, World. (Test)]'
}
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_avg_results Ran
ran; our contract draft was wrong, not the code
cgraywang/deepstruct/src/dataset_processing/evaluate.py
code served (permissive licence) · get_code("3e9c0f90d3b4010c")
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 numpy as np

# Construct sample results - a list of dictionaries from multiple episodes
# Each episode has various metrics
results = [
    {
        'reward': 100.5,
        'loss': 0.45,
        'accuracy': 0.92,
        'steps': 50
    },
    {
        'reward': 105.2,
        'loss': 0.38,
        'accuracy': 0.95,
        'steps': 48
    },
    {
        'reward': 98.7,
        'loss': 0.52,
        'accuracy': 0.89,
        'steps': 52
    }
]

ARGS = {
    'results': results
}
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 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
insertSpace Ran
ran; our contract draft was wrong, not the code
cgraywang/deepstruct/src/data_scripts/multi_woz_create_data.py
code served (permissive licence) · get_code("d7503a387ec4bc30")
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 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 re

def insertSpace(token, text):
    sidx = 0
    while True:
        sidx = text.find(token, sidx)
        if sidx == -1:
            break
        if sidx + 1 < len(text) and re.match('[0-9]', text[sidx - 1]) and re.match('[0-9]', text[sidx + 1]):
            sidx += 1
            continue
        if text[sidx - 1] != ' ':
            text = text[:sidx] + ' ' + text[sidx:]
            sidx += 1
        if sidx + len(token) < len(text) and text[sidx + len(token)] != ' ':
            text = text[:sidx + 1] + ' ' + text[sidx + 1:]
        sidx += 1
    return text

ARGS = {
    "token": ".",
    "text": "The price is 3.14 dollars and 2.5 euros."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
is_ascii Ran
ran, violated the contract we drafted
cgraywang/deepstruct/src/data_scripts/multi_woz_create_data.py
code served (permissive licence) · get_code("1b465b9239cb631c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    "s": "Hello, World! This is an ASCII string with numbers 12345 and symbols @#$%"
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 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
oie_fix Ran
ran on a synthesized input
cgraywang/deepstruct/src/dataset_processing/output_formats.py
code served (permissive licence) · get_code("b1f7144387836c66")
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

ARGS = {
    "string": "[example string. with, various (characters)]"
}
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
register_dataset Ran
ran; our contract draft was wrong, not the code
cgraywang/deepstruct/src/dataset_processing/datasets.py
code served (permissive licence) · get_code("404087a3ff94d6e0")
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 type. 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

# Define a minimal dataset class to pass to register_dataset
class MinimalDataset:
    name = "test_dataset"
    
    def __init__(self):
        pass

# Create an instance of the dataset class
dataset_instance = MinimalDataset()

# Define ARGS mapping the parameter to a value
ARGS = {
    "dataset_class": dataset_instance.__class__
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
register_input_format Ran
ran; our contract draft was wrong, not the code
cgraywang/deepstruct/src/dataset_processing/input_formats.py
code served (permissive licence) · get_code("4afe64752662fe3b")
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 type. 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 register_input_format takes a format_class parameter
# and expects it to have a 'name' attribute (accessed via format_class.name)
# It stores the class in a dict using that name as the key

class StandInFormatClass:
    name = "test_input_format"

ARGS = {
    "format_class": StandInFormatClass
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
register_output_format Ran
ran; our contract draft was wrong, not the code
cgraywang/deepstruct/src/dataset_processing/output_formats.py
code served (permissive licence) · get_code("ba71a83cd3836e77")
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 type. 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 torch.nn as nn

torch.manual_seed(0)

class SimpleOutputFormat:
    """A minimal output format class with required 'name' attribute"""
    name = "simple_format"

ARGS = {
    "format_class": SimpleOutputFormat
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
evaluate_documents Not yet run
unverified (harvested, no recorded run)
cgraywang/deepstruct/src/dataset_processing/coreference_metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lengsicong/tell2design, is pointer only (licence: NONE) · get_code("44ea1242eeeb38ac")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from lengsicong/tell2design, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

normalize Not yet run
unverified (harvested, no recorded run)
cgraywang/deepstruct/src/data_scripts/multi_woz_create_data.py
code served (permissive licence) · get_code("c99ace056d9e2b0b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 10 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 10 later) and 3 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
f1 12 other papers
5 dated earlier, 1 the same month, 6 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1907.10529 (2019-07)
SpanBERT: Improving Pre-training by Representing and Predicting Spans
2021.naacl-main.125 (2021 (year only))
Incorporating Syntax and Semantics in Coreference Resolution with Heterogeneous Graph Attention Network
and 9 more not named here
is_ascii 9 other papers
6 dated earlier, 3 later
1911.08151 (2019-11)
Retrospective and Prospective Mixture-of-Generators for Task-oriented Dialogue Response Generation
2020.acl-main.53 (2020 (year only))
Efficient Dialogue State Tracking by Selectively Overwriting Memory
2005.00796 (2020-05)
A Simple Language Model for Task-Oriented Dialogue
and 6 more not named here
insertSpace 5 other papers
4 dated earlier, 1 later
2020.acl-main.53 (2020 (year only))
Efficient Dialogue State Tracking by Selectively Overwriting Memory
2101.09374 (2021-01)
Slot Self-Attentive Dialogue State Tracking
2104.00773 (2021-04)
MultiWOZ 2.4: A Multi-Domain Task-Oriented Dialogue Dataset with Essential Annotation Corrections to Improve State Tracking Evaluation
and 2 more not named here
evaluate_documents 4 other papers
1 dated earlier, 3 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
2310.13774 (2023-10)
Seq2seq is All You Need for Coreference Resolution
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning
and 1 more not named here
b_cubed 3 other papers
3 later
2310.13774 (2023-10)
Seq2seq is All You Need for Coreference Resolution
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning
2311.15941 (2023-11)
Tell2Design: A Dataset for Language-Guided Floor Plan Generation
normalize 3 other papers
2 dated earlier, 1 later
2020.acl-main.53 (2020 (year only))
Efficient Dialogue State Tracking by Selectively Overwriting Memory
2106.03521 (2021-06)
REDDITBIAS: A Real-World Resource for Bias Evaluation and Debiasing of Conversational Language Models
2407.21633 (2024-07)
Zero-Shot Cross-Domain Dialogue State Tracking via Dual Low-Rank Adaptation
get_avg_results 2 other papers
2 later
2305.09731 (2023-05)
What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learning
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning
register_dataset 2 other papers
2 later
2305.09731 (2023-05)
What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learning
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning
register_input_format 2 other papers
2 later
2305.09731 (2023-05)
What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learning
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning
register_output_format 2 other papers
2 later
2305.09731 (2023-05)
What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learning
2311.03748 (2023-11)
Unified Low-Resource Sequence Labeling by Sample-Aware Dynamic Sparse Finetuning

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

We introduce a method for improving the structural understanding abilities of language models. Unlike previous approaches that finetune the models with task-specific augmentation, we pretrain language models on a collection of task-agnostic corpora to generate structures from text. Our structure pretraining enables zero-shot transfer of the learned knowledge that models have about the structure tasks. We study the performance of this approach on 28 datasets, spanning 10 structure prediction tasks including open information extraction, joint entity and relation extraction, named entity recognition, relation classification, semantic role labeling, event extraction, coreference resolution, factual probe, intent detection, and dialogue state tracking. We further enhance the pretraining with the task-specific training sets. We show that a 10B parameter language model transfers non-trivially to most tasks and obtains state-of-the-art performance on 21 of 28 datasets that we evaluate. 1

For agents

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

get_harvested_code_for_paper("2205.10475")
get_code_for_paper("2205.10475")
have("2205.10475")

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

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

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

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

Connect an agent — have() is free.