Features Models Studio Docs Lab News Open the workspace
Eltes Lab · on-device training

Train a language model in this tab.

Not a scripted demo. A real character-level neural network with embeddings, a hidden layer and a softmax output — trained by backpropagation and Adam, right here in JavaScript. Watch the loss fall from a random guess to recognisable words, then sample from the model you just built. No server, no API key, no downloads: 51,245 parameters on the default corpus and ten seconds on an ordinary laptop.

v3.18.0 51,245 parameters ~9 s for 1,500 steps Zero network requests
The console

Press train. Watch it learn.

Every number below is measured in your browser from the model in front of you. Training runs in small slices, so the page stays responsive and the curve draws as it happens.

Setup

Architecture
A 14-character window, 24-wide embeddings and 128 tanh units give 51,245 weights on the Eltes corpus, 48,950 on the story and 53,999 on the code — the vocabulary sets the exact count. Larger shapes learn slightly more but cost time on every step.
Idle — nothing trained yet.
The model starts from a fixed seed, so the same setup always gives the same run. Nothing leaves this tab; the saved checkpoint goes to localStorage only.

Cross-entropy loss

no run yet
The curve appears here. Loss starts near ln(vocab) — a random guess — and falls as the weights learn.
Validation loss is measured on text the model never trains on.
Training Validation —
Step
0
Tokens
0
Train loss
—
Val loss
—
Perplexity
—
Speed
—ms

Reading the dashed line. Validation is measured on the last 10% of the corpus. On a corpus this small it usually bottoms out after a few hundred steps and then climbs while training loss keeps falling — overfitting. The ring marks the best validation point; the readout names its step.

Sampling

Give it a prompt. Read what it predicts.

The model continues your characters one at a time. Temperature is how much risk it takes; top-k keeps the choice inside the k most likely characters. A trained model writes words and fragments — a model this small does not write essays.

Output

waiting for a model
Train a model above, then press Generate.
The continuation appears here, character by character.

Controls

0.70
Low = tidy and repetitive. High = adventurous, often misspelled.
12
240

Checkpoint

localStorage · eltes.lab.model.v1
No checkpoint Train a model, then save it to this browser. The chat can then answer as Eltes Lab-1.
The learning test

Prove it actually learned.

Free generation from a small model is word salad, so here is a test with a pass mark. Give the model one paragraph, over and over, until the loss reaches zero — then ask it to recite from a short prompt. If the weights really changed, the paragraph comes back. Nothing is scripted.

One paragraph

repeated 24×
Idle — the paragraph is not in a model yet.

Recital

loss —
The model's recital appears here, generated one character at a time from its own weights.
Match —
Match is character-level similarity between the recital and the paragraph. A random model scores near zero; a memorised one should pass 90%. This is memorisation, not understanding — which is exactly why it is a fair test of training.
Honest limits

What this model is — and is not.

The point of training your own model is to see how one actually works, not to pretend a 51k-parameter network is a chatbot. Here is the straight answer.

What it is

  • A real neural network. One embedding table, one tanh hidden layer, one softmax over the vocabulary. Every weight is trained by backpropagation with Adam, gradient clipping, dropout and weight decay.
  • Reproducible. A seeded PRNG initialises the weights and picks every batch, so the same corpus, shape and seed reproduce the same curve.
  • Measured, not asserted. Training and validation loss are computed live on a 90/10 split; perplexity is derived from them.
  • Yours. The checkpoint is a base64 dump of the weight arrays in localStorage. No upload, no account, no key.

What it is not

  • Not an instruction follower. It predicts the next character; it cannot answer a question, call a tool or follow a request. Ask it for the weather and you will get letters.
  • Not a large model. 51,245 parameters on the default corpus against billions in a hosted model — and it is trained on tens of kilobytes of text, not the web.
  • Not a writer. Free generation produces word-shaped fragments. Memorisation is the only place it looks fluent, and that is because the text is in the weights.
  • Not Eltes CAI. CAI is the separate rule engine that answers product questions; Lab is the model you train here. In chat it is labelled On-device · trained here.
1

Characters in

Text becomes integer ids through a vocabulary built from the corpus; unseen characters become one unknown token.

2

Forward pass

The last 14 ids are looked up in the embedding table, concatenated, and pushed through tanh to 128 hidden units.

3

Backward pass

Cross-entropy against the true next character gives a gradient for every weight — hand-written backprop, no autograd library.

4

Adam update

Gradients are clipped by global norm, then Adam steps the weights with bias correction. Repeat.

Train it once. Chat with it after.

Save the checkpoint and open the workspace: Eltes Lab-1 appears in the model picker as an on-device model. It will quote a continuation of what you type and tell you plainly that a character model wrote it.