CS 312 — Deep Learning Alchemy

Assignment 1: Basics — Empirical ML

Mastering one “model organism”: d8, a ~35M-parameter Llama-style decoder trained on tokenized DCLM. Ungraded, but the quiz cites your experiments. Handout: PDF · code.

The default d8 recipe

Model
d8

8 layers · hidden 512 · 8 heads · RoPE · RMSNorm · QK-norm · SwiGLU · vocab 4096

Data
614.4M tok

600,000 seqs × 1024 · batch 64 (65,536 tok/step)

Optimizer
AdamW

β=(0.9, 0.95) · peak LR 0.003 · 1% warmup · linear decay · wd 0.1 · clip 1.0

Problems

1 · Warmup: hyperparameter sweeps ~50 runs

Log-scale sweeps of warmup, LR, batch size, weight decay; co-varying pairs; LR schedulers (linear / cos / constant / wsd).

2 · Reliability of a scaling law ~50 runs

d4–d9 scaling fits for four recipes, pre-registered d8/d9 predictions, then slope-changing and law-breaking interventions.

3 · Measuring variation ~25 runs

Model seed, data seed, hardware nondeterminism (H100 vs A100); deterministic reference runs.

4 · Amplification of randomness ~15 runs

Change one token (position 100 of row 0 → id 17) and watch the divergence grow.

5 · Loss curve augury ~5 runs

Macro shapes and micro-structure of loss curves.

6 · Activations & gradient norms 0–5 runs

Per-module RMS statistics logged to W&B across depth and training.

7 · Your own prediction problem 5–10 runs

Write a quiz question plus a <100-line diff that answers it.

Runs

Live from the ledger on this server. Every run uses the repo’s exact default hyperparameters unless the “Changes” column says otherwise.

Loading…

How it runs here

The course repo targets a Stanford-only Modal workspace and a shared, read-only data volume. This site’s runs use a personal workspace instead, with three changes and no change to training code or hyperparameters:

Source: /root/cs312/assignments on the droplet. GPU: H100 on Modal.