Writing criteria for this guide
Every "for Mere Mortals" guide is written to the same nine-point standard, so a reader who trusts one can trust the rest. Here it is, with the verification notes for this particular guide below.
- Fix it first. Reader outcomes lead, not action items: each chapter opens by naming the outcome it delivers, shows a check the reader can run to confirm they got it, and a reasonable reader finishes able to state what was done, what it means, and what to try next.
- Plain language. Short sentences, everyday vocabulary, technical terms defined on first use. No slang, and no idioms that only make sense in one country — the reader may be translating as they go.
- No dead ends. A guide never tells the reader to do something it cannot show them how to verify. Every claim a reader relies on — an install, a command, an output — is something this guide demonstrates or clearly labels documented-only below.
- Live-verified where it matters. Procedures are run for real in the guide's lab wherever the build machine allows it, and the transcripts kept in the repository are the evidence. What could not be run is listed honestly below, never presented as if it had been.
- General audiences. Nothing in this guide — examples, fixtures, names, addresses — is modelled on any particular reader or author's real life, network, or organisations. The lab's dataset is invented for the occasion: a fictional company's fictional product.
- Standalone. A reader needs this guide, its lab, and nothing else. Where another guide would genuinely help, it is pointed to once, by name, and the chapter still completes without it.
- Honest about limits. Chapter 12 names what the technique cannot do: the base model as a ceiling, facts held as soft tendencies rather than records, the narrowness of a 24-example world, the deliberately tiny scale of the demonstration, and an adapter's unauditable insides.
- The ethics rule is in the text, early. Chapter 1 and the README state the rule plainly — train only on data you have the right to use — before any procedure depends on it, chapter 3 works through what it means in practice, and chapter 10 extends it to consent for images of people.
- Builds clean. The site builds with MkDocs in strict mode with no warnings, and a fresh reader following the chapters in order reaches the stated outcome of each.
Verification notes for this guide
The build machine is a 2-CPU, 7.7 GB Ubuntu 24.04 sandbox.
The lab installed torch 2.14.1+cpu, transformers
5.20.2, peft 0.21.2 and accelerate 1.15.0 with pip
into a fresh virtual environment (Python 3.12.3) and trained
distilgpt2 (81,912,576 parameters) on CPU. All transcripts
live in lora-lab/transcripts/; the training script is
lora-lab/train_lora.py, the comparison script is
lora-lab/compare.py, the dataset is lora-lab/dataset.jsonl
and the test questions are lora-lab/held-out.jsonl.
Run for real, with transcripts as evidence:
- Versions of Python and of every library in the lab's stack, and confirmation that no GPU was involved (t00).
- The dataset checks of chapter 4: 24 lines, every line parses as JSON with the same two keys (t01).
- A complete LoRA training run: 24 examples, 20 epochs, 120 steps, rank 8, alpha 16, learning rate 5e-4, batch 4, seed 42, the question part of each example masked out of the loss. PEFT reports 147,456 trainable parameters of 82,060,032 (0.18%). The logged loss fell from 3.9243 at step 3 to 2.4386 at step 120, final training loss 2.7848 (t02).
- The adapter saved by that run: adapter_model.safetensors of 591,352 bytes plus its adapter_config.json, listed and read back (t03).
- The before/after comparison of chapter 8: the untouched base model and the same model with the adapter loaded in a fresh process, asked the five questions of held-out.jsonl — four genuinely held out, one repeated from training as a control — with greedy generation, so the adapter is the only difference (t04). The recorded result: the house style appeared in all five adapted answers, and none of the four held-out facts was answered correctly; the control's trained fact also came back wrong. Chapter 8 reports this in full, unvarnished.
Documented only — described from the projects' documentation, not run, and the text does not claim otherwise:
- GPU training. The lab had no graphics card; the text says the same commands use one when present, and nothing about achievable speed on any particular card.
- Merging an adapter into a base model, and exporting a merged model to GGUF for llama.cpp or Ollama (chapter 9, labelled in its own text as a map, not a transcript).
- Image LoRA with kohya_ss (chapter 10): the whole chapter is a survey of a neighbouring craft, labelled as such in its own text; nothing in it was run.
- QLoRA and the other parameter-efficient variants in chapter 11, characterised rather than benchmarked.
- Real-sized work throughout: multi-billion-parameter models, thousand-example datasets, and tuned hyperparameters. The lab demonstrates mechanisms at the smallest scale that still works, and chapter 12 says so.
Fixtures are this guide's own and deliberately generic: 24 invented support answers about an invented kettle (the Kestrel K-2) from an invented company (Harbour & Pine), written in an invented house style so the fingerprints of learning are easy to see in the output. No example is modelled on any real person, organisation, product or piece of writing. Trained adapter weights and downloaded models are not in the repository: the adapter is a build artefact, reproducible from the dataset, the script and the seed kept here.