distilbert/distilgpt2
Xenova/distilgpt2
text-generation · GPT2LMHeadModel
1. Causal BPE Next-Token Streaming Workbench
pipeline("text-generation", "Xenova/distilgpt2", { device: "wasm", dtype: "q8" })
via shared @huggingface/transformers@3.7.5 off the main thread. Feed a natural
prose, story, tech, or code prefix below — DistilGPT-2 predicts what comes next rather than
answering chat instructions. Special token: <|endoftext|> (BOS/EOS/UNK ID
50256).
Choose a writing, code, story, or technical lead preset:
.txt, .md, .csv, .json)
File contents stay 100% on your device. Drag-and-drop or press Ctrl/Cmd+V outside text fields.
2. See Inside: Byte-Level BPE (Ġ / Ċ) & Next-Token Probabilities
GPT-2 uses a 50,257-entry byte-level BPE tokenizer where leading spaces become
Ġ (U+0120) and newlines become Ċ (U+010A).
Inspect the exact tokens of your prompt + continuation alongside the real top-10 next-token
probability distribution over all 50,257 vocabulary entries.
Next-Token Candidate Probabilities
Entropy –Full 50,257-vocab Shannon entropy H(P) will appear after a live forward pass.
Run a prompt above to inspect live logits from pipe.model(inputs).
BPE Whitespace (Ġ) & Subword Inspector
Ġ)
Subword continuation
Newline (Ċ)
Special (50256)
Tokenization breakdown will appear after running DistilGPT-2.
Ġ whitespace and subword splits.
3. Why DistilGPT-2 Matters · Ladder & Source
By distilling 12 layers of GPT-2 Small down to 6 layers with a triple loss (language modeling + cosine hidden-state alignment + KL divergence), DistilGPT-2 keeps 82M parameters and fits into an 84.91 MB quantized ONNX graph that loads quickly in any browser without a GPU. Explore the full 5-route ladder below:
Compare Greedy vs Top-K vs Temperature sweeps and measure how left context collapses ambiguity.
Practical · Batch Autocomplete StudioBatch-complete email drafts, headlines, and CSV columns off-thread with Cancel and formula-safe exports.
Wild · Base-Model Stress LabProbe greedy repetition loops, instruction drift, JSON closure failure, 2019 cutoff, and T=1.45 chaos.
Multi-model · Guardrail & Style ClassifierChain DistilGPT-2 with DeBERTa-v3 Zero-Shot NLI (87.25 MB) to classify generated tone and safety live.