wassname's ML Debugging Folklore

In an attempt to upskill the machine learning debugging on AI coding assistants (and humans), I've collected high quality sources on how to debug machine learning projects, focusing on the mindset and the "taste". When I started ML I went searching for discussions on best practices, and started a few discussions of my own and they helped me a lot, over the years I've collected good ones. I hope they can help others, as well as help in auto research setups. This intro is human written, and the below is AI written with human guidance.

Use as a Claude skill

/skills add https://github.com/wassname/ml_debug

Or paste SKILL.md into your system prompt / context when debugging.

What's here

  • This README -- the folklore, for humans: verbatim sourced quotes from practitioners, general lessons first, modern transformers and LLM fine-tuning in their own section.

  • SKILL.md -- what an agent loads. Not the folklore, which agents read and ignore. Instead the rituals the folklore implies: a trigger, a form to fill, and an artifact to show the user. "Assume you have a bug" becomes "send a subagent to find one and report what it found".

  • PLAYBOOK.md -- the synthesized long-form: mental models, practitioner priors, step catalogs, symptom tables, the agent debugging loop, triage, and anti-patterns. Menus of hypotheses distilled from the same sources, not quotes. Deeper one-off tricks (loss-surface analysis, stuck-metric diagnosis, sweep reliability) live in refs/.

  • docs/evidence/ -- frozen local copies of source material (blog posts, talks, papers, reddit threads). Claims here link back to exact quotes.

Folklore

Think more, experiment less

before acting plan by writing multiple competing hypotheses: consider the most likely failure but also some of: a subtle failure, a perverse failure, a possible bug, and an unknown. Put a rough credence on each. Finally write down what you expect to see differently for success vs each possiblity and brainstorm the cheapest tests that may narrow them down. - wassname

Switching from experimenting a lot and thinking a little to experimenting a little and thinking a lot was a key turnaround in productivity. When debugging with long iteration times, you really need to pour time into the hypothesis-forming step - thinking about what all the possibilities are, how likely they seem on their own, and how likely they seem in light of everything you've seen so far. Spend as much time as you need, even if it takes 30 minutes, or an hour. Reserve experiments for once you've fleshed out the hypothesis space as thoroughly as possible and know which pieces of evidence would allow you to best distinguish between the different possibilities.1

Don't write from scratch; start or compare to a working a reference

If you are stuck, find a working reference implementation and compare it to yours. Relvent as the hyperparameters, model, data but especially subtle things like algorithm tweaks, and engineering tricks. If nothing jumps out, the fastest way might be to try a bisection search. Here you adapt their code wholesale and try the quickest test you can. If their code works then try again with half their features and so on. Eventuall you narrow down the features that are nessesary - wassname

If you're doing anything that involves an RL algorithm as a component in a larger system, don't try and implement the RL algorithm yourself. [...] RL is unstable enough at the moment that you'll never be sure whether your system doesn't work because of a bug in your RL implementation or because of a bug in your larger system.1

We find that implementation differences which are often not reflected in publications can have dramatic impacts on performance.2

When you're stuck after a diagnostic cycle or two, the generalization of this advice is to find a working implementation (rank candidates by community adoption > papers citing it > code that runs > author reputation) and diff your math, computation graph, and hyperparameters against it. For RL see rl/SKILL.md.

Assume you have a bug

When their RL implementation doesn't work, people are often keen to either (a) adjust their network architecture or (b) adjust their hyperparameters. On the other hand, they're reluctant to say they've got a bug. Most often, it turns out they've got a bug. Why bugs are so much more common in RL code is discussed above, but there's another advantage to assuming you've got a bug: bugs are a damn sight faster to find and fix than validating that your new architecture is an improvement over the old one.3

What I'm advocating for here is not a blind faith in the buginess of your code, but for dramatically raising the threshold at which you start thinking 'OK, I think this is correct.'3

A bug can also hide, because most ML models have multiple adaptive parts:

"If one part is broken, the other parts can adapt and still achieve roughly acceptable performance" 4 , and it may not show in the output at all.

Default to disbelieving your own results (Neel Nanda)

The default state of the world is that your research is false, because doing research is hard.5

Excitement is evidence of bullshit: Generally, most true results are not exciting, but a fair amount of false results are. So from a Bayesian perspective, if a result is exciting and cool, it's even more likely to be false than normal5

