Tune the baseline before trusting a deep-learning result

Tatsunori Hashimoto explains how hyperparameters, scaling, randomness and matched controls shape reliable experiments.

THTatsunori Hashimoto登壇者 · Stanford University
チャンネル
Stanford Online
公開日
2026年11月24日
動画
1:17:43
読了時間
9 分
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

A model that appears to beat a baseline may simply have been tuned more carefully. Stanford professor Tatsunori Hashimoto shows examples where changing learning rate or weight decay altered the apparent research conclusion, then explains why optimal settings can move with model scale. Small models and scaling ladders make experiments cheaper, but a convincing fit can still fail at the largest run. To interpret and debug results, he recommends measuring variation, pairing comparisons and examining internal statistics against a known-good control.

  1. 1Learning rate can overturn a seemingly clear comparisonHashimoto shows cases where tuning an existing method or baseline changed the research conclusion. He recommends starting with learning rate when tuning resources are limited.
  2. 2Good settings shift with batch size and model scaleA Step Law sweep shows a roughly quadratic loss curve in log learning rate and dependencies between learning rate and batch size. A default that works can still leave material performance unused.
  3. 3A convincing scaling fit can fail at the largest runHashimoto describes a Marin training run that departed from a fit that looked good at smaller scales. Hyperparameter scaling and accounting choices are among the complications.
  4. 4Small differences can be amplified during trainingIn a study he discusses, varying initialization, data order or augmentation separately produced similar final variation. He compares the dynamics to a chaotic system.
  5. 5Paired evaluations remove shared example difficultyComparing two methods on the same items can isolate their differences from variation caused by the items themselves.
  6. 6Internal statistics can warn before loss divergesA query-key normalization example shows an attention statistic rising before a large run fails. Hashimoto recommends comparing such signals with a known-good control.

ポイント

  1. If only one hyperparameter can be tuned, Hashimoto recommends starting with the learning rate.
  2. Tune the baseline as well as the proposed method before attributing a gain to a new idea.
  3. Use small-scale experiments and scaling ladders, but verify that relationships survive at larger scales.
  4. Measure run-to-run variation and use paired comparisons when evaluating methods on the same examples.
  5. For debugging, track internal statistics against a known-good control and change one thing at a time.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
01

Hyperparameters and the danger of an untuned baseline

Hashimoto frames deep learning as an experimental science. He shows examples in which careful tuning changes the apparent outcome of a comparison.

Tatsunori Hashimoto frames deep learning as an experimental discipline. Results described in papers do not necessarily transfer reliably to the course's toy system, so students need to test the phenomena themselves rather than assume that a published result applies unchanged.

He describes an experiment loop: a researcher has an idea, implements it, runs a test, observes the outcome and updates their understanding. Progress depends on a fast loop, careful interpretation and experiments that make good use of time and computing resources.

The lecture separates four skills: tuning hyperparameters, scaling experiments efficiently, understanding stochasticity and debugging. Hashimoto calls these partly craft skills: no single procedure replaces experience across all settings.

A hyperparameter is broadly a choice not directly learned from the data, including the optimizer, learning rate and architecture. When a run fails, the output tells you that something in the bundle of choices went wrong, but not which choice caused it.

To attribute an experimental result to a new idea, the other settings need to be chosen carefully and held comparable. If he could tune only one setting, Hashimoto would tune the learning rate: empirically it is often highly sensitive, though he offers no theoretical reason it must always be so.

Other settings, such as Adam's momentum parameters, often matter less in his experience. Model size and training steps also matter but change the compute budget, so experiments commonly keep them fixed while adjusting settings such as the learning rate.

For a first example, Hashimoto recounts work on privacy-preserving language-model fine-tuning. A straightforward algorithm appeared to perform poorly with ordinary batch sizes and learning rates, supporting a belief that the problem needed more elaborate methods.

A student instead swept hyperparameters and found a high-performing region at much larger settings than the usual training recipe. Hashimoto says this made a simple private optimization method useful and changed the direction of subsequent work.

A second case concerned repeated training on limited data. With a standard recipe, additional passes appeared to stop helping or make results worse. More extensive tuning, including stronger weight decay, produced a qualitatively different curve and better results.

His third case compares optimizers. New methods appeared to outperform AdamW under the reported baseline settings, but in the examples he shows, retuning AdamW's learning rate or weight decay erased or reversed the apparent advantage. He stresses that the issues are easier to see in hindsight than when the original experiments are designed.

The search space is large and some parameters interact. Tuning is feasible partly because researchers have developed reasonable defaults and partly because many choices can be adjusted without simultaneously retuning everything else. Learning rate and batch size are one pair that can interact.

02

How to search efficiently as scale changes

