SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.12592 · 2020

GECToR -- Grammatical Error Correction: Tag, Not Rewrite

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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, 1 violated it and 8 have no contract verdict; 1 failure of our instrument; 2 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/2005.12592.json · badge: /api/ran/2005.12592.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
grammarly/gector canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
gotutiyan/gector reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_merge_transformation Ran
ran on a synthesized input
grammarly/gector/utils/preprocess_data.py
code served (permissive licence) · get_code("e2be5e9c2082d301")
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. 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

# Analyze the function to understand what parameters it needs:
# - source_tokens: a list of strings (tokens)
# - target_words: a list of strings (words)
# - shift_idx: an integer index

# Test case 1: merge with space
source_tokens_1 = ["hello", "world"]
target_words_1 = ["helloworld"]
shift_idx_1 = 0

# Test case 2: swap transformation
source_tokens_2 = ["a", "b"]
target_words_2 = ["b", "a"]
shift_idx_2 = 5

# Test case 3: no transformation
source_tokens_3 = ["foo"]
target_words_3 = ["bar"]
shift_idx_3 = 10

ARGS = {
    "source_tokens": source_tokens_1,
    "target_words": target_words_1,
    "shift_idx": shift_idx_1,
}
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 — a list 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
convert_using_case Ran
ran on a synthesized input
grammarly/gector/utils/helpers.py
code served (permissive licence) · get_code("87468610676c6dd6")
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)

# The function convert_using_case takes two parameters:
# 1. token: a string to be transformed
# 2. smart_action: a string that starts with '$TRANSFORM_CASE_' and ends with a case transformation type

ARGS = {
    "token": "hello",
    "smart_action": "$TRANSFORM_CASE_LOWER"
}
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
filter_line Ran
ran on a synthesized input
grammarly/gector/utils/filter_brackets.py
code served (permissive licence) · get_code("fc4f0a3954e20959")
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 re

def filter_line(line):
    if '-LRB-' in line and '-RRB-' in line:
        rep = re.sub('\\-.*?LRB.*?\\-.*?\\-.*?RRB.*?\\-', '', line)
        line_cleaned = rep
    elif '-LRB-' in line and '-RRB-' not in line or ('-LRB-' not in line and '-RRB-' in line):
        line_cleaned = line.replace('-LRB-', '"').replace('-RRB-', '"')
    else:
        line_cleaned = line
    return line_cleaned


ARGS = {
    'line': 'This is a sentence with -LRB- parenthetical content -RRB- in it.'
}
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
get_bpe_groups Ran
ran on a synthesized input
grammarly/gector/gector/tokenization.py
code served (permissive licence) · get_code("6f0e771498f45ff4")
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.

import torch

torch.manual_seed(0)

# Analyzing the function:
# - token_offsets: iterable of tuples (start_token, end_token)
# - bpe_offsets: list/sequence with .index() method and indexing, contains tuples (start_bpe, end_bpe)
# - input_ids: list-like with len() that we iterate over
# - max_bpe_pieces: int (default 5)

# The function:
# 1. Calls len() on bpe_offsets, input_ids
# 2. Calls .index() on bpe_offsets to find (0, 0)
# 3. Indexes into bpe_offsets with integers
# 4. Iterates over token_offsets
# 5. Uses range() and len()
# 6. Checks membership with "in"

token_offsets = [
    (0, 5),
    (5, 10),
    (10, 15)
]

bpe_offsets = [
    (0, 2),
    (2, 4),
    (4, 6),
    (6, 8),
    (8, 10),
    (10, 12),
    (12, 14),
    (0, 0)
]

input_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

max_bpe_pieces = 5

ARGS = {
    "token_offsets": token_offsets,
    "bpe_offsets": bpe_offsets,
    "input_ids": input_ids,
    "max_bpe_pieces": max_bpe_pieces
}
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 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
get_offsets_and_reduce_input_ids Ran
ran on a synthesized input
grammarly/gector/gector/tokenization.py
code served (permissive licence) · get_code("e465d1ef5c3c98db")
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)

