It predicts. It doesn't look up.
The transformer chooses one character token at a time from its learned weights. The demo runs actual inference, without a hosted AI provider or a canned answer lookup.
Autoregressive generationPEBBLE ECOSYSTEM / 02
A real transformer. Exactly two million parameters. Built and trained in a language you can explore.
Meet PebbleLM: a small educational model that makes the journey from code to learned behavior visible.
Actual trained weights. No external AI API. Code, data and weights are MIT.
01 / MEET THE MODEL
A compact experiment with the whole stack open: the network, tokenizer, training loop, dataset and checkpoint.
The transformer chooses one character token at a time from its learned weights. The demo runs actual inference, without a hosted AI provider or a canned answer lookup.
Autoregressive generationForty topics cover Pebble syntax, programming concepts and machine learning. Short questions work best; unfamiliar wording can produce a wrong answer.
Explore the actual outputs →Inspect every parameter, run the checkpoint on your CPU, or change the Pebble source and retrain. Code, original data and released weights carry the MIT license.
Run it on your machine →BUILT FOR EXPLORATION
Trace embeddings, causal attention, training loss and sampling in readable source.
Compare prompts and temperatures, then inspect where memorization stops generalizing.
Use the JSON endpoint or local CLI in educational prototypes. It isn't trained for general chat or reliable factual advice.
02 / EXPERIMENT
Start with a familiar topic, then change its wording. Watch what a tiny model remembers—and where it struggles.
A small question can teach you a lot about a small model.
Your output appears here after you generate.
An educational model, not a general assistant. It learns a narrow set of programming and ML topics. It can repeat an answer, mix learned phrases or produce incorrect text. Changing wording is a test of generalization, not a request for new knowledge.
Last three results, held only in this page’s memory.
03 / RECORDED OUTPUTS
Explore recorded greedy generations from the released checkpoint. Compare a seen training phrasing with a reserved test phrasing.
What is Pebble?
Pebble is a small programming language.
Greedy generation · published canonical evaluation
How does Pebble work?
Pebble is a small programming language.
Training target:
Greedy generation · published reserved evaluation
Topics and target answers are shared between splits. Seen phrasing: 38/40 exact answers. Reserved phrasing: 4/40. These examples are recorded results; use the playground for a fresh run.
04 / EVIDENCE
Exact matches on the first training phrasing for each topic.
Read every familiar-prompt output ↗Exact matches when those same topics are asked with held-out wording.
Read every reserved-prompt output ↗Both sets use the same 40 topics and target answers. This measures sensitivity to phrasing. It does not measure new knowledge or general reasoning.
Released checkpoint measurementsPacked 299-position sequences
Individual question/answer prompts
Validation selects the checkpoint
05 / UNDERSTAND
01 / ENCODE CHARACTERS
The tokenizer maps printable ASCII, newline, tab and four special tokens into 101 IDs. Each ID gets a learned 200-dimensional vector, plus a learned position embedding.
101 tokens × 200 dimensions + 299 positions × 200
dimensionsInspect the tokenizer ↗
A fixed vocabulary turns your question into character tokens. The model sees at most 299 characters of context.
Four decoder blocks use causal attention. Each position learns from the characters that came before it.
The tied output projection assigns probabilities to the next character. Temperature controls sampling.
Generation continues until the end token or the limit. Compare the output with the published evaluation.
The network, tokenizer, training loop and sampling are Pebble programs. TensorFlow.js/WASM provides numerical kernels and automatic differentiation.
Read the actual network// Exact trainable parameter count
(101 + 299) × 200
+ 4 × (4 × 200² + 2 × 200 × 800)
= 2,000,000
06 / MADE TO BE OPENED
Run inference locally, call the demo endpoint, inspect the source or reproduce training. No model API key or database setup.
Node 24, one install, then a prompt.
↗02 / CALL THE ENDPOINTPOST a question with bounded sampling options; receive the answer and elapsed time.
↗03 / EXPERIMENTTokenizer, training data, optimizer loop and evaluation are open.
↗curl https://pebble-llm.vercel.app/api/generate \
-H 'Content-Type: application/json' \
--data '{"prompt":"What is Pebble?","temperature":0,"seed":2026,"maxNewTokens":96}'
Public demo endpoint · 160-character ASCII prompt · 96-character output limit
07 / KEEP EXPLORING
Run Pebble, inspect how programs behave and explore the machine-learning guide.
Open the machine-learning guideMODEL / REPRODUCEReproduce training, inspect the real weights and compare memorization with new phrasing.
Read the reproduction stepsSENTINEL / APPLYExplore a separate Pebble-trained model that scores typed agent actions before they run.
Open Sentinel