Learning rate and batch size interact and their optima move with model and data size. Small-model sweeps and batching can make tuning more economical.

Hashimoto turns to the Step Law study as an example of a hyperparameter sweep. It plots final loss against choices such as learning rate and batch size for language-model training, then asks how the best choices move as models and datasets grow.

In the displayed experiments, loss as a function of log learning rate looks roughly quadratic, with the minimum shifting as batch size changes. A joint view shows correlation between the settings, so moving them together can preserve near-optimal performance.

Defaults can be forgiving: the usual Adam learning rate often avoids catastrophic failure across a range of settings. But a run that works reasonably well can still leave performance on the table, enough to change the outcome of a close comparison.

The study also shows optimal settings changing with model and data size. Hashimoto cautions students not to memorize the exact dependencies as universal laws; the important point is that a good setting at one scale may not be best at another.

Retuning every large model would be costly, so researchers want to learn which settings matter, how they interact and whether small-scale findings can transfer. Experimental hygiene includes being alert to these choices even when they feel less interesting than a new architecture.

For many small-model sweeps, GPU utilization can be poor because operations are small. Hashimoto describes using vmap in JAX or PyTorch to batch compatible runs with the same tensor shapes, reducing repeated operation-launch overhead.

He advises choosing a scale small enough to permit meaningful tuning while still being relevant to the intended use. A single expensive run with an untuned setting may teach less than a number of smaller, controlled experiments.

03

Scaling ladders are useful but can break

Small models can serve as experimental stand-ins for larger ones. Hashimoto explains why extrapolation and hyperparameter transfer still require careful engineering.

The next question is how to make experiments cheaper without losing their relevance. Hashimoto compares small models with model organisms in biology: researchers use simpler systems to learn before moving toward the costly setting they ultimately care about.

Machine learning has an advantage in this analogy because model complexity can often be varied continuously. A scaling ladder trains models at multiple sizes, allowing researchers to examine whether patterns found cheaply can inform a larger run.

He notes that a simple scaling relationship is not guaranteed by theory. Nevertheless, many empirical curves are close to straight lines on suitable logarithmic axes over useful ranges, making extrapolation a practical tool.

Hashimoto traces examples from early work that predicted large-dataset performance using smaller datasets, through later studies of translation and neural networks. He credits work in the late 2010s with emphasizing the implications of scaling model and data size, not just the savings from small experiments.

A useful mental picture has three regions: guessing with almost no data, a range where error improves predictably as data grows, and eventual saturation for a fixed model. The relationship between data and performance need not remain linear forever.

Scaling relationships can also help allocate a fixed budget between model size and training data. Hashimoto cites Chinchilla-style fits as examples of jointly describing error using both quantities, while noting that pretraining often gives cleaner relationships than other domains.

He cautions that scaling laws are engineered, not automatic. In a Marin example, a fit looked persuasive across small and intermediate runs, but the largest run failed to follow the prediction. The team investigated and changed the setup before obtaining a better fit later.

One source of error is that optimal learning rate and batch size themselves change with scale. Another is how researchers count parameters and operations: different accounting choices can shift fitted relationships and help explain disagreement between studies.

Hashimoto shows that published proposals for scaling hyperparameters can disagree substantially even when the groups have trained strong models. The hope is to develop settings or invariances that transfer from small to large models, reducing the need for repeated expensive searches.

04

Randomness, chaos and paired comparisons

Training variation can arise from several sources and tiny changes may amplify. Matched examples help distinguish a real difference from shared variation.

The lecture then asks how to tell whether two nearby experimental results differ meaningfully. Neural-network training contains randomness from the sampled data and its order, the initial parameters and, where used, dropout or random augmentation.

Random initialization also breaks symmetry so different parts of a network can learn different things. Fixing a seed makes a particular sequence repeatable, but does not remove the need to understand how results vary across different initial conditions.

Hashimoto discusses an image-classification study that varied initialization, data order and augmentation separately. Each produced a similar scale of final variation, and turning all three on increased it only slightly rather than adding their variances in a simple way.

He interprets this as a sign that tiny early differences can be amplified until runs differ as much as they would under other random choices. This is closer to a chaotic system such as a double pendulum than to a picture in which a small perturbation simply remains small.

He points to Edge of Stability work: full-batch training with a small learning rate can produce a smooth loss curve, while increasing the rate can create irregular spikes even without random minibatch selection. The behavior can look stochastic despite a deterministic setup.

The practical lesson is to know the run-to-run variation of the system. Small differences in loss are not automatically meaningless: examples in published architecture studies show differences that are small in absolute terms but consistent relative to their standard errors.

Hashimoto also recommends paired comparisons when both methods are evaluated on the same examples. If examples vary greatly in difficulty, examining each method's difference on the same item can remove shared variation and make a comparison more informative than looking only at separate error bars.

