Karpathy's GitHub Repositories: A Practical Learning Path for FDEs
Learn what micrograd, minbpe, nanoGPT, llm.c, nanochat and autoresearch teach, then turn that knowledge into measurable customer-facing AI engineering work.
BY ARJUN MEHTA · FDEINTERVIEWS EDITORIAL · UPDATED NOVEMBER 24, 2026 · 5 MIN READ
PRACTICE THIS:Learn the FDE foundations ·Practice ML fundamentals ·Practice deployment tradeoffs
Andrej Karpathy's repositories offer a useful route from gradients to tokenization, model training and automated experiments. For a forward deployed engineer, pair each mechanism with a customer decision: why an adaptation failed, why input costs rose, whether a model fits, or what evidence permits a release.
You do not need to finish all seven projects before building useful systems. Choose the first mechanism you cannot explain, run a small experiment and write down what changed. The sequence below is our suggested FDE curriculum, not an official Karpathy syllabus or endorsement. Repository details were checked on November 24, 2026.
Choose a starting point by the problem you face
The sequence connects implementation knowledge to evidence you can show another engineer. Readers who already understand a stage can start at the next one.
| Repository | Mechanism to learn | Small deliverable for an FDE |
|---|---|---|
| micrograd | Scalar reverse-mode automatic differentiation | A checked gradient and an explanation of one parameter update |
| Neural Networks: Zero to Hero | Guided progression through neural networks and language models | A tiny overfitting experiment with separate training and validation results |
| minbpe | Byte-level BPE vocabulary construction and tokenization | A comparison of token counts across representative customer text |
| nanoGPT | A compact transformer and training loop | An annotated forward pass and loss calculation |
| llm.c | Model operations expressed in C/CUDA | A profile explaining where time or memory is spent |
| nanochat | Tokenization, training, evaluation and inference in one project | A run manifest linking data, tokenizer, checkpoint and evaluation |
| autoresearch | Bounded, repeated training experiments | A protected evaluator and an experiment ledger with a stop budget |
The FDE foundations course supplies the customer-discovery and delivery work alongside these model internals.
Learn gradients with a prediction you can check
micrograd is small enough to inspect how operations create a computation graph and accumulate gradients. Before running this CPU exercise, calculate the gradient yourself. We fit the single parameter w to one synthetic observation, x=2, target=6.
In a fresh virtual environment, install micrograd==0.1.0, then run:
from micrograd.engine import Value
w = Value(1.0)
prediction = w * 2.0
loss = (prediction - 6.0) ** 2
loss.backward()
print("loss:", loss.data, "gradient:", w.grad)
w.data -= 0.1 * w.grad
new_loss = (w * 2.0 - 6.0) ** 2
print("new weight:", w.data, "new loss:", round(new_loss.data, 2))
Expected output is loss 16, gradient −16, new weight 2.6 and new loss 0.64. The derivative is 2 × (2w − 6) × 2. Increasing w moves the prediction toward six, so the negative gradient makes sense.
Now change the learning rate to one. The loss rises to 784: the update overshoots. A falling loss on one observation also says nothing about performance on new cases. These two checks turn “the model is learning” into claims you can test. Read backpropagation intuition before expanding to many parameters; reset accumulated gradients between optimization steps.
Use tokenization to investigate a real input budget
minbpe makes training, encoding and decoding a tokenizer visible. Build a small corpus with prose, product identifiers, JSON, non-English text and repeated whitespace. Save the tokenizer vocabulary and merges with your experiment.
For each sample, record UTF-8 bytes, characters, tokens and whether decoding reproduces the input. Then compare with the tokenizer shipped with the model you intend to serve. A tokenizer you trained for an exercise does not produce the token IDs that arbitrary pretrained weights expect.
Customer exercise: a support workflow costs more after adding device logs. Compare token counts before and after removing repeated log prefixes, while retaining timestamps, error codes and evidence needed for diagnosis. Report both token savings and any diagnostic information lost. Our tokenization reference connects that measurement to context limits and billing.
Read the training loop, then follow the complete artifact
nanoGPT's README now marks the project deprecated and recommends nanochat. It remains a readable historical teaching implementation. Use it to explain inputs shifted against next-token targets, causal attention and why validation data must be separate. Prefer a current supported recipe when the goal is a new training experiment.
llm.c exposes the work below a Python training call. Start with the CPU reference when your aim is to understand the operations; its CUDA paths are a separate performance exercise. Measure the implementation and hardware you actually ran. A faster kernel is useful only when that operation matters to your workload.
nanochat connects the broader pipeline. Its documented full speedrun targets an 8×H100 node; the project also describes smaller and CPU configurations. The existence of a CPU path does not make the full reference run a laptop exercise. A published training-cost example depends on the recipe, hardware price and benchmark. It is not the total cost of serving a production assistant.
Build a run manifest containing the repository revision, data split, tokenizer revision, model configuration, random seed, checkpoint and evaluation output. Before a customer deployment, add the KV-cache budget, arrival-rate assumptions and rollback configuration. Training reproducibility and serving readiness need different evidence.
Borrow the experiment loop from autoresearch carefully
The upstream autoresearch setup lets an agent edit train.py, with preparation and evaluation utilities in prepare.py. Training uses a five-minute budget that excludes startup and compilation, and selection uses validation bits per byte. The documented upstream setup requires an NVIDIA GPU, tested on H100. Keep the repository's scope in mind when adapting its pattern.
For an FDE exercise, use the same propose → measure → keep or reject structure on a small retrieval configuration search. Fix the corpus, labels and evaluation implementation. Permit changes only to named parameters, such as chunk size and candidate count. Run candidates on a development set, retain the full ledger, then evaluate the selected candidate once on a held-out test set.
Use an isolated workspace, a wall-clock and cost ceiling, and tools limited to the experiment. Enforce protected files outside the agent's writable workspace; a sentence saying “do not edit the evaluator” is insufficient. Review verifier gaming before allowing automatic selection.
The result to present is a configuration diff with quality, latency and failure cases. This article's CPU calculation was executed; the GPU training recipes are upstream references, not training runs performed for this guide.
Keep a learning notebook that another engineer can audit
For every exercise, save the question, source revision, prediction, observed result and unresolved issue. Separate your interpretation from the raw output. An agent can help retrieve those notes, but a note saying “deploy this” is not current permission to change a customer's system. The agent-memory reference includes a practice case for stale notes and action authority.
For an interview, choose one experiment and explain its failure mode aloud. Then use the 25-problem FDE practice set to apply the same reasoning to retrieval, tool use and production recovery.
Turn it into offers. Work the real questions and concepts this maps to:
FAQ
Start with micrograd if derivatives and backpropagation are unfamiliar, using Neural Networks: Zero to Hero for guided explanation. If you already understand training, start with minbpe and investigate how your customer's text becomes tokens.
The small micrograd exercise here runs on a CPU. Tokenizer experiments are also practical without a GPU. Full nanochat speedruns and the upstream autoresearch training setup have different hardware requirements; inspect their current recipes before renting compute.
nanoGPT remains useful for reading a compact transformer training loop, but its README marks it deprecated and points to nanochat. Use nanochat to study the broader current training, evaluation and inference pipeline.
They build valuable model understanding. FDE work also requires customer discovery, data access, evaluation, deployment, incident handling and handover. Pair each repository exercise with a concrete customer decision and evidence that supports it.
Discussion (3)
A useful stopping point is being able to predict an experiment's result before running it, then explain a mismatch. Completing every notebook is a weaker measure.
llm.c is especially useful for readers who need to explain a profile. The CPU reference and optimized CUDA paths serve different learning goals.
Keep a final evaluation set outside an automated experiment loop. Repeatedly selecting against the same validation cases can turn a clean-looking improvement into overfitting.
