SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1602.07776 · 2016

Recurrent Neural Network Grammars

arXiv · PDF · Open in the Atlas

Code that ran

8 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, 1 violated it and 2 have no contract verdict; 5 failures 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/1602.07776.json · badge: /api/ran/1602.07776.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
dpfried/rnng-bert extension (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
Psarpei/Recognition-of-logical-document-structures community (classifier label)
classifier basis not recorded on the link
2 ran · 2 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
get_between_brackets Ran
ran; our contract draft was wrong, not the code
dpfried/rnng-bert/scripts/retag.py
pointer only (licence: NONE) · get_code("2347da1339a984a0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dpfried/rnng-bert 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.

get_graph Ran
ran; our contract draft was wrong, not the code
dpfried/rnng-bert/scripts/bert_parse.py
pointer only (licence: NONE) · get_code("4289934e599d98d1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dpfried/rnng-bert 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.

get_tags_tokens_lowercase Ran
ran; our contract draft was wrong, not the code
dpfried/rnng-bert/scripts/retag.py
pointer only (licence: NONE) · get_code("5791adaa76c577c0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dpfried/rnng-bert 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.

is_next_open_bracket Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from Nickil21/weakly-supervised-parsing
pointer only · get_code("625f98c10e41a690")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

make_command Ran
ran; our contract draft was wrong, not the code
dpfried/rnng-bert/scripts/bert_parse.py
pointer only (licence: NONE) · get_code("bf01d3fec3465c34")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dpfried/rnng-bert 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.

make_dim Ran
ran on a synthesized input
Psarpei/Recognition-of-logical-document-structures/cnn/pycnn/pycnn_viz.py
code served (permissive licence) · get_code("59f803e03a8d8e91")
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 SimpleConcreteDim. 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 collections import namedtuple

torch.manual_seed(0)

# Test case 1: passing an int
arg1_int = 5

# Test case 2: passing int and int
arg2_a = 10
arg2_b = 20

# Test case 3: passing a tuple
arg3_tuple = (8, 12)

# Test case 4: passing a SimpleConcreteDim
class SimpleConcreteDim(object):
    def __init__(self, nrows, ncols, inferred):
        self.nrows = nrows
        self.ncols = ncols
        self.inferred = inferred

    def __getitem__(self, key):
        return [self.nrows, self.ncols][key]

    def __iter__(self):
        return iter([self.nrows, self.ncols])

    def __str__(self):
        return 'Dim(%s,%s)' % (self.nrows, self.ncols)

    def __eq__(self, other):
        return isinstance(other, SimpleConcreteDim) and self.nrows == other.nrows and (self.ncols == other.ncols)

    def __ne__(self, other):
        return not self == other

    def __hash__(self):
        return hash((self.nrows, self.ncols))

    def isvalid(self):
        return True

    def invalid(self):
        return False

class InvalidConcreteDim(object):
    def __init__(self, a_dim=None, b_dim=None):
        self.a_dim = a_dim
        self.b_dim = b_dim

    def __getitem__(self, key):
        return None

    def __repr__(self):
        if self.a_dim is None and self.b_dim is None:
            return 'InvalidDim'
        else:
            return 'InvalidDim(%s, %s)' % (self.a_dim, self.b_dim)

    def __str__(self):
        return repr(self)

    def isvalid(self):
        return False

    def invalid(self):
        return True

arg4_dim = SimpleConcreteDim(15, 25, False)

# Test case 5: passing an InvalidConcreteDim
arg5_invalid = InvalidConcreteDim()

# Test case 6: passing InvalidConcreteDim with dimensions
arg6_invalid_with_dims = InvalidConcreteDim(a_dim=3, b_dim=4)

# Create multiple sets of arguments covering all code paths
ARGS = {
    "a": 5,
    "b": None,
    "inferred": False
}
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 SimpleConcreteDim — a SimpleConcreteDim output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleConcreteDim 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
parse Ran
ran; our contract draft was wrong, not the code
dpfried/rnng-bert/scripts/bert_parse.py
pointer only (licence: NONE) · get_code("d73ae4737d0072dc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dpfried/rnng-bert 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.

run_lstm Ran
ran on a synthesized input
Psarpei/Recognition-of-logical-document-structures/cnn/pyexamples/attention.py
code served (permissive licence) · get_code("cae93ce40fd6beae")
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 3, 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 torch.nn as nn

torch.manual_seed(0)

class LSTMState:
    """Stand-in LSTM state that supports add_input and output methods."""
    def __init__(self, hidden, cell):
        self.hidden = hidden
        self.cell = cell
    
    def add_input(self, vector):
        """Process input vector and return new state."""
        # Simple mock: just update hidden state by adding input
        new_hidden = self.hidden + vector
        new_cell = self.cell * 0.9
        return LSTMState(new_hidden, new_cell)
    
    def output(self):
        """Return output vector (the hidden state)."""
        return self.hidden

class DummyModel(nn.Module):
    """Minimal model that doesn't need to do anything for this function."""
    def __init__(self):
        super().__init__()
    
    def forward(self, x):
        return x

# Create model instance
model = DummyModel()

# Create initial state with batch size 2, hidden dim 4
batch_size = 2
hidden_dim = 4
init_state = LSTMState(
    hidden=torch.randn(batch_size, hidden_dim),
    cell=torch.randn(batch_size, hidden_dim)
)

# Create input vectors - list of 3 input vectors, each batch_size x 4
input_vecs = [
    torch.randn(batch_size, hidden_dim),
    torch.randn(batch_size, hidden_dim),
    torch.randn(batch_size, hidden_dim)
]

ARGS = {
    "model": model,
    "init_state": init_state,
    "input_vecs": input_vecs
}
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 3, 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
copy_dim Not yet run
unverified (harvested, no recorded run)
Psarpei/Recognition-of-logical-document-structures/cnn/pycnn/pycnn_viz.py
code served (permissive licence) · get_code("7983fa98d9f8a780")
How it ran

no invocation recorded.

ensure_same_dim Not yet run
unverified (harvested, no recorded run)
Psarpei/Recognition-of-logical-document-structures/cnn/pycnn/pycnn_viz.py
code served (permissive licence) · get_code("8248591e58ec8b6b")
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, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 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
is_next_open_bracket 3 other papers
3 later
2108.00104 (2021-08)
Structural Guidance for Transformer Language Models
2110.02283 (2021-10)
Co-training an Unsupervised Constituency Parser with Weak Supervision
2502.11469 (2025-02)
If Attention Serves as a Cognitive Model of Human Memory Retrieval, What is the Plausible Memory Representation?
copy_dim 2 other papers
2 later
1701.03980 (2017-01)
DyNet: The Dynamic Neural Network Toolkit
2024.findings-acl.532 (2024 (year only))
InstructCMP: Length Control in Sentence Compression through Instruction-based Large Language Models
ensure_same_dim 2 other papers
2 later
1701.03980 (2017-01)
DyNet: The Dynamic Neural Network Toolkit
2024.findings-acl.532 (2024 (year only))
InstructCMP: Length Control in Sentence Compression through Instruction-based Large Language Models
get_between_brackets 2 other papers
2 later
2108.00104 (2021-08)
Structural Guidance for Transformer Language Models
2502.11469 (2025-02)
If Attention Serves as a Cognitive Model of Human Memory Retrieval, What is the Plausible Memory Representation?
get_graph 2 other papers
2 later
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training
1907.04347 (2019-07)
Cross-Domain Generalization of Neural Constituency Parsers
make_command 2 other papers
2 later
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training
1907.04347 (2019-07)
Cross-Domain Generalization of Neural Constituency Parsers
parse 2 other papers
2 later
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training
1907.04347 (2019-07)
Cross-Domain Generalization of Neural Constituency Parsers

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 recurrent neural network grammars, probabilistic models of sentences with explicit phrase structure. We explain efficient inference procedures that allow application to both parsing and language modeling. Experiments show that they provide better parsing in English than any single previously published supervised generative model and better language modeling than state-of-the-art sequential RNNs in English and Chinese.

For agents

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

get_harvested_code_for_paper("1602.07776")
get_code_for_paper("1602.07776")
have("1602.07776")

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

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

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

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

Connect an agent — have() is free.