SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.07396 · EMNLP · 2020

Grounded Adaptation for Zero-shot Executable Semantic Parsing

Mike Lewis, Luke Zettlemoyer, Victor Zhong, Sida Wang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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 8 have no contract verdict; 0 failures of our instrument; 3 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/2009.07396.json · badge: /api/ran/2009.07396.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
vzhong/gazp community (classifier label)
classifier basis not recorded on the link
8 ran · 3 no recorded run
FunctionStatusWhere it lives
find_shortest_path Ran
ran on a synthesized input
vzhong/gazp/editsql_postprocess.py
code served (permissive licence) · get_code("d78f1c3233d062d9")
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

# Analyze the function:
# - start: a node identifier (used in comparisons and as dict key)
# - end: a node identifier (used in comparisons)
# - graph: a dict where keys are nodes and values are lists of tuples (node, edge_weight)
#   The function iterates over graph[ele] and accesses node[0] and node[1]

# Build a simple graph structure
graph = {
    'A': [('B', 1.5), ('C', 2.0)],
    'B': [('D', 0.5), ('E', 1.0)],
    'C': [('E', 1.2)],
    'D': [('F', 0.8)],
    'E': [('F', 0.3)],
    'F': []
}

start = 'A'
end = 'F'

ARGS = {
    'start': start,
    'end': end,
    'graph': graph
}
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
gen_from Ran
ran on a synthesized input
vzhong/gazp/editsql_postprocess.py
code served (permissive licence) · get_code("801f821346462f3d")
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 numpy as np
from collections import defaultdict

# Build a minimal schema dict that the function expects
schema = {
    'table_names_original': ['users', 'orders', 'products'],
    'column_names': [
        (0, 'user_id'),
        (0, 'name'),
        (1, 'order_id'),
        (1, 'user_id'),
        (1, 'product_id'),
        (2, 'product_id'),
        (2, 'price'),
    ],
    'column_names_original': [
        (0, 'user_id'),
        (0, 'name'),
        (1, 'order_id'),
        (1, 'user_id'),
        (1, 'product_id'),
        (2, 'product_id'),
        (2, 'price'),
    ],
    'foreign_keys': [
        (3, 0),  # orders.user_id -> users.user_id
        (4, 5),  # orders.product_id -> products.product_id
    ],
    'db_id': 'test_db'
}

# candidate_tables is a set of table indices
candidate_tables = {0, 1, 2}

ARGS = {
    'candidate_tables': candidate_tables,
    'schema': schema,
}
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 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
iterate_sparc Ran
ran on a synthesized input
vzhong/gazp/converter.py
code served (permissive licence) · get_code("0a6eb00e2b06e65a")
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 generator. 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 tqdm

# Construct test data for iterate_sparc
# The function expects data as a list of dicts with 'interaction' and 'database_id' keys
# Each interaction item needs 'query' key

data = [
    {
        'database_id': 'db_1',
        'interaction': [
            {'query': 'SELECT * FROM users'},
            {'query': 'SELECT * FROM orders'}
        ]
    },
    {
        'database_id': 'db_2',
        'interaction': [
            {'query': 'SELECT name FROM customers'},
        ]
    }
]

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
normalize_space Ran
ran on a synthesized input
vzhong/gazp/editsql_postprocess.py
code served (permissive licence) · get_code("8d068c5aae5973aa")
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.

# Analyze the function
# normalize_space takes a single parameter: format_sql (a string)
# The function manipulates SQL strings through various replace and split operations
# It expects a string containing SQL with newlines and various formatting

# Create a simple SQL string to pass as argument
format_sql_input = """SELECT col1, col2
FROM table1
JOIN table2 ON table1.id = table2.id
WHERE col1 = 'value'
ORDER BY col1"""

ARGS = {
    "format_sql": format_sql_input
}
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 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
pad_sequence Ran
ran on a synthesized input
vzhong/gazp/model/cycle.py
code served (permissive licence) · get_code("a7943ed412e918de")
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 Tensor, ndim 3, dtype family int, shape (2, 2, 4) 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
from torch import nn

torch.manual_seed(0)

# Construct a list of tensors with different sequence lengths
# pad_sequence expects a list/iterable of tensors
inds = [
    torch.tensor([[1, 2, 3, 4]]),  # shape (1, 4)
    torch.tensor([[5, 6, 7, 8], [9, 10, 11, 12]]),  # shape (2, 4)
]

pad_value = 0
device_arg = None

