Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · AI · Past the basics · about 15 min to read

Play it as a journeyTutor comes with a plan

The small model that learned from the big one: distillation and on-device

Inference
Inference · Open board

The Inference board follows a prompt through a model to a reply. This lesson shrinks the model at the middle of that picture until it fits on a laptop.

Lesson 36 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 10 March 2023: a 7B model on a MacBook
  • Distillation: a student that copies a teacher’s answers
  • A run you can repeat: 51 weights learn from 387
  • Quantisation: fewer bits for every weight
  • A block with one scale: how 4.5 bits happens
  • GGUF and llama.cpp: one file to run it all
  • The distillation loss
  • The run
  • The quantiser
  • Why smaller is faster: the memory read
  • Edges and trade-offs
  • Running a GGUF file

Terms it explains: inference, hard label, soft label, teacher, student, distillation, temperature, synthetic data, bit, quantisation, scale, Q4_0, Common mistakes, context window, greedy, grounding, hallucination, KV cache, logits, prefill vs decode, sampling, stateless, the KV cache grows with context, throughput, top-k / top-p (nucleus), TTFT.

Lab

One GPU, one chat, cores 99% idle. How many more chats fit before anything gets slower?

Drag Chats sharing one read of the weights to the right and watch operations per byte rise until The wall stops it.

Open The batch size dial

The model has read 'The weather today is'. How often does it say something other than sunny?

Drag How hard the drum is shaken from T = 0.1 to 5 and watch Outside the top word climb.

Open The temperature dial

Review AI