1. Set up
Pick your settings, then press Prepare model.
Progress is saved in this browser automatically.
3. Teach it a task
Pre-training teaches a model to continue text. Fine-tuning shows it examples of an instruction and a good answer, so it learns to follow it. Use the built-in task (write a sentence that uses a given word), or teach it your own examples.
Available once the model has been trained a while.
| Before | After | |
|---|---|---|
| Uses the requested word | – | – |
| Control: another question's word | – | – |
| Finishes its sentence | – | – |
Held-out examples: your answer and the model's
4. Learn from preferences
Fine-tuning shows the model good answers, but never what to avoid. Here the model writes several answers per prompt, a checker marks which use the word and finish properly, and it is trained to prefer the good ones over the bad ones (DPO).
Available once fine-tuning has finished.
| Before | After | |
|---|---|---|
| Uses the requested word | – | – |
| Control: another question's word | – | – |
| Finishes its sentence | – | – |
2. Watch it learn
- Step
- 0
- Train loss
- –
- Validation loss
- –
- Speed
- –
Loss is in bits per byte of text: lower is better, 8 means no idea at all.
- Train (smoothed)
- Validation
| Step | Train | Validation |
|---|
What the model writes while it trains
- Samples appear here as training progresses.
5. Try it
Continue some text
A pre-trained model continues whatever you start.
–
Ask the fine-tuned model
Fine-tune the model first, then type a word and it writes a sentence using it.
- –
Save or share the model
Put the files in one folder and the command-line tool can use them:
tlm chat --model folder --input "dragon"
Open a model from files
Choose model.safetensors and tokenizer.json (and sft.json to ask it
questions). Models made by the tlm command-line tool work too. An opened model can generate text but not train.