# The Doc Quatrain corpus

Ten short technical field notes by Doc Quatrain, a fictional writer who explains ordinary
infrastructure problems entirely in rhyming verse. This is the training corpus for the
ten-part fine-tuning series on this site, and every word of it is invented for that
purpose. Doc Quatrain is not a person, and none of these incidents happened to anybody.

The corpus exists because a fine-tuning demonstration needs a voice you can check. Train a
model on a writer whose style is subtle and you spend the evaluation arguing about whether
the output feels different. Train it on a writer who rhymes and the question answers
itself from across the room, which means the interesting questions get to be the real ones:
how much data, how many passes, what broke, and what the model learned that nobody asked
it to learn.

## The voice, stated deliberately

Written down here because part eight of the series argues that you should always write it
down before you build a dataset, and it would be strange to skip my own advice.

**Style**, meaning the surface:

- Rhyming couplets, AABB, four beats to a line and loose about it.
- Plain technical vocabulary. The verse is the only ornament; the nouns stay ordinary.
- Short stanzas, two or four lines, with a blank line between.
- No exclamation marks. The tone is dry rather than delighted.

**Character**, meaning the part that survives translation into prose:

- He opens by naming his own mistake, in the first two lines, without preamble.
- The middle explains the mechanism plainly, in order, one idea per stanza.
- Somewhere past the midpoint he concedes a point against himself. The concession is
  real and costs him something; it is never a rhetorical setup.
- He sells nothing and recommends no product by name.
- He closes on the thing that will bite you next, never on a summary of what was said.

That split is the whole argument of the series. A model can pick up the rhyme in twenty
minutes and still write pieces that open on a boast and close on a tidy summary, which
looks like Doc Quatrain and is not him. Part ten is about telling those apart.

## Files

Everything the series uses, in the form it uses it. There is no archive to download and no
repository yet. All of this is going to GitHub eventually. Until it does, this is a static
site, so each file is fetched on its own from this folder.

**The corpus.** Ten pieces, each about three hundred words, which is one to two minutes of
reading. They are deliberately few and deliberately short, because that is the realistic
situation for anybody training on their own writing, and pretending otherwise would teach
the wrong lesson about how much data you need.

    01-the-backup-that-was-never-tested.md
    02-it-was-always-dns.md
    03-the-ups-that-lied.md
    04-the-certificate-nobody-owned.md
    05-the-dust-i-never-looked-at.md      <- held out, never trained on
    06-the-disk-that-filled-with-logs.md
    07-the-spare-i-did-not-buy.md
    08-the-firmware-update.md
    09-the-cable-i-did-not-label.md
    10-the-monitoring-went-quiet.md       <- held out, never trained on

**The training data**, built from those ten by the script below.

    train.jsonl              8 examples, roughly 2,100 words
    holdout.jsonl            2 examples the training run never sees

**The runnable parts.** Python, because that is what the rest of the stack is.

    requirements.txt         torch, transformers, peft, trl, bitsandbytes
    build_corpus.py          turns the ten poems into the two JSONL files
    train.py                 the fine-tune itself: QLoRA, one GPU
    generate.py              generate from the result, and from the base, to compare
    qwen3-8b-quatrain.yml    the same run as an Axolotl config, if you prefer one

The whole thing, from an empty directory to a trained adapter:

    python3 -m venv .venv && source .venv/bin/activate
    pip install -r requirements.txt

    python3 build_corpus.py     # -> train.jsonl, holdout.jsonl
    python3 train.py            # -> out/adapter
    python3 generate.py "Write a field note about monitoring that failed silently."

`build_corpus.py` needs nothing but a Python install. `train.py` needs an NVIDIA GPU: about
11 GB of VRAM on the 8B model, or roughly 6 GB with `BASE_MODEL=Qwen/Qwen3-1.7B`, which is
a laptop card. Both default to their own directory, so they work from inside this folder
with no arguments and no paths to edit.

Both of those last two are generated from the site's own sources rather than copied by
hand, and a check fails the build if they drift, so the configuration you download is the
one printed in the write-up.
