samuellimabraz commited on
Commit
3d71d63
Β·
unverified Β·
1 Parent(s): 45c45c3

feat: add new slides on LLM training paradigms and further reading resources

Browse files
content/slides/ch01-what-is-ai.tsx CHANGED
@@ -394,6 +394,13 @@ export const ch01: Chapter = {
394
  detection head β€” which is why it converges fast on the small
395
  datasets we collect at competitions.
396
  </p>
 
 
 
 
 
 
 
397
  </div>
398
  ),
399
  viz: <FoundationModels />,
 
394
  detection head β€” which is why it converges fast on the small
395
  datasets we collect at competitions.
396
  </p>
397
+ <Callout label="Further reading" tone="accent">
398
+ <a className="underline" href="https://huggingface.co/blog/samuellimabraz/peft-methods" target="_blank" rel="noreferrer">
399
+ PEFT: Parameter-Efficient Fine-Tuning Methods
400
+ </a>
401
+ {" β€” "}LoRA, adapters, prefix-tuning and friends: how to fine-tune
402
+ a foundation model with &lt; 1 % of its parameters.
403
+ </Callout>
404
  </div>
405
  ),
406
  viz: <FoundationModels />,
content/slides/ch03-paradigms.tsx CHANGED
@@ -195,6 +195,56 @@ export const ch03: Chapter = {
195
  ),
196
  viz: <AgentEnvLoop />,
197
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  {
199
  id: "ch03-05",
200
  title: "Where each fits in Black Bee",
 
195
  ),
196
  viz: <AgentEnvLoop />,
197
  },
198
+ {
199
+ id: "ch03-llm",
200
+ title: "Modern LLMs use all three",
201
+ eyebrow: "Pretrain Β· fine-tune Β· align",
202
+ layout: "split",
203
+ content: (
204
+ <div className="space-y-4">
205
+ <p>
206
+ The training pipeline behind GPT-4, LLaMA, and Gemini composes the
207
+ paradigms we just saw, in this order:
208
+ </p>
209
+ <ol className="space-y-2 text-[14px] text-ink/85">
210
+ <li>
211
+ <strong>1. Self-supervised pretraining</strong> β€” predict the
212
+ next token on trillions of tokens of unlabelled text. Produces a
213
+ general-purpose base model.
214
+ </li>
215
+ <li>
216
+ <strong>2. Supervised fine-tuning (SFT)</strong> β€” train on a
217
+ much smaller set of high-quality instruction / answer pairs.
218
+ Teaches the format.
219
+ </li>
220
+ <li>
221
+ <strong>3. RLHF</strong> β€” reinforcement learning from human
222
+ feedback. A reward model learns from human preferences; the
223
+ policy is then optimised against it (PPO or DPO).
224
+ </li>
225
+ </ol>
226
+ <p className="text-muted">
227
+ Yann LeCun&apos;s 2016 &quot;cake&quot; analogy survives in this
228
+ form: most of the calories come from unsupervised pretraining;
229
+ SFT and RLHF are the icing and the cherry.
230
+ </p>
231
+ </div>
232
+ ),
233
+ viz: (
234
+ <figure className="mx-auto flex w-full max-w-[760px] flex-col items-center">
235
+ <div className="w-full overflow-hidden rounded-md border border-stroke bg-surface">
236
+ <img
237
+ src="/figures/llm-paradigms.jpg"
238
+ alt="Unsupervised pretraining, supervised fine-tuning, and RLHF, drawn as a monstrous creature with a cherry on top."
239
+ className="block w-full"
240
+ />
241
+ </div>
242
+ <figcaption className="mt-3 text-center font-mono text-[11px] uppercase tracking-[0.12em] text-muted">
243
+ modern reimagining of LeCun&apos;s &quot;cake&quot; analogy
244
+ </figcaption>
245
+ </figure>
246
+ ),
247
+ },
248
  {
249
  id: "ch03-05",
250
  title: "Where each fits in Black Bee",
content/slides/ch05-deep-learning.tsx CHANGED
@@ -244,6 +244,15 @@ export const ch05: Chapter = {
244
  differentiate it automatically β€” autograd. We only have to write
245
  the forward pass.
246
  </p>
 
 
 
 
 
 
 
 
 
247
  </div>
248
  ),
249
  viz: <BackpropChain />,
 
244
  differentiate it automatically β€” autograd. We only have to write
245
  the forward pass.
246
  </p>
247
+ <Callout label="Implemented from scratch">
248
+ <a className="underline" href="https://github.com/samuellimabraz/cafedl" target="_blank" rel="noreferrer">
249
+ cafedl
250
+ </a>{" "}
251
+ β€” a small deep-learning library I wrote in Java to internalise
252
+ backprop, layer composition, and OOP design patterns. Useful if
253
+ you want to see every line of an autograd engine before reaching
254
+ for PyTorch.
255
+ </Callout>
256
  </div>
257
  ),
