Publish the verified sample provenance and canonical study explorer
Browse filesFiles changed (25)
- research/README.md+43-17
- research/docs/explorer.js+1-1
- research/docs/figures/curves.png
- research/docs/index.html+4-4
- research/docs/study.json
- research/reports/experiments/abstracts-pilot-s00-trace-r03-fp64/experiment.mdAdded+11
- research/reports/experiments/abstracts-pilot-s00-trace-r03-fp64/learnings.mdAdded+5
- research/reports/experiments/experiments.md+1
- research/reports/experiments/learnings.md+2
- research/reports/paper.pdf
- research/reports/plan.md+1-1
- research/reports/progress.md+2-2
- research/reports/summary.md+3-3
- research/results/abstracts-pilot-s00-trace-r03-fp64/config.jsonAdded+18
- research/results/abstracts-pilot-s00-trace-r03-fp64/evaluation.jsonlAdded+4
- research/results/abstracts-pilot-s00-trace-r03-fp64/events.jsonlAdded+22
- research/results/abstracts-pilot-s00-trace-r03-fp64/state.jsonAdded+8
- research/results/verification/tests.json+30-25
- research/src/thirdloss/records.py+3
- research/src/thirdloss/release.py+1-2
- research/src/thirdloss/report_paper.py+8-12
- research/src/thirdloss/report_records.py+11-3
- research/src/thirdloss/reporting.py+5-9
- research/src/thirdloss/study.py+5-4
- research/tests/test_reporting.py+8
36 unmodified lines37383940404142424344454647484849505126 unmodified lines7879808181828383848586878817 unmodified lines10610710810710911011111211311419 unmodified lines13413513613313713813914014114216 unmodified lines15916016115616216316416516616716 unmodified lines18418518617918718818919019119215 unmodified lines20820921020121121221321421521611 unmodified lines22822923021923123223323423523613 unmodified lines25025125223925325425525625725811 unmodified lines27027127225727327427527627727811 unmodified lines29029129227529329429529629729811 unmodified lines31031131229331331431531631731811 unmodified lines33033133231133333433533633733811 unmodified lines35035135232935335435535635735836 unmodified linesA same-probe check on pretrained Pythia found that single-precision arithmetic materially changed the third-order training gradient. The first adapter pilot is archived as a numerical diagnostic. The corrected adapter arms evaluate derivatives in double precision while ordinary training and prediction use the GPU. [Pre-test precision amendment](reports/amendments/adapter-precision.md) · [Full-model numerical checks](results/verification)
<!-- RESULTS:START -->[Explore the results](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/) · [Paper](reports/paper.pdf) · [Run ledger](reports/experiments/experiments.md)[Explore the results](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/) · [Paper](reports/paper.pdf) · [Run ledger](reports/experiments/experiments.md)
Recorded 18 runs, including 18 with a completed summary.Recorded 19 runs, including 18 with a completed summary.
**TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
**Research abstracts.** Awaiting paired test results (0 of 8 full-horizon training triplets).
**TinyStories development pilot.** At 2,097,152 training targets, the third-order run recorded 0.00004 nats per target token lower against Ordinary AdamW, 0.00024 nats per target token lower against Trace + third derivative, 0.00175 nats per target token lower against Squared Hessian norm, 0.00032 nats per target token lower against Randomized gradient signs, 0.00034 nats per target token lower against Hessian trace. These are single-seed descriptions using selected on development.**TinyStories development pilot.** At 2,097,152 training targets, the third-order run recorded 0.00004 nats per target token lower against Ordinary AdamW, 0.00024 nats per target token lower against Trace + third derivative, 0.00175 nats per target token lower against Squared Hessian norm, 0.00032 nats per target token lower against Randomized gradient signs, 0.00034 nats per target token lower against Hessian trace. These are single-seed descriptions using strengths selected on development.
**Research abstracts development pilot.** At 65,536 training targets, the third-order run recorded 0.00091 nats per target token higher against Ordinary AdamW. These are single-seed descriptions using initial pilot strengths.
26 unmodified lines
### Recorded predictions
First archived sample in run-ID order per stage and method. [All continuations](reports/experiments/experiments.md)First registered checkpoint and sample in run-ID order per stage and method. [All continuations](reports/experiments/experiments.md)
<details><summary>Research abstracts · Initial checkpoint</summary><details><summary>Research abstracts · Initial checkpoint · control, seed 0</summary>
[Recorded sample](results/abstracts-control-s00-initial-r00/samples.jsonl)
**Prompt**
17 unmodified lines
</details>
<details><summary>Research abstracts · Unigram</summary><details><summary>Research abstracts · Unigram · control, seed 0</summary>
[Recorded sample](results/abstracts-control-s00-unigram-r00/samples.jsonl)
**Prompt**
19 unmodified lines
</details>
<details><summary>Research abstracts · Ordinary AdamW</summary><details><summary>Research abstracts · Ordinary AdamW · pilot, seed 0</summary>
[Recorded sample](results/abstracts-pilot-s00-ce-r00/samples.jsonl)
**Prompt**
16 unmodified lines
</details>
<details><summary>Research abstracts · Third derivative</summary><details><summary>Research abstracts · Third derivative · pilot, seed 0</summary>
[Recorded sample](results/abstracts-pilot-s00-third-r03-fp64/samples.jsonl)
**Prompt**
16 unmodified lines
</details>
<details><summary>Research abstracts · Hessian trace</summary><details><summary>Research abstracts · Hessian trace · pilot, seed 0</summary>
[Recorded sample](results/abstracts-pilot-s00-trace-r01-fp64/samples.jsonl)
**Prompt**
15 unmodified lines
</details>
<details><summary>TinyStories · Initial checkpoint</summary><details><summary>TinyStories · Initial checkpoint · control, seed 0</summary>
[Recorded sample](results/stories-control-s00-initial-r00/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Unigram</summary><details><summary>TinyStories · Unigram · control, seed 0</summary>
[Recorded sample](results/stories-control-s00-unigram-r00/samples.jsonl)
**Prompt**
13 unmodified lines
</details>
<details><summary>TinyStories · Ordinary AdamW</summary><details><summary>TinyStories · Ordinary AdamW · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-ce-r00/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Trace + third derivative</summary><details><summary>TinyStories · Trace + third derivative · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-combined-r01/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Squared Hessian norm</summary><details><summary>TinyStories · Squared Hessian norm · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-hessian_norm-r03/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Randomized gradient signs</summary><details><summary>TinyStories · Randomized gradient signs · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-sham-r01/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Third derivative</summary><details><summary>TinyStories · Third derivative · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-third-r01/samples.jsonl)
**Prompt**
11 unmodified lines
</details>
<details><summary>TinyStories · Hessian trace</summary><details><summary>TinyStories · Hessian trace · pilot, seed 0</summary>
[Recorded sample](results/stories-pilot-s00-trace-r01/samples.jsonl)
**Prompt**
1 unmodified line234556781 unmodified line// Browser APIs: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D
"use strict";
const element = id => document.getElementById(id);
const repository = "https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss";
const repository = document.querySelector("a.source").href;
const local = ["localhost", "127.0.0.1", "[::1]"].includes(location.hostname) ||
new URL(location.href).searchParams.get("live") === "1";
const metrics = {16 unmodified lines17181920202122231 unmodified line252627282829303159 unmodified lines919293949495969798999910010110216 unmodified lines <nav aria-label="Study sections">
<a href="#curves">Training</a><a href="#evidence">Evidence</a><a href="#outputs">Outputs</a><a href="#method">Method</a>
</nav>
<a class="source" href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss">Repository ↗</a>
<a class="source" href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian">Repository ↗</a>
</div>
</header>
<main id="top">1 unmodified line <div>
<h1>Third derivatives in<br>language-model training</h1>
<p>Does penalizing changes in loss curvature improve next-token predictions? Compare ordinary training, Hessian-trace regularization, and a third-derivative penalty at equal training tokens.</p>
<a class="protocol" href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/blob/main/reports/preregistration.md">Read the preregistration <span aria-hidden="true">↗</span></a>
<a class="protocol" href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/blob/main/reports/preregistration.md">Read the preregistration <span aria-hidden="true">↗</span></a>
</div>
<div class="summary" aria-label="Study totals">
<div><span>Completed runs</span><strong id="runs-count">—</strong></div>59 unmodified lines </div>
</section>
<section id="method">
<div class="section-title"><h2>Method</h2><a href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/blob/main/reports/paper.pdf">Read the paper ↗</a></div>
<div class="section-title"><h2>Method</h2><a href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/blob/main/reports/paper.pdf">Read the paper ↗</a></div>
<p class="prose">Hochreiter and Schmidhuber proposed that among equally good training fits, flatter minima may generalize better. If weights can be rounded more coarsely and still fit, a good predictor can take fewer bits to describe. Here the test of generalization is how well the model predicts unseen tokens. <a href="https://people.idsia.ch/~juergen/fm/node1.html">Flat Minima (1997) ↗</a></p>
<p class="prose">The Hessian describes local loss curvature. On active updates, two independent random sign vectors estimate how quickly that curvature changes for the next-token loss of two text windows. The derivatives cover all TinyStories decoder weights or only Pythia’s trainable attention adapters, including interactions between trainable weights.</p>
<p class="prose">When moving away from a flat bottom makes curvature change faster, the third-derivative penalty can pull the weights back. A steep bowl with constant curvature receives zero penalty from this term. Whether the optimizer finds wider minima is a separate question from the measured next-token loss.</p>
<img class="architecture" src="figures/penalty-directions.png" alt="Analytic loss curves. Trace and third-derivative penalties push in opposite directions at an asymmetric minimum. They pull displaced weights back in a flat quartic and give zero update in a steep quadratic." loading="lazy">
<p class="curve-note">Circles mark the ordinary loss minima. Arrows show downhill directions for each penalty. The vertical scales vary by panel. <a href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/blob/main/docs/third-derivative-penalty.md#when-can-the-penalty-favor-a-wider-minimum">Worked examples and the basin-width bound ↗</a></p>
<p class="curve-note">Circles mark the ordinary loss minima. Arrows show downhill directions for each penalty. The vertical scales vary by panel. <a href="https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/blob/main/docs/third-derivative-penalty.md#when-can-the-penalty-favor-a-wider-minimum">Worked examples and the basin-width bound ↗</a></p>
<img class="architecture" src="figures/architecture.png" alt="TinyStories full-weight training and Pythia QKV adaptation feed next-token cross-entropy, a Hessian contraction, a third derivative and the regularized objective." loading="lazy">
<div class="method-links">
<a href="https://doi.org/10.1007/BFb0086566">Derivative roughness ↗</a>1234567891011# Research abstracts · Hessian trace
Run `abstracts-pilot-s00-trace-r03-fp64` · [raw records](../../../results/abstracts-pilot-s00-trace-r03-fp64/) · [registered design](../../preregistration.md)
| Stage | Method | Phase | Seed | Ratio | Train tokens | Dev NLL | Test NLL | Tokens/s | Status || --- | --- | --- | --- | --- | --- | --- | --- | --- | --- || Research abstracts | Hessian trace | pilot | 0 | 0.030 | 65,536 | 3.0883 | — | — | scoring development |
Training time is 153.6 seconds. Peak allocated GPU memory is — MiB. Development token accuracy is 0.4160. Test token accuracy is —.
[Design and hyperparameter rationale](../../planned-runs.md) · [Saved configuration](../../../results/abstracts-pilot-s00-trace-r03-fp64/config.json)12345# Run learnings
Development NLL changed by -0.1168 nats per target token from 4,096 to 65,536 training targets. Attribution to the regularizer uses matched comparisons across seeds.
[Experiment and source records](experiment.md)11 unmodified lines1213141516171811 unmodified lines| [abstracts-pilot-s00-third-r03](./abstracts-pilot-s00-third-r03/experiment.md) | Research abstracts | Third derivative | diagnostic | 0 | 0.030 | 65,536 | 3.1168 | — | 907 | complete || [abstracts-pilot-s00-third-r03-fp64](./abstracts-pilot-s00-third-r03-fp64/experiment.md) | Research abstracts | Third derivative | pilot | 0 | 0.030 | 65,536 | 3.1149 | — | 188 | complete || [abstracts-pilot-s00-trace-r01-fp64](./abstracts-pilot-s00-trace-r01-fp64/experiment.md) | Research abstracts | Hessian trace | pilot | 0 | 0.010 | 65,536 | 3.1140 | — | 435 | complete || [abstracts-pilot-s00-trace-r03-fp64](./abstracts-pilot-s00-trace-r03-fp64/experiment.md) | Research abstracts | Hessian trace | pilot | 0 | 0.030 | 65,536 | 3.0883 | — | — | scoring development || [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) | TinyStories | Initial checkpoint | control | 0 | 0.000 | 0 | 8.3437 | — | 0 | complete || [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) | TinyStories | Unigram | control | 0 | 0.000 | 0 | 6.0036 | — | 0 | complete || [stories-pilot-s00-ce-r00](./stories-pilot-s00-ce-r00/experiment.md) | TinyStories | Ordinary AdamW | pilot | 0 | 0.000 | 2,097,152 | 3.8770 | — | 123,871 | complete |17 unmodified lines181920212223242517 unmodified lines
- [abstracts-pilot-s00-trace-r01-fp64](./abstracts-pilot-s00-trace-r01-fp64/experiment.md) — Development NLL changed by -0.1171 nats per target token from 4,096 to 65,536 training targets. Attribution to the regularizer uses matched comparisons across seeds.
- [abstracts-pilot-s00-trace-r03-fp64](./abstracts-pilot-s00-trace-r03-fp64/experiment.md) — Development NLL changed by -0.1168 nats per target token from 4,096 to 65,536 training targets. Attribution to the regularizer uses matched comparisons across seeds.
- [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) — The observed development NLL is 8.3437 nats per target token.
- [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) — The observed development NLL is 6.0036 nats per target token.9 unmodified lines10111213131415169 unmodified lines| Pilot and controls | Start with third-order training and the untrained model and unigram comparisons. Calibrate on training gradients, finish equal-budget strength searches and select on development NLL. Compare signed trace, squared Hessian norm, randomized third-order gradient signs, and the combined objective. [Run matrix](planned-runs.md) · [Selections](../results/selection) |
| Feasibility | Target the first pilot and free controls within fourteen hours. Use observed token throughput, validation time and peak allocated memory to project the week’s work before opening either test set. [Progress and timing](progress.md) |
| Confirmation | Use eight paired seeds per stage for ordinary AdamW, Hessian trace, and the selected third-order penalty. Freeze all stage checkpoints and the test digest before scoring. Report seed-level differences, median intervals, both Holm-adjusted sign tests, development results at matched training time, and compute costs. [Analysis decisions](preregistration.md) |
| Publication | After each completed run or evaluation, update the research archive, model card, experiment log, learnings, paper and explorer from the same raw observations. [Experiment ledger](experiments/experiments.md) · [Paper](paper.pdf) · [Explorer](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/) |
| Publication | After each completed run or evaluation, update the research archive, model card, experiment log, learnings, paper and explorer from the same raw observations. [Experiment ledger](experiments/experiments.md) · [Paper](paper.pdf) · [Explorer](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/) |
The dated progress record gives completed milestones and outstanding work. Source code, token-stream digests, restartable checkpoint settings and reload instructions are available from the reproduction guide. [Progress](progress.md) · [Reproduction guide](../docs/runbook.md)
12334565 unmodified lines1213141515161718# Study progress
Updated 2026-11-25T09:18:45+00:00.Updated 2026-11-25T09:26:37+00:00.
17 training/control records and 0 final evaluations are complete. This is 14.2% of 120 planned model milestones.
5 unmodified lines
Statistical status: pending. Awaiting confirmatory runs.
**abstracts** has 5 completed runs. The next milestone is determined by the run matrix.**abstracts** has 5 completed runs. Current records: abstracts-pilot-s00-trace-r03-fp64 (scoring development, 65,536 targets).
Statistical status: pending. Awaiting confirmatory runs.
123345678991011121313141516# Study summary
Recorded 18 runs, including 18 with a completed summary.Recorded 19 runs, including 18 with a completed summary.
**TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
**Research abstracts.** Awaiting paired test results (0 of 8 full-horizon training triplets).
[Interactive explorer](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/) · [Per-run ledger](experiments/experiments.md) · [Preregistration](preregistration.md) · [Paper](paper.pdf)[Interactive explorer](https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian/) · [Per-run ledger](experiments/experiments.md) · [Preregistration](preregistration.md) · [Paper](paper.pdf)
## Development observations
**TinyStories development pilot.** At 2,097,152 training targets, the third-order run recorded 0.00004 nats per target token lower against Ordinary AdamW, 0.00024 nats per target token lower against Trace + third derivative, 0.00175 nats per target token lower against Squared Hessian norm, 0.00032 nats per target token lower against Randomized gradient signs, 0.00034 nats per target token lower against Hessian trace. These are single-seed descriptions using selected on development.**TinyStories development pilot.** At 2,097,152 training targets, the third-order run recorded 0.00004 nats per target token lower against Ordinary AdamW, 0.00024 nats per target token lower against Trace + third derivative, 0.00175 nats per target token lower against Squared Hessian norm, 0.00032 nats per target token lower against Randomized gradient signs, 0.00034 nats per target token lower against Hessian trace. These are single-seed descriptions using strengths selected on development.
**Research abstracts development pilot.** At 65,536 training targets, the third-order run recorded 0.00091 nats per target token higher against Ordinary AdamW. These are single-seed descriptions using initial pilot strengths.
123456789101112131415161718{
"id": "abstracts-pilot-s00-trace-r03-fp64",
"stage": "abstracts",
"method": "trace",
"phase": "pilot",
"seed": 0,
"ratio": 0.03,
"token_budget": 65536,
"batch_windows": 8,
"context": 128,
"data_manifest_sha256": "0638bd23a7d1dc3ecb9138074ecd922211df2637f60736ddfab7e9aec0b3ccb9",
"microbatch": 2,
"derivative_dtype": "float64",
"derivative_device": "cpu",
"coefficients": {
"trace": 4.232668506589168e-08
}
}1234{"timestamp": "2026-11-25T09:23:04+00:00", "split": "dev", "targets_scored": 428032, "targets_to_score": 5124071, "nll_so_far": 3.108243330600159, "accuracy_so_far": 0.4124341170753589, "score_seconds": 60.13073129999975}
{"timestamp": "2026-11-25T09:24:04+00:00", "split": "dev", "targets_scored": 854016, "targets_to_score": 5124071, "nll_so_far": 3.1070146722489036, "accuracy_so_far": 0.413103501573741, "score_seconds": 120.2883948000017}
{"timestamp": "2026-11-25T09:25:04+00:00", "split": "dev", "targets_scored": 1265664, "targets_to_score": 5124071, "nll_so_far": 3.1018533033671454, "accuracy_so_far": 0.4137030049049353, "score_seconds": 180.4415474999987}
{"timestamp": "2026-11-25T09:26:05+00:00", "split": "dev", "targets_scored": 1662976, "targets_to_score": 5124071, "nll_so_far": 3.1042621866544695, "accuracy_so_far": 0.4134822150169335, "score_seconds": 240.70859909999854}12345678910111213141516171819202122{"timestamp": "2026-11-25T09:19:10+00:00", "step": 1, "tokens": 1024, "train_seconds": 0.8203949000017019, "loss": 3.3628768920898438, "accuracy": 0.38671875, "lr": 3.3333333333333335e-05, "gradient_norm": 1.1452151536941528, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 0.8203949000017019}
{"timestamp": "2026-11-25T09:19:32+00:00", "step": 2, "tokens": 2048, "train_seconds": 22.69535729999916, "loss": 3.4265871047973633, "accuracy": 0.3720703125, "lr": 6.666666666666667e-05, "gradient_norm": 1.1337052583694458, "derivatives": {"trace": {"estimate": 1510.6847122874765, "raw_grad_norm": 967020.0889974502, "lambda": 4.232668506589168e-08, "probe_seconds": 20.837838999999803}}, "host_probe_seconds": 20.837838999999803, "training_seconds_excluding_host_probes": 1.8575182999993558, "penalty": 0.0005115382084067936}
{"timestamp": "2026-11-25T09:19:35+00:00", "step": 4, "tokens": 4096, "train_seconds": 24.184651600007783, "loss": 3.335285186767578, "accuracy": 0.3671875, "lr": 9.994033404481737e-05, "gradient_norm": 1.1429003477096558, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 3.346812600007979, "dev_nll": 3.2050935145816766, "dev_accuracy": 0.4029541015625}
{"timestamp": "2026-11-25T09:19:39+00:00", "step": 8, "tokens": 8192, "train_seconds": 27.588129100004153, "loss": 3.153710126876831, "accuracy": 0.412109375, "lr": 9.851624761560943e-05, "gradient_norm": 1.307447075843811, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 6.750290100004349, "dev_nll": 3.1848572317976505, "dev_accuracy": 0.40576171875}
{"timestamp": "2026-11-25T09:20:03+00:00", "step": 11, "tokens": 11264, "train_seconds": 51.34093500000745, "loss": 3.222881555557251, "accuracy": 0.4150390625, "lr": 9.623426070191522e-05, "gradient_norm": 1.140632152557373, "derivatives": {"trace": {"estimate": -410.10428172081595, "raw_grad_norm": 868195.9114623038, "lambda": 4.232668506589168e-08, "probe_seconds": 20.85973699999886}}, "host_probe_seconds": 20.85973699999886, "training_seconds_excluding_host_probes": 9.643359000008786, "penalty": -0.00013886683821256557}
{"timestamp": "2026-11-25T09:20:06+00:00", "step": 12, "tokens": 12288, "train_seconds": 52.29275320001034, "loss": 3.2244973182678223, "accuracy": 0.421875, "lr": 9.525191870029581e-05, "gradient_norm": 1.1609612703323364, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 10.595177200011676, "dev_nll": 3.167334184923675, "dev_accuracy": 0.4073486328125}
{"timestamp": "2026-11-25T09:20:10+00:00", "step": 16, "tokens": 16384, "train_seconds": 55.284040600010485, "loss": 3.1743507385253906, "accuracy": 0.4013671875, "lr": 9.028539129595197e-05, "gradient_norm": 1.3022633790969849, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 13.586464600011823, "dev_nll": 3.153323730221018, "dev_accuracy": 0.40869140625}
{"timestamp": "2026-11-25T09:20:14+00:00", "step": 20, "tokens": 20480, "train_seconds": 58.501724600013404, "loss": 3.3647890090942383, "accuracy": 0.380859375, "lr": 8.38266930414179e-05, "gradient_norm": 1.2582865953445435, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 16.80414860001474, "dev_nll": 3.141088357253466, "dev_accuracy": 0.40771484375}
{"timestamp": "2026-11-25T09:20:37+00:00", "step": 22, "tokens": 22528, "train_seconds": 80.72395010001492, "loss": 3.1014509201049805, "accuracy": 0.3994140625, "lr": 8.01209674912089e-05, "gradient_norm": 1.2094333171844482, "derivatives": {"trace": {"estimate": -347.26580623998086, "raw_grad_norm": 1033792.7539904471, "lambda": 4.232668506589168e-08, "probe_seconds": 20.768768099995214}}, "host_probe_seconds": 20.768768099995214, "training_seconds_excluding_host_probes": 18.257606000021042, "penalty": -0.00011758888331898106}
{"timestamp": "2026-11-25T09:20:39+00:00", "step": 24, "tokens": 24576, "train_seconds": 82.08860320001986, "loss": 3.163144111633301, "accuracy": 0.4130859375, "lr": 7.614895343622941e-05, "gradient_norm": 1.4822345972061157, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 19.622259100025985, "dev_nll": 3.1304753722506575, "dev_accuracy": 0.4068603515625}
{"timestamp": "2026-11-25T09:21:01+00:00", "step": 25, "tokens": 25600, "train_seconds": 104.08553360002406, "loss": 3.160763740539551, "accuracy": 0.3994140625, "lr": 7.407614758194375e-05, "gradient_norm": 1.2352839708328247, "derivatives": {"trace": {"estimate": 2431.418073750566, "raw_grad_norm": 1151210.280645826, "lambda": 4.232668506589168e-08, "probe_seconds": 20.968858100000944}}, "host_probe_seconds": 20.968858100000944, "training_seconds_excluding_host_probes": 20.650331400029245, "penalty": 0.0008233109365692575}
{"timestamp": "2026-11-25T09:21:05+00:00", "step": 28, "tokens": 28672, "train_seconds": 106.44928290002281, "loss": 3.2388410568237305, "accuracy": 0.3984375, "lr": 6.757685356832243e-05, "gradient_norm": 1.238802433013916, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 23.01408070002799, "dev_nll": 3.1210773665225133, "dev_accuracy": 0.4085693359375}
{"timestamp": "2026-11-25T09:21:09+00:00", "step": 32, "tokens": 32768, "train_seconds": 109.3466636000303, "loss": 3.472531318664551, "accuracy": 0.375, "lr": 5.84728957956991e-05, "gradient_norm": 1.3810346126556396, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 25.911461400035478, "dev_nll": 3.1126226205960847, "dev_accuracy": 0.410400390625}
{"timestamp": "2026-11-25T09:21:13+00:00", "step": 36, "tokens": 36864, "train_seconds": 112.22359190003772, "loss": 3.132420063018799, "accuracy": 0.400390625, "lr": 4.9222074018405206e-05, "gradient_norm": 1.2544296979904175, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 28.7883897000429, "dev_nll": 3.1055949754081666, "dev_accuracy": 0.410888671875}
{"timestamp": "2026-11-25T09:21:18+00:00", "step": 40, "tokens": 40960, "train_seconds": 115.42110020003747, "loss": 3.0673372745513916, "accuracy": 0.421875, "lr": 4.021559281401244e-05, "gradient_norm": 1.2362866401672363, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 31.985898000042653, "dev_nll": 3.1004766558180563, "dev_accuracy": 0.410888671875}
{"timestamp": "2026-11-25T09:21:22+00:00", "step": 44, "tokens": 45056, "train_seconds": 118.3313624000366, "loss": 3.38905668258667, "accuracy": 0.373046875, "lr": 3.183432393205763e-05, "gradient_norm": 1.2262520790100098, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 34.89616020004178, "dev_nll": 3.096751482808031, "dev_accuracy": 0.412353515625}
{"timestamp": "2026-11-25T09:21:26+00:00", "step": 48, "tokens": 49152, "train_seconds": 121.19241670003248, "loss": 3.232553482055664, "accuracy": 0.376953125, "lr": 2.443269974962181e-05, "gradient_norm": 1.2406020164489746, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 37.75721450003766, "dev_nll": 3.0938708244939335, "dev_accuracy": 0.4136962890625}
{"timestamp": "2026-11-25T09:21:48+00:00", "step": 50, "tokens": 51200, "train_seconds": 142.58278420003626, "loss": 3.0859992504119873, "accuracy": 0.404296875, "lr": 2.1199063110826618e-05, "gradient_norm": 1.6927725076675415, "derivatives": {"trace": {"estimate": 1306.07316143556, "raw_grad_norm": 3021103.0699667563, "lambda": 4.232668506589168e-08, "probe_seconds": 19.854530700002215}}, "host_probe_seconds": 19.854530700002215, "training_seconds_excluding_host_probes": 39.293051300039224, "penalty": 0.0004422539790167716}
{"timestamp": "2026-11-25T09:21:51+00:00", "step": 52, "tokens": 53248, "train_seconds": 144.27424620003876, "loss": 3.066322088241577, "accuracy": 0.41015625, "lr": 1.8323724811743496e-05, "gradient_norm": 1.1389482021331787, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 40.984513300041726, "dev_nll": 3.0918713661958463, "dev_accuracy": 0.414306640625}
{"timestamp": "2026-11-25T09:21:55+00:00", "step": 56, "tokens": 57344, "train_seconds": 147.47696270003507, "loss": 3.2468066215515137, "accuracy": 0.40234375, "lr": 1.3765739298084793e-05, "gradient_norm": 1.1320654153823853, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 44.18722980003804, "dev_nll": 3.0903795417398214, "dev_accuracy": 0.4150390625}
{"timestamp": "2026-11-25T09:21:59+00:00", "step": 60, "tokens": 61440, "train_seconds": 150.7008369000323, "loss": 3.167062759399414, "accuracy": 0.4091796875, "lr": 1.09514941707089e-05, "gradient_norm": 1.1818270683288574, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 47.411104000035266, "dev_nll": 3.0892473537824117, "dev_accuracy": 0.4154052734375}
{"timestamp": "2026-11-25T09:22:04+00:00", "step": 64, "tokens": 65536, "train_seconds": 153.6093276000247, "loss": 3.1683597564697266, "accuracy": 0.400390625, "lr": 1e-05, "gradient_norm": 1.0687135457992554, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 50.319594700027665, "dev_nll": 3.0883107148692943, "dev_accuracy": 0.416015625}12345678{
"status": "scoring development",
"targets_scored": 1662976,
"targets_to_score": 5124071,
"nll_so_far": 3.1042621866544695,
"accuracy_so_far": 0.4134822150169335,
"score_seconds": 240.70859909999854
}1232345688 unmodified lines9596979898991001011021031031041051061071081081091101111121131131141151161171181181191201211221231231241251261271281281291301311321331331341351361371381381391401411421431431441451461471481481491501511521531531541551563 unmodified lines1601611621631631641651661671681681691701711721731731741751761771781781791801812 unmodified lines1841851861871871881891901911921921931941951961971981992002011972022032042052062022072082092102112072122132142152162122172182192203 unmodified lines224225226222227228229230{
"checked_at": "2026-11-25T08:30:11+00:00",
"git_revision": "021264128e1fc7eb7dd7b03db922ca576dc144af",
"checked_at": "2026-11-25T09:26:27+00:00",
"git_revision": "1d6f87f98019521f424ef05e5878d4a7b645a07f",
"exit_code": 0,
"cases": [
{88 unmodified lines },
{
"test": "tests.test_data.test_exact_and_edited_documents_respect_split_priority",
"seconds": 0.002,
"seconds": 0.003,
"outcome": "passed"
},
{
"test": "tests.test_data.test_prefix_candidates_match_exhaustive_jaccard_including_boundary",
"seconds": 0.054,
"seconds": 0.061,
"outcome": "passed"
},
{
"test": "tests.test_data.test_abstract_submission_month_and_base_id_grouping",
"seconds": 0.034,
"seconds": 0.037,
"outcome": "passed"
},
{
"test": "tests.test_data.test_prepare_from_parquet_proves_train_only_fit_packing_and_repair",
"seconds": 0.093,
"seconds": 0.216,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_gpu_production_decoder_third_order_update_matches_cpu",
"seconds": 2.451,
"seconds": 4.067,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_quartic_penalty_retains_fourth_derivative",
"seconds": 0.004,
"seconds": 0.003,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_mixed_cubic_exactly_averages_to_tensor_norm",
"seconds": 0.042,
"seconds": 0.053,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_random_probe_generator_gives_independent_directions",
"seconds": 0.183,
"seconds": 0.219,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[third]",
"seconds": 0.002,
"seconds": 0.004,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[trace]",
"seconds": 0.003,
"seconds": 0.002,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[hessian_norm]",
"seconds": 0.003,
"seconds": 0.002,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_quadratic_has_curvature_and_zero_third_derivative",
"seconds": 0.002,
"seconds": 0.001,
"outcome": "passed"
},
{3 unmodified lines },
{
"test": "tests.test_derivatives.test_tiny_transformer_against_dense_tensor_and_finite_differences",
"seconds": 1.62,
"seconds": 2.205,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_actual_adamw_update_responds_to_the_third_order_term",
"seconds": 0.007,
"seconds": 0.014,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_production_story_model_exposes_full_weight_penalty_gradient",
"seconds": 0.045,
"seconds": 0.064,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_pythia_adapter_fourth_derivative_and_portable_checkpoint",
"seconds": 4.554,
"seconds": 7.936,
"outcome": "passed",
"measurements": {
"adapter_directional_autograd": "9035.374247002468",2 unmodified lines },
{
"test": "tests.test_derivatives.test_large_finite_gradient_norm_survives_squaring",
"seconds": 0.002,
"seconds": 0.004,
"outcome": "passed"
},
{
"test": "tests.test_derivatives.test_sequential_windows_reproduce_joint_penalty_and_training_gradient",
"seconds": 0.189,
"seconds": 0.164,
"outcome": "passed"
},
{
"test": "tests.test_reporting.test_examples_label_an_eligible_run_and_preserve_the_fixed_sample_order",
"seconds": 0.001,
"outcome": "passed"
},
{
"test": "tests.test_reporting.test_snapshot_keeps_full_score_and_trace_semantics",
"seconds": 0.015,
"seconds": 0.03,
"outcome": "passed"
},
{
"test": "tests.test_reporting.test_report_before_first_run_keeps_readme_and_emits_protocol_paper",
"seconds": 0.485,
"seconds": 1.64,
"outcome": "passed"
},
{
"test": "tests.test_training.test_randomized_control_preserves_coordinate_magnitudes_and_zero_is_noop",
"seconds": 0.099,
"seconds": 0.149,
"outcome": "passed"
},
{
"test": "tests.test_training.test_step_recovery_matches_uninterrupted_weights",
"seconds": 2.134,
"seconds": 2.362,
"outcome": "passed"
},
{3 unmodified lines },
{
"test": "tests.test_training.test_evaluator_requires_measured_schedule_before_test_reads",
"seconds": 0.029,
"seconds": 0.043,
"outcome": "passed"
}
]7 unmodified lines89101112131415167 unmodified lines
from dotenv import load_dotenv
GITHUB = "https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss-with-derivative-of-hessian"
PAGES = "https://burnycoder.github.io/"+GITHUB.rsplit("/",1)[1]+"/"
HORIZONS = {"stories": 2**24, "abstracts": 2**19}
BATCHES = {"stories": 32, "abstracts": 8}
METHODS = ("ce", "trace", "third", "hessian_norm", "sham", "combined")4 unmodified lines567889101112131314154 unmodified lines
from huggingface_hub import HfApi
from .records import read_json, sha256, write_json
from .records import GITHUB, read_json, sha256, write_json
OWNER = "BurnyCoder"
STUDY_HUB = f"{OWNER}/thirdloss-study"
COLLECTION = f"{OWNER}/third-derivatives-in-language-model-training-6b067fb7d5ae3eca49ebb378"
GITHUB = "https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss"
STAGE_HUB = {"stories":f"{OWNER}/thirdloss-stories", "abstracts":f"{OWNER}/thirdloss-pythia-410m-adapters"}
22 unmodified lines2324252626272829352 unmodified lines38238338438538638538638738838838939039139239339439539639139239839939339439539639739822 unmodified lines Image, KeepTogether, LongTable, PageBreak, Paragraph, SimpleDocTemplate, Spacer, TableStyle,
)
from .report_records import METHODS, REPOSITORY, STAGES, completed, describe_difference, finite, fmt, verdict_text
from .report_records import METHODS, REPOSITORY, STAGES, completed, describe_difference, example_runs, finite, fmt, verdict_text
REFERENCES = {
"flat": ("Hochreiter and Schmidhuber (1994), Simplifying neural nets by discovering flat minima",352 unmodified lines p(f"{STAGES[stage]} / {METHODS[base]}: median ΔNLL {fmt(stats['median_delta'], 5)}, "
f"interval [{fmt(lo,5)}, {fmt(hi,5)}] at achieved coverage {fmt(stats['ci_coverage'],4)}. "
f"Holm-adjusted p = {fmt(stats['p_holm'], 5)}.", "caption")
has_examples = any(run["samples"] for run in study["runs"])
if has_examples:
examples = example_runs(study["runs"])
if examples:
p("Appendix · Output examples", "heading")
p("For each stage and method, the first saved sample in run-ID order is shown in excerpt. "
p("For each stage and method, the first registered checkpoint and sample in run-ID order is shown in excerpt. "
"The experiment ledger contains every full saved continuation and its corresponding "
f"reference when recorded. {_link(REPOSITORY + '/tree/main/reports/experiments', 'All outputs')}")
seen = set()
for run in study["runs"]:
key = (run.get("stage"), run.get("method"))
if not run["samples"] or key in seen:
continue
seen.add(key)
for run in examples:
sample = run["samples"][0]
label = f"{STAGES.get(key[0], key[0])} · {METHODS.get(key[1], key[1])}"
example = [Paragraph(escape(label), styles["subheading"])]
label = f"{STAGES[run['stage']]} · {METHODS[run['method']]} · {run['phase']}, seed {run['seed']}"
url = REPOSITORY + "/blob/main/results/" + run["id"] + "/samples.jsonl"
example = [Paragraph(_link(url,label), styles["subheading"])]
for field, name in (("prompt", "Prompt"), ("reference", "Reference"), ("continuation", "Prediction")):
if sample.get(field) is not None:
value = str(sample[field])8 unmodified lines910111213141415151617161 unmodified lines17918018118318218318418528 unmodified lines2142152162172182192202212222232242252262272288 unmodified linesfrom tempfile import NamedTemporaryFile
from .analysis import analyze_stage
from .records import GITHUB as REPOSITORY, PAGES
REPOSITORY = "https://github.com/BurnyCoder/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss"
PAGES = "https://burnycoder.github.io/llm-training-with-penalizing-rapid-changes-of-curvature-of-its-loss/"
STAGES = {"stories": "TinyStories", "abstracts": "Research abstracts"}
METHODS = {
"ce": "Ordinary AdamW",161 unmodified lines return [{"method": method, "third_id": third["id"], "comparison_id": other["id"],
"tokens": third["tokens"], "delta": third["dev_nll"] - other["dev_nll"],
"third_nll": third["dev_nll"], "baseline_nll": other["dev_nll"],
"strength_basis": "selected on development" if ratios else "initial pilot strengths"}
"strength_basis": "strengths selected on development" if ratios else "initial pilot strengths"}
for method, other in by_method.items() if method != "third" and other.get("tokens") == third.get("tokens")]
28 unmodified lines return run.get("status", "").lower() in {"complete", "completed", "finished", "evaluated", "success"}
def example_runs(runs):
"""Choose one completed registered checkpoint per method independently of sample text or scores."""
examples = {}
for run in sorted(runs,key=lambda r:r["id"]):
if completed(run) and run["phase"] in {"confirm","pilot","control"} and run["samples"]:
examples.setdefault((run["stage"],run["method"]),run)
return list(examples.values())
def describe_difference(delta) -> str:
if delta == 0:
return "identical development NLL"8 unmodified lines910111212131415242 unmodified lines2582592602612612632642652662672682622632642652662712672682692708 unmodified linesfrom .report_figures import build_figures
from .report_paper import write_paper
from .report_records import (
METHODS, PAGES, STAGES, atomic_text, completed, describe_difference, finite, fmt, study_snapshot,
METHODS, PAGES, STAGES, atomic_text, completed, describe_difference, example_runs, finite, fmt, study_snapshot,
verdict_text,
)
242 unmodified lines for key in ("paired", "curves"):
if key in figures:
readme.append(f"")
seen = set()
panels = []
for run in study["runs"]:
key = (run.get("stage"), run.get("method"))
if not run["samples"] or key in seen:
continue
seen.add(key)
panels.append(f"<details><summary>{_stage(run)} · {_method(run)}</summary>\n\n"
for run in example_runs(study["runs"]):
panels.append(f"<details><summary>{_stage(run)} · {_method(run)} · {run['phase']}, seed {run['seed']}</summary>\n\n"
+ f"[Recorded sample](results/{run['id']}/samples.jsonl)\n\n"
+ _sample(run["samples"][0]) + "\n\n</details>")
if panels:
readme += ["### Recorded predictions", "First archived sample in run-ID order per "
readme += ["### Recorded predictions", "First registered checkpoint and sample in run-ID order per "
"stage and method. [All continuations](reports/experiments/experiments.md)", *panels]
_update_readme(root, "\n\n".join(readme))
write_paper(study, root / "reports" / "paper.pdf", root / "docs" / "figures", figures)1 unmodified line23456789124 unmodified lines1341351361351361371381391401411421431421431441451461471 unmodified line
import hashlib
import json
import subprocess
import sys
from pathlib import Path
from huggingface_hub import hf_hub_download124 unmodified lines
def milestone(project,storage,summary,publish):
from .reporting import build_report
from .progress import progress
path = project/"results"/summary["id"]/"summary.json"
marker = storage/"releases"/(summary["id"]+".json")
fingerprint = sha256(path)
if publish and marker.exists() and read_json(marker)["summary_sha256"]==fingerprint:
return
build_report(project)
progress(project)
# A study can run for days. Render from the current checked-in reporting code so a
# later milestone cannot replace an updated paper or explorer with an older template.
subprocess.run([sys.executable,"-m","thirdloss.cli","--project",str(project),"report"],cwd=project,check=True)
if publish:
publish_weights(project,storage,summary)
label = "evaluation" if "test_nll" in summary else "development"6 unmodified lines78910111213141516171819206 unmodified linesfrom thirdloss.reporting import build_report, study_snapshot
def test_examples_label_an_eligible_run_and_preserve_the_fixed_sample_order():
from thirdloss.report_records import example_runs
fields = {"stage":"abstracts","method":"third","status":"complete","samples":[{"continuation":"example"}]}
rows = [{**fields,"id":key,"phase":phase} for key,phase in
[("a-archived","diagnostic"),("c-later","pilot"),("b-corrected","pilot")]]
assert [r["id"] for r in example_runs(rows)] == ["b-corrected"]
def test_snapshot_keeps_full_score_and_trace_semantics(tmp_path):
"""Distinguish raw derivative size, weighted training contribution and full validation."""
run = tmp_path / "results" / "stories-pilot-s00-third-r03"research/README.md+43-17
research/docs/explorer.js+1-1
research/docs/figures/curves.png

Large File Pointer Details
- SHA256: 002062aae079438291378605bdb1471c607e36147a18b9b27aab7b7a9c680e52
- Pointer size: 131 Bytes
- Size of remote file: 176 kB

Large File Pointer Details
- SHA256: eacfa7a07db11ece058ca89eaa15549ad391fce89b9bb2a2298443fe2d83ea82
- Pointer size: 131 Bytes
- Size of remote file: 177 kB
research/docs/index.html+4-4
research/docs/study.json
research/reports/experiments/abstracts-pilot-s00-trace-r03-fp64/experiment.mdAdded+11
research/reports/experiments/abstracts-pilot-s00-trace-r03-fp64/learnings.mdAdded+5
research/reports/experiments/experiments.md+1
research/reports/experiments/learnings.md+2
research/reports/paper.pdf
research/reports/plan.md+1-1
research/reports/progress.md+2-2
research/reports/summary.md+3-3
research/results/abstracts-pilot-s00-trace-r03-fp64/config.jsonAdded+18
research/results/abstracts-pilot-s00-trace-r03-fp64/evaluation.jsonlAdded+4
research/results/abstracts-pilot-s00-trace-r03-fp64/events.jsonlAdded+22
research/results/abstracts-pilot-s00-trace-r03-fp64/state.jsonAdded+8
research/results/verification/tests.json+30-25
research/src/thirdloss/records.py+3
research/src/thirdloss/release.py+1-2
research/src/thirdloss/report_paper.py+8-12
research/src/thirdloss/report_records.py+11-3
research/src/thirdloss/reporting.py+5-9
research/src/thirdloss/study.py+5-4
research/tests/test_reporting.py+8