The cheapest antidote he gives: "Read your data ... Often, the quality of the data is a crucial driver of the results of your experiments. Often, it is quite bad."5

I'll add. for LLM's I suggest assuming every negative results is a bug, and 1) reviewing associated code and output logs to find the top 5 reasons/probabilities why the results might be invalid 2) to avoid skimming this report should involve quoting and interpreting to the user about everything, which should include at least: config, weird code / engineering, data, eval and importantly the log and metrics behaviour and demos in it. It should often include looking at a random sample of output and comparing it to the expected output. - wassname

Understand the system to shrink the search (Ulisse Mini)

When good programmers debug hard problems fast, it's usually because they understand the system well enough to track the important internal state in their head, letting them drastically reduce the solution space they're searching over.6

Gears beat black boxes (John Wentworth)

figuring out a system's gears takes extra work up-front, but yields dividends forever. [...] The black-box approach is cheaper for one-off tasks, but usually doesn't yield any insights which will generalize to new tasks using the same system7

Broken code fails silently; measure everything (Spinning Up)

Josh Achiam's warning is RL-framed but general:

broken RL code almost always fails silently, where the code appears to run fine except that the agent never learns how to solve the task.8

So instrument heavily, because "you can't tell it's broken if you can't see that it's breaking,"8 and don't trust one passing setup: "sometimes things will work in one environment even when you have a breaking bug, so make sure to test in more than one environment."8

Pursue anomalies; investigate confusion

If you ever see a plot or a behaviour that just seems weird, chase right after it! Do not - do not - just 'hope it goes away'. Chasing anomalies is one of the most powerful ways to debug your system, because if you've noticed a problem without having had to go look for it, that means it's a really big problem. [...] It's really tempting to think that the cool extra functionality you were planning to write today [...] might just magically fix this anomalous behaviour. It won't. Give up on your plan for the day and chase the anomaly instead.3

It was only by following that confusion and realising that taking the difference between frames zeroed out the background that gave the hint of a problem with normalization.1

It seems important to really commit yourself to always investigate whenever you notice confusion.1

These are really important to flag to the user and investigate patiently

Read what you actually wrote, not what you meant (gwern)

you can't find typos in your own writing without a great deal of effort because you know what it's supposed to say; so copyediting advice runs like 'read it out loud' or 'print it out and read it' or 'wait a week' [...] or even 'read it upside down'. That's the sort of thing it takes to force you to read what you actually wrote, and not what you thought you wrote.9

This is why fresh eyes (or a fresh-eyes subagent) catches what you can't.

Never accept the kludge (Patrick Kidger)

Kidger, on why research code is so reliably buggy:

Academic software is almost always a poorly-maintained kludge of leaky abstractions, awful formatting, and bugs that don't cripple things only because some other bug stops them from doing so.10

This is a systemic professional failing. [...] the overwhelming majority of your time will be spent in front of a screen, staring at code. And yet most of you (yes, you) would not pass muster as a junior developer.10

His fix is a posture, "never accept the kludge": messed up your git repo? Find the commands to fix it, "don't just delete it and clone from the remote."10 The instinct that refuses kludges is the same one that refuses .detach()-to-silence-autograd and except: pass.

Loss curves are a red herring

When someone's RL implementation isn't working, they luuuuuurv to copy-paste a screenshot of their loss curve to you. They do this because they know they want a pretty, exponentially-decaying loss curve, and they know what they have isn't that. The problem with using the loss curve as an indicator of correctness is somewhat that it's not reliable, but mostly because it doesn't localise errors. The shape of your loss curve says very little about where in your code you've messed up, and so says very little about what you need to change to get things working.3

(But sometimes they are not, they separate underfitting and over, gradient explosion vs vanishing, saturation vs not... and so on)

Inspect the data first

The first step to training a neural net is to not touch any neural net code at all and instead begin by thoroughly inspecting your data. [...] The outliers especially almost always uncover some bugs in data quality or preprocessing.11

Slavv's "37 reasons" list opens with the same anecdote (gradients flowing, loss falling, predictions all background) and puts "Verify that the input data is correct" and "Start with a really small dataset (2-20 samples). Overfit on it" at the top of its emergency checklist12 .

Andrew Ng's error-analysis procedure is the same move applied after your first trained model: before investing a month in any fix, gather ~100 misclassified dev examples and count the failure categories in a spreadsheet.

