SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.19089 · EMNLP · 2023

Pushdown Layers: Encoding Recursive Structure in Transformer Language Models

Jacob Andreas, Christopher Manning, Pratyusha Sharma, Shikhar Murty

arXiv · PDF · Open in the Atlas

Code that ran

14 of 23 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 3 failures of our instrument; 9 no recorded run), measured 2026-11-23; 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/2310.19089.json · badge: /api/ran/2310.19089.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
murtyshikhar/pushdown-layers canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
MurtyShikhar/Pushdown-Layers community
Papers with Code archive
9 ran · 7 no recorded run
FunctionStatusWhere it lives
AttentionMask Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("551d6401ece551f3")
How it ran

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

DotDict Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("a7a732117e3ad716")
How it ran

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

MultiHeadAttentionBase Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("6ea6715c721ed9a7")
How it ran

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

PositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("545b1940b792fa22")
How it ran

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

RelativeAttentionBase Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("59316687afde843b")
How it ran

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

TiedEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("5612e13b2384e5b0")
How it ran

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

TransformerEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("217b95213cfe1f2b")
How it ran

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

TransformerResult Ran
ran on a synthesized input · constructed an object; no result was computed
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("cd78addc129539b3")
How it ran

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

compute_per_token_logprob Ran
ran; our contract draft was wrong, not the code
murtyshikhar/pushdown-layers/pushdown_util.py
pointer only (licence: NONE) · get_code("70622ae82f44b450")
How it ran

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

compute_stack_logprobs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
murtyshikhar/pushdown-layers/pushdown_util.py
pointer only (licence: NONE) · get_code("dcf24b95d9f14aa9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, murtyshikhar/pushdown-layers 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_parsing_accuracy Ran
ran; our contract draft was wrong, not the code
murtyshikhar/pushdown-layers/eval_utils/eval_pushdown_model.py
pointer only (licence: NONE) · get_code("45d4819a42863712")
How it ran

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

logsumexp Ran
ran, honoured the contract we drafted
murtyshikhar/pushdown-layers/beam_search_util.py
pointer only (licence: NONE) · get_code("6b331f505ce51944")
How it ran

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

sinusoidal_pos_embedding Ran
ran, honoured the contract we drafted
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("f24ed9058bec8d35")
How it ran

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

sinusoidal_pos_embedding Ran
ran, honoured the contract we drafted
murtyshikhar/pushdown-layers/layers/positional_encoding.py
pointer only (licence: NONE) · get_code("d6b9018a0880eafd")
How it ran

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

PushdownAttention Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("040a0db1fa164ee2")
How it ran

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

PushdownLM Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("1d6a2fb2322500d7")
How it ran

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

StackPredictor Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("ea75be5e2691ee1e")
How it ran

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

Transformer Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("e1e85555ec42de79")
How it ran

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

TransformerEncoderLayer Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("cd05f27177c97848")
How it ran

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

TransformerEncoderWithLayer Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("5d6f6fc2cd657722")
How it ran

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

TransformerEncoderWithLayer Not yet run
unverified (harvested, no recorded run)
murtyshikhar/pushdown-layers/layers/transformer/transformer.py
pointer only (licence: NONE) · get_code("9f7833997a6a7918")
How it ran

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

TransformerLM Not yet run
unverified (harvested, no recorded run)
MurtyShikhar/Pushdown-Layers/models/pushdown_transformer_lm.py
pointer only (licence: NONE) · get_code("199613ff3592d354")
How it ran

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

cross_entropy Not yet run
unverified (harvested, no recorded run)
murtyshikhar/pushdown-layers/layers/cross_entropy_label_smoothing.py
pointer only (licence: NONE) · get_code("de36bbda5931ac11")
How it ran

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

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 18 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
AttentionMask
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2110.07732 (2021-10)
The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization
TransformerEncoderWithLayer
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2108.12284 (2021-08)
The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers
sinusoidal_pos_embedding
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training

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

Recursion is a prominent feature of human language, and fundamentally challenging for self-attention due to the lack of an explicit recursive-state tracking mechanism. Consequently, Transformer language models poorly capture long-tail recursive structure and exhibit sample-inefficient syntactic generalization. This work introduces Pushdown Layers, a new self-attention layer that models recursive state via a stack tape that tracks estimated depths of every token in an incremental parse of the observed prefix. Transformer LMs with Pushdown Layers are syntactic language models that autoregressively and synchronously update this stack tape as they predict new tokens, in turn using the stack tape to softly modulate attention over tokens-for instance, learning to "skip" over closed constituents. When trained on a corpus of strings annotated with silver constituency parses, Transformers equipped with Pushdown Layers achieve dramatically better and 3-5x more sample-efficient syntactic generalization, while maintaining similar perplexities. Pushdown Layers are a drop-in replacement for standard self-attention. We illustrate this by finetuning GPT2-medium with Pushdown Layers on an automatically parsed WikiText-103, leading to improvements on several GLUE text classification tasks.

For agents

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

get_harvested_code_for_paper("2310.19089")
get_code_for_paper("2310.19089")
have("2310.19089")

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

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

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

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

Connect an agent — have() is free.