258
  viz: <BackpropChain />,
content/slides/ch11-nectar.tsx CHANGED
@@ -246,6 +246,16 @@ ObjectDetectionEvaluator(detector.model, cfg).evaluate()`}
246
  </tbody>
247
  </table>
248
  </div>
 
 
 
 
 
 
 
 
 
 
249
  </div>
250
  ),
251
  },
 
246
  </tbody>
247
  </table>
248
  </div>
249
+ <Callout label="Worked example, published" tone="accent">
250
+ For a full, public end-to-end detection project that follows the
251
+ same pipeline (data β†’ architecture comparison β†’ training β†’
252
+ evaluation β†’ deployment), see{" "}
253
+ <a className="underline" href="https://huggingface.co/blog/samuellimabraz/signature-detection-model" target="_blank" rel="noreferrer">
254
+ Open-Source Handwritten Signature Detection Model
255
+ </a>{" "}
256
+ β€” YOLO vs DETR vs RF-DETR with real numbers and an open model on
257
+ the Hub.
258
+ </Callout>
259
  </div>
260
  ),
261
  },
content/slides/ch12-closing.tsx CHANGED
@@ -36,6 +36,37 @@ export const ch12: Chapter = {
36
  <li>Β· COCO mAP definition (cocodataset.org)</li>
37
  </ul>
38
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
  ),
41
  },
 
36
  <li>Β· COCO mAP definition (cocodataset.org)</li>
37
  </ul>
38
  </div>
39
+ <div className="md:col-span-2">
40
+ <div className="mb-3 font-mono text-[11px] uppercase tracking-[0.12em] text-muted">
41
+ Worked examples and side projects
42
+ </div>
43
+ <ul className="space-y-2 text-[15px]">
44
+ <li>
45
+ Β·{" "}
46
+ <a className="underline" href="https://huggingface.co/blog/samuellimabraz/signature-detection-model" target="_blank" rel="noreferrer">
47
+ Signature detection blog
48
+ </a>{" "}
49
+ β€” full detection pipeline, YOLO vs DETR vs RF-DETR, with
50
+ published model and dataset.
51
+ </li>
52
+ <li>
53
+ Β·{" "}
54
+ <a className="underline" href="https://huggingface.co/blog/samuellimabraz/peft-methods" target="_blank" rel="noreferrer">
55
+ PEFT methods
56
+ </a>{" "}
57
+ β€” LoRA, adapters, prefix-tuning: fine-tuning foundation models
58
+ cheaply.
59
+ </li>
60
+ <li>
61
+ Β·{" "}
62
+ <a className="underline" href="https://github.com/samuellimabraz/cafedl" target="_blank" rel="noreferrer">
63
+ cafedl
64
+ </a>{" "}
65
+ β€” Java deep-learning library written from scratch; an autograd
66
+ engine you can read end-to-end.
67
+ </li>
68
+ </ul>
69
+ </div>
70
  </div>
71
  ),
72
  },
public/figures/llm-paradigms.jpg ADDED

Git LFS Details

  • SHA256: c1060cbf835d08430b6cfff9c3d1b2addbf9302859e9087676c98d939ec9d323
  • Pointer size: 131 Bytes
  • Size of remote file: 148 kB