Manually examining 100 examples does not take long. Even if you take one minute per image, you'd be done in under two hours. These two hours could save you a month of wasted effort.13

Labels are often wrong (koaning)

Vincent Warmerdam:

It turns out that bad labels are a huge problem in many popular benchmark datasets.14

His cheap way to find them: train a deliberately high-bias model, then sort by where it disagrees with the label while assigning the correct class low confidence. The takeaway: "maybe we should spend [...] less time tuning parameters and instead spend it trying to get a more meaningful dataset."14

The tank story: your model learns the confound (gwern)

The canonical data-leakage parable:

A cautionary tale in artificial intelligence tells about researchers training an neural network (NN) to detect tanks in photographs, succeeding, only to realize the photographs had been collected under specific conditions for tanks/non-tanks and the NN had learned something useless like time of day.15

gwern traced versions back to 1992 and concluded it is "a classic 'urban legend'" with no solid source15 . The lesson holds twice over: a model will gladly learn a confound in how the data was collected instead of the task, and even your cautionary tales deserve a citation.

Test-set contamination is insidious (Domingos)

Domingos' 2012 CACM paper set out to write down ML "folk knowledge" (the same project as this file):

Doing well on the training set is easy (just memorize the examples). The most common mistake among machine learning beginners is to test on the training data and have the illusion of success.16

Contamination of your classifier by test data can occur in insidious ways, for example, if you use test data to tune parameters and do a lot of tuning. (Machine learning algorithms have lots of knobs, and success often comes from twiddling them a lot, so this is a real concern.)16

Lones catalogs the concrete leak routes: scaling statistics computed on the full dataset before splitting, augmentation before splitting, look-ahead bias when cross-validating time series17 .

Overfit one batch first

Overfit a tiny subset of data. Lastly and most importantly, before training on the full dataset try to train on a tiny portion (e.g. 20 examples) of your data and make sure you can achieve zero cost. For this experiment it's also best to set regularization to zero [...]. Unless you pass this sanity check with a small dataset it is not worth proceeding to the full dataset.18

Overfit a single batch of only a few examples (e.g. as little as two). [...] If they do not, there is a bug somewhere and we cannot continue to the next stage.11

And remove a variable while you're at it: "Always use a fixed random seed [...]. This removes a factor of variation and will help keep you sane."11

The most common neural net mistakes (Karpathy)

The 2018 tweet thread that seeded the recipe post. Every item is a silent failure except 5:

most common neural net mistakes: 1) you didn't try to overfit a single batch first. 2) you forgot to toggle train/eval mode for the net. 3) you forgot to .zero_grad() (in pytorch) before .backward(). 4) you passed softmaxed outputs to a loss that expects raw logits. ; others? :)19

oh: 5) you didn't use bias=False for your Linear/Conv2d layer when using BatchNorm, or conversely forget to include it for the output layer .This one won't make you silently fail, but they are spurious parameters19

  1. thinking view() and permute() are the same thing (& incorrectly using view)19

Number 6 is the bug the backprop-to-input dependency check catches mechanically (refs/diagnostics.md).

Seed variance: you can't tell a bug from bad luck

Look, there's variance in supervised learning too, but it's rarely this bad. If my supervised learning code failed to beat random chance 30% of the time, I'd have super high confidence there was a bug in data loading or training. If my reinforcement learning code does no better than random, I have no idea if it's a bug, if my hyperparameters are bad, or if I simply got unlucky.20

Instability to random seed is like a canary in a coal mine. If pure randomness is enough to lead to this much variance between runs, imagine how much an actual difference in the code could make.20

Henderson confirmed it quantitatively: splitting 10 same-config runs (differing only in seed) into two groups of five produces "statistically different distributions just from varying random seeds."2 This is why one good run proves nothing (refs/sweeps.md).

Normalize and scale everything

From the slides21 :

  • If observations have unknown range, standardize
  • Compute running estimate of mean and standard deviation
  • x' = clip((x - mu)/sigma, -10, 10)
  • Rescale the rewards, but don't shift mean, as that affects agent's will to live
  • Standardize prediction targets (e.g., value functions) the same way

Use running statistics over all data seen so far, not just recent data; using only recent data silently shifts the input distribution out from under the model.