# Build a minimal tokenizer_output dict with the required structure
# The function expects 'input_ids' and 'offset_mapping' for each batch item
tokenizer_output = {
    'input_ids': [
        [101, 2054, 2003, 1037, 3231, 102],  # batch item 0: 6 tokens
        [101, 1045, 2572, 2017, 102],  # batch item 1: 5 tokens
    ],
    'offset_mapping': [
        [
            (0, 0),    # [CLS]
            (0, 4),    # "what"
            (5, 8),    # "is"
            (9, 10),   # "a"
            (11, 15),  # "test"
            (16, 16),  # [SEP]
        ],
        [
            (0, 0),    # [CLS]
            (0, 1),    # "I"
            (2, 6),    # "love"
            (7, 11),   # "you"
            (12, 12),  # [SEP]
        ],
    ],
}

# token_offset_list: list of lists of tuples defining token ranges
# Each inner list corresponds to a batch item and contains (start_token, end_token) tuples
token_offset_list = [
    [
        (0, 4),   # token offsets for first example
        (5, 8),
        (9, 10),
    ],
    [
        (0, 1),   # token offsets for second example
        (2, 6),
    ],
]

ARGS = {
    'tokenizer_output': tokenizer_output,
    'token_offset_list': token_offset_list,
    'index_name': 'bert',
    'max_bpe_length': 80,
    'max_bpe_pieces': 5,
}
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
get_target_sent_by_edits Ran
ran on a synthesized input
grammarly/gector/utils/helpers.py
code served (permissive licence) · get_code("395b7b304d288571")
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.

# Global dictionary needed by the functions
DECODE_VERB_DICT = {
    'run_PAST': 'ran',
    'eat_PAST': 'ate',
    'go_PRESENT': 'go',
}

# Setup code for get_target_sent_by_edits
source_tokens = ['The', 'cat', 'runs', 'quickly']

# Edits format: (start, end, label, _)
# Different types of edits to test:
edits = [
    (0, 1, '$TRANSFORM_CASE_UPPER', None),  # Transform case
    (1, 2, '$REPLACE_dog', None),  # Replace token
    (3, 4, '', None),  # Delete token
    (2, 2, '$APPEND_very', None),  # Append token
]

ARGS = {
    'source_tokens': source_tokens,
    'edits': edits,
}
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
need_add_prefix_space Ran
ran, violated the contract we drafted
gotutiyan/gector/src/gector/cli/predict.py
code served (permissive licence) · get_code("eacea3a25d6b9838")
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 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

