ContentsThe library

Making a Model Smaller

Round the Finished Model, or Train One That Expects It

Last timeWhere the Precision Still Matters

Rounding a trained model takes an hour and a few hundred sample inputs. Training one that knows it will be rounded costs a run and buys about two bits.

Everything so far has been applied to a model that was already finished. Take

the trained weights, choose step sizes, round, ship. That is one of two

families, and it is the cheap one. The other trains the model with the rounding

already in the picture, so the weights land somewhere that tolerates it.

The difference in cost is large and the difference in result is real. This

lesson is about how much of each.

The cheap method, and the set it depends on

Rounding a finished model needs no labels, no gradients and no training

infrastructure. For the weights there is nothing to decide beyond the step

sizes, since the weights are sitting there and can be inspected directly.

The activations are the complication. Their ranges are not visible in the

stored model, because activations do not exist until something is run through

it. So a few hundred inputs are pushed through, the values each part produces

are recorded, and the ranges are set from what was seen. Those inputs are the

calibration set, and they are the part of this method that quietly goes wrong.

FIG 1The same model, four calibration sets
stepWhat the calibration inputs wereInputs usedQuality on held-out traffic, points lostWhat went wrongwhat happened
1Random web text5124.1ranges set by text unlike the trafficConvenient and wrong. The activation ranges a general corpus produces are not the ones a support assistant produces, and the clipping lands on the values that matter.
2Real traffic, English only5122.3other languages clip badlyBetter, and it encoded a blind spot. Requests in other languages drive channels the set never visited, so their ranges are too narrow.
3Real traffic, sampled across languages a5120.6nothing identifiedThe set now looks like the traffic. This is the whole of the advice and it is routinely skipped in favour of whatever text was easy to obtain.
4Real traffic, sampled across languages a321.9too few inputs to see the tailsThe right distribution and not enough of it. The extreme channels appear rarely, so a small sample misses how far they reach.
4 steps
Four runs that differ only in which inputs chose the ranges. The spread between the best and worst is larger than the difference between four-bit and eight-bit storage, which is a useful thing to know before arguing about bit widths.

Two or three hundred inputs is usually enough once the distribution is right,

and a thousand is plenty. What matters far more than the count is that they

look like what the system will actually see: the same languages, the same task

mix, the same prompt lengths, including the awkward tail.

The lesson stops here

4 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Three Budgets, and Only One of Them Is the Weights
  2. 02Round It, Store the Integer, Multiply It Backopening only
  3. 03Most of the Model Does Not Care, and You Have to Find the Part That Doesopening only
  4. 04Round the Finished Model, or Train One That Expects Ityou are here
  5. 05A Zero Still Occupies Its Place in the Rowopening only
  6. 06The Wrong Answers Are Where the Teaching Isopening only
  7. 07The Average Moved Half a Point and the Model Cannot Add Any Moreopening only
  8. 08The Savings Multiply and So Does the Damageopening only

Read alongside