Skip to content
Lab NotesUpdated 2 min read

Write the missing page

By Reza Motaghi

A loss curve can fall beautifully for an hour while the model trains on the first fifth of every example. Nothing warns you.

On 22 August I ran the first fine-tuning of a vision model on my own radiology reads, with Unsloth, on a mixture-of-experts base, Qwen3.6-35B-A3B. A mixture-of-experts model keeps its knowledge in many small expert networks and routes each token to a few of them. Nobody had published whether Unsloth could fine-tune a vision model built that way. One board-certified oral and maxillofacial radiologist, first training run, no ML team.

So before the run I wrote a thirty-second check. One backward pass, then count the adapter weights that actually received a gradient inside the expert layers. Two hundred and forty did. Zero would have meant a day of training the attention layers only, with the loss falling nicely and the experts, where most of the model's knowledge lives, learning nothing.

Two defaults would have quietly ruined the same run.

The loader's ceiling on sequence length was 2,048 tokens. A full report with its image runs to about 11,700. The loader does not refuse a longer input. It cuts it and says nothing, so the model would have trained on the first fifth of every report and never seen the sections that matter.

The batch collator's default resize shrinks every image to the smallest one in the batch. For a full panoramic radiograph that throws away the detail subtle findings ride on. Nothing warns. The loss still falls.

Both fixes are one argument each. Both are now mandatory lines in my runbook, next to the check that catches them.

A silent default is more dangerous than a crash. A crash costs an hour. A silent default costs the run and hands you a model that looks trained. Before the first training step: tokenise your longest example and set the ceiling above it, print the resolution the collator actually used, and count the gradients where the knowledge lives.

The working configuration, the check and the two defaults are on one page on my site, so the next person with this question finds an answer instead of a forum thread.

About the author

Reza Motaghi is an oral and maxillofacial radiologist and Chief Innovation Officer who reads every day and builds, evaluates, and trains the imaging AI for it. He built CBCTScope, the first CBCT viewer with native AI-agent control, and writes about what a model did on a real case and what it did not.

The newsletter

Get the essays as they’re written.

Imaging AI, evaluation, and building alone, from a radiologist who reads every day and tests before he trusts. A few essays a month, nothing else.

Join for FreeFree · Unsubscribe anytime

Related

  1. Three training runs, one lesson

    Three fine-tunings on my own radiology reads learned my report and not the image, and no training dial showed it. The three checks that catch it.

  2. Your own labels drift as you learn

    My facts per read nearly doubled over a reading campaign. A sparse answer key scores true findings as inventions. Measure your drift before you grade anyone.

  3. Read a paper for the experiments it lets you skip

    One paper read twice struck a planned experiment and handed me a step. How to read a paper for the experiments it lets you skip.