SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.10668 · NeurIPS · 2023

BenchCLAMP: A Benchmark for Evaluating Language Models on Syntactic and Semantic Parsing

Jason Eisner, Richard Shin, Subhro Roy, Sam Thomson, Tongfei Chen, Adam Pauls, Benjamin Van Durme, Microsoft Machines

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 3 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2206.10668.json · badge: /api/ran/2206.10668.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
microsoft/semantic_parsing_with_constrained_lm canonical (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_and_print_fit Ran
ran on a synthesized input
microsoft/semantic_parsing_with_constrained_lm/src/semantic_parsing_with_constrained_lm/fit_max_steps.py
code served (permissive licence) · get_code("5a2ae711aef94233")
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 numpy as np
import random
from dataclasses import dataclass
from typing import List, Tuple

# Set random seeds for reproducibility
random.seed(0)
np.random.seed(0)

# Create sample pairs data
# pairs should be List[Tuple[int, int]] where each tuple is (input, output)
# We create a small dataset with a roughly linear relationship
pairs = [
    (1, 5),
    (2, 8),
    (3, 11),
    (4, 14),
    (5, 17),
    (6, 20),
    (7, 23),
    (8, 26),
    (9, 29),
    (10, 32),
]

ARGS = {
    "pairs": pairs,
    "num_splits": 2,
    "max_unreachable": 5,
}
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 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
cross_validation_fit Ran
ran on a synthesized input
microsoft/semantic_parsing_with_constrained_lm/src/semantic_parsing_with_constrained_lm/fit_max_steps.py
code served (permissive licence) · get_code("8a3ce80af5668522")
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 defaultdict. 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 collections
import random
from dataclasses import dataclass
from typing import Dict, Iterator, List, Tuple
import numpy as np

@dataclass(frozen=True)
class Quantiles:
    intercept_quantile: float
    slope_quantile: float

@dataclass
class Result:
    num_unreachable: int
    surplus_steps: List[int]

def fit(pairs: List[Tuple[int, int]]) -> Iterator[Tuple[Quantiles, float, float]]:
    intercept_quantiles = np.linspace(0, 1, 101)
    slope_quantiles = np.linspace(1, 0.9, 11)
    intercept_by_quantile = dict(zip(intercept_quantiles, np.quantile([o for _, o in pairs], intercept_quantiles)))
    intercept_by_quantile[-1] = 0.0
    for intercept_quantile, intercept in intercept_by_quantile.items():
        slopes = [(o - intercept) / i for i, o in pairs]
        max_slopes = np.quantile(slopes, slope_quantiles)
        for slope_quantile, slope in zip(slope_quantiles, max_slopes):
            yield (Quantiles(intercept_quantile, slope_quantile), intercept, slope)

def cross_validation_fit(pairs: List[Tuple[int, int]], num_splits: int) -> Dict[Quantiles, List[Result]]:
    all_results: Dict[Quantiles, List[Result]] = collections.defaultdict(list)
    test_set_size = len(pairs) / num_splits
    random.Random(0).shuffle(pairs)
    for test_start, test_end in zip(np.arange(0, len(pairs), test_set_size), np.arange(test_set_size, len(pairs), test_set_size)):
        test_start = int(test_start)
        test_end = int(test_end)
        train_data = pairs[:test_start] + pairs[test_end:]
        test_data = pairs[test_start:test_end]
        for quantiles, intercept, slope in fit(train_data):
            predicted = [int(i * slope + intercept) for i, _ in test_data]
            num_missed = sum((p < o for p, (_, o) in zip(predicted, test_data)))
            surplus_steps = [p - o for p, (_, o) in zip(predicted, test_data)]
            all_results[quantiles].append(Result(num_missed, surplus_steps))
    return all_results

pairs = [
    (1, 10),
    (2, 20),
    (3, 30),
    (4, 40),
    (5, 50),
    (6, 60),
    (7, 70),
    (8, 80),
]

ARGS = {
    "pairs": pairs,
    "num_splits": 2,
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
filter_exp_dict Ran
ran; our contract draft was wrong, not the code
microsoft/semantic_parsing_with_constrained_lm/src/semantic_parsing_with_constrained_lm/run_exp.py
pointer only (licence: MIT); the stored copy get_code serves, from um-arm-lab/efficient-eng-2-ltl, is pointer only (licence: NONE) · get_code("4183422535231a5a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from um-arm-lab/efficient-eng-2-ltl, 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.

filter_fit Ran
ran on a synthesized input
microsoft/semantic_parsing_with_constrained_lm/src/semantic_parsing_with_constrained_lm/fit_max_steps.py
code served (permissive licence) · get_code("b1defe1f92175d5e")
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 itertools
from dataclasses import dataclass
from typing import Dict, List, Tuple
import numpy as np

@dataclass(frozen=True)
class Quantiles:
    intercept_quantile: float
    slope_quantile: float

@dataclass
class Result:
    num_unreachable: int
    surplus_steps: List[int]

# Create sample data
q1 = Quantiles(intercept_quantile=0.1, slope_quantile=0.2)
q2 = Quantiles(intercept_quantile=0.3, slope_quantile=0.4)
q3 = Quantiles(intercept_quantile=0.5, slope_quantile=0.6)

result1 = Result(num_unreachable=2, surplus_steps=[1, 2, 3])
result2 = Result(num_unreachable=3, surplus_steps=[4, 5])
result3 = Result(num_unreachable=1, surplus_steps=[6, 7, 8, 9])
result4 = Result(num_unreachable=5, surplus_steps=[10])
result5 = Result(num_unreachable=2, surplus_steps=[11, 12])

all_results = {
    q1: [result1, result2],
    q2: [result3, result4],
    q3: [result5]
}

max_unreachable = 10

ARGS = {
    "all_results": all_results,
    "max_unreachable": max_unreachable
}
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 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
openai_token_to_bytes Ran
ran; our contract draft was wrong, not the code
microsoft/semantic_parsing_with_constrained_lm/src/semantic_parsing_with_constrained_lm/lm_openai_gpt3.py
code served (permissive licence) · get_code("dbda3623619056cc")
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 bytes. 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 ast

def openai_token_to_bytes(token: str) -> bytes:
    if token.startswith('bytes:'):
        return ast.literal_eval(f"b'{token[6:]}'")
    else:
        return token.encode('utf-8')

# Test case 1: regular string token
token_1 = "hello world"

# Test case 2: bytes-prefixed token
token_2 = "bytes:hello"

ARGS = {
    "token": token_1
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
filter_exp_dict 1 other paper
1 later
2303.08006 (2023-03)
Data-Efficient Learning of Natural Language to Linear Temporal Logic Translators for Robot Task Specification
openai_token_to_bytes 1 other paper
1 later
2309.11765 (2023-09)
Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation

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 work has shown that generation from a prompted or fine-tuned language model can perform well at semantic parsing when the output is constrained to be a valid semantic representation. We introduce BenchCLAMP, a Benchmark to evaluate Constrained LAnguage Model Parsing, that includes context-free grammars for seven semantic parsing datasets and two syntactic parsing datasets with varied output representations, as well as a constrained decoding interface to generate only valid outputs covered by these grammars. We provide low, medium, and high resource splits for each dataset, allowing accurate comparison of various language models under different data regimes. Our benchmark supports evaluation of language models using prompt-based learning as well as fine-tuning. We benchmark eight language models, including two GPT-3 variants available only through an API. Our experiments show that encoder-decoder pretrained language models can achieve similar performance or surpass state-of-the-art methods for syntactic and semantic parsing when the model output is constrained to be valid.

For agents

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

get_harvested_code_for_paper("2206.10668")
get_code_for_paper("2206.10668")
have("2206.10668")

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

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

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

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

Connect an agent — have() is free.