ARGS = {
    "inds": inds,
    "pad": pad_value,
    "device": device_arg,
}
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 Tensor, ndim 3, dtype family int, shape (2, 2, 4) — shape (2, 2, 4) 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
read_database_schema Ran
ran on a synthesized input
vzhong/gazp/editsql_preprocess.py
code served (permissive licence) · get_code("4d78971ecb256ed8")
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 json
import tempfile
import os

# Create a temporary JSON file with valid database schema data
temp_dir = tempfile.mkdtemp()
database_schema_filename = os.path.join(temp_dir, "schema.json")

database_schemas = [
    {
        "db_id": "database1",
        "table_names": ["users", "orders"],
        "table_names_original": ["users", "orders"],
        "column_names_original": [
            [0, "id"],
            [0, "name"],
            [1, "order_id"],
            [1, "user_id"],
            [-1, "total"]
        ]
    },
    {
        "db_id": "database2",
        "table_names": ["products", "inventory"],
        "table_names_original": ["products", "inventory"],
        "column_names_original": [
            [0, "product_id"],
            [0, "product_name"],
            [1, "stock_count"],
            [-1, "price"]
        ]
    }
]

with open(database_schema_filename, 'w') as f:
    json.dump(database_schemas, f)

schema_tokens = {}
column_names = {}
database_schemas_dict = {}

ARGS = {
    "database_schema_filename": database_schema_filename,
    "schema_tokens": schema_tokens,
    "column_names": column_names,
    "database_schemas_dict": database_schemas_dict
}
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 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
remove_from_with_join Ran
ran on a synthesized input
vzhong/gazp/editsql_preprocess.py
code served (permissive licence) · get_code("d31ff7fd717c208a")
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. 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.

# Analyzing the function remove_from_with_join
# It takes a single parameter: format_sql_2 which should be a string containing SQL statements
# The function processes SQL by splitting on newlines and looking for 'select' and 'from' keywords
# It extracts table names and their aliases from FROM clauses

# Create a simple valid SQL string that the function can process
format_sql_input = """select col1, col2
from table1 as t1
where col1 > 5"""

ARGS = {
    "format_sql_2": format_sql_input
}
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 tuple — a tuple 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
remove_from_without_join Ran
ran on a synthesized input
vzhong/gazp/editsql_preprocess.py
code served (permissive licence) · get_code("4258d1b9dafb037c")
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.

# Analyze the function to understand what it needs:
# - format_sql_3: a string with SQL statements separated by newlines
# - column_names: a collection (list/set) of column names to check
# - schema_tokens: a collection containing qualified column names like "table.column"

# The function processes SQL strings, looks for SELECT and FROM clauses,
# and qualifies column names with table names where appropriate.

ARGS = {
    "format_sql_3": """select name
from users
select age""",
    "column_names": ["name", "age", "email", "id"],
    "schema_tokens": ["users.name", "users.age", "users.email", "orders.id", "orders.amount"]
}
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 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
corpus_bleu Not yet run
unverified (harvested, no recorded run)
vzhong/gazp/bleu.py
code served (permissive licence) · get_code("dabf87ffe599be77")
How it ran

no invocation recorded.

modified_precision Not yet run
unverified (harvested, no recorded run)
vzhong/gazp/bleu.py
code served (permissive licence) · get_code("cbcbdae866b89725")
How it ran

no invocation recorded.

sentence_bleu Not yet run
unverified (harvested, no recorded run)
vzhong/gazp/bleu.py
code served (permissive licence) · get_code("1317c04d6dfdb3d6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 later) and 8 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
modified_precision 2 other papers
1 dated earlier, 1 later
1911.04700 (2019-11)
A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data
2106.06169 (2021-06)
BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data
corpus_bleu 1 other paper
1 later
2106.06169 (2021-06)
BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data
sentence_bleu 1 other paper
1 the same month
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

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 propose Grounded Adaptation for Zeroshot Executable Semantic Parsing (GAZP) to adapt an existing semantic parser to new environments (e.g. new database schemas). GAZP combines a forward semantic parser with a backward utterance generator to synthesize data (e.g. utterances and SQL queries) in the new environment, then selects cycleconsistent examples to adapt the parser. Unlike data-augmentation, which typically synthesizes unverified examples in the training environment, GAZP synthesizes examples in the new environment whose inputoutput consistency are verified. On the Spider, Sparc, and CoSQL zero-shot semantic parsing tasks, GAZP improves logical form and execution accuracy of the baseline parser. Our analyses show that GAZP outperforms dataaugmentation in the training environment, performance increases with the amount of GAZPsynthesized data, and cycle-consistency is central to successful adaptation.

For agents

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

get_harvested_code_for_paper("2009.07396")
get_code_for_paper("2009.07396")
have("2009.07396")

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

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

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

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

Connect an agent — have() is free.