# 092 SOURCE_MAP — verified 2026-10-05 Independent teaching orchestration calls unmodified official installed APIs. No upstream executable code copied. Five source files anonymously re-read and byte-compared with installed packages; see upstream_verification.json. Model/data resources use exact revisions and20file hashes in resources.lock.json. | Module/formula | Actual official fixed source | Local implementation and differences | |---|---|---| | Chat templating | Transformers4.49.0 [apply_chat_template L1527](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/tokenization_utils_base.py#L1527), [special-token handling L1723](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/tokenization_utils_base.py#L1723) | templates.py/messages changes user instruction only; real tokenizer chat template unchanged. common.py/build verifies exact prefix boundary, removes trailing newline, retains assistant EOS | | Llama output/logits | [LlamaForCausalLM forward L859](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/models/llama/modeling_llama.py#L859) | run.py uses AutoModelForCausalLM; actual input[1,83],hidden[1,83,576],logits[1,83,49152] | | Masked shifted cross-entropy | [ForCausalLMLoss L32–48](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/loss/loss_utils.py#L32), [denominator L24](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/loss/loss_utils.py#L24) | common.py/collate labels prefix/pad=-100, no ID-based EOS masking; run.py independent shifted CE check.64steps×16valid tokens=1024. Reconstructs prior checkpoint only, no new training contrast | | Deterministic decoding | [generate L1879](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/generation/utils.py#L1879), [argmax L3259](https://github.com/huggingface/transformers/blob/a22a4378d97d06b7a1d9abad6e0086d30fdea199/src/transformers/generation/utils.py#L3259) | run.py/ev,greedy32,first argmax504 checked against generation,no truncation | | SGD | PyTorch2.6.0 [step L104](https://github.com/pytorch/pytorch/blob/2236df1770800ffea5697b11b0bb0d910b2e59e1/torch/optim/sgd.py#L104), [update L353](https://github.com/pytorch/pytorch/blob/2236df1770800ffea5697b11b0bb0d910b2e59e1/torch/optim/sgd.py#L353) | run.py optional exact64step regeneration,lr.001/no momentum/decay,clip1. Numeric state hashing independent teaching implementation | | F/C/J and paired delta | Our prespecified protocol, not a published benchmark metric implementation | scoring.py and audit.py independently parse format/unique-label proxy; run.py/pairs retains win/tie/loss rather than selected best template. Delta=sum(J_variant-J_original)/n | | Template robustness motivation | [Sclar et al.ICLR2024,arXivv2](https://arxiv.org/abs/2310.11324v2); [Yan et al.FindingsACL2024](https://aclanthology.org/2024.findings-acl.613/) | We do NOT implement FormatSpread search or CoIN training; only borrow the research question. Six fixed templates, no optimized prompt search | Transformers repository https://github.com/huggingface/transformers at a22a4378d97d06b7a1d9abad6e0086d30fdea199, Apache-2.0; PyTorch https://github.com/pytorch/pytorch at2236df1770800ffea5697b11b0bb0d910b2e59e1, BSD-style. License files retained verbatim. Access date2026-10-05; upstream_verification.json contains actual HTTP/byte-equality evidence. Model/tokenizer HuggingFaceTB/SmolLM2-135M-Instruct12fd25f77366fa6b3b4b768ec3050bf629380bac,Apache2.0. SST2 8d51e7e4887a4caaa95b3fbebbf53c0490b58bbb and AG News eb185aade064a813bc0b7f42de02595523103ca4 have unknown license in pinned cards; no raw data redistribution. Original papers and mirror distinction described in THIRD_PARTY.md. common.py/mixture.py/scoring.py/prepare.py are byte-identical self-written modules from [091 fixed source](https://github.com/distance539/ai-research-lab/tree/7bd49bd7d6c1cd950d58506cfe7d4e962d161c85/cycle06/091-data-mixture-retention), included completely. mixture.py/select reuses splits; its news training/scheduling helpers are retained for provenance but NOT called in092. New run.py,templates.py,audit.py are independent teaching implementations. No hidden parent-directory imports. This is not an official SmolLM training recipe, and no copied third-party executable code is relicensed.