Unit 2 of 10 · about 5 hours · implement

Experiment lineage and reconstructing a real training codebase

A recipe name does not specify an experiment. Reconstructing the executed path exposes configuration overrides and hidden transformations before they become explanations for a gain.

You'll be able to

  • Trace one real SFT path from launch arguments through tokenization, masking, loss, update and checkpoint publication.
  • Attach resolved configuration, source revision, environment and artifact digests to each experiment edge.
  • Separate a historical released recipe from the current code path used for your modification.

Covers

Configuration, code, environment, artifact and evaluation lineageReconstructing launch, configuration, data, model, objective, trainer and evaluation paths
1

Read

In this order, only the parts listed

0 of 2 done

  1. Open Instruct: reconstruct the SFT execution pathOpen Instruct

    FlatArguments, main, dataset construction with get_cached_dataset_tulu, model and optimizer construction, training loop, checkpoint and final-save branches

    Read, do not launch the default recipe. Follow sft_tokenize_mask_out_prompt_v1 and mask_labels in dataset_transformation.py at the same revision. Keep native evaluation launchers outside your independent evaluation path.

  2. The Turing Way: capture the execution environmentThe Turing Way - Reproducible Research

    Reproducible Environments: Summary, What is a Computational Environment?, and Motivation and Background (page read 2026-10-16)

2

Focus on

  • Record the effective values after CLI overrides, model loading and dataset transformations. A configuration file alone omits runtime decisions and inherited defaults.
  • Trace a real message into token IDs and labels, then into the scalar loss and optimizer update. Distinguish final-assistant-only targets from all-assistant targets; the two named masking paths have different contracts.
  • The Programming unit on dependency locks, run manifests and quality gates already records the environment. Add dataset-transform fingerprints, upstream checkpoint digests and evaluator identity rather than another generic environment tutorial.
  • Read the OLMo 2 release as a historical case. A newer OLMo-core or Open Instruct revision does not retroactively identify the code that trained that release. Record unknown historical edges as unknown.
Common mistakes · 3
  • Recording a Git commit while ignoring an uncommitted patch. Store both the base revision and the patch digest.
  • Treating a dataset cache hit as proof that tokenizer, template and filtering settings match. Check the cache's identity contract.
  • Tracing only the forward call. Reduction, accumulation, clipping and scheduler placement can change the effective objective or update.
3

Try it yourself

Closed-book, before checking anything

Close the source and reconstruct the SFT call graph from arguments to saved policy. Reopen it and correct each unsupported edge. In lmlab, serialize one resolved run record and verify every parent digest before accepting its outputs; changing a parent identity must invalidate that binding rather than relabel an old result.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.What does a clean source revision fail to identify?Answer

    Data and model revisions, resolved arguments, environment, external evaluators and any local patch. Those belong in the run record too.

  2. 2.Why inspect both prompt masking and the training loss?Answer

    Correct labels can still receive wrong weighting through reduction or accumulation. Trace which tokens contribute and their denominator through the update.

  3. 3.An old checkpoint loads under current code. Have you reconstructed its training recipe?Answer

    No. Load compatibility establishes only that loading succeeded. Historical code, configuration, data and update semantics still need evidence.

You're done when

Your trace names the executed data, masking, objective, update and save functions, and a changed upstream identity is caught before old outputs enter a comparison.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 9 more in the section
  • Open InstructAllen Institute for AI · required

    Read one recipe path (open_instruct/finetune.py, dpo.py or grpo_fast.py) with its tests and the chat-template and label-masking code in dataset_transformation.py. Make a bounded tested change on a small model or fixture. Its native evaluations are unmaintained and its single-GPU smoke launcher needs Beaker, so evaluate with a separately pinned evaluator.

  • The Turing Way - Reproducible ResearchThe Turing Way Community · support

    Use the chapters on reproducible environments, testing, code review, research data management and research compendia (under book.the-turing-way.org/reproducible-research/) to package the final artifact for an independent clean run.

Also in this section

  • LLM Post-Training LaboratoryRoadmap-Final · primary

    Complete the project through its baseline, SFT, preference or reward, RL or reasoning, evaluation, failure campaign, reproduction and extension gates. Keep one versioned artifact chain across the whole track.

  • OLMo Fully Open Training StackAllen Institute for AI · required

    Read Section 6 (clusters, Beaker, stability and operations, hardware utilization, environmental cost) and the evaluation appendices, then trace one released configuration from data and tokenizer through OLMo-core training code, checkpoints and evaluation. Reconstruct only the paths your modification touches and record what was measured versus inferred.

  • CS336 Assignments 4 and 5 - Integration HandoffStanford University · support

    Reuse the data and alignment artifacts already completed. Connect their versions through a single manifest and rerun one clean baseline before the extension.

  • RLHF Book Companion CodeNathan Lambert · support

    Use one complete module path (for example direct_alignment/ or policy_gradients/) as the small reference implementation, with model, context and sample sizes cut to fit your GPU. Trace one objective end to end, add resume and regression coverage, then compare the modified and unchanged paths.

  • NeurIPS Paper ChecklistNeurIPS · support

    Answer Q1 (claims), Q4 to Q8 (reproducibility, code and data, settings, uncertainty, compute including failed runs) and Q11 to Q13 where you share artifacts, as the claim and evidence contract for the final report. Skip the submission rules.

  • Tulu 3, Section 8.2 (Insights from the Unfruitful)Allen Institute for AI · support

    Read Section 8.2 for how a team reports what did not work, then write your own negative results the same way.

  • nanoGPT and TRL as Modifiable CodeAndrej Karpathy; Hugging Face · support

    If OLMo-core or Open Instruct is too heavy for your machine, make the bounded tested change in nanoGPT (commit 3adf61e) or in a TRL 1.15.0 trainer or collator instead, with a frozen-batch oracle before and after.

  • How to Scale Your ModelJAX ML Team · depth

    Use the roofline, sharding, training, transformers, profiling and GPU parts (/scaling-book/roofline, /sharding, /training, /transformers, /profiling, /gpus) only to defend the analytical distributed plan. Measured multi-device work belongs to the ML Systems track.

  • Machine Learning Engineering - Fault Tolerance and ReproducibilityStas Bekman · reference

    Use training/fault-tolerance/, training/reproducibility/README.md and training/emulate-multi-node.md for the vocabulary of the analytical failure and retry plan.