ARGS = {
    'model_id': 'roberta-base'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
reduce_input_ids Ran
ran on a synthesized input
grammarly/gector/gector/tokenization.py
code served (permissive licence) · get_code("3b89561b72017ad9")
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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function to understand what arguments it needs:
# - input_ids: list/array that can be indexed with integers
# - bpe_groups: list of lists, where each inner list contains token IDs
# - saved_ids: list of indices into input_ids
# - max_bpe_length: int (default 80)
# - max_bpe_pieces: int (default 5)

# The function:
# 1. Indexes into input_ids using values from saved_ids: input_ids[i]
# 2. Iterates through bpe_groups by index (token_id in range(len(bpe_groups)))
# 3. Accesses bpe_groups[token_id] which should be a list
# 4. Slices bpe_groups[token_id] and checks membership in saved_ids
# 5. Filters saved_ids by checking if elements are in redundant_ids

# Create input_ids - a list of token values
input_ids = [10, 20, 30, 40, 50, 60, 70, 80]

# Create bpe_groups - a list of lists where each inner list contains indices
# that map to input_ids positions
bpe_groups = [
    [0, 1],      # token 0: indices 0, 1
    [2, 3, 4],   # token 1: indices 2, 3, 4
    [5, 6],      # token 2: indices 5, 6
    [7]          # token 3: index 7
]

# Create saved_ids - list of indices we want to keep
# These should reference positions in input_ids and be present in bpe_groups
saved_ids = [0, 1, 2, 3, 4, 5, 6, 7]

# Set max_bpe_length to trigger the while loop logic
max_bpe_length = 8

# Set max_bpe_pieces to allow some reduction
max_bpe_pieces = 3

ARGS = {
    "input_ids": input_ids,
    "bpe_groups": bpe_groups,
    "saved_ids": saved_ids,
    "max_bpe_length": max_bpe_length,
    "max_bpe_pieces": max_bpe_pieces
}
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 — 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
replace_merge_transforms Ran
ran on a synthesized input
grammarly/gector/utils/helpers.py
code served (permissive licence) · get_code("fa83b5a1840e54e0")
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

def replace_merge_transforms(tokens):
    if all((not x.startswith('$MERGE_') for x in tokens)):
        return tokens
    target_line = ' '.join(tokens)
    target_line = target_line.replace(' $MERGE_HYPHEN ', '-')
    target_line = target_line.replace(' $MERGE_SPACE ', '')
    return target_line.split()

ARGS = {
    'tokens': ['hello', ' $MERGE_HYPHEN ', 'world', ' $MERGE_SPACE ', '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 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
visualizer Ran
ran; our contract draft was wrong, not the code
gotutiyan/gector/src/gector/cli/predict.py
code served (permissive licence) · get_code("0f854050e3b7af65")
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 torch
import numpy as np

# Analyze the function to understand what it needs:
# - iteration_log: List[List[Dict]]
# - Each dict in the inner list has keys: 'tag', 'src'
# - 'tag' can be None (signals end of iteration log for that sentence)
# - 'src' is a list of tokens (strings)
# - 'tag' is a list of tags (strings) when not None

# Create sample data matching the function's usage
iteration_log = [
    # First sentence
    [
        {
            'src': ['$START', 'The', 'cat', 'sat'],
            'tag': ['START', 'DET', 'NOUN', 'VERB']
        },
        {
            'src': ['$START', 'The', 'cat', 'sat'],
            'tag': ['START', 'DET', 'NOUN', 'VERB']
        },
        {
            'src': ['$START', 'The', 'cat', 'sat'],
            'tag': None  # Signals end of iterations for this sentence
        }
    ],
    # Second sentence
    [
        {
            'src': ['$START', 'Dogs', 'run'],
            'tag': ['START', 'NOUN', 'VERB']
        },
        {
            'src': ['$START', 'Dogs', 'run'],
            'tag': None  # Signals end of iterations for this sentence
        }
    ]
]

ARGS = {
    'iteration_log': iteration_log
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
annotate_fce_doc Not yet run
unverified (harvested, no recorded run)
grammarly/gector/utils/prepare_clc_fce_data.py
code served (permissive licence) · get_code("94f13ee8c30ce76f")
How it ran

no invocation recorded.

convert_fce Not yet run
unverified (harvested, no recorded run)
grammarly/gector/utils/prepare_clc_fce_data.py
code served (permissive licence) · get_code("9a10dedeb0b5dac7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 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
convert_using_case 1 other paper
1 later
2023.findings-emnlp.142 (2023 (year only))
G-SPEED: General SParse Efficient Editing MoDel
filter_line 1 other paper
1 later
2023.findings-emnlp.142 (2023 (year only))
G-SPEED: General SParse Efficient Editing MoDel
get_target_sent_by_edits 1 other paper
1 later
2023.findings-emnlp.142 (2023 (year only))
G-SPEED: General SParse Efficient Editing MoDel
replace_merge_transforms 1 other paper
1 later
2023.findings-emnlp.142 (2023 (year only))
G-SPEED: General SParse Efficient Editing MoDel

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

In this paper, we present a simple and efficient GEC sequence tagger using a Transformer encoder. Our system is pre-trained on synthetic data and then fine-tuned in two stages: first on errorful corpora, and second on a combination of errorful and error-free parallel corpora. We design custom token-level transformations to map input tokens to target corrections. Our best single-model/ensemble GEC tagger achieves an $F_{0.5}$ of 65.3/66.5 on CoNLL-2014 (test) and $F_{0.5}$ of 72.4/73.6 on BEA-2019 (test). Its inference speed is up to 10 times as fast as a Transformer-based seq2seq GEC system. The code and trained models are publicly available.

For agents

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

get_harvested_code_for_paper("2005.12592")
get_code_for_paper("2005.12592")
have("2005.12592")

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

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

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

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

Connect an agent — have() is free.