SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.00066 · NeurIPS · 2022

Improving Policy Learning via Language Dynamics Distillation

Tim Rocktäschel, Jesse Mu, Edward Grefenstette, Luke Zettlemoyer, Victor Zhong

arXiv · PDF · Open in the Atlas

Code that ran

2 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 6 no recorded run), measured 2026-11-23; 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/2210.00066.json · badge: /api/ran/2210.00066.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/language-dynamics-distillation canonical (classifier label)
classifier basis not recorded on the link
0 ran · 1 no recorded run
ahjwang/messenger-emma application (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 2 no recorded run
facebookresearch/nle application (classifier label)
classifier basis: classifier_2025
0 ran · 2 no recorded run
FunctionStatusWhere it lives
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
ahjwang/messenger-emma/messenger/models/emma.py
code served (permissive licence) · get_code("7d377f889cf16d0e")
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 an instance of its own class, Encoder: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Create a minimal encoder model that has the expected interface
class MinimalEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, input_ids, attention_mask, token_type_ids):
        # Return an object with last_hidden_state attribute
        batch_size = input_ids.shape[0]
        seq_length = input_ids.shape[1]
        hidden_state = self.linear(torch.randn(batch_size, seq_length, 4))
        
        class EncoderOutput:
            def __init__(self, lhs):
                self.last_hidden_state = lhs
        
        return EncoderOutput(hidden_state)

# Create a minimal tokenizer that has the expected interface
class MinimalTokenizer:
    def __call__(self, text, return_tensors=None, truncation=False, 
                 truncation_strategy=None, padding=None, max_length=None):
        # Return a dict with tensor values
        batch_size = 1
        seq_len = max_length if max_length else 10
        return {
            'input_ids': torch.randint(0, 100, (batch_size, seq_len)),
            'attention_mask': torch.ones(batch_size, seq_len),
            'token_type_ids': torch.zeros(batch_size, seq_len)
        }

encoder_model = MinimalEncoder()
tokenizer = MinimalTokenizer()
device = torch.device('cpu')
max_length = 36

ARGS = {
    'model': encoder_model,
    'tokenizer': tokenizer,
    'device': device,
    'max_length': max_length
}
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 Encoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Encoder 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
nonzero_mean Ran
ran; our contract draft was wrong, not the code
ahjwang/messenger-emma/messenger/models/emma.py
code served (permissive licence) · get_code("dacaf8ab3063a9ff")
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 float, shape (2, 3, 5) 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

torch.manual_seed(0)

# Create a test embedding tensor
# Shape: (H, W, L, D) = (2, 3, 4, 5)
# H=2 (height), W=3 (width), L=4 (layers), D=5 (embedding dimension)
emb = torch.randn(2, 3, 4, 5)

# Make some values zero to test the non-zero handling
emb[0, 0, :, :] = 0

ARGS = {
    "emb": emb
}
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 float, shape (2, 3, 5) — shape (2, 3, 5) 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
EMMA Not yet run
unverified (harvested, no recorded run)
ahjwang/messenger-emma/messenger/models/emma.py
code served (permissive licence) · get_code("801be0895c4e0bf2")
How it ran

no invocation recorded.

compute_baseline_loss Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from facebookresearch/nle
pointer only; the stored copy get_code serves, from facebookresearch/nle, is pointer only (licence: NOASSERTION) · get_code("e624e7bc82f85ecd")
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. No invocation recorded.

compute_entropy_loss Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from facebookresearch/nle
pointer only; the stored copy get_code serves, from facebookresearch/nle, is pointer only (licence: NOASSERTION) · get_code("3fba94f2f8bc0565")
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. No invocation recorded.

compute_policy_gradient_loss Not yet run
unverified (harvested, no recorded run)
facebookresearch/nle/nle/agent/agent.py
pointer only (licence: NOASSERTION) · get_code("f46896c3a13fa416")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/nle (NOASSERTION). 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.

learn Not yet run
unverified (harvested, no recorded run)
facebookresearch/nle/nle/agent/agent.py
pointer only (licence: NOASSERTION) · get_code("fa8a88fb35b3b6f6")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/nle (NOASSERTION). 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.

nonzero_mean Not yet run
unverified (harvested, no recorded run)
vzhong/language-dynamics-distillation/messenger/emma.py
code served (permissive licence) · get_code("22e55c2b5b19dab7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 7 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, 2 later) and 4 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
compute_baseline_loss
brick of this paper's assembly: loss
6 other papers
5 dated earlier, 1 later
1708.04782 (2017-08)
StarCraft II: A New Challenge for Reinforcement Learning
1809.04474 (2018-09)
Multi-task Deep Reinforcement Learning with PopArt
1910.03552 (2019-10)
TorchBeast: A PyTorch Platform for Distributed RL
and 3 more not named here
compute_entropy_loss
brick of this paper's assembly: loss
5 other papers
4 dated earlier, 1 later
1809.04474 (2018-09)
Multi-task Deep Reinforcement Learning with PopArt
1910.03552 (2019-10)
TorchBeast: A PyTorch Platform for Distributed RL
2006.13760 (2020-06)
The NetHack Learning Environment
and 2 more not named here
compute_policy_gradient_loss
brick of this paper's assembly: loss
2 other papers
2 dated earlier
1910.03552 (2019-10)
TorchBeast: A PyTorch Platform for Distributed RL
2201.03544 (2022-01)
The Effects of Reward Misspecification: Mapping and Mitigating Misaligned Models

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

Recent work has shown that augmenting environments with language descriptions improves policy learning. However, for environments with complex language abstractions, learning how to ground language to observations is difficult due to sparse, delayed rewards. We propose Language Dynamics Distillation (LDD), which pretrains a model to predict environment dynamics given demonstrations with language descriptions, and then fine-tunes these language-aware pretrained representations via reinforcement learning (RL). In this way, the model is trained to both maximize expected reward and retain knowledge about how language relates to environment dynamics. On SILG, a benchmark of five tasks with language descriptions that evaluate distinct generalization challenges on unseen environments (NetHack, ALFWorld, RTFM, Messenger, and Touchdown), LDD outperforms tabula-rasa RL, VAE pretraining, and methods that learn from unlabeled demonstrations in inverse RL and reward shaping with pretrained experts. In our analyses, we show that language descriptions in demonstrations improve sample-efficiency and generalization across environments, and that dynamics modeling with expert demonstrations is more effective than with non-experts.

For agents

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

get_harvested_code_for_paper("2210.00066")
get_code_for_paper("2210.00066")
have("2210.00066")

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

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

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

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

Connect an agent — have() is free.