SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.04700 · 2019

A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 2 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 2 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/1911.04700.json · badge: /api/ran/1911.04700.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
Lireanstar/BPDG community (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
ghosthamlet/persona reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
convert2str_biased Ran
ran on a synthesized input
Lireanstar/BPDG/generate_for_different_weight.py
code served (permissive licence) · get_code("c3f6270b38a24112")
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 str. 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)

ARGS = {
    'dic': {
        'tag': '技术',
        'gender': 'male',
        'loc': '北京'
    }
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
convert2str_biased Ran
ran on a synthesized input
Lireanstar/BPDG/generate_our_sample.py
code served (permissive licence) · get_code("a9175f4c15228f9e")
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 str. 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

def convert2str_biased(dic):
    tag = dic['tag']
    gender = '男' if dic['gender'] == 'male' else '女'
    loc = ';'.join(dic['loc'].split())
    res = '性别: ' + gender + ',地域: ' + loc + ',标签: ' + tag
    return res

ARGS = {
    'dic': {
        'tag': '工程师',
        'gender': 'male',
        'loc': '北京 上海 深圳'
    }
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
convert2str_random Ran
ran on a synthesized input
Lireanstar/BPDG/generate_for_different_weight.py
code served (permissive licence) · get_code("265176bed2384a33")
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 str. 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)

dic = {
    'tag': ['python', '机器学习'],
    'gender': 'male',
    'loc': '北京'
}

ARGS = {
    'dic': dic
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
convert2str_random Ran
ran on a synthesized input
Lireanstar/BPDG/generate_our_sample.py
code served (permissive licence) · get_code("2dc8a8ca058b4e62")
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 str. 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)

ARGS = {
    'dic': {
        'tag': ['机器学习', '深度学习'],
        'gender': 'male',
        'loc': '北京 上海 深圳'
    }
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
count_ngram Ran
ran, honoured the contract we drafted
Lireanstar/BPDG/eval_distinct.py
code served (permissive licence) · get_code("630cad41c958eab5")
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 int, ndim 0, dtype family int, shape () 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 numpy as np

torch.manual_seed(0)

# The function expects:
# - hyps_resp: list of lists (each inner list contains tokens/strings)
# - n: int (the n-gram size)

# Create sample data: list of responses where each response is a list of tokens
hyps_resp = [
    ['hello', 'world', 'how', 'are', 'you'],
    ['hello', 'there', 'friend'],
    ['world', 'peace', 'and', 'love'],
    ['how', 'are', 'you', 'doing', 'today']
]

n = 2

ARGS = {
    'hyps_resp': hyps_resp,
    'n': n
}
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 int, ndim 0, dtype family int, shape () — shape () 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
epoch_time Ran
ran, honoured the contract we drafted
ghosthamlet/persona/AttentionRouting/trainer.py
code served (permissive licence) · get_code("74ee173b5a288642")
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 tuple, 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 time

# The function takes two time values (in seconds, typically from time.time())
# We'll create realistic start and end times with a difference of several minutes and seconds

start_time = int(time.time()) - 125  # 2 minutes 5 seconds ago
end_time = int(time.time())  # current time

ARGS = {
    "start_time": start_time,
    "end_time": end_time,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 tuple, ndim 1, dtype family int — 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
eval_distinct Ran
ran on a synthesized input
Lireanstar/BPDG/eval_distinct.py
code served (permissive licence) · get_code("4a9c412680bac6ee")
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 float, ndim 0, dtype family float, shape () 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 eval_distinct takes a list of responses where each response
# is a list of tokens (strings). It computes distinct 1-gram and 2-gram scores.
# Let's create a simple list of tokenized responses.

hyps_resp = [
    ['hello', 'world', 'how', 'are', 'you'],
    ['hello', 'there', 'friend'],
    ['the', 'quick', 'brown', 'fox'],
    ['hello', 'world', 'again']
]

ARGS = {
    'hyps_resp': hyps_resp
}
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 float, ndim 0, dtype family float, shape () — shape () 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
eval_ppl Ran
ran on a synthesized input
Lireanstar/BPDG/eval_ppl.py
code served (permissive licence) · get_code("1ec2c2d36a3cda9a")
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 math
import torch
import torch.nn as nn

torch.manual_seed(0)

class MockModel(nn.Module):
    """Mock model that implements next_word_probability method"""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 8)
    
    def next_word_probability(self, context, prefix):
        """
        Returns (probs_dict, eos_probs) where probs_dict maps token to probability
        """
        # Simulate probability distribution over vocabulary
        probs_dict = {
            'token_0': 0.3,
            'token_1': 0.25,
            'token_2': 0.2,
            'token_3': 0.15,
            'token_4': 0.1
        }
        eos_probs = 0.5
        return probs_dict, eos_probs


# Create model instance
model = MockModel()

# Create context dict (simple stand-in)
context = {
    'user_input': 'hello world',
    'history': ['greeting']
}

# Create golden response tokens (list of tokens)
resp_gt = ['token_0', 'token_1', 'token_2', 'token_3']

# Create vocabulary (list of tokens)
vocab = ['token_0', 'token_1', 'token_2', 'token_3', 'token_4']

ARGS = {
    'model': model,
    'context': context,
    'resp_gt': resp_gt,
    'vocab': vocab
}
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
pad_sequence Ran
ran; our contract draft was wrong, not the code
Lireanstar/BPDG/eval_bleu.py
code served (permissive licence) · get_code("82c47c8c6308eca1")
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 chain. 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
from itertools import chain

torch.manual_seed(0)

# The function takes:
# - sequence: an iterable of items to pad
# - n: an integer specifying the n-gram size (used to determine padding amount)
# - pad_left: boolean flag
# - pad_right: boolean flag
# - left_pad_symbol: symbol to use for left padding
# - right_pad_symbol: symbol to use for right padding

# Construct a simple sequence (list of tokens/strings)
sequence = ['the', 'cat', 'sat', 'on', 'the', 'mat']

# n parameter - determines how many pad symbols to add (n-1)
n = 3

# Padding flags
pad_left = True
pad_right = True

# Pad symbols
left_pad_symbol = '<START>'
right_pad_symbol = '<END>'

ARGS = {
    'sequence': sequence,
    'n': n,
    'pad_left': pad_left,
    'pad_right': pad_right,
    'left_pad_symbol': left_pad_symbol,
    'right_pad_symbol': right_pad_symbol
}
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 chain — a chain output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a chain 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
read_dialog Ran
ran on a synthesized input
Lireanstar/BPDG/eval_distinct.py
code served (permissive licence) · get_code("b8f38ce75cf35fdb")
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 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 json
import codecs
import tempfile
import os

# Create a temporary file with JSON lines content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "dialogs.jsonl")

# Write sample dialog data to the temporary file
dialogs_data = [
    {"id": 1, "turns": ["Hello", "Hi there"]},
    {"id": 2, "turns": ["How are you?", "I'm good"]},
    {"id": 3, "turns": ["What's up?", "Not much"]}
]

with codecs.open(temp_file, 'w', 'utf-8') as f:
    for dialog in dialogs_data:
        f.write(json.dumps(dialog) + '\n')

ARGS = {
    "file": temp_file
}
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, ndim 1, dtype family float — 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
corpus_bleu Not yet run
unverified (harvested, no recorded run)
Lireanstar/BPDG/eval_bleu.py
code served (permissive licence) · get_code("d80bae86a71b0be8")
How it ran

no invocation recorded.

modified_precision Not yet run
unverified (harvested, no recorded run)
Lireanstar/BPDG/eval_bleu.py
code served (permissive licence) · get_code("d52e5869b9bdda18")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 9 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
pad_sequence 10 other papers
1 dated earlier, 9 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
2106.06169 (2021-06)
BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data
and 7 more not named here
modified_precision 2 other papers
2 later
2009.07396 (2020-09)
Grounded Adaptation for Zero-shot Executable Semantic Parsing
2106.06169 (2021-06)
BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data
count_ngram 1 other paper
1 later
2310.14892 (2023-10)
Air-Decoding: Attribute Distribution Reconstruction for Decoding-Time Controllable Text Generation

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

Endowing dialogue systems with personas is essential to deliver more human-like conversations. However, this problem is still far from well explored due to the difficulties of both embodying personalities in natural languages and the persona sparsity issue observed in most dialogue corpora. This paper proposes a pre-training based personalized dialogue model that can generate coherent responses using persona-sparse dialogue data. In this method, a pre-trained language model is used to initialize an encoder and decoder, and personal attribute embeddings are devised to model richer dialogue contexts by encoding speakers' personas together with dialogue histories. Further, to incorporate the target persona in the decoding process and to balance its contribution, an attention routing structure is devised in the decoder to merge features extracted from the target persona and dialogue contexts using dynamically predicted weights. Our model can utilize persona-sparse dialogues in a unified manner during the training process, and can also control the amount of persona-related features to exhibit during the inference process. Both automatic and manual evaluation demonstrates that the proposed model outperforms state-of-the-art methods for generating more coherent and persona consistent responses with persona-sparse data.

For agents

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

get_harvested_code_for_paper("1911.04700")
get_code_for_paper("1911.04700")
have("1911.04700")

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

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

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

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

Connect an agent — have() is free.