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

DDS, MSc · Board-certified specialist in oral and maxillofacial radiology · Independent researcher

Reza Motaghi is a board-certified specialist in oral and maxillofacial radiology who reads medical images every day, 100,000+ reports signed, and runs enterprise AI in production as Chief Innovation Officer. He builds the training data from his own reads, made together with fellow radiologists under one written standard, trains models on it, and tests them on cases they have never seen.

He published Radigrade, the registered benchmark for AI-written radiograph reports: invented findings counted first, graded by an AI judge calibrated against his own verdicts, general models in public and vendors’ systems privately on request. He also built CBCTScope, the first CBCT reading viewer with native AI-agent control.

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. Inventory before interpretation

    Blind on my own radiographs, the strongest general model reported a root canal in a tooth that was not there, then kept writing. Count before you interpret.

  3. What the best general model read on a specialist's ruler

    The strongest general model read three findings in ten on my cases and invented three in four. One accuracy number hides that. Three questions to ask.