SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.04096 · EMNLP · 2021

A Three-Stage Learning Framework for Low-Resource Knowledge-Grounded Dialogue Generation

Longhui Zhang, Xiaofeng Zhao, Feiliang Ren, Shilei Liu, Bochao Li, Shujuan Yin

arXiv · PDF · Open in the Atlas

Code that ran

18 of 27 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 7 have no contract verdict; 10 failures of our instrument; 9 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-21; 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/2109.04096.json · badge: /api/ran/2109.04096.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
neukg/kat-tslf canonical (classifier label)
classifier basis: census
12 ran · 1 no recorded run
neukg/KAT-TSLF community
Papers with Code archive
6 ran · 8 no recorded run
FunctionStatusWhere it lives
to_list Ran
ran; our contract draft was wrong, not the code
neukg/kat-tslf/run_kat.py
pointer only (licence: MIT); the stored copy get_code serves, from AI-secure/InfoBERT, is pointer only (licence: NONE) · get_code("9df40357afea56cc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from AI-secure/InfoBERT, 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. A run is recorded.

Attention Ran
ran on a synthesized input
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("076a62f8319088ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. 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

# INIT_ARGS for Attention.__init__
INIT_ARGS = {
    'embed_dim': 8,
    'num_heads': 2,
    'dropout': 0.1,
    'bias': True,
    'encoder_decoder_attention': 'self'
}

# ARGS for Attention.forward
# Input shape: Time(SeqLen) x Batch x Channel
tgt_len = 5
bsz = 2
embed_dim = 8

query = torch.randn(tgt_len, bsz, embed_dim)
key = torch.randn(tgt_len, bsz, embed_dim)  # For self-attention, key can be same as query
key_padding_mask = None
layer_state = None
attn_mask = None
output_attentions = False

ARGS = {
    'query': query,
    'key': key,
    'key_padding_mask': key_padding_mask,
    'layer_state': layer_state,
    'attn_mask': attn_mask,
    'output_attentions': output_attentions
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LearnedPositionalEmbedding Ran
ran on a synthesized input
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("e3e39310f3d0ef9a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (3, 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
from torch import nn

class LearnedPositionalEmbedding(nn.Embedding):
    """
    This module learns positional embeddings up to a fixed maximum size.
    Padding ids are ignored by either offsetting based on padding_idx
    or by setting padding_idx to None and ensuring that the appropriate
    position ids are passed to the forward function.
    """

    def __init__(self, num_embeddings: int, embedding_dim: int, padding_idx: int, offset):
        self.offset = offset
        assert padding_idx is not None
        num_embeddings += offset
        super().__init__(num_embeddings, embedding_dim, padding_idx=padding_idx)

    def forward(self, input_ids, use_cache=False):
        """Input is expected to be of size [bsz x seqlen]."""
        bsz, seq_len = input_ids.shape[:2]
        if use_cache:
            positions = input_ids.data.new(1, 1).fill_(seq_len - 1)
        else:
            positions = torch.arange(seq_len, dtype=torch.long, device=self.weight.device)
        return super().forward(positions + self.offset)


INIT_ARGS = {
    "num_embeddings": 16,
    "embedding_dim": 4,
    "padding_idx": 0,
    "offset": 2,
}

ARGS = {
    "input_ids": torch.tensor([[1, 2, 3], [4, 5, 6]], dtype=torch.long),
    "use_cache": False,
}

if __name__ == "__main__":
    model = LearnedPositionalEmbedding(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 (3, 4) — shape (3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_make_linear_from_emb Ran
ran; our contract draft was wrong, not the code
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("0505f2c6f279d366")
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) and returned Linear. 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
from torch import nn

torch.manual_seed(0)

# The function expects an embedding layer (emb) with a weight attribute
# that has shape (vocab_size, emb_size)
emb = nn.Embedding(num_embeddings=5, embedding_dim=3)

ARGS = {
    "emb": emb
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
calc_banned_bad_words_ids Ran
ran; our contract draft was wrong, not the code
neukg/kat-tslf/kat/gen_utils.py
code served (permissive licence) · get_code("6b81c6ad0d553004")
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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - prev_input_ids: Iterable[int] - gets iterated over (outer loop), each element is compared with banned_token_seq
#   It appears to be an iterable of sequences (since _tokens_match is called with prev_input_ids_slice)
# - bad_words_ids: Iterable[int] - gets iterated over (inner loop), each element is a sequence
#   Each banned_token_seq needs len() and indexing operations

# The function expects:
# - prev_input_ids to be an iterable of sequences (lists of token ids)
# - bad_words_ids to be an iterable of sequences (lists of token ids)

# Simple test case:
# prev_input_ids: batch of token sequences
prev_input_ids = [
    [1, 2, 3],      # sequence 1
    [4, 5, 6, 7]    # sequence 2
]

# bad_words_ids: sequences of bad tokens to ban
# Each bad_words_ids entry is a sequence, and we ban the last token if the previous tokens match
bad_words_ids = [
    [2, 3, 999],    # ban token 999 if preceded by [2, 3]
    [5, 6, 888],    # ban token 888 if preceded by [5, 6]
    [10, 777]       # ban token 777 if preceded by [10]
]

ARGS = {
    "prev_input_ids": prev_input_ids,
    "bad_words_ids": bad_words_ids
}
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 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
calc_banned_ngram_tokens Ran
ran on a synthesized input
neukg/kat-tslf/kat/gen_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from shmsw25/AmbigQA, is pointer only (licence: NONE) · get_code("8d77347cfa15b834")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shmsw25/AmbigQA, 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. A run is recorded.

calc_corpus_bleu Ran
ran on a synthesized input
neukg/kat-tslf/dial/metrics.py
code served (permissive licence) · get_code("00ea45ede0d0bda7")
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 tuple, ndim 1, 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 numpy as np
from collections import defaultdict, Counter
import math

# The function calc_corpus_bleu expects:
# - cands: a list of lists of strings (candidate tokens)
# - golds: a list of lists of strings (gold/reference tokens)

# Create small example data
cands = [
    ["the", "cat", "sat", "on", "the", "mat"],
    ["a", "dog", "ran", "fast"]
]

golds = [
    ["the", "cat", "is", "sitting", "on", "the", "mat"],
    ["the", "dog", "ran", "very", "fast"]
]

ARGS = {
    "cands": cands,
    "golds": golds
}
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 tuple, ndim 1, dtype family float — a tuple 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
calc_sentence_bleu Ran
ran on a synthesized input
neukg/kat-tslf/dial/metrics.py
code served (permissive licence) · get_code("022dbe2dc9fabd22")
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 tuple, ndim 1, 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.

from nltk.translate.bleu_score import corpus_bleu, sentence_bleu, SmoothingFunction

# Create sample candidates (hypotheses) and references (gold standard)
# Each candidate and gold reference should be a list of tokens (strings)

cands = [
    ["the", "cat", "sat", "on", "the", "mat"],
    ["hello", "world"],
    ["a", "quick", "brown", "fox"],
    ["this", "is", "a", "test"]
]

golds = [
    ["the", "cat", "is", "sitting", "on", "the", "mat"],
    ["hello", "world"],
    ["the", "quick", "brown", "fox"],
    ["this", "is", "a", "test", "sentence"]
]

ARGS = {
    "cands": cands,
    "golds": golds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
fill_with_neg_inf Ran
ran; our contract draft was wrong, not the code
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("3dac763ebcde95c6")
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) 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

torch.manual_seed(0)

# The function fill_with_neg_inf takes a tensor t and:
# 1. Calls t.float() - converts to float
# 2. Calls .fill_(float('-inf')) - fills with -inf in-place
# 3. Calls .type_as(t) - converts back to original type
# So we need a tensor that supports these operations

# Create a small tensor with a specific dtype (e.g., float16 for FP16 compatibility testing)
t = torch.randn(2, 4, dtype=torch.float16)

ARGS = {
    "t": t
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
get_parameter_number Ran
ran on a synthesized input
neukg/kat-tslf/run_kat.py
code served (permissive licence) · get_code("e7a0f438d6d3b92f")
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 dict. 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)

class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 3)
        # Freeze one parameter to have non-trainable params
        self.linear2.bias.requires_grad = False
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

net = SimpleNet()

ARGS = {
    'net': net
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
invert_mask Ran
ran; our contract draft was wrong, not the code
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("1a820c6ccda29913")
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) 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

torch.manual_seed(0)

# Create a 2D attention mask tensor with shape (batch_size=2, seq_length=4)
# Using values 0 and 1 to test the inversion logic
attention_mask = torch.tensor([
    [1, 1, 0, 1],
    [1, 0, 0, 1]
], dtype=torch.long)

ARGS = {
    "attention_mask": attention_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
label_smoothed_nll_loss Ran
ran on a synthesized input
neukg/kat-tslf/dial/utils.py
code served (permissive licence) · get_code("e386d3a24af4d168")
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 tuple, ndim 1, 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

torch.manual_seed(0)

# Create log probabilities tensor
# Shape: (batch_size=2, vocab_size=4)
# lprobs should be log probabilities, so values between -inf and 0
lprobs = torch.log(torch.softmax(torch.randn(2, 4), dim=-1))

# Create target indices tensor
# Shape: (batch_size=2,) - indices into the vocabulary
# Values should be in range [0, vocab_size) or ignore_index
target = torch.tensor([1, 2], dtype=torch.long)

# Epsilon for label smoothing (typically small, e.g., 0.1)
epsilon = 0.1

# Ignore index for padding tokens
ignore_index = -100

ARGS = {
    "lprobs": lprobs,
    "target": target,
    "epsilon": epsilon,
    "ignore_index": ignore_index,
}
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 tuple, ndim 1, dtype family float — a tuple 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
lmap Ran
ran; our contract draft was wrong, not the code
neukg/kat-tslf/run_kat.py
pointer only (licence: MIT); the stored copy get_code serves, from ypw0102/gdr, is pointer only (licence: NONE) · get_code("64e8746cf3f62e8e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ypw0102/gdr, 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. A run is recorded.

lmap Ran
ran; our contract draft was wrong, not the code
neukg/kat-tslf/dial/utils.py
code served (permissive licence) · get_code("7c43af131a6f39a6")
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 1, dtype family int; 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 numpy as np
from typing import Callable, List, Iterable

torch.manual_seed(0)

# Define a simple callable function
def square(x):
    """Simple function that squares its input"""
    return x ** 2

# Define an iterable (list of numbers)
numbers = [1, 2, 3, 4, 5]

# Construct ARGS dict
ARGS = {
    "f": square,
    "x": numbers,
}
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 list, ndim 1, dtype family int — 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
make_padding_mask Ran
ran; our contract draft was wrong, not the code
neukg/kat-tslf/kat/modeling.py
pointer only (licence: MIT); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("f20c9b1aead27fea")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, 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. A run is recorded.

mean Ran
ran, violated the contract we drafted
neukg/kat-tslf/dial/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from schrammlb2/USHER_Implementation, is pointer only (licence: NONE) · get_code("e8b6cf1e9387fc9a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from schrammlb2/USHER_Implementation, 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. A run is recorded.

shift_tokens_right Ran
ran; our contract draft was wrong, not the code
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("59b0b785b926c986")
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) and returned Tensor, ndim 2, dtype family int, 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

torch.manual_seed(0)

# Create a small batch of input_ids
# Shape: (batch_size=2, sequence_length=4)
input_ids = torch.tensor([
    [101, 2054, 2003, 102],
    [101, 1045, 2572, 102]
], dtype=torch.long)

# Pad token ID (commonly 0 in many tokenizers)
pad_token_id = 0

# Decoder start token ID (commonly 2 in many seq2seq models)
decoder_start_token_id = 2

ARGS = {
    "input_ids": input_ids,
    "pad_token_id": pad_token_id,
    "decoder_start_token_id": decoder_start_token_id,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int, 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
top_k_top_p_filtering Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
neukg/kat-tslf/kat/gen_utils.py
code served (permissive licence) · get_code("685c7abbaa62f39d")
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, 10) 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
from torch import Tensor

torch.manual_seed(0)

# Create a small batch of logits
# Shape: (batch_size=2, vocab_size=10)
logits = torch.randn(2, 10)

ARGS = {
    "logits": logits,
    "top_k": 5,
    "top_p": 0.9,
    "filter_value": -float('Inf'),
    "min_tokens_to_keep": 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, 10) — shape (2, 10) 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
BartDecoder Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("1c4335258b6b3c81")
How it ran

no invocation recorded.

BartEncoder Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("bd033265551789b6")
How it ran

no invocation recorded.

BartModel Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("f71ab4c4691bb48f")
How it ran

no invocation recorded.

DecoderLayer Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("872d52d59b50cd30")
How it ran

no invocation recorded.

EncoderLayer Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("9893bc0028ec41d0")
How it ran

no invocation recorded.

PretrainedBartModel Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("742714f74dc45495")
How it ran

no invocation recorded.

SinusoidalPositionalEmbedding Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("c77b117cb39bd303")
How it ran

no invocation recorded.

_prepare_bart_decoder_inputs Not yet run
unverified (harvested, no recorded run)
neukg/KAT-TSLF/kat/modeling.py
code served (permissive licence) · get_code("c1189a349bdb2e2a")
How it ran

no invocation recorded.

add_newline_to_end_of_each_sentence Not yet run
unverified (harvested, no recorded run)
neukg/kat-tslf/dial/utils.py
code served (permissive licence) · get_code("a1d9937402bebf7e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 27 distinct functions with an identity, 12 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 3 the same month, 12 later) and 15 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
to_list 41 other papers
20 dated earlier, 3 the same month, 15 later, 3 same year, order not determinable
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
1910.06188 (2019-10)
Q8BERT: Quantized 8Bit BERT
1911.02984 (2019-11)
The TechQA Dataset
and 38 more not named here
fill_with_neg_inf
brick of this paper's assembly: helper
16 other papers
2 dated earlier, 14 later · 3 only as an assembly brick
1906.00295 (2019-06)
Multimodal Transformer for Unaligned Multimodal Language Sequences
2007.00808 (2020-07)
Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrieval
2111.08456 (2021-11)
Trustworthy Multimodal Regression with Mixture of Normal-inverse Gamma Distributions
and 13 more not named here
lmap 9 other papers
6 dated earlier, 1 the same month, 2 later
2007.08426 (2020-07)
Investigating Pretrained Language Models for Graph-to-Text Generation
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
and 6 more not named here
make_padding_mask
brick of this paper's assembly: helper
9 other papers
5 dated earlier, 2 later, 2 same year, order not determinable
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 6 more not named here
calc_banned_ngram_tokens 8 other papers
2 dated earlier, 1 the same month, 5 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2106.01317 (2021-06)
Enriching Transformers with Structured Tensor-Product Representations for Abstractive Summarization
2109.08828 (2021-09)
Perspective-taking and Pragmatics for Generating Empathetic Responses Focused on Emotion Causes
and 5 more not named here
label_smoothed_nll_loss 7 other papers
6 dated earlier, 1 later
2007.08426 (2020-07)
Investigating Pretrained Language Models for Graph-to-Text Generation
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
and 4 more not named here
shift_tokens_right
brick of this paper's assembly: helper
7 other papers
7 later
2201.05966 (2022-01)
UNIFIEDSKG: Unifying and Multi-Tasking Structured Knowledge Grounding with Text-to-Text Language Models
2203.07836 (2022-03)
Graph Pre-training for AMR Parsing and Generation
2207.03509 (2022-07)
Meta-Learning the Difference: Preparing Large Language Models for Efficient Adaptation
and 4 more not named here
top_k_top_p_filtering 5 other papers
1 dated earlier, 4 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2309.01017 (2023-09)
Contrastive Grouping with Transformer for Referring Image Segmentation
2402.02503 (2024-02)
GeReA: Question-Aware Prompt Captions for Knowledge-based Visual Question Answering
and 2 more not named here
mean 3 other papers
3 later
2207.01115 (2022-07)
USHER: Unbiased Sampling for Hindsight Experience Replay
2504.18397 (2025-04)
Unsupervised Visual Chain-of-Thought Reasoning via Preference Optimization
2604.07937 (2026-04)
HCRE: LLM-based Hierarchical Classification for Cross-Document Relation Extraction with a Prediction-then-Verification Strategy
calc_banned_bad_words_ids 2 other papers
1 dated earlier, 1 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2410.03968 (2024-10)
Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategies
lmap 2 other papers
1 dated earlier, 1 later
2108.02866 (2021-08)
Dual Reader-Parser on Hybrid Textual and Tabular Evidence for Open Domain Question Answering
2401.10487 (2024-01)
Generative Dense Retrieval: Memory Can Be a Burden
add_newline_to_end_of_each_sentence 1 other paper
1 later
2411.07130 (2024-11)
On Many-Shot In-Context Learning for Long-Context Evaluation

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

Neural conversation models have shown great potentials towards generating fluent and informative responses by introducing external background knowledge. Nevertheless, it is laborious to construct such knowledge-grounded dialogues, and existing models usually perform poorly when transfer to new domains with limited training samples. Therefore, building a knowledge-grounded dialogue system under the low-resource setting is a still crucial issue. In this paper, we propose a novel threestage learning framework based on weakly supervised learning which benefits from large scale ungrounded dialogues and unstructured knowledge base. To better cooperate with this framework, we devise a variant of Transformer with decoupled decoder which facilitates the disentangled learning of response generation and knowledge incorporation. Evaluation results on two benchmarks indicate that our approach can outperform other state-of-the-art methods with less training data, and even in zero-resource scenario, our approach still performs well.

For agents

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

get_harvested_code_for_paper("2109.04096")
get_code_for_paper("2109.04096")
have("2109.04096")

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

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

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

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

Connect an agent — have() is free.