SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.10256 · ACL · 2022

Dependency-based Mixture Language Models

Xiaojun Wan, Zhixian Yang

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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 2 have no contract verdict; 1 failure of our instrument; 1 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/2203.10256.json · badge: /api/ran/2203.10256.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
fadedcosine/dependency-guided-neural-text-generation canonical (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
FunctionStatusWhere it lives
build_subword_dependecy_head Ran
ran on a synthesized input
fadedcosine/dependency-guided-neural-text-generation/DPLM-Transformer/util/build_bpe_dependency.py
code served (permissive licence) · get_code("7ae14efdfb766b41")
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

torch.manual_seed(0)

# Analyze the function:
# - tok_dependency_headlist: list of lists of token dependency heads (integers)
# - word_to_bpe_index_list: list of lists of lists - each word maps to BPE indices
# 
# The function iterates through tok_dep_head and word_to_bpe in parallel
# For each tok_head (integer), it indexes into word_to_bpe_index[tok_head - 1]
# It accesses [-1] element and does +1, then appends word_to_bpe[1:] elements
#
# So:
# - tok_dependency_headlist: list of lists of integers (dependency head indices)
# - word_to_bpe_index_list: list of lists of lists of integers (BPE index ranges)

# Example: 2 sentences
# Sentence 1: 3 tokens, each with some BPE indices
# Sentence 2: 2 tokens, each with some BPE indices

tok_dependency_headlist = [
    # Sentence 1: 3 tokens with dependency heads
    [1, 0, 1],  # token 0 depends on token 1, token 1 on ROOT (0), token 2 on token 1
    # Sentence 2: 2 tokens with dependency heads
    [1, 0],  # token 0 depends on token 1, token 1 on ROOT (0)
]

word_to_bpe_index_list = [
    # Sentence 1: 3 words, each mapping to a list of BPE indices
    [
        [0, 1],      # word 0 has BPE indices 0, 1
        [2, 3, 4],   # word 1 has BPE indices 2, 3, 4
        [5],         # word 2 has BPE index 5
    ],
    # Sentence 2: 2 words
    [
        [0, 1, 2],   # word 0 has BPE indices 0, 1, 2
        [3, 4],      # word 1 has BPE indices 3, 4
    ],
]

ARGS = {
    "tok_dependency_headlist": tok_dependency_headlist,
    "word_to_bpe_index_list": word_to_bpe_index_list,
}
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
build_word_to_bpe_index_list Ran
ran on a synthesized input
fadedcosine/dependency-guided-neural-text-generation/DPLM-Transformer/util/build_bpe_dependency.py
code served (permissive licence) · get_code("4207d98823b1dcea")
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.

# Setup code for build_word_to_bpe_index_list

ARGS = {
    "tok_sentences": [
        "copepods are small crustaceans .",
        "the quick brown fox jumps"
    ],
    "bpe_sentences": [
        "cop@@ e@@ po@@ ds are small cru@@ stac@@ e@@ ans .",
        "the quick brown fox jumps"
    ]
}
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 — 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
cumsoftmax Ran
ran; our contract draft was wrong, not the code
fadedcosine/dependency-guided-neural-text-generation/DPLM-LSTM/ON_LSTM.py
code served (permissive licence) · get_code("4b59eaae917b5a2d")
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 2, dtype family float, shape (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
import torch.nn.functional as F

torch.manual_seed(0)

# The function cumsoftmax takes a tensor x and an optional dim parameter
# It applies softmax along dim, then cumsum along dim
# We need to provide a simple tensor as input

x = torch.randn(2, 4)  # Small tensor: batch size 2, feature dim 4

ARGS = {
    'x': x,
    'dim': -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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (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
embedded_dropout Not yet run
unverified (harvested, no recorded run)
fadedcosine/dependency-guided-neural-text-generation/DPLM-LSTM/embed_regularize.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yx3266/SEN, is pointer only (licence: NONE) · get_code("62d148258bdd054f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yx3266/SEN, 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. No invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 2 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
embedded_dropout 6 other papers
5 dated earlier, 1 later
1803.08240 (2018-03)
An Analysis of Neural Language Modeling at Multiple Scales
1810.09536 (2018-10)
Ordered Neurons: Integrating Tree Structures into Recurrent Neural Networks
1905.11881 (2019-05)
Why gradient clipping accelerates training: A theoretical justification for adaptivity
and 3 more not named here
cumsoftmax 2 other papers
2 dated earlier
1810.09536 (2018-10)
Ordered Neurons: Integrating Tree Structures into Recurrent Neural Networks
2106.01093 (2021-06)
LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations

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

Various models have been proposed to incorporate knowledge of syntactic structures into neural language models. However, previous works have relied heavily on elaborate components for a specific language model, usually recurrent neural network (RNN), which makes themselves unwieldy in practice to fit into other neural language models, such as Transformer and GPT-2. In this paper, we introduce the Dependency-based Mixture Language Models. In detail, we first train neural language models with a novel dependency modeling objective to learn the probability distribution of future dependent tokens given context. We then formulate the next-token probability by mixing the previous dependency modeling probability distributions with self-attention. Extensive experiments and human evaluations show that our method can be easily and effectively applied to different neural language models while improving neural text generation on various tasks. 1 Models External Parameters? External Networks? Architecture Agnostic? RNNG (Dyer et al., 2016) Yes Yes No PRPN (Shen et al., 2018) Yes Yes No URNNG (Kim et al., 2019) Yes Yes No ON-LSTM (Shen et al., 2019) Yes No No DMLM (Ours) No or Negligible No Yes Table 1: The difference between our DMLM and previous neural language models that incorporate knowledge of syntactic structures. Previous models often require external networks and external Parameters. For example, PRPN consists of three neural networks: Parsing Network, Reading Network and Predict Network. ON-LSTM is built upon a single LSTM, but it requires two additional gates in the LSTM cells, which leads to external parameters. All these previous models can only be built upon RNN architecture. However, as an architecture-agnostic method, DMLM needs no external parameters or networks when built upon Transformer, while it only needs negligible external parameters when built upon RNN.

For agents

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

get_harvested_code_for_paper("2203.10256")
get_code_for_paper("2203.10256")
have("2203.10256")

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

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

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

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

Connect an agent — have() is free.