Model laboratory
Give a small Transformer a starting point. Inspect what it predicts, one character at a time.
Loading model weights…
Your starting point
Continue a short story using characters from the training corpus.
Sampling settings
Lower is more predictable. Higher takes more chances.
Use the same seed and settings to repeat a result.
Experimental model 005. All 12 reviewed continuations failed grammar and coherence checks. Expect misspellings, repetition and loss of story context.
The continuation
Ready for a promptChoose a prompt, then generate.
Inspect the next-character prediction
Top probabilities at the end of the current text, before temperature or sampling filters.
Training record
This experimental checkpoint adds 2,400 optimizer updates to the archived width-64 model. Lower character loss did not establish story coherence.
Learning curve
Cross entropy · Lower is betterThe data
Dataset provenance, exact split information and hashes are included with the source.
Inspect the full run record ↗Story data: TinyStories · CDLA-Sharing-1.0. Project code remains MIT licensed.
What this establishes
Tokenization, causal attention, gradient descent, serialization and browser generation work together. A tiny corpus and small model do not establish general language ability.
Model notes
The classic Transformer architecture comes from Fareed Khan’s open training project. We train a compact character model, then execute its operations directly in JavaScript.
Characters become numbers
A corpus-derived character vocabulary maps your text to token IDs. Unsupported characters are reported explicitly.
Attention reads the context
Learned token and position embeddings pass through causal multi-head attention, layer normalization, residual connections and ReLU feed-forward layers.
One more character
The output layer scores the vocabulary. Temperature and top-k sampling select the next character. The context window advances as the text grows.
Reproduce the work
The source bundle contains the upstream architecture, our training and export script, the exact corpus, inference implementation and parity checks.
Download the project ↗Provenance & limitations
Based on train-llm-from-scratch, MIT licensed. This demo has no instruction tuning, retrieval or safety training. Training happens in Python; this public Space runs inference only.