Tricks substitute for each other

On the slides21 :

Always Be Ablating

  • Different tricks may substitute
  • Especially whitening

Many normalization/regularization tricks do roughly the same job (they improve conditioning), so stacking them adds complexity without proportional benefit.

Changing anything changes everything (Sculley et al.)

Why ablation and one-change-at-a-time work, from Google's production-ML technical-debt paper:

Entanglement. Machine learning systems mix signals together, entangling them and making isolation of improvements impossible. For instance, consider a system that uses features x1, ...xn in a model. If we change the input distribution of values in x1, the importance, weights, or use of the remaining n 1 features may all change. [...] No inputs are ever really independent. We refer to this here as the CACE principle: Changing Anything Changes Everything. CACE applies not only to input signals, but also to hyper-parameters, learning settings, sampling methods, convergence thresholds, data selection, and essentially every other possible tweak.22

This is also why "I changed the method and a hyperparameter and it got better" tells you nothing about the method.

Exploration over exploitation (Google tuning playbook)

The Google Research tuning playbook opens by admitting there is "an astonishing amount of toil and guesswork" in getting deep nets to work; their counter is experiment-design discipline:

Although one might think we would spend most of our time trying to maximize performance on the validation set, in practice we spend the majority of our time trying to gain insight into the problem, and comparatively little time greedily focused on the validation error. In other words, we spend most of our time on "exploration" and only a small amount on "exploitation".23

