SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2011.05268 · NeurIPS · 2020

Towards Interpretable Natural Language Understanding with Explanations as Latent Variables

Wangchunshu Zhou, Jian Tang, Jinyi Hu, Hanlin Zhang, Xiaodan Liang, Maosong Sun, Chenyan Xiong

arXiv · PDF · Open in the Atlas

Code that ran

2 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 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; 0 failures of our instrument; 12 no recorded run), measured 2026-11-21; 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/2011.05268.json · badge: /api/ran/2011.05268.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
JamesHujy/ELV marked official in Papers with Code
Papers with Code archive
2 ran · 12 no recorded run
FunctionStatusWhere it lives
BertConfig Ran
ran on a synthesized input · constructed an object; no result was computed
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("cfcccfa363b0d97d")
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, BertConfig: 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 copy
import json
import tempfile
import os

# Create a minimal BertConfig setup
# The function accepts either:
# 1. An int (vocab_size)
# 2. A string (path to JSON config file)

# We'll test with an int vocab_size as the primary argument

ARGS = {
    'vocab_size_or_config_json_file': 30522,
    'hidden_size': 768,
    'num_hidden_layers': 12,
    'num_attention_heads': 12,
    'intermediate_size': 3072,
    'hidden_act': 'gelu',
    'hidden_dropout_prob': 0.1,
    'attention_probs_dropout_prob': 0.1,
    'max_position_embeddings': 512,
    'type_vocab_size': 2,
    'relax_projection': 0,
    'new_pos_ids': False,
    'initializer_range': 0.02,
    'task_idx': None,
    'fp32_embedding': False,
    'ffn_type': 0,
    'label_smoothing': None,
    'num_qkv': 0,
    'seg_emb': False,
    'source_type_id': 0,
    'target_type_id': 1,
    'no_segment_embedding': False,
}
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 BertConfig — 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 BertConfig 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
LabelSmoothingLoss Ran
ran on a synthesized input · constructed an object; no result was computed
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("e0010670dcd7b506")
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, LabelSmoothingLoss: 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)

# Parameters for LabelSmoothingLoss
label_smoothing = 0.1
tgt_vocab_size = 10
ignore_index = 0
size_average = None
reduce = None
reduction = 'mean'

ARGS = {
    'label_smoothing': label_smoothing,
    'tgt_vocab_size': tgt_vocab_size,
    'ignore_index': ignore_index,
    'size_average': size_average,
    'reduce': reduce,
    'reduction': reduction,
}
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 LabelSmoothingLoss — 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 LabelSmoothingLoss 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
BertAttention Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("79fb582753417716")
How it ran

no invocation recorded.

BertEmbeddings Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("079b9f19680e22e9")
How it ran

no invocation recorded.

BertEncoder Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("fcc6106b91ccf5a8")
How it ran

no invocation recorded.

BertForSeq2SeqFinetuningWithPseudoMask Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("a073600618d7cd25")
How it ran

no invocation recorded.

BertLMPredictionHead Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("4c4cc2ac34ec0f6d")
How it ran

no invocation recorded.

BertLayer Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("06470b60e5848309")
How it ran

no invocation recorded.

BertModel Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("f31e6bafe1bf135f")
How it ran

no invocation recorded.

BertPreTrainingHeads Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("9ab2eef8291e2fb8")
How it ran

no invocation recorded.

BertPredictionHeadTransform Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("8edf5cdb355831e7")
How it ran

no invocation recorded.

BertSelfAttention Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("0cddc969b8e047cc")
How it ran

no invocation recorded.

PreTrainedBertModel Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("1e4c8070e2b6f7a0")
How it ran

no invocation recorded.

TransformerFFN Not yet run
unverified (harvested, no recorded run)
JamesHujy/ELV/ELV_re/s2s_ft/modeling_decoding.py
code served (permissive licence) · get_code("a50158bd9f69ff91")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 13 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
BertSelfAttention
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2004.05150 (2020-04)
Longformer: The Long-Document Transformer

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Generating natural language explanations has shown to be effective in not only offering interpretable explanations but also providing additional information and supervision for prediction. However, existing approaches usually require a large set of human annotated explanations for training while collecting a large set of explanations is not only time consuming but also expensive. In this paper, we develop a general framework for interpretable natural language understanding that requires only a small set of human annotated explanations for training. Our framework treats natural language explanations as latent variables that model the underlying reasoning process of a neural model. To optimize it, we develop a variational EM framework where an explanation generation module and an explanationaugmented prediction module are alternatively optimized and mutually enhance each other. Moreover, we further propose an explanation-based self-training method under this framework for semi-supervised learning. It alternates between assigning pseudo-labels to unlabeled data and generating new explanations to iteratively improve each other. Experiments on two natural language understanding tasks demonstrate that our framework can not only make effective predictions in both supervised and semi-supervised settings, but also generate good natural language explanations. 2 * Equal contribution, with order determined by rolling a dice. Work was done during internship at Mila. 2 Code is available at https://github.com/JamesHujy/ELV.git 34th Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, Canada.

For agents

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

get_harvested_code_for_paper("2011.05268")
get_code_for_paper("2011.05268")
have("2011.05268")

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

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

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

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

Connect an agent — have() is free.