He advises treating training as potentially stochastic, learning the rough size of variation and understanding where it comes from. In his experience, that intuition often helps decide when additional statistical testing or repeated runs are needed.

05

Debug using loss curves and internal measurements

Know what normal training looks like, then inspect activations, gradients and other statistics. Matched controls and one-change-at-a-time experiments can narrow down failures.

Debugging begins with knowing what normal looks like. Training can fail outright, progress too slowly or show no expected gain; an investigator needs both external measures such as loss and internal measurements of what is happening in the network.

Internal observables include activations during the forward pass, gradients and signals propagated backward, parameters and the optimizer's state. They can help locate an anomalous layer or show how a run evolves over time.

Loss curves are a useful first diagnostic, but their normal shape depends on the setting. Hashimoto contrasts relatively interpretable pretraining curves with reinforcement-learning runs whose reward curves may look noisy even when the outcome is good.

Learning-rate schedules leave visible signatures on loss. As a schedule lowers the learning rate, loss can drop in a corresponding pattern; if the rate is raised again, the curve may rise. A late loss drop may reflect the schedule rather than a mysterious new capability.

Looking inside the network can reveal more. Hashimoto revisits initialization research that examined activation scales across layers and chose a scheme that kept signals from collapsing or exploding as they moved forward and backward.

He next describes work on where to place layer normalization in a transformer. Comparing gradient statistics across layers can reveal an imbalance; a change in placement can make those statistics more even and improve training stability.

A further example is query-key normalization in attention. In the example he shows, a large model without the normalization eventually diverges, while an internal attention statistic had risen abnormally before the loss made the failure obvious.

An unusual internal value is not by itself proof of a cause. Hashimoto recommends comparing it with a known-good control, such as a smaller model, and building intuition about which deviations require intervention and which the architecture can tolerate.

Layer normalization provides an example of an invariance that can complicate diagnosis: large parameter norms may be less immediately harmful if normalization controls the signals entering later computations. A researcher needs to understand the system rather than react to every large number in isolation.

For a live example, he reviews an open Marin investigation. A large run showed rapidly growing attention-related norms compared with smaller runs. The team traced the effect through internal activations and considered how normalization and other parts of the network affected its consequences.

The team judged the growth concerning over the long term but not an immediate failure, and added modest weight decay rather than making a drastic architectural change. Hashimoto uses the case to illustrate controls, internal measurements and careful evaluation of whether an anomaly is fatal.

His final debugging advice is to change one thing at a time. If several fixes are applied together, it becomes hard to know which caused the result and hard to build a reliable mental model.

Where possible, interpolate between a known working model and the broken one: add or remove changes gradually until the behavior changes. He closes by urging students to run efficient experiments, question misleading results and use tightly matched controls.

同じチャンネルの記事

1:08:38EN
Stanford Online· 2026年11月24日Stanford’s deep-learning course teaches students to predict experimentsTatsunori Hashimoto, Suhas Kotha · Stanford UniversityA small language model and repeated quizzes test intuition; one demonstration shows why a component can look broken until its learning rate is tuned.Deep LearningPretraining & midtrainingNeural Networks
56:46EN
Stanford Online· 2026年11月23日Amy X. Zhang: AI agents need shared plans and continual alignmentAmy X. Zhang · University of WashingtonResearch on cooperative work suggests better ways to divide tasks, notice agent activity and adjust to changing social preferences.Human-AI CollaborationAI agentsAI interface design+2
1:44:59EN
Stanford Online· 2026年11月21日Evaluate LLMs by the Work You Need Them to DoAfshine Amidi, Shervine Amidi · Stanford UniversityHuman ratings, model judges and benchmarks each miss different failures; Stanford’s instructors show how to combine and test them.評価(Evals)AI agentsモデルと学習+1
1:00:02EN
Stanford Online· 2026年11月20日Philip Guo: The Small Choices That Kept Python Tutor AlivePhilip Guo · UC San DiegoA free code visualizer reached nearly 30 million people through instant access, a narrow mission and years of careful maintenance.EducationProgramming Languagesプロダクトと UX+2
48:59EN
Stanford Online· 2026年11月19日Cynthia Bailey: Choose AI models for the task and guard your API keysCynthia Bailey · Stanford UniversityStanford’s Cynthia Bailey shows how token overhead, repeated agent steps and exposed credentials turn AI use into real costs.AI cost & performanceAI agentsAI Safety+1
49:17EN
Stanford Online· 2026年11月19日Stanford graduate study: start with a course before committing to a degreePax Heymeyer, Jonathan Nottman · Stanford Engineering Center for Global and Online EducationStanford’s online team explains course-by-course admission, credit, workload, exams and 2026–27 tuition.Education