Their experiment-design vocabulary is the reusable part: each round has scientific hyperparameters (the thing you're measuring), nuisance hyperparameters (must be re-tuned for the comparison to be fair), and fixed ones (caveats on your conclusions).

The learning rate is a nuisance hyperparameter because we can only fairly compare models with different numbers of hidden layers if the learning rate is tuned separately for each number of layers (the optimal learning rate generally depends on the model architecture).23

Adam at 3e-4 for baselines (Karpathy)

In the early stages of setting baselines I like to use Adam with a learning rate of 3e-4. In my experience Adam is much more forgiving to hyperparameters, including a bad learning rate.11

If you change the batch size, the learning rate has to move with it: linearly for SGD24 , with an exponent between 0.5 and 1 for Adam25 , and large-batch training without warmup can diverge in the first epoch and look like a code bug24 .

Modern transformers and LLM fine-tuning

Most of the sources above predate large transformers; these come from the people training and fine-tuning them.

Tricks hide in reference code (lucidrains)

lucidrains' x-transformers is a catalogue of training tricks, each tied to its paper. The debugging-relevant one: when a transformer diverges, attention logits blowing up is a prime suspect, and the now-standard fix is QK normalization.

We are nearing the point of wiping out a source of transformer training instability with one simple intervention.26

Scaled-up recipes accumulate these one-line stability fixes in code long before they're written up.

Modern LLM-pretraining gotchas (nanochat)

Karpathy's nanochat is one of the few public records of what scaling a transformer from scratch actually takes. Two gotchas:

Do note that switching to the BOS dataloader changes the validation loss and makes all previous experiments not comparable in absolute value of the loss, because we have a lot fewer "confusing" tokens in the train/val batches. [...] Therefore, the loss appears lower but this is "fake" to some extent.27

Original implementation clipped local gradients before sync. Since this codebase doesn't use DDP (gradient sync is in the optimizers), each rank was clipping based on its own local norm.27

He then removed clipping altogether: "Grad norm never exceeds 1.0 naturally, so clipping is always inactive", and it cost ~2% in time from the all-reduce.27

When NaN hits, look at the frames before it (Stas Bekman)

Bekman wrote the DebugUnderflowOverflow tool during BLOOM-era large-model training. It keeps a rolling buffer of per-module abs-min/abs-max frames, so when inf/NaN is detected you see the run-up rather than only the crash site.

As you can see it's the previous frames that we need to look into when the numbers start going into very large for fp16 numbers.28

Corollary from the same docstring: validate your debugging instrumentation on a few cheap batches before betting an hours-long run on it.

Loss spikes usually mean a bad data pocket (Stas Bekman)

Bekman's ML Engineering book has a gallery of real loss-curve pathologies from BLOOM and IDEFICS training, with the honest caveat that "very often we don't really understand why certain types of spikes happen" and pattern recognition is the realistic goal:

In general there are 3 types of loss spikes: 1. Fast recovering spikes 2. Slow recovering spikes 3. Not fully recovering spikes

The spikes usually happen because of a bad data pocket, either due to badly shuffled data or because it hasn't been cleaned from some garbage scraped from the websites.29

And the post-mortem of the 104B model that diverged for months before BLOOM-176B succeeded:

We think the 2 main obstacles were using fp16 and data that had a lot of garbage in it. For BLOOM-176B we switched to bf16, used much cleaner data and also added an embedding layer-norm and that made all the difference.29

His recommended way to build this intuition: "The best learning is to read Publicly available training LLM/VLM logbooks because there you can see exactly what happened and how the problem has been overcome."29

Walk the pipeline in data order (HF course)

The HF LLM course debugging chapter is a worked narrative in the Karpathy-recipe lineage: a deliberately broken fine-tune, fixed step by step, checking each stage at the exact point it enters the model.

The best way to debug an error that arises in trainer.train() is to manually go through this whole pipeline to see where things went awry. The error is then often very easy to solve.30

Hyperparameter tuning is always emphasized as being the hardest part of machine learning, but it's just the last step to help you gain a little bit on the metric. [...] don't launch into a time-consuming and costly hyperparameter search until you have something that beats the baseline you have on your dataset.30

Chat template and BOS handling must match across train and deploy (unsloth)

When a model trains fine but produces nonsense after export to llama.cpp or Ollama, the cause is usually not the weights:

The most common cause of this error is using an incorrect chat template. It's essential to use the SAME chat template that was used when training the model in Unsloth and later when you run it in another framework, such as llama.cpp or Ollama. [...] It might also be because your inference engine adds an unnecessary "start of sequence" token (or the lack of thereof on the contrary) so ensure you check both hypotheses31

Their FAQ also explains the suspiciously perfect loss curve: when the loss sits at exactly zero, every label has probably been masked out and the model is learning nothing.

All labels in your dataset are -100. Training losses will be all 0.31

Shrink every axis at once, and clear the caches (axolotl)

Axolotl's debugging guide (the general tips trace to Hamel Husain) gives the minimal-repro recipe for training loops: one GPU, one process, a tiny model, tiny data, a single step, no eval. It also warns that caching can quietly undo your experiment, because the run you think you changed may be replaying artifacts produced before the change:

Eliminate concurrency: Restrict the number of processes to 1 for both training and data preprocessing32

Axolotl caches certain steps and so does the underlying HuggingFace trainer. You may want to clear some of these caches when debugging.32

Their training-stability page adds the masking check ("inspect tokenized samples to confirm only the target tokens are trainable") and, bluntly: "Debugging a failed run without metrics is guesswork."33

Start here rather than treating the bibliography as flat:

Folklore sources (the quotes above trace to these):

For modern transformer pretraining specifically (most sources above predate it), see Karpathy's recipe and the nanochat experiment log (320+ empirical HP sweeps for a GPT-2-scale run). For LLM-as-judge eval debugging workflow more broadly, Hamel Husain's "Your AI Product Needs Evals" covers the error-analysis-first approach for LLM products. Most multi-source claims trace to quotes in docs/ml_debug_folklore.argdown (vargdown); the full evidence set is in docs/evidence/.

Does it help?

Measured on ml-bench: 12 hard machine learning research problems from my own work, none of them in any training set, each answer graded against my own answer by a panel of five LLM judges. A score of 1.00 means the model matched me. The test gives the model this SKILL.md and nothing else, so the only change is the document.

No measurable gain, from three answers per question in each arm:

deepseek-v4-flash-0731, 12 questions bare with SKILL.md
mean score +0.643 +0.667
the three runs +0.608, +0.648, +0.674 +0.746, +0.641, +0.614

The difference is +0.023 with a standard error of 0.044, so it is not distinguishable from zero. Pairing by question rather than by run gives the same +0.023 with a standard error of 0.031, t of 0.76. The runs themselves scatter by more than the difference between the two columns.

An earlier version of this section reported +0.135, or 59% of the distance to gpt-5.6-sol. That was one run of each arm, and it happens to be the first run in each column above. It did not survive the other two.

Two other readings. With SKILL.md the model writes 31% more text for the same score, so any verbosity bias in the judges makes the true effect smaller than +0.023, not larger. And only 1 answer in 36 uses the document's own vocabulary, so the document is in the context without changing much of what the model writes. The header does tell it not to quote the document back.

Caveats: one model, three answers per question, one judge panel, at bench version v96. The result is that this document did not help this model on these questions. It is not evidence about a stronger model, a longer task, or an agent that can run code.

Other skills

Citation

@misc{wassname2026mldebug,
  title = {ML Debugging Folklore: A Practitioner Debugging Skill for LLM Agents},
  author = {Michael J. Clark},
  year = {2026},
  url = {https://github.com/wassname/ml_debug/}
}

  1. Matthew Rahtz (Amid Fish), "Lessons Learned Reproducing a Deep RL Paper" — http://amid.fish/reproducing-deep-rl (cache: frame-diff confusion, investigate-confusion, think-more, don't-implement-RL-yourself) ↩︎

  2. Henderson et al., "Deep Reinforcement Learning that Matters" (AAAI 2018) — https://arxiv.org/pdf/1709.06560 (cache: seeds-create-different-distributions, implementation-differences) ↩︎

  3. Andy Jones, "Debugging RL, Without the Agonizing Pain" — https://andyljones.com/posts/rl-debugging.html (cache: anomalies, write-from-scratch, assume-bug, raise-threshold, loss-curve) ↩︎

  4. Goodfellow, Bengio, Courville, Deep Learning, ch. 11 "Practical Methodology" — https://www.deeplearningbook.org/ (cache: one-part-broken-others-adapt, weights-adapt-to-compensate) ↩︎

  5. Neel Nanda, "How to Become a Mechanistic Interpretability Researcher" — https://www.alignmentforum.org/posts/jP9KDyMkchuv6tHwm/how-to-become-a-mechanistic-interpretability-researcher (cache: research-is-false, excitement-is-bullshit, read-your-data) ↩︎

  6. Ulisse Mini, "How to get good at programming" — https://www.lesswrong.com/posts/LTypqBMTSmRrrhb2v/how-to-get-good-at-programming (cache: track-internal-state, brute-force-search, leaky-abstractions) ↩︎

  7. John Wentworth, "Gears-Level Models are Capital Investments" — https://www.lesswrong.com/posts/nEBbw2Bc2CnN2RMxy/gears-level-models-are-capital-investments (cache: gears-dividends, valley-of-bad-theory) ↩︎

  8. Joshua Achiam, "Spinning Up as a Deep RL Researcher" (OpenAI, 2018) — https://spinningup.openai.com/en/latest/spinningup/spinningup.html (cache: fails-silently, test-more-than-one-env, measure-everything) ↩︎

  9. Gwern Branwen, "Unseeing" — https://gwern.net/unseeing (cache: read-what-you-wrote, single-anomaly) ↩︎

  10. Patrick Kidger, "Just Know Stuff" (2023) — https://kidger.site/thoughts/just-know-stuff/ (cache: kludge-definition, junior-developer, never-accept-the-kludge, don't-delete-and-clone) ↩︎

  11. Andrej Karpathy, "A Recipe for Training Neural Networks" (2019) — https://karpathy.github.io/2019/04/25/recipe/ (cache: inspect-data, fixed-seed, overfit-one-batch, Adam-3e-4; note: this is an abridged note with its own "..." elisions) ↩︎

  12. Slav Ivanov, "37 Reasons why your Neural Network is not working" (2017) — https://blog.slavv.com/37-reasons-why-your-neural-network-is-not-working-4020854bd607 (cache: opening anecdote, emergency checklist) ↩︎

  13. Andrew Ng, Machine Learning Yearning (2018 draft), ch. 13-19 on error analysis — https://github.com/ajaymache/machine-learning-yearning (cache: build-first-system, 100-examples procedure, Eyeball/Blackbox dev sets) ↩︎

  14. Vincent D. Warmerdam (koaning), "Bad Labels" (2021) — https://koaning.io/posts/labels/ (cache: bad-labels-huge-problem, confidence-sort trick, spend-less-time-tuning) ↩︎

  15. Gwern Branwen, "The Neural Net Tank Legend" — https://gwern.net/tank (cache: cautionary tale, urban-legend conclusion) ↩︎

  16. Pedro Domingos, "A Few Useful Things to Know About Machine Learning" (CACM, Oct 2012) — https://homes.cs.washington.edu/~pedrod/papers/cacm12.pdf (cache: test-on-train illusion, insidious-contamination, overfitting-bugbear, features-are-key) ↩︎

  17. Michael A. Lones, "How to avoid machine learning pitfalls" (2021, updated annually) — https://arxiv.org/pdf/2108.02497 (cache: full do/don't TOC, leakage, look-ahead bias). Aimed at beginners but the most exhaustive checklist here: 36 do/don'ts across data prep, training, evaluation, comparison, and reporting. ↩︎

  18. Stanford CS231n, "Neural Networks Part 3" — https://cs231n.github.io/neural-networks-3/ (cache: overfit-tiny-subset) ↩︎

  19. Andrej Karpathy, "most common neural net mistakes" tweet thread, 1 Jul 2018 — https://x.com/karpathy/status/1013244313327681536 (cache: tweets 1-3 verbatim, cross-checked against threadreaderapp; x.com itself blocks fetching) ↩︎

  20. Alex Irpan, "Deep Reinforcement Learning Doesn't Work Yet" (2018) — https://www.alexirpan.com/2018/02/14/rl-hard.html (cache: variance-bug-or-unlucky, seed-canary) ↩︎

  21. John Schulman, "Nuts and Bolts of Deep RL Research" slides — http://joschu.net/docs/nuts-and-bolts.pdf (cache: Always-Be-Ablating, standardize-observations; clean slide transcript) ↩︎

  22. Sculley et al., "Hidden Technical Debt in Machine Learning Systems" (NIPS 2015) — https://papers.nips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf (cache: abstract, CACE/entanglement, ensemble caveat) ↩︎

  23. Godbole, Dahl, Gilmer, Shallue, Nado, "Deep Learning Tuning Playbook" (Google Research / Google Developers, 2023; Google Developers page last updated 2025-08-25) — https://developers.google.com/machine-learning/guides/deep-learning-tuning-playbook (cache: exploration-over-exploitation, scientific/nuisance/fixed, incremental-tuning) ↩︎

  24. Goyal et al., "Accurate, Large Minibatch SGD" (2017) — https://arxiv.org/pdf/1706.02677 ↩︎

  25. McCandlish, Kaplan et al., "An Empirical Model of Large-Batch Training" (2018) — https://arxiv.org/pdf/1812.06162 (cache) ↩︎

  26. Phil Wang (lucidrains), x-transformers README — https://github.com/lucidrains/x-transformers (cache: post-embedding LayerNorm / BLOOM+YaLM, attention-overflow / cosine-sim norm, autoregressive validation, "wiping out a source of instability" / QK RMSNorm) ↩︎

  27. Karpathy, nanochat experiment log (cache) ↩︎

  28. Stas Bekman, DebugUnderflowOverflow docstring, transformers debug_utils.py (2021) — https://github.com/huggingface/transformers/blob/main/src/transformers/debug_utils.py (cache: purpose, detection-and-frame-buffer, previous-frames) ↩︎

  29. Stas Bekman, Machine Learning Engineering Open Book, "Understanding Training Loss Patterns" + "Instabilities" — https://github.com/stas00/ml-engineering (cache: heartbeat, 104B post-mortem, spike types + bad-data-pocket, init-std, PaLM batch-skipping, logbooks) ↩︎

  30. Sylvain Gugger et al., HF LLM Course ch. 8.4, "Debugging the training pipeline" — https://huggingface.co/learn/llm-course/chapter8/4 (cache: walk-the-pipeline, overfit-one-batch, no-tuning-before-baseline) ↩︎

  31. Unsloth (Daniel & Michael Han-Chen), "Troubleshooting & FAQs" — https://docs.unsloth.ai/basics/troubleshooting-and-faqs (cache: template-mismatch + BOS, shuffle-eval, all-labels100-loss-0) ↩︎

  32. Axolotl, "Debugging" (general tips: Hamel Husain) — https://docs.axolotl.ai/docs/debugging.html (cache: simplify, one-process, small-model + fast-iteration, caches) ↩︎

  33. Axolotl, "Training Stability" — https://docs.axolotl.ai/docs/training_stability.html (cache: metrics-from-the-start, inspect-tokenized-masking, reward-fn-standalone) ↩︎

S
Description
No description provided
Readme
5.7 MiB
Languages
Python 98.9%
Just 1.1%