thealper2/dialogpt-small-dailydialog
microsoft/DialoGPT-small fine-tuned on OpenRL/daily_dialog for next-utterance generation in multi-turn
open-domain dialogue.
Model details
| Base model | microsoft/DialoGPT-small (GPT-2 architecture, 12 layers, 768 hidden, 117M parameters) |
| Architecture | Decoder-only causal language model |
| Tokenizer | GPT-2 BPE, 50257 tokens, unchanged (no special tokens added) |
| Context window | 1024 positions; training sequences capped at 256 tokens |
| Language | English |
| Last updated | 2026-09-20 |
Input format
Turns are concatenated and separated by the native <|endoftext|> token, which is also
used as the padding token:
turn_1 <|endoftext|> turn_2 <|endoftext|> ... turn_k <|endoftext|> response <|endoftext|>
At inference time the prompt ends after the last <|endoftext|> and the model continues
with the response. No custom special tokens were introduced, so the embedding matrix is
identical in size to the base model's.
Training data
| Split | Context/response pairs |
|---|---|
| train | 73887 |
| validation | 7069 |
| test | 6740 |
Each dialogue [u1, ..., un] is expanded into n-1 pairs (u1 -> u2, u1+u2 -> u3, ...),
preserving chronological order. Empty utterances and dialogues shorter than two turns are
dropped. Light detokenisation removes DailyDialog's spaced punctuation and split
contractions. The official train/validation/test splits are used as published; the test
split is not seen during training.
Training procedure
| Hyperparameter | Value |
|---|---|
| Epochs | 3.0 |
| Optimizer | AdamW |
| Learning rate | 0.000050 |
| LR schedule | cosine, 346 warmup steps (0.050 ratio) |
| Weight decay | 0.010 |
| Per-device batch size | 16 |
| Gradient accumulation | 2 |
| Effective batch size | 32 |
| Max sequence length | 256 |
| Precision | bf16 |
| Total optimisation steps | 6927 |
| Seed | 42 |
| Hardware | NVIDIA GeForce RTX 5060 Ti |
| Wall-clock training time | 53m 3s |
Loss: causal language-modelling cross-entropy computed on the response tokens only.
Context positions and padding positions are set to -100, so the objective is
P(response | dialogue_context) rather than plain LM over the whole sequence.
| Loss | Value |
|---|---|
| Final training loss | 2.6347 |
| Validation loss (token-weighted) | 2.5359 |
Evaluation
Measured on the held-out DailyDialog test split. Loss and perplexity are token-weighted over response tokens; BLEU/ROUGE/BERTScore are computed over 500 sampled generations against a single reference reply each.
| Metric | Value |
|---|---|
| Test loss | 2.5605 |
| Perplexity | 12.9418 |
| BLEU (sacreBLEU) | 0.2717 |
| ROUGE-1 | 9.4559 |
| ROUGE-2 | 0.7864 |
| ROUGE-L | 7.0662 |
| BERTScore F1 | n/a |
| Distinct-1 / Distinct-2 | 0.1590 / 0.6802 |
Decoding used for the scored generations: sampling, temperature=0.80,
top_k=50, top_p=0.90, repetition_penalty=1.10,
max_new_tokens=64.
BLEU and ROUGE measure n-gram overlap with one reference continuation. Open-domain dialogue admits many valid replies, so these scores are weak indicators of conversational quality and are reported for comparability only.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "thealper2/dialogpt-small-dailydialog"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
model.eval()
history = ["Hello! How are you doing today?"]
prompt = "".join(turn + tokenizer.eos_token for turn in history)
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=64,
do_sample=True,
temperature=0.80,
top_k=50,
top_p=0.90,
repetition_penalty=1.10,
no_repeat_ngram_size=3,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
)
reply = tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(reply.strip())
For multi-turn use, append both the user message and the generated reply to history and
rebuild the prompt. Keeping the last ~8 turns is enough for the 1024-token window.
Limitations
- Trained on 11k everyday English conversations; the domain is small talk, and the model has no grounding, retrieval or factual knowledge beyond GPT-2 pre-training.
- Greedy decoding degenerates into short, repetitive replies; sampling with
repetition_penaltyandno_repeat_ngram_sizeis recommended. - No safety filtering or alignment tuning was applied, and biases from GPT-2 pre-training and from DailyDialog carry over.
- DailyDialog is licensed CC BY-NC-SA 4.0, so this fine-tuned checkpoint inherits the non-commercial restriction; the base model itself is MIT licensed.
Reproduction
make install
make train
make evaluate