BurnyCoder commited on
Commit
3ad584c
·
verified ·
1 Parent(s): f772d40

Record development results for abstracts-pilot-s00-third-r03-fp64

Browse files
Files changed (31) hide show
  1. research/README.md +3 -2
  2. research/docs/explorer.js +10 -1
  3. research/docs/figures/curves.png +2 -2
  4. research/docs/runbook.md +1 -1
  5. research/docs/study.json +0 -0
  6. research/docs/third-derivative-penalty.md +154 -0
  7. research/reports/amendments/adapter-precision.md +2 -0
  8. research/reports/experiments/abstracts-pilot-s00-third-r03-fp64/experiment.md +69 -0
  9. research/reports/experiments/abstracts-pilot-s00-third-r03-fp64/learnings.md +5 -0
  10. research/reports/experiments/experiments.md +1 -0
  11. research/reports/experiments/learnings.md +2 -0
  12. research/reports/paper.pdf +0 -0
  13. research/reports/progress.md +3 -3
  14. research/reports/summary.md +2 -1
  15. research/results/abstracts-pilot-s00-third-r03-fp64/config.json +18 -0
  16. research/results/abstracts-pilot-s00-third-r03-fp64/evaluation.jsonl +12 -0
  17. research/results/abstracts-pilot-s00-third-r03-fp64/events.jsonl +22 -0
  18. research/results/abstracts-pilot-s00-third-r03-fp64/samples.jsonl +3 -0
  19. research/results/abstracts-pilot-s00-third-r03-fp64/summary.json +43 -0
  20. research/results/calibration/abstracts-third-fp64.json +155 -0
  21. research/results/verification/pythia-scoring-batches.json +49 -0
  22. research/results/verification/tests.json +42 -27
  23. research/src/thirdloss/analysis.py +14 -9
  24. research/src/thirdloss/cli.py +14 -2
  25. research/src/thirdloss/report_paper.py +21 -7
  26. research/src/thirdloss/report_records.py +4 -1
  27. research/src/thirdloss/reporting.py +8 -0
  28. research/src/thirdloss/study.py +24 -9
  29. research/src/thirdloss/train.py +19 -3
  30. research/tests/test_analysis.py +13 -0
  31. research/tests/test_training.py +20 -0
research/README.md CHANGED
@@ -15,7 +15,7 @@ Does a language model predict unseen tokens better when training penalizes rapid
15
 
16
  These papers motivate a distinct experiment here: putting the squared norm of the **third derivative of next-token loss with respect to trainable weights** directly in the training objective. The reviewed studies leave its effect on held-out next-token loss open.
17
 
18
- The third-order term measures how the Hessian changes as weights move. Two independent random sign vectors estimate its squared Frobenius norm. Differentiating the estimate gives the optimizer a fourth-derivative contribution. This combines an order-three roughness density with matrix-free norm estimation. [Duchon](https://doi.org/10.1007/BFb0086566) · [Bujanović and Kressner](https://arxiv.org/pdf/2004.06433) · [Hessian comparator](https://arxiv.org/pdf/2208.05924)
19
 
20
  The protocol and run matrix were published before model execution. The scores, comparisons and continuations below are regenerated from each run’s raw records. [Preregistration](reports/preregistration.md) · [Run matrix](reports/planned-runs.md) · [Literature](reports/literature-review.md) · [State of the art](reports/state-of-the-art-review.md) · [Progress](reports/progress.md)
21
 
@@ -24,7 +24,7 @@ A same-probe check on pretrained Pythia found that single-precision arithmetic m
24
  <!-- RESULTS:START -->
25
  [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)
26
 
27
- Recorded 14 runs, including 13 with a completed summary.
28
 
29
  **TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
30
 
@@ -37,6 +37,7 @@ Recorded 14 runs, including 13 with a completed summary.
37
  | Stage | Phase | Method | Ratio | Tokens/run | Runs | Median dev NLL | Median test NLL |
38
  | --- | --- | --- | --- | --- | --- | --- | --- |
39
  | Research abstracts | diagnostic | Third derivative | 0.030 | 65,536 | 1 | 3.1168 | — |
 
40
  | TinyStories | control | Initial checkpoint | 0.000 | 0 | 1 | 8.3437 | — |
41
  | TinyStories | control | Unigram | 0.000 | 0 | 1 | 6.0036 | — |
42
  | TinyStories | pilot | Ordinary AdamW | 0.000 | 2,097,152 | 1 | 3.8770 | — |
 
15
 
16
  These papers motivate a distinct experiment here: putting the squared norm of the **third derivative of next-token loss with respect to trainable weights** directly in the training objective. The reviewed studies leave its effect on held-out next-token loss open.
17
 
18
+ The third-order term measures how the Hessian changes as weights move. Two independent random sign vectors estimate its squared Frobenius norm. Differentiating the estimate gives the optimizer a fourth-derivative contribution. This combines an order-three roughness density with matrix-free norm estimation. [Worked examples and the training implementation](docs/third-derivative-penalty.md) · [Duchon](https://doi.org/10.1007/BFb0086566) · [Bujanović and Kressner](https://arxiv.org/pdf/2004.06433) · [Hessian comparator](https://arxiv.org/pdf/2208.05924)
19
 
20
  The protocol and run matrix were published before model execution. The scores, comparisons and continuations below are regenerated from each run’s raw records. [Preregistration](reports/preregistration.md) · [Run matrix](reports/planned-runs.md) · [Literature](reports/literature-review.md) · [State of the art](reports/state-of-the-art-review.md) · [Progress](reports/progress.md)
21
 
 
24
  <!-- RESULTS:START -->
25
  [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)
26
 
27
+ Recorded 15 runs, including 14 with a completed summary.
28
 
29
  **TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
30
 
 
37
  | Stage | Phase | Method | Ratio | Tokens/run | Runs | Median dev NLL | Median test NLL |
38
  | --- | --- | --- | --- | --- | --- | --- | --- |
39
  | Research abstracts | diagnostic | Third derivative | 0.030 | 65,536 | 1 | 3.1168 | — |
40
+ | Research abstracts | pilot | Third derivative | 0.030 | 65,536 | 1 | 3.1149 | — |
41
  | TinyStories | control | Initial checkpoint | 0.000 | 0 | 1 | 8.3437 | — |
42
  | TinyStories | control | Unigram | 0.000 | 0 | 1 | 6.0036 | — |
43
  | TinyStories | pilot | Ordinary AdamW | 0.000 | 2,097,152 | 1 | 3.8770 | — |
research/docs/explorer.js CHANGED
@@ -83,7 +83,7 @@ function showLedger() {
83
  tr.append(first);
84
  const evaluation = run.evaluation_progress;
85
  const status = evaluation?.targets_to_score > 0
86
- ? `${run.status} (${number(100 * evaluation.targets_scored / evaluation.targets_to_score, 1)}%)`
87
  : run.status;
88
  for (const value of [methodName(run.method), run.seed ?? "—", number(run.ratio, 3),
89
  number(run.tokens, 0), number(run.dev_nll, 4), number(run.test_nll, 4),
@@ -268,6 +268,15 @@ function showEvidence() {
268
  number(m.train_seconds, 1), number(m.tokens, 0), number(m.dev_nll, 5)]))));
269
  target.append(details);
270
  }
 
 
 
 
 
 
 
 
 
271
  }
272
 
273
  function showSample() {
 
83
  tr.append(first);
84
  const evaluation = run.evaluation_progress;
85
  const status = evaluation?.targets_to_score > 0
86
+ ? `${evaluation.split === "test" ? "scoring test" : run.status} (${number(100 * evaluation.targets_scored / evaluation.targets_to_score, 1)}%)`
87
  : run.status;
88
  for (const value of [methodName(run.method), run.seed ?? "—", number(run.ratio, 3),
89
  number(run.tokens, 0), number(run.dev_nll, 4), number(run.test_nll, 4),
 
268
  number(m.train_seconds, 1), number(m.tokens, 0), number(m.dev_nll, 5)]))));
269
  target.append(details);
270
  }
271
+ if ((outcome.matched_nonhost_time || []).length) {
272
+ const details = node("details");
273
+ details.append(node("summary", "Development loss after subtracting host derivative calls"));
274
+ details.append(table(["Seed", "Cutoff (s)", "Method", "Checkpoint (s)", "Training tokens", "Dev NLL"],
275
+ outcome.matched_nonhost_time.flatMap(t => Object.entries(t.by_method).map(([name, m]) =>
276
+ [t.seed, number(t.cutoff_seconds, 1), methodName(name), number(m.clock_seconds, 1),
277
+ number(m.tokens, 0), number(m.dev_nll, 5)]))));
278
+ target.append(details);
279
+ }
280
  }
281
 
282
  function showSample() {
research/docs/figures/curves.png CHANGED

Git LFS Details

  • SHA256: de2e927c0f2199c1bf6ecbfeace0f2e77699b9def6c4147fc272fc6ed4b25a45
  • Pointer size: 131 Bytes
  • Size of remote file: 114 kB

Git LFS Details

  • SHA256: ef784b3c67e9ec9749f869204edd94e13be0eb693a6c167674e071ff8579d5d1
  • Pointer size: 131 Bytes
  • Size of remote file: 160 kB
research/docs/runbook.md CHANGED
@@ -1,6 +1,6 @@
1
  # Reproducing the study
2
 
3
- Install Python 3.12 and [uv](https://docs.astral.sh/uv/). The lock targets Windows AMD64 and Linux x86_64 with an NVIDIA driver supporting the CUDA 13.2 PyTorch wheel. The default scratch model and adapter math use float32. Make a project-local environment and install all locked dependencies with `uv sync --locked`. Copy `.env.example` to `.env` and optionally set `THIRDLOSS_STORAGE` to a directory with room for corpora, CUDA checkpoints and Hub downloads. Use the existing GitHub CLI and Hugging Face login for publication.
4
 
5
  ```sh
6
  uv run thirdloss verify
 
1
  # Reproducing the study
2
 
3
+ Install Python 3.12 and [uv](https://docs.astral.sh/uv/). The lock targets Windows AMD64 and Linux x86_64 with an NVIDIA driver supporting the CUDA 13.2 PyTorch wheel. Scratch training and ordinary adapter updates use float32. Adapter derivatives use float64. Make a project-local environment and install all locked dependencies with `uv sync --locked`. Copy `.env.example` to `.env` and optionally set `THIRDLOSS_STORAGE` to a directory with room for corpora, CUDA checkpoints and Hub downloads. Use the existing GitHub CLI and Hugging Face login for publication.
4
 
5
  ```sh
6
  uv run thirdloss verify
research/docs/study.json CHANGED
The diff for this file is too large to render. See raw diff
 
research/docs/third-derivative-penalty.md ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How the project computes the third-derivative penalty
2
+
3
+ The model assigns a probability to each possible next token. Its **loss** is the mean negative log probability it assigns to the tokens that actually follow. The project differentiates this number **with respect to the trainable weights**. The first derivative gives the slope of the loss, the second gives its curvature, and the third tells us how that curvature changes as a weight moves. The training penalty adds up the **squares** of those changes. [Token loss](../src/thirdloss/models.py) · [Preregistered objective](../reports/preregistration.md)
4
+
5
+ With one weight $w$, you can just differentiate three times. For $\ell(w)=w^4$, the successive derivatives are $4w^3$, $12w^2$ and $24w$. The penalty is $(24w)^2$. With many weights you also choose **which weight** to differentiate at each step. PyTorch directly differentiates the minibatch loss along the chosen directions by applying the chain rule at the current weights. The estimate enters when one pair of directions stands in for the sum of squares over **all** weight triples. [Project’s scalar derivative check](../tests/test_derivatives.py) · [Penalty code](../src/thirdloss/penalties.py)
6
+
7
+ ## What gets differentiated?
8
+
9
+ Let $\theta=(\theta_1,\ldots,\theta_d)$ be the $d$ trainable numbers. Let $B$ be the fixed **minibatch**, the training examples whose mean loss is $\ell_B(\theta)$. Write $\partial_i$ for the rate of change as weight $\theta_i$ moves with all other weights held fixed.
10
+
11
+ | Quantity | Meaning |
12
+ |---|---|
13
+ | $g_k=\partial_k\ell_B$ | The slope along weight $k$. The **gradient** $g=\nabla_\theta\ell_B$ lists these slopes for all weights. |
14
+ | $H_{jk}=\partial_j g_k$ | How the slope along $k$ changes when $j$ moves. The **Hessian** $H_B$ is the table of all such second derivatives. |
15
+ | $T_{ijk}=\partial_i H_{jk}$ | How that curvature changes when $i$ moves. The **third-derivative tensor** $T=\nabla_\theta^3\ell_B$ is the array of all ordered triples. |
16
+ | $P_B=\sum_{i,j,k}T_{ijk}^2$ | The **squared Frobenius norm**. Square each entry and add over all three indices to get one training penalty. |
17
+
18
+ A **pure** third derivative uses the same weight three times, as in $T_{xxx}$. A **mixed** derivative uses several weights, as in $T_{xxy}$. For a smooth loss, permuting these indices gives the same derivative value. Each ordered position still counts in the squared norm. Squaring lets increases and decreases both contribute. Two entries $+2$ and $-2$ would sum to zero, while their squares contribute $8$.
19
+
20
+ ## A direct calculation beside an all-plus probe
21
+
22
+ Take two weights, $x=1$ and $y=2$. Set $s=x+y$ and $\ell(x,y)=s^3/3$. In the table, differentiate the expressions in $x,y$ before substituting the values. Both $\partial_xs$ and $\partial_ys$ equal $1$.
23
+
24
+ A **probe** is a vector used to take a weighted sum. Suppose the four independent sign draws for our two probes all happen to be $+1$. Then $u=v=(1,1)$ for this draw. Every weighted sum in the right column is ordinary addition.
25
+
26
+ | Step | Direct derivatives, entry by entry | One probe pair, adding along the way |
27
+ |---|---|---|
28
+ | First derivative | $\partial_x\ell=(3s^2/3)\cdot1=s^2$. Likewise $\partial_y\ell=s^2$. The gradient is $(s^2,s^2)=(9,9)$. | Start with the same gradient. Use $u$ to add its two entries, giving $a=s^2+s^2=2s^2$. |
29
+ | Second derivative | Each gradient entry has derivative $2s$ in $x$ and $2s$ in $y$. The Hessian has four entries, each $2s=6$. | Differentiate $a$ to get $(4s,4s)=(12,12)$. Use $v$ to add again, giving $b=4s+4s=8s$. |
30
+ | Third derivative | Differentiate each of those four Hessian entries in both $x$ and $y$. Each derivative is $2\cdot1=2$. There are eight entries equal to $2$. | Differentiate $b$ to get $r=(\partial_x(8s),\partial_y(8s))=(8,8)$. |
31
+ | Square and add | $8\times 2^2=\mathbf{32}$. | $8^2+8^2=\mathbf{128}$. |
32
+
33
+ **Where did the extra contribution come from?** For the $x$ component alone, the direct calculation gives $2^2+2^2+2^2+2^2=16$. The probe gives $(2+2+2+2)^2=64$. The same thing happens for $y$. For the **raw sum**, the two routes agree exactly because the eight entries sum to $16$ and $r_x+r_y=8+8=16$. Keeping just the **pure** entries would give a squared sum of $2^2+2^2=8$. The full squared norm includes six mixed entries as well.
34
+
35
+ **What happens with random signs?** For this Hessian, $u^\top H_Bv=2s(u_1+u_2)(v_1+v_2)$. If either vector has opposite entries, its sum is zero, so $r=(0,0)$. If the two entries within each vector match, both sums have magnitude $2$ and both entries of $r$ have magnitude $8$. Each vector has matching entries with probability $1/2$, independently of the other vector. Across the 16 equally likely probe pairs, 12 give $0$ and four give $128$. Their average is the exact $32$.
36
+
37
+ ## Why two independent sign vectors work for any smooth loss
38
+
39
+ Draw each entry of $u$ and $v$ independently, equally likely to be $+1$ or $-1$. These are **Rademacher** signs, with no division by the vector length. Hold them fixed while differentiating. The transpose in $u^\top H_Bv$ turns $u$ into a row. A dot product multiplies matching entries and adds them. In the following expansion, multiplying $H_B$ by $v$ sums along each row, and dotting with $u$ sums across rows.
40
+
41
+ $$
42
+ (H_Bv)_j=\sum_k H_{jk} v_k,\qquad
43
+ u^\top H_Bv=\sum_j u_j(H_Bv)_j=\sum_{j,k}u_jv_k H_{jk}.
44
+ $$
45
+
46
+ Taking the gradient gives one number for each $i$. A derivative of a finite sum is the sum of its derivatives. The signs factor out as constants, so
47
+
48
+ $$
49
+ r_i=\partial_i(u^\top H_Bv)
50
+ =\sum_{j,k}u_jv_k\,\partial_i H_{jk}
51
+ =\sum_{j,k}u_jv_k\,T_{ijk}.
52
+ $$
53
+
54
+ This is the exact **contraction** for the chosen signs, meaning that two indices of the tensor have been summed and one is still free. The random estimate is the scalar $\widehat P_B=\lVert r\rVert_2^2=\sum_i r_i^2$, the squared **Euclidean length** of that vector.
55
+
56
+ Squaring one component multiplies its sum by a second copy. Label the indices in the second copy $a,b$ so we can see which entries get paired.
57
+
58
+ $$
59
+ r_i^2=
60
+ \left(\sum_{j,k}T_{ijk}u_jv_k\right)
61
+ \left(\sum_{a,b}T_{iab}u_av_b\right)
62
+ =\sum_{j,k,a,b}T_{ijk}T_{iab}\,u_j u_a v_k v_b.
63
+ $$
64
+
65
+ **Expectation** $\mathbb E$ means average over the signs at the same weights and on the same minibatch. If $j=a$, then $u_j u_a=1$. If $j\ne a$, the product is equally likely to be $+1$ or $-1$ and averages to zero. The same holds for $v_k v_b$. Independence between the vectors lets us multiply these two averages. Only $j=a$ **and** $k=b$ survive, giving
66
+
67
+ $$
68
+ \mathbb E_{u,v}[r_i^2]=\sum_{j,k}T_{ijk}^2,\qquad
69
+ \mathbb E_{u,v}[\widehat P_B]=\sum_i\mathbb E_{u,v}[r_i^2]
70
+ =\sum_{i,j,k}T_{ijk}^2=\lVert T\rVert_F^2 .
71
+ $$
72
+
73
+ One probe supplies signs for $j$, the other for $k$. The gradient already returns every $i$. The word **unbiased** refers to the equality after averaging. The example above shows how far a single draw can be from that average. The same identity follows from treating $(j,k)$ as a single column index in the matrix version of the result. [Bujanović and Kressner, Lemma 2.1](https://arxiv.org/pdf/2004.06433#page=3)
74
+
75
+ ### What breaks if we reuse one vector?
76
+
77
+ Take $\ell(x,y)=x^2y/2$. Its gradient is $(xy,x^2/2)$, so its Hessian and the two slices of its third derivative are
78
+
79
+ $$
80
+ H=\begin{pmatrix}y&x\\x&0\end{pmatrix},\qquad
81
+ \partial_x H=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad
82
+ \partial_y H=\begin{pmatrix}1&0\\0&0\end{pmatrix}.
83
+ $$
84
+
85
+ Both pure third derivatives are zero. The three ones come from mixed derivatives, so the exact penalty is $3$. Multiply the Hessian by the two probes to get $u^\top H v=y u_1v_1+x(u_1v_2+u_2v_1)$. Differentiating in $x,y$ gives $r=(u_1v_2+u_2v_1,\ u_1v_1)$.
86
+
87
+ | How the signs are drawn | What gets squared | Result |
88
+ |---|---|---|
89
+ | Independent $u,v$ | The two signs in $r_x$ reinforce half the time and cancel half the time. The square of $r_y$ is always $1$. | The estimate is $5$ or $1$ with equal probability. Its mean is $3$. |
90
+ | Set $v=u$ on every draw | $r_x=u_1u_2+u_2u_1=2u_1u_2$ and $r_y=u_1^2=1$. | Every draw gives $4+1=5$. Its mean is $5$. |
91
+
92
+ ## Why the project computes a vector instead of listing every derivative
93
+
94
+ The ordinary training gradient already contains one exact automatic derivative per trainable coordinate, up to floating-point rounding. A third derivative has three coordinate slots. With $d$ weights the dense array has $d^3$ ordered entries. The counts below use the recorded trainable coordinates. The storage estimates count just one dense array at the arithmetic precision used by the corresponding derivative path. An exabyte (EB) is $10^{18}$ bytes. [Weight and loss definitions](../src/thirdloss/models.py) · [Adapter precision amendment](../reports/amendments/adapter-precision.md)
95
+
96
+ | Trainable coordinates in this project | $d$ | Dense third-derivative entries, $d^3$ | Storage for those entries |
97
+ |---|---:|---:|---:|
98
+ | TinyStories decoder trained from scratch, including its shared input/output embedding | 2,557,632 | $1.67\times10^{19}$ | about 66.9 EB at 4 bytes per entry |
99
+ | Research abstracts, rank-eight LoRA factors in Pythia-410M’s query/key/value projections. The pretrained base weights are frozen. | 786,432 | $4.86\times10^{17}$ | about 3.89 EB at 8 bytes per entry |
100
+
101
+ To reproduce either row, read `trainable_parameters` from the linked record, cube it, and multiply by the bytes per entry. Symmetry can reduce storage to one entry per distinct unordered triple, $d(d+1)(d+2)/6$, which still grows cubically. [TinyStories parameter count](../results/stories-pilot-s00-third-r03/summary.json) · [Adapter parameter count](../results/abstracts-pilot-s00-third-r03/summary.json)
102
+
103
+ You *can* compute the exact sum without storing all $d^3$ entries. For example, take $u=e_j$ and $v=e_k$, where $e_j$ has a one only at position $j$. Then $u^\top H_Bv=H_{jk}$ and $r_i=T_{ijk}$. Square and sum this vector and repeat for every ordered pair $(j,k)$. That direct scheme needs $d^2$ such vectors. The project takes one random pair on an active update. It trades an exact scalar for a noisy estimate while still differentiating the loss directly along the chosen directions. The small-model reference test explicitly builds the tensor and compares the two computations for the **same** signs. [Dense reference and derivative tests](../tests/test_derivatives.py) · [PyTorch’s Hessian–vector product tutorial](https://docs.pytorch.org/tutorials/intermediate/jacobians_hessians.html#computing-hessian-vector-products)
104
+
105
+ ## The actual training update
106
+
107
+ 1. **Compute the ordinary loss gradient.** Each update uses the mean next-token loss on the full training batch, 32 windows for TinyStories or eight for abstracts. In code, $\theta$ consists of the tensors with `requires_grad` enabled. [Training loop](../src/thirdloss/train.py) · [Registered batches and model configurations](../reports/planned-runs.md)
108
+ 2. **Choose the derivative minibatch.** In the third-order arm, a random gate opens with probability $1/8$ per update. On an active update the code chooses two distinct windows from that batch, each with 128 target tokens. Their mean **unregularized** token loss is $\ell_B$. Averaging over signs gives the exact squared norm for those windows. Averaging over window selection as well targets $\mathbb E_B[\lVert\nabla_\theta^3\ell_B\rVert_F^2]$, the mean of the minibatch squared norms. [Window and gate sampling](../src/thirdloss/windows.py) · [Preregistration](../reports/preregistration.md)
109
+ 3. **Differentiate with fixed probes.** `random_signs` draws $u,v$ separately. `hessian_vector` computes $Hu=\nabla_\theta(g^\top u)$. `third_contraction` takes $\nabla_\theta(v^\top Hu)$, and `estimate(..., "third")` computes `inner(r, r)`. For a smooth scalar loss the Hessian is symmetric, so the code’s $v^\top Hu$ equals $u^\top Hv$ in the proof. PyTorch differentiates the dot products directly and keeps their computation graph for the next derivative. [Penalty implementation](../src/thirdloss/penalties.py) · [PyTorch automatic differentiation](https://docs.pytorch.org/docs/2.15/generated/torch.autograd.grad.html)
110
+ 4. **Apply the penalty gradient.** The penalty value uses third derivatives. To move the weights, the optimizer needs the derivative of that value, $\partial_m\widehat P_B=2\sum_i r_i\,\partial_m r_i$. Differentiating $r_i$ introduces **fourth** derivatives. The code adds $8\lambda\nabla_\theta\widehat P_B$ to the ordinary loss gradient on active updates, where $\lambda$ is the calibrated penalty coefficient. The factor eight compensates for the gate probability before gradient clipping and the AdamW update. For the one-weight example, differentiating the penalty $(24w)^2$ gives $1152w$. [Training objectives](../src/thirdloss/objectives.py) · [Training loop](../src/thirdloss/train.py) · [Quartic gradient check](../tests/test_derivatives.py)
111
+
112
+ The amended adapter path computes derivatives in double precision on a copy with the current adapter weights. On the study laptop these calculations run on the CPU, and ordinary training uses the GPU. The code processes the two windows sequentially with the **same pair** of probes across windows. If their contractions are $r_1,r_2$, linearity gives $r_B=(r_1+r_2)/2$ for the mean loss. The code squares that mean, preserving the cross-window terms in the registered penalty. The row and column probes **within** the pair are independent. [Two-window implementation](../src/thirdloss/objectives.py) · [Precision and device choices](../reports/amendments/adapter-precision.md)
113
+
114
+ The ordinary AdamW baseline passes the first gradient straight to clipping and the optimizer. The Hessian-trace arm uses one probe twice in $u^\top Hu$ because its target is the **trace**, the sum of the Hessian’s diagonal entries. The squared-Hessian arm uses $\lVert Hu\rVert_2^2$. The combined arm adds trace and third-order penalties. The sign-randomized control uses additional signs on the **finished penalty gradient**, a separate operation from choosing $u,v$ to measure the third derivative. [Comparator implementations](../src/thirdloss/penalties.py) · [Control and combined updates](../src/thirdloss/objectives.py) · [Planned comparisons](../reports/planned-runs.md)
115
+
116
+ <details>
117
+ <summary>Reproduce the worked examples and the dense storage estimates</summary>
118
+
119
+ Run this Python block from the repository root in the project’s locked environment. It differentiates both polynomials, enumerates every probe pair and reads the real models’ coordinate counts from their archived summaries. [SymPy differentiation](https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html#derivatives)
120
+
121
+ ~~~python
122
+ from collections import Counter
123
+ from itertools import product
124
+ import json
125
+ from pathlib import Path
126
+ from sympy import Matrix, diff, hessian, symbols
127
+
128
+ x, y = symbols("x y")
129
+ weights = (x, y)
130
+ probes = [Matrix(pair) for pair in product((-1, 1), repeat=2)]
131
+
132
+ for loss in ((x + y)**3 / 3, x**2 * y / 2):
133
+ entries = [diff(loss, *triple) for triple in product(weights, repeat=3)]
134
+ exact = sum(entry**2 for entry in entries)
135
+ H = hessian(loss, weights)
136
+ counts = Counter()
137
+ for u, v in product(probes, repeat=2):
138
+ curvature = u.dot(H * v)
139
+ r = [diff(curvature, weight) for weight in weights]
140
+ counts[sum(entry**2 for entry in r)] += 1
141
+ mean = sum(value * count for value, count in counts.items()) / counts.total()
142
+ assert mean == exact
143
+ print(loss, "exact", exact, "frequencies", sorted(counts.items()), "mean", mean)
144
+
145
+ for run, bytes_per_entry in (("stories-pilot-s00-third-r03", 4),
146
+ ("abstracts-pilot-s00-third-r03", 8)):
147
+ summary = Path("results", run, "summary.json")
148
+ d = json.loads(summary.read_text(encoding="utf-8"))["trainable_parameters"]
149
+ entries = d**3
150
+ print(run, f"{d:,} weights", f"{entries:.3g} entries",
151
+ f"{entries * bytes_per_entry / 10**18:.3g} EB")
152
+ ~~~
153
+
154
+ </details>
research/reports/amendments/adapter-precision.md CHANGED
@@ -10,4 +10,6 @@ The first FP32 adapter pilot remains public with its original checkpoint, scores
10
 
11
  The primary computational comparison uses elapsed training time while one GPU is reserved. The raw training records separately measure the time spent in host probe calls. Subtracting these calls gives a supplementary time-accounting estimate that also excludes their transfers. It does not measure individual CUDA kernel durations. Host and dedicated-GPU memory have separate units and accounting. [Time accounting](../../src/thirdloss/train.py)
12
 
 
 
13
  Before rerunning the adapter pilot, benchmark inference batches of 2, 8, 16 and 32 windows on 256 fixed training windows. Retain the original batch of two unless a candidate is at least 10% faster, agrees within 0.000002 nats per target and one top-one prediction with the reference, and uses at most 7 GiB of allocated CUDA memory. Select the fastest eligible batch and use it for all amended-stage development and test scoring. Training batch sizes, evaluation targets and contexts are fixed. [Scoring benchmark](../../src/thirdloss/probe_check.py)
 
10
 
11
  The primary computational comparison uses elapsed training time while one GPU is reserved. The raw training records separately measure the time spent in host probe calls. Subtracting these calls gives a supplementary time-accounting estimate that also excludes their transfers. It does not measure individual CUDA kernel durations. Host and dedicated-GPU memory have separate units and accounting. [Time accounting](../../src/thirdloss/train.py)
12
 
13
+ Before any confirmatory training, the first FP64 pilot showed that individual host derivative calls could take about a minute. To resolve the early part of the matched-time comparison, record the same fixed development windows at initialization and at every fourth update through the first routine diagnostic interval in all three adapter confirmatory arms. Evaluation runs outside both training clocks. Each reported matched score still uses the latest actual measurement at or before the shortest final time. [Timestamped FP64 pilot updates](../../results/abstracts-pilot-s00-third-r03-fp64/events.jsonl) · [Validation schedule](../../src/thirdloss/train.py)
14
+
15
  Before rerunning the adapter pilot, benchmark inference batches of 2, 8, 16 and 32 windows on 256 fixed training windows. Retain the original batch of two unless a candidate is at least 10% faster, agrees within 0.000002 nats per target and one top-one prediction with the reference, and uses at most 7 GiB of allocated CUDA memory. Select the fastest eligible batch and use it for all amended-stage development and test scoring. Training batch sizes, evaluation targets and contexts are fixed. [Scoring benchmark](../../src/thirdloss/probe_check.py)
research/reports/experiments/abstracts-pilot-s00-third-r03-fp64/experiment.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Research abstracts · Third derivative
2
+
3
+ Run `abstracts-pilot-s00-third-r03-fp64` · [raw records](../../../results/abstracts-pilot-s00-third-r03-fp64/) · [registered design](../../preregistration.md)
4
+
5
+ | Stage | Method | Phase | Seed | Ratio | Train tokens | Dev NLL | Test NLL | Tokens/s | Status |
6
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
7
+ | Research abstracts | Third derivative | pilot | 0 | 0.030 | 65,536 | 3.1149 | — | 188 | complete |
8
+
9
+ Training time is 349.3 seconds. Peak allocated GPU memory is 2,346.3 MiB. Development token accuracy is 0.4131. Test token accuracy is —.
10
+
11
+ [Design and hyperparameter rationale](../../planned-runs.md) · [Saved configuration](../../../results/abstracts-pilot-s00-third-r03-fp64/config.json)
12
+
13
+ The process working-set high-water mark was 15,321.1 MiB. This OS measure includes earlier work in the same interpreter.
14
+
15
+ ## Fixed-prompt generations
16
+
17
+ **Prompt**
18
+
19
+ One of the central objectives of contemporary neuroimaging research is to
20
+ create predictive models
21
+
22
+ **Reference continuation**
23
+
24
+ that can disentangle the connection between patterns
25
+ of functional connectivity across the entire brain and various behavioral
26
+ traits. Previous studies have shown that models trained to predict behavioral
27
+ features from the individual's functional
28
+
29
+ **Model continuation**
30
+
31
+ that will accurately predict the behavior of
32
+ patient-specific neurological disorders such as epilepsy. In this paper, we
33
+ present a novel dataset of EEG data recorded from children with focal
34
+ subcortical epilepsy
35
+
36
+ **Prompt**
37
+
38
+ In the evolving landscape of computer vision, foundation models have emerged
39
+ as pivotal tools
40
+
41
+ **Reference continuation**
42
+
43
+ , exhibiting exceptional adaptability to a myriad of tasks.
44
+ Among these, the Segment Anything Model (SAM) by Meta AI has distinguished
45
+ itself in image segmentation. However, SAM, like
46
+
47
+ **Model continuation**
48
+
49
+ to study the behavior of computer vision systems.
50
+ These widely adopted modeling approaches tend to be associated with
51
+ a small number of identified object classes. On the one hand, they
52
+ are often effective to
53
+
54
+ **Prompt**
55
+
56
+ We investigate the connection between the turnover frequency in the radio
57
+ spectrum, $\nu
58
+
59
+ **Reference continuation**
60
+
61
+ _{\rm TO}$, and the rate of ionising ultra-violet photons,
62
+ $Q_{\rm HI}$, in extragalactic sources. From a large, optically selected,
63
+ sample we
64
+
65
+ **Model continuation**
66
+
67
+ _{\rm{break}}$, and the spectral index of the underlying
68
+ spectral index $s_{\rm{break}}$, and reveal that there is a universal
69
+ relationship between both quantities that can be used to
research/reports/experiments/abstracts-pilot-s00-third-r03-fp64/learnings.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Run learnings
2
+
3
+ Development NLL changed by -0.1165 nats per target token from 4,096 to 65,536 training targets. Attribution to the regularizer uses matched comparisons across seeds.
4
+
5
+ [Experiment and source records](experiment.md)
research/reports/experiments/experiments.md CHANGED
@@ -8,6 +8,7 @@ NLL is negative log-likelihood in nats per target token. A smaller value assigns
8
  | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
9
  | [abstracts-control-s00-initial-r00](./abstracts-control-s00-initial-r00/experiment.md) | Research abstracts | Initial checkpoint | control | 0 | 0.000 | — | — | — | — | configured |
10
  | [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 |
 
11
  | [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) | TinyStories | Initial checkpoint | control | 0 | 0.000 | 0 | 8.3437 | — | 0 | complete |
12
  | [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) | TinyStories | Unigram | control | 0 | 0.000 | 0 | 6.0036 | — | 0 | complete |
13
  | [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 |
 
8
  | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
9
  | [abstracts-control-s00-initial-r00](./abstracts-control-s00-initial-r00/experiment.md) | Research abstracts | Initial checkpoint | control | 0 | 0.000 | — | — | — | — | configured |
10
  | [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 |
11
+ | [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 |
12
  | [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) | TinyStories | Initial checkpoint | control | 0 | 0.000 | 0 | 8.3437 | — | 0 | complete |
13
  | [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) | TinyStories | Unigram | control | 0 | 0.000 | 0 | 6.0036 | — | 0 | complete |
14
  | [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 |
research/reports/experiments/learnings.md CHANGED
@@ -10,6 +10,8 @@ Independent random signs include mixed weight derivatives in the expected penalt
10
 
11
  - [abstracts-pilot-s00-third-r03](./abstracts-pilot-s00-third-r03/experiment.md) — This original FP32 adapter run is preserved as a numerical diagnostic. The same-probe full-checkpoint audit found substantial rounding error in both the penalty and its training gradient. Strength selection and confirmatory inference use separately named FP64 derivative runs. The run ledger records 1 interrupted attempt(s).
12
 
 
 
13
  - [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) — The observed development NLL is 8.3437 nats per target token.
14
 
15
  - [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) — The observed development NLL is 6.0036 nats per target token.
 
10
 
11
  - [abstracts-pilot-s00-third-r03](./abstracts-pilot-s00-third-r03/experiment.md) — This original FP32 adapter run is preserved as a numerical diagnostic. The same-probe full-checkpoint audit found substantial rounding error in both the penalty and its training gradient. Strength selection and confirmatory inference use separately named FP64 derivative runs. The run ledger records 1 interrupted attempt(s).
12
 
13
+ - [abstracts-pilot-s00-third-r03-fp64](./abstracts-pilot-s00-third-r03-fp64/experiment.md) — Development NLL changed by -0.1165 nats per target token from 4,096 to 65,536 training targets. Attribution to the regularizer uses matched comparisons across seeds.
14
+
15
  - [stories-control-s00-initial-r00](./stories-control-s00-initial-r00/experiment.md) — The observed development NLL is 8.3437 nats per target token.
16
 
17
  - [stories-control-s00-unigram-r00](./stories-control-s00-unigram-r00/experiment.md) — The observed development NLL is 6.0036 nats per target token.
research/reports/paper.pdf CHANGED
Binary files a/research/reports/paper.pdf and b/research/reports/paper.pdf differ
 
research/reports/progress.md CHANGED
@@ -1,8 +1,8 @@
1
  # Study progress
2
 
3
- Updated 2026-11-25T07:56:00+00:00.
4
 
5
- 12 training/control records and 0 final evaluations are complete. This is 10.0% of 120 planned model milestones.
6
 
7
  ## Current record
8
 
@@ -12,7 +12,7 @@ Pilot rates project 1.69 remaining confirmation GPU-hours, excluding validation,
12
 
13
  Statistical status: pending. Awaiting confirmatory runs.
14
 
15
- **abstracts** has 0 completed runs. Current records: abstracts-control-s00-initial-r00 (configured, 0 targets).
16
 
17
  Statistical status: pending. Awaiting confirmatory runs.
18
 
 
1
  # Study progress
2
 
3
+ Updated 2026-11-25T08:31:27+00:00.
4
 
5
+ 13 training/control records and 0 final evaluations are complete. This is 10.8% of 120 planned model milestones.
6
 
7
  ## Current record
8
 
 
12
 
13
  Statistical status: pending. Awaiting confirmatory runs.
14
 
15
+ **abstracts** has 1 completed runs. Current records: abstracts-control-s00-initial-r00 (configured, 0 targets).
16
 
17
  Statistical status: pending. Awaiting confirmatory runs.
18
 
research/reports/summary.md CHANGED
@@ -1,6 +1,6 @@
1
  # Study summary
2
 
3
- Recorded 14 runs, including 13 with a completed summary.
4
 
5
  **TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
6
 
@@ -17,6 +17,7 @@ Recorded 14 runs, including 13 with a completed summary.
17
  | Stage | Phase | Method | Ratio | Tokens/run | Runs | Median dev NLL | Median test NLL |
18
  | --- | --- | --- | --- | --- | --- | --- | --- |
19
  | Research abstracts | diagnostic | Third derivative | 0.030 | 65,536 | 1 | 3.1168 | — |
 
20
  | TinyStories | control | Initial checkpoint | 0.000 | 0 | 1 | 8.3437 | — |
21
  | TinyStories | control | Unigram | 0.000 | 0 | 1 | 6.0036 | — |
22
  | TinyStories | pilot | Ordinary AdamW | 0.000 | 2,097,152 | 1 | 3.8770 | — |
 
1
  # Study summary
2
 
3
+ Recorded 15 runs, including 14 with a completed summary.
4
 
5
  **TinyStories.** Awaiting paired test results (0 of 8 full-horizon training triplets).
6
 
 
17
  | Stage | Phase | Method | Ratio | Tokens/run | Runs | Median dev NLL | Median test NLL |
18
  | --- | --- | --- | --- | --- | --- | --- | --- |
19
  | Research abstracts | diagnostic | Third derivative | 0.030 | 65,536 | 1 | 3.1168 | — |
20
+ | Research abstracts | pilot | Third derivative | 0.030 | 65,536 | 1 | 3.1149 | — |
21
  | TinyStories | control | Initial checkpoint | 0.000 | 0 | 1 | 8.3437 | — |
22
  | TinyStories | control | Unigram | 0.000 | 0 | 1 | 6.0036 | — |
23
  | TinyStories | pilot | Ordinary AdamW | 0.000 | 2,097,152 | 1 | 3.8770 | — |
research/results/abstracts-pilot-s00-third-r03-fp64/config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "abstracts-pilot-s00-third-r03-fp64",
3
+ "stage": "abstracts",
4
+ "method": "third",
5
+ "phase": "pilot",
6
+ "seed": 0,
7
+ "ratio": 0.03,
8
+ "token_budget": 65536,
9
+ "batch_windows": 8,
10
+ "context": 128,
11
+ "data_manifest_sha256": "0638bd23a7d1dc3ecb9138074ecd922211df2637f60736ddfab7e9aec0b3ccb9",
12
+ "microbatch": 2,
13
+ "derivative_dtype": "float64",
14
+ "derivative_device": "cpu",
15
+ "coefficients": {
16
+ "third": 1.8177534873097565e-16
17
+ }
18
+ }
research/results/abstracts-pilot-s00-third-r03-fp64/evaluation.jsonl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"timestamp": "2026-11-25T08:20:39+00:00", "split": "dev", "targets_scored": 466944, "targets_to_score": 5124071, "nll_so_far": 3.1088260477000293, "accuracy_so_far": 0.41273685923793857, "score_seconds": 60.07268810000096}
2
+ {"timestamp": "2026-11-25T08:21:39+00:00", "split": "dev", "targets_scored": 925696, "targets_to_score": 5124071, "nll_so_far": 3.1037195404750437, "accuracy_so_far": 0.41355261338495575, "score_seconds": 120.31516709999778}
3
+ {"timestamp": "2026-11-25T08:22:40+00:00", "split": "dev", "targets_scored": 1353728, "targets_to_score": 5124071, "nll_so_far": 3.1033672920460624, "accuracy_so_far": 0.41359194756996975, "score_seconds": 180.52763439999762}
4
+ {"timestamp": "2026-11-25T08:23:40+00:00", "split": "dev", "targets_scored": 1810432, "targets_to_score": 5124071, "nll_so_far": 3.107115674487629, "accuracy_so_far": 0.4134543578549208, "score_seconds": 240.65438119999817}
5
+ {"timestamp": "2026-11-25T08:24:40+00:00", "split": "dev", "targets_scored": 2199552, "targets_to_score": 5124071, "nll_so_far": 3.103493530255763, "accuracy_so_far": 0.4138829179760242, "score_seconds": 300.8205721999984}
6
+ {"timestamp": "2026-11-25T08:25:41+00:00", "split": "dev", "targets_scored": 2633728, "targets_to_score": 5124071, "nll_so_far": 3.103459329177223, "accuracy_so_far": 0.4140503499222395, "score_seconds": 362.3933545}
7
+ {"timestamp": "2026-11-25T08:26:42+00:00", "split": "dev", "targets_scored": 3082240, "targets_to_score": 5124071, "nll_so_far": 3.1019827696466913, "accuracy_so_far": 0.41433827346345514, "score_seconds": 422.642445999998}
8
+ {"timestamp": "2026-11-25T08:27:42+00:00", "split": "dev", "targets_scored": 3534848, "targets_to_score": 5124071, "nll_so_far": 3.105719434134236, "accuracy_so_far": 0.4139979993482039, "score_seconds": 482.86223529999916}
9
+ {"timestamp": "2026-11-25T08:28:42+00:00", "split": "dev", "targets_scored": 3966976, "targets_to_score": 5124071, "nll_so_far": 3.1073454599289025, "accuracy_so_far": 0.413889572308983, "score_seconds": 543.0346836000026}
10
+ {"timestamp": "2026-11-25T08:29:42+00:00", "split": "dev", "targets_scored": 4415488, "targets_to_score": 5124071, "nll_so_far": 3.109312734825594, "accuracy_so_far": 0.4136915330762987, "score_seconds": 603.1816443999996}
11
+ {"timestamp": "2026-11-25T08:30:42+00:00", "split": "dev", "targets_scored": 4866048, "targets_to_score": 5124071, "nll_so_far": 3.111963312678009, "accuracy_so_far": 0.41345543652672556, "score_seconds": 663.3964372999981}
12
+ {"timestamp": "2026-11-25T08:31:17+00:00", "split": "dev", "targets_scored": 5124071, "targets_to_score": 5124071, "nll_so_far": 3.1148602603458824, "accuracy_so_far": 0.4130924415372074, "score_seconds": 697.9214215000029}
research/results/abstracts-pilot-s00-third-r03-fp64/events.jsonl ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"timestamp": "2026-11-25T08:13:31+00:00", "step": 1, "tokens": 1024, "train_seconds": 0.962927699998545, "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.962927699998545}
2
+ {"timestamp": "2026-11-25T08:14:29+00:00", "step": 2, "tokens": 2048, "train_seconds": 59.588642899998376, "loss": 3.4265871047973633, "accuracy": 0.3720703125, "lr": 6.666666666666667e-05, "gradient_norm": 2.477825164794922, "derivatives": {"third": {"estimate": 687644208669.4894, "raw_grad_norm": 1361448063580871.2, "lambda": 1.8177534873097565e-16, "probe_seconds": 57.878220300000976}}, "host_probe_seconds": 57.878220300000976, "training_seconds_excluding_host_probes": 1.7104225999974005, "penalty": 0.0009999741266698578}
3
+ {"timestamp": "2026-11-25T08:14:36+00:00", "step": 4, "tokens": 4096, "train_seconds": 64.748265299997, "loss": 3.3355765342712402, "accuracy": 0.3671875, "lr": 9.994033404481737e-05, "gradient_norm": 1.1430377960205078, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 6.870044999996026, "dev_nll": 3.205850869708229, "dev_accuracy": 0.4027099609375}
4
+ {"timestamp": "2026-11-25T08:14:40+00:00", "step": 8, "tokens": 8192, "train_seconds": 67.7308524, "loss": 3.1542978286743164, "accuracy": 0.41015625, "lr": 9.851624761560943e-05, "gradient_norm": 1.3654953241348267, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 9.852632099999028, "dev_nll": 3.185838397825137, "dev_accuracy": 0.406494140625}
5
+ {"timestamp": "2026-11-25T08:15:38+00:00", "step": 11, "tokens": 11264, "train_seconds": 125.70181410000441, "loss": 3.222909927368164, "accuracy": 0.412109375, "lr": 9.623426070191522e-05, "gradient_norm": 4.982945442199707, "derivatives": {"third": {"estimate": 305501104666.5071, "raw_grad_norm": 3591553778733335.5, "lambda": 1.8177534873097565e-16, "probe_seconds": 55.88409010000032}}, "host_probe_seconds": 55.88409010000032, "training_seconds_excluding_host_probes": 11.939503700003115, "penalty": 0.00044426055870762094}
6
+ {"timestamp": "2026-11-25T08:15:44+00:00", "step": 12, "tokens": 12288, "train_seconds": 130.09385470000416, "loss": 3.226421594619751, "accuracy": 0.4208984375, "lr": 9.525191870029581e-05, "gradient_norm": 1.1676359176635742, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 16.33154430000286, "dev_nll": 3.1688174732844345, "dev_accuracy": 0.40673828125}
7
+ {"timestamp": "2026-11-25T08:15:48+00:00", "step": 16, "tokens": 16384, "train_seconds": 132.96146440000302, "loss": 3.176070213317871, "accuracy": 0.404296875, "lr": 9.028539129595197e-05, "gradient_norm": 1.3013406991958618, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 19.199154000001727, "dev_nll": 3.155030827212613, "dev_accuracy": 0.40869140625}
8
+ {"timestamp": "2026-11-25T08:15:52+00:00", "step": 20, "tokens": 20480, "train_seconds": 135.62548290000996, "loss": 3.365168571472168, "accuracy": 0.3818359375, "lr": 8.38266930414179e-05, "gradient_norm": 1.2591444253921509, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 21.86317250000866, "dev_nll": 3.14251070341561, "dev_accuracy": 0.40771484375}
9
+ {"timestamp": "2026-11-25T08:16:52+00:00", "step": 22, "tokens": 22528, "train_seconds": 195.6454539000115, "loss": 3.1007277965545654, "accuracy": 0.4013671875, "lr": 8.01209674912089e-05, "gradient_norm": 1.1925373077392578, "derivatives": {"third": {"estimate": 171513315730.0954, "raw_grad_norm": 105524567385533.45, "lambda": 1.8177534873097565e-16, "probe_seconds": 58.4897392999992}}, "host_probe_seconds": 58.4897392999992, "training_seconds_excluding_host_probes": 23.39340420001099, "penalty": 0.0002494151422307522}
10
+ {"timestamp": "2026-11-25T08:16:58+00:00", "step": 24, "tokens": 24576, "train_seconds": 200.80499380000765, "loss": 3.1658759117126465, "accuracy": 0.4140625, "lr": 7.614895343622941e-05, "gradient_norm": 1.4459034204483032, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 28.552944100007153, "dev_nll": 3.131769879197236, "dev_accuracy": 0.4073486328125}
11
+ {"timestamp": "2026-11-25T08:17:55+00:00", "step": 25, "tokens": 25600, "train_seconds": 257.6465824000079, "loss": 3.161825180053711, "accuracy": 0.400390625, "lr": 7.407614758194375e-05, "gradient_norm": 1.5947465896606445, "derivatives": {"third": {"estimate": 918015450216.7732, "raw_grad_norm": 821309261872224.1, "lambda": 1.8177534873097565e-16, "probe_seconds": 56.20942120000109}}, "host_probe_seconds": 56.20942120000109, "training_seconds_excluding_host_probes": 29.185111500006315, "penalty": 0.0013349806288286204}
12
+ {"timestamp": "2026-11-25T08:18:02+00:00", "step": 28, "tokens": 28672, "train_seconds": 263.6649002000049, "loss": 3.242283582687378, "accuracy": 0.3974609375, "lr": 6.757685356832243e-05, "gradient_norm": 1.1834553480148315, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 35.203429300003336, "dev_nll": 3.1222981341998093, "dev_accuracy": 0.407958984375}
13
+ {"timestamp": "2026-11-25T08:18:06+00:00", "step": 32, "tokens": 32768, "train_seconds": 266.4159822000038, "loss": 3.47184419631958, "accuracy": 0.3759765625, "lr": 5.84728957956991e-05, "gradient_norm": 1.3780546188354492, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 37.954511300002196, "dev_nll": 3.1137536005699076, "dev_accuracy": 0.4097900390625}
14
+ {"timestamp": "2026-11-25T08:18:10+00:00", "step": 36, "tokens": 36864, "train_seconds": 269.1472620000095, "loss": 3.13436222076416, "accuracy": 0.3994140625, "lr": 4.9222074018405206e-05, "gradient_norm": 1.27980637550354, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 40.68579110000792, "dev_nll": 3.1068799886270426, "dev_accuracy": 0.41162109375}
15
+ {"timestamp": "2026-11-25T08:18:14+00:00", "step": 40, "tokens": 40960, "train_seconds": 271.90369160000773, "loss": 3.0670571327209473, "accuracy": 0.4267578125, "lr": 4.021559281401244e-05, "gradient_norm": 1.2274017333984375, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 43.442220700006146, "dev_nll": 3.101782739860937, "dev_accuracy": 0.4114990234375}
16
+ {"timestamp": "2026-11-25T08:18:18+00:00", "step": 44, "tokens": 45056, "train_seconds": 274.78990590000467, "loss": 3.3899011611938477, "accuracy": 0.3681640625, "lr": 3.183432393205763e-05, "gradient_norm": 1.2034586668014526, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 46.32843500000308, "dev_nll": 3.098028525535483, "dev_accuracy": 0.4119873046875}
17
+ {"timestamp": "2026-11-25T08:18:22+00:00", "step": 48, "tokens": 49152, "train_seconds": 277.2874240000019, "loss": 3.2332143783569336, "accuracy": 0.376953125, "lr": 2.443269974962181e-05, "gradient_norm": 1.29664945602417, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 48.82595310000033, "dev_nll": 3.095082105253823, "dev_accuracy": 0.411865234375}
18
+ {"timestamp": "2026-11-25T08:19:21+00:00", "step": 50, "tokens": 51200, "train_seconds": 336.416138200002, "loss": 3.0864548683166504, "accuracy": 0.4052734375, "lr": 2.1199063110826618e-05, "gradient_norm": 2.964020013809204, "derivatives": {"third": {"estimate": 757294136851.5509, "raw_grad_norm": 1853270582350327.2, "lambda": 1.8177534873097565e-16, "probe_seconds": 57.830706500000815}}, "host_probe_seconds": 57.830706500000815, "training_seconds_excluding_host_probes": 50.12396079999962, "penalty": 0.0011012592465449108}
19
+ {"timestamp": "2026-11-25T08:19:28+00:00", "step": 52, "tokens": 53248, "train_seconds": 341.5731149000021, "loss": 3.066990852355957, "accuracy": 0.41015625, "lr": 1.8323724811743496e-05, "gradient_norm": 1.1498953104019165, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 55.28093749999971, "dev_nll": 3.093058333382942, "dev_accuracy": 0.4130859375}
20
+ {"timestamp": "2026-11-25T08:19:31+00:00", "step": 56, "tokens": 57344, "train_seconds": 344.05631189999986, "loss": 3.2474496364593506, "accuracy": 0.4033203125, "lr": 1.3765739298084793e-05, "gradient_norm": 1.1399725675582886, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 57.76413449999745, "dev_nll": 3.091498479945585, "dev_accuracy": 0.4139404296875}
21
+ {"timestamp": "2026-11-25T08:19:35+00:00", "step": 60, "tokens": 61440, "train_seconds": 346.7057458999989, "loss": 3.1669363975524902, "accuracy": 0.40625, "lr": 1.09514941707089e-05, "gradient_norm": 1.1765968799591064, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 60.41356849999647, "dev_nll": 3.0903065995080397, "dev_accuracy": 0.414306640625}
22
+ {"timestamp": "2026-11-25T08:19:39+00:00", "step": 64, "tokens": 65536, "train_seconds": 349.2530617000011, "loss": 3.1704280376434326, "accuracy": 0.40234375, "lr": 1e-05, "gradient_norm": 1.135949730873108, "derivatives": {}, "host_probe_seconds": 0, "training_seconds_excluding_host_probes": 62.960884299998725, "dev_nll": 3.089313570468221, "dev_accuracy": 0.4146728515625}
research/results/abstracts-pilot-s00-third-r03-fp64/samples.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {"timestamp": "2026-11-25T08:31:20+00:00", "split": "dev", "prompt": "One of the central objectives of contemporary neuroimaging research is to\ncreate predictive models", "reference": " that can disentangle the connection between patterns\nof functional connectivity across the entire brain and various behavioral\ntraits. Previous studies have shown that models trained to predict behavioral\nfeatures from the individual's functional", "continuation": " that will accurately predict the behavior of\npatient-specific neurological disorders such as epilepsy. In this paper, we\npresent a novel dataset of EEG data recorded from children with focal\nsubcortical epilepsy", "prompt_ids": [4041, 273, 253, 4275, 16566, 273, 13399, 6551, 40270, 2561, 310, 281, 187, 6953, 15970, 3210], "generated_ids": [326, 588, 13613, 3283, 253, 3879, 273, 187, 15325, 14, 6160, 20967, 9360, 824, 347, 29931, 15, 496, 436, 2929, 13, 359, 187, 15068, 247, 4460, 10895, 273, 29253, 941, 5950, 432, 2151, 342, 18560, 187, 2377, 68, 35149, 29931], "tokens": 40, "sampling_seed": 7401, "temperature": 0.8}
2
+ {"timestamp": "2026-11-25T08:31:22+00:00", "split": "dev", "prompt": "In the evolving landscape of computer vision, foundation models have emerged\nas pivotal tools", "reference": ", exhibiting exceptional adaptability to a myriad of tasks.\nAmong these, the Segment Anything Model (SAM) by Meta AI has distinguished\nitself in image segmentation. However, SAM, like", "continuation": " to study the behavior of computer vision systems.\nThese widely adopted modeling approaches tend to be associated with\na small number of identified object classes. On the one hand, they\nare often effective to", "prompt_ids": [688, 253, 25537, 13016, 273, 4382, 8113, 13, 12153, 3210, 452, 13082, 187, 284, 30847, 5657], "generated_ids": [281, 1263, 253, 3879, 273, 4382, 8113, 2718, 15, 187, 6872, 7561, 8671, 14053, 7274, 5257, 281, 320, 2330, 342, 187, 66, 1355, 1180, 273, 3636, 1789, 5971, 15, 1623, 253, 581, 1133, 13, 597, 187, 609, 2223, 3576, 281], "tokens": 40, "sampling_seed": 7402, "temperature": 0.8}
3
+ {"timestamp": "2026-11-25T08:31:25+00:00", "split": "dev", "prompt": "We investigate the connection between the turnover frequency in the radio\nspectrum, $\\nu", "reference": "_{\\rm TO}$, and the rate of ionising ultra-violet photons,\n$Q_{\\rm HI}$, in extragalactic sources. From a large, optically selected,\nsample we", "continuation": "_{\\rm{break}}$, and the spectral index of the underlying\nspectral index $s_{\\rm{break}}$, and reveal that there is a universal\nrelationship between both quantities that can be used to", "prompt_ids": [1231, 7409, 253, 4602, 875, 253, 25759, 4294, 275, 253, 5553, 187, 39862, 13, 669, 3023], "generated_ids": [1126, 1109, 92, 7054, 12460, 285, 253, 9879, 3605, 273, 253, 6944, 187, 18181, 1544, 3605, 370, 84, 1126, 1109, 92, 7054, 12460, 285, 10313, 326, 627, 310, 247, 10898, 187, 46397, 875, 1097, 13483, 326, 476, 320, 908, 281], "tokens": 40, "sampling_seed": 7403, "temperature": 0.8}
research/results/abstracts-pilot-s00-third-r03-fp64/summary.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "abstracts-pilot-s00-third-r03-fp64",
3
+ "stage": "abstracts",
4
+ "method": "third",
5
+ "phase": "pilot",
6
+ "seed": 0,
7
+ "ratio": 0.03,
8
+ "token_budget": 65536,
9
+ "batch_windows": 8,
10
+ "context": 128,
11
+ "data_manifest_sha256": "0638bd23a7d1dc3ecb9138074ecd922211df2637f60736ddfab7e9aec0b3ccb9",
12
+ "microbatch": 2,
13
+ "derivative_dtype": "float64",
14
+ "derivative_device": "cpu",
15
+ "coefficients": {
16
+ "third": 1.8177534873097565e-16
17
+ },
18
+ "device": "cuda",
19
+ "torch": "2.15.0+cu132",
20
+ "platform": "Windows-11-10.0.26200-SP0",
21
+ "gpu": "NVIDIA GeForce RTX 5070 Laptop GPU",
22
+ "initial_trainable_sha256": "1c45ca4d5b3a6cd1b53eadaa7df8af15e21a040a8a61aa7f0e91d1b6f019320b",
23
+ "cpu_threads": 6,
24
+ "evaluation_batch_windows": 16,
25
+ "git_revision": "a1ba0fc2e322c16968bbce4e3dc5b9ac67037374",
26
+ "trainable_parameters": 786432,
27
+ "host_probe_seconds": 286.2921774000024,
28
+ "training_seconds_excluding_host_probes": 62.960884299998725,
29
+ "weights_sha256": "ba783a138db5dcb60db9075e12ef04ab5251e8591e5f580fd48b4418f8e2e1e0",
30
+ "weights_name": "adapter_model.safetensors",
31
+ "matched_dev_nll": 3.089313570468221,
32
+ "tokens": 65536,
33
+ "steps": 64,
34
+ "train_seconds": 349.2530617000011,
35
+ "tokens_per_sec": 187.64617175008087,
36
+ "process_peak_rss_mib": 15321.11328125,
37
+ "peak_vram_mb": 2346.30029296875,
38
+ "dev_nll": 3.1148602603458824,
39
+ "dev_accuracy": 0.4130924415372074,
40
+ "dev_tokens": 5124071,
41
+ "finished_at": "2026-11-25T08:31:25+00:00",
42
+ "status": "complete"
43
+ }
research/results/calibration/abstracts-third-fp64.json ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "stage": "abstracts",
3
+ "kind": "third",
4
+ "data_manifest_sha256": "0638bd23a7d1dc3ecb9138074ecd922211df2637f60736ddfab7e9aec0b3ccb9",
5
+ "unit_lambda": 6.059178291032522e-15,
6
+ "draws": [
7
+ {
8
+ "draw": 0,
9
+ "ce_grad_norm": 1.1272474527359009,
10
+ "penalty_grad_norm": 910729436494438.9,
11
+ "value": 834685395129.9045,
12
+ "norm_ratio": 1.2377413176353218e-15,
13
+ "probe_seconds": 60.33973419999893,
14
+ "peak_allocated_mib": 1552.23583984375
15
+ },
16
+ {
17
+ "draw": 1,
18
+ "ce_grad_norm": 1.1757105588912964,
19
+ "penalty_grad_norm": 186194126220231.7,
20
+ "value": 159812556631.67688,
21
+ "norm_ratio": 6.3144342024015186e-15,
22
+ "probe_seconds": 55.740933799999766,
23
+ "peak_allocated_mib": 1552.23583984375
24
+ },
25
+ {
26
+ "draw": 2,
27
+ "ce_grad_norm": 1.2021815776824951,
28
+ "penalty_grad_norm": 108966576920843.86,
29
+ "value": 153088393491.90155,
30
+ "norm_ratio": 1.1032571744965348e-14,
31
+ "probe_seconds": 55.759018200002174,
32
+ "peak_allocated_mib": 1552.23583984375
33
+ },
34
+ {
35
+ "draw": 3,
36
+ "ce_grad_norm": 1.0702996253967285,
37
+ "penalty_grad_norm": 3.9919238583350056e+16,
38
+ "value": 6953712848913.515,
39
+ "norm_ratio": 2.6811624253853893e-17,
40
+ "probe_seconds": 54.50471869999819,
41
+ "peak_allocated_mib": 1552.23583984375
42
+ },
43
+ {
44
+ "draw": 4,
45
+ "ce_grad_norm": 1.181842565536499,
46
+ "penalty_grad_norm": 105071420078010.61,
47
+ "value": 219610434477.3632,
48
+ "norm_ratio": 1.1247992695435507e-14,
49
+ "probe_seconds": 54.978216199997405,
50
+ "peak_allocated_mib": 1552.23583984375
51
+ },
52
+ {
53
+ "draw": 5,
54
+ "ce_grad_norm": 1.2219445705413818,
55
+ "penalty_grad_norm": 250434198480525.06,
56
+ "value": 282150956586.81854,
57
+ "norm_ratio": 4.87930393674411e-15,
58
+ "probe_seconds": 56.60531099999935,
59
+ "peak_allocated_mib": 1552.23583984375
60
+ },
61
+ {
62
+ "draw": 6,
63
+ "ce_grad_norm": 1.1192132234573364,
64
+ "penalty_grad_norm": 632518813384390.5,
65
+ "value": 197389403517.5067,
66
+ "norm_ratio": 1.7694544411553732e-15,
67
+ "probe_seconds": 56.84666650000145,
68
+ "peak_allocated_mib": 1552.23583984375
69
+ },
70
+ {
71
+ "draw": 7,
72
+ "ce_grad_norm": 1.0118643045425415,
73
+ "penalty_grad_norm": 174341460541931.47,
74
+ "value": 153537460935.50665,
75
+ "norm_ratio": 5.803922379663525e-15,
76
+ "probe_seconds": 53.74921510000058,
77
+ "peak_allocated_mib": 1552.23583984375
78
+ },
79
+ {
80
+ "draw": 8,
81
+ "ce_grad_norm": 1.225813627243042,
82
+ "penalty_grad_norm": 83586087695599.7,
83
+ "value": 129242221450.65302,
84
+ "norm_ratio": 1.4665282956024434e-14,
85
+ "probe_seconds": 56.13168239999868,
86
+ "peak_allocated_mib": 1552.23583984375
87
+ },
88
+ {
89
+ "draw": 9,
90
+ "ce_grad_norm": 1.167998194694519,
91
+ "penalty_grad_norm": 114416639410859.17,
92
+ "value": 175741652819.1452,
93
+ "norm_ratio": 1.020828963958948e-14,
94
+ "probe_seconds": 57.82997389999946,
95
+ "peak_allocated_mib": 1552.23583984375
96
+ },
97
+ {
98
+ "draw": 10,
99
+ "ce_grad_norm": 1.1549506187438965,
100
+ "penalty_grad_norm": 441687750783840.4,
101
+ "value": 612261541935.509,
102
+ "norm_ratio": 2.6148577059116208e-15,
103
+ "probe_seconds": 57.42297689999759,
104
+ "peak_allocated_mib": 1552.23583984375
105
+ },
106
+ {
107
+ "draw": 11,
108
+ "ce_grad_norm": 1.0679398775100708,
109
+ "penalty_grad_norm": 94314795672815.34,
110
+ "value": 158101082366.27707,
111
+ "norm_ratio": 1.1323142566250467e-14,
112
+ "probe_seconds": 58.35683330000029,
113
+ "peak_allocated_mib": 1552.23583984375
114
+ },
115
+ {
116
+ "draw": 12,
117
+ "ce_grad_norm": 1.2423405647277832,
118
+ "penalty_grad_norm": 287315887794136.56,
119
+ "value": 94744715880.54042,
120
+ "norm_ratio": 4.323953590822402e-15,
121
+ "probe_seconds": 59.645345000000816,
122
+ "peak_allocated_mib": 1552.23583984375
123
+ },
124
+ {
125
+ "draw": 13,
126
+ "ce_grad_norm": 1.177032709121704,
127
+ "penalty_grad_norm": 385676112557798.44,
128
+ "value": 482594580708.791,
129
+ "norm_ratio": 3.0518683185111985e-15,
130
+ "probe_seconds": 58.16326520000075,
131
+ "peak_allocated_mib": 1552.23583984375
132
+ },
133
+ {
134
+ "draw": 14,
135
+ "ce_grad_norm": 1.1937261819839478,
136
+ "penalty_grad_norm": 102328970961512.16,
137
+ "value": 120579032529.80841,
138
+ "norm_ratio": 1.1665573989138721e-14,
139
+ "probe_seconds": 59.03697579999789,
140
+ "peak_allocated_mib": 1552.23583984375
141
+ },
142
+ {
143
+ "draw": 15,
144
+ "ce_grad_norm": 1.1019200086593628,
145
+ "penalty_grad_norm": 116499166026949.25,
146
+ "value": 111835215128.08981,
147
+ "norm_ratio": 9.45860855694418e-15,
148
+ "probe_seconds": 57.153079499999876,
149
+ "peak_allocated_mib": 1552.23583984375
150
+ }
151
+ ],
152
+ "derivative_device": "cpu",
153
+ "derivative_dtype": "float64",
154
+ "initial_trainable_sha256": "1c45ca4d5b3a6cd1b53eadaa7df8af15e21a040a8a61aa7f0e91d1b6f019320b"
155
+ }
research/results/verification/pythia-scoring-batches.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "timestamp": "2026-11-25T07:57:00+00:00",
3
+ "split": "train",
4
+ "device": "cuda",
5
+ "initial_trainable_sha256": "1c45ca4d5b3a6cd1b53eadaa7df8af15e21a040a8a61aa7f0e91d1b6f019320b",
6
+ "records": [
7
+ {
8
+ "batch": 2,
9
+ "seconds": 7.977122499996767,
10
+ "targets_per_second": 4107.7468723857855,
11
+ "peak_allocated_mib": 1649.23291015625,
12
+ "nll": 3.2559770708321594,
13
+ "accuracy": 0.402374267578125,
14
+ "tokens": 32768,
15
+ "perplexity": 25.944952209677197
16
+ },
17
+ {
18
+ "batch": 8,
19
+ "seconds": 4.270318099999713,
20
+ "targets_per_second": 7673.433040035637,
21
+ "peak_allocated_mib": 1942.24755859375,
22
+ "nll": 3.255976888554869,
23
+ "accuracy": 0.40234375,
24
+ "tokens": 32768,
25
+ "perplexity": 25.944947480502044
26
+ },
27
+ {
28
+ "batch": 16,
29
+ "seconds": 4.224423999999999,
30
+ "targets_per_second": 7756.797139681056,
31
+ "peak_allocated_mib": 2337.26708984375,
32
+ "nll": 3.255976888554869,
33
+ "accuracy": 0.40234375,
34
+ "tokens": 32768,
35
+ "perplexity": 25.944947480502044
36
+ },
37
+ {
38
+ "batch": 32,
39
+ "seconds": 4.2637074000012944,
40
+ "targets_per_second": 7685.330377030575,
41
+ "peak_allocated_mib": 3121.30615234375,
42
+ "nll": 3.255976888554869,
43
+ "accuracy": 0.40234375,
44
+ "tokens": 32768,
45
+ "perplexity": 25.944947480502044
46
+ }
47
+ ],
48
+ "selected_batch": 16
49
+ }
research/results/verification/tests.json CHANGED
@@ -1,16 +1,16 @@
1
  {
2
- "checked_at": "2026-11-25T07:54:35+00:00",
3
- "git_revision": "7412d483aa852eef3bba78ecf33912c8be8a3eb0",
4
  "exit_code": 0,
5
  "cases": [
6
  {
7
  "test": "tests.test_analysis.test_wins_require_both_registered_exact_sign_tests",
8
- "seconds": 0.002,
9
  "outcome": "passed"
10
  },
11
  {
12
  "test": "tests.test_analysis.test_second_comparator_failure_and_ties_count_separately",
13
- "seconds": 0.002,
14
  "outcome": "passed"
15
  },
16
  {
@@ -83,9 +83,14 @@
83
  "seconds": 0.001,
84
  "outcome": "passed"
85
  },
 
 
 
 
 
86
  {
87
  "test": "tests.test_analysis.test_time_matched_comparison_uses_one_validation_population_across_methods",
88
- "seconds": 0.002,
89
  "outcome": "passed"
90
  },
91
  {
@@ -95,82 +100,82 @@
95
  },
96
  {
97
  "test": "tests.test_data.test_prefix_candidates_match_exhaustive_jaccard_including_boundary",
98
- "seconds": 0.058,
99
  "outcome": "passed"
100
  },
101
  {
102
  "test": "tests.test_data.test_abstract_submission_month_and_base_id_grouping",
103
- "seconds": 0.053,
104
  "outcome": "passed"
105
  },
106
  {
107
  "test": "tests.test_data.test_prepare_from_parquet_proves_train_only_fit_packing_and_repair",
108
- "seconds": 0.451,
109
  "outcome": "passed"
110
  },
111
  {
112
  "test": "tests.test_derivatives.test_gpu_production_decoder_third_order_update_matches_cpu",
113
- "seconds": 2.731,
114
  "outcome": "passed"
115
  },
116
  {
117
  "test": "tests.test_derivatives.test_quartic_penalty_retains_fourth_derivative",
118
- "seconds": 0.006,
119
  "outcome": "passed"
120
  },
121
  {
122
  "test": "tests.test_derivatives.test_mixed_cubic_exactly_averages_to_tensor_norm",
123
- "seconds": 0.044,
124
  "outcome": "passed"
125
  },
126
  {
127
  "test": "tests.test_derivatives.test_random_probe_generator_gives_independent_directions",
128
- "seconds": 0.172,
129
  "outcome": "passed"
130
  },
131
  {
132
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[third]",
133
- "seconds": 0.003,
134
  "outcome": "passed"
135
  },
136
  {
137
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[trace]",
138
- "seconds": 0.002,
139
  "outcome": "passed"
140
  },
141
  {
142
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[hessian_norm]",
143
- "seconds": 0.002,
144
  "outcome": "passed"
145
  },
146
  {
147
  "test": "tests.test_derivatives.test_quadratic_has_curvature_and_zero_third_derivative",
148
- "seconds": 0.001,
149
  "outcome": "passed"
150
  },
151
  {
152
  "test": "tests.test_derivatives.test_signed_hessian_trace_and_squared_norm_have_correct_gradients",
153
- "seconds": 0.005,
154
  "outcome": "passed"
155
  },
156
  {
157
  "test": "tests.test_derivatives.test_tiny_transformer_against_dense_tensor_and_finite_differences",
158
- "seconds": 2.44,
159
  "outcome": "passed"
160
  },
161
  {
162
  "test": "tests.test_derivatives.test_actual_adamw_update_responds_to_the_third_order_term",
163
- "seconds": 0.019,
164
  "outcome": "passed"
165
  },
166
  {
167
  "test": "tests.test_derivatives.test_production_story_model_exposes_full_weight_penalty_gradient",
168
- "seconds": 0.046,
169
  "outcome": "passed"
170
  },
171
  {
172
  "test": "tests.test_derivatives.test_pythia_adapter_fourth_derivative_and_portable_checkpoint",
173
- "seconds": 4.959,
174
  "outcome": "passed",
175
  "measurements": {
176
  "adapter_directional_autograd": "9035.374247002468",
@@ -179,32 +184,42 @@
179
  },
180
  {
181
  "test": "tests.test_derivatives.test_large_finite_gradient_norm_survives_squaring",
182
- "seconds": 0.003,
183
  "outcome": "passed"
184
  },
185
  {
186
  "test": "tests.test_derivatives.test_sequential_windows_reproduce_joint_penalty_and_training_gradient",
187
- "seconds": 0.109,
188
  "outcome": "passed"
189
  },
190
  {
191
  "test": "tests.test_reporting.test_snapshot_keeps_full_score_and_trace_semantics",
192
- "seconds": 0.014,
193
  "outcome": "passed"
194
  },
195
  {
196
  "test": "tests.test_reporting.test_report_before_first_run_keeps_readme_and_emits_protocol_paper",
197
- "seconds": 0.586,
198
  "outcome": "passed"
199
  },
200
  {
201
  "test": "tests.test_training.test_randomized_control_preserves_coordinate_magnitudes_and_zero_is_noop",
202
- "seconds": 0.134,
203
  "outcome": "passed"
204
  },
205
  {
206
  "test": "tests.test_training.test_step_recovery_matches_uninterrupted_weights",
207
- "seconds": 2.016,
 
 
 
 
 
 
 
 
 
 
208
  "outcome": "passed"
209
  }
210
  ]
 
1
  {
2
+ "checked_at": "2026-11-25T08:30:11+00:00",
3
+ "git_revision": "021264128e1fc7eb7dd7b03db922ca576dc144af",
4
  "exit_code": 0,
5
  "cases": [
6
  {
7
  "test": "tests.test_analysis.test_wins_require_both_registered_exact_sign_tests",
8
+ "seconds": 0.001,
9
  "outcome": "passed"
10
  },
11
  {
12
  "test": "tests.test_analysis.test_second_comparator_failure_and_ties_count_separately",
13
+ "seconds": 0.001,
14
  "outcome": "passed"
15
  },
16
  {
 
83
  "seconds": 0.001,
84
  "outcome": "passed"
85
  },
86
+ {
87
+ "test": "tests.test_analysis.test_adapter_time_comparisons_keep_allocated_device_and_host_excluded_clocks_distinct",
88
+ "seconds": 0.001,
89
+ "outcome": "passed"
90
+ },
91
  {
92
  "test": "tests.test_analysis.test_time_matched_comparison_uses_one_validation_population_across_methods",
93
+ "seconds": 0.001,
94
  "outcome": "passed"
95
  },
96
  {
 
100
  },
101
  {
102
  "test": "tests.test_data.test_prefix_candidates_match_exhaustive_jaccard_including_boundary",
103
+ "seconds": 0.054,
104
  "outcome": "passed"
105
  },
106
  {
107
  "test": "tests.test_data.test_abstract_submission_month_and_base_id_grouping",
108
+ "seconds": 0.034,
109
  "outcome": "passed"
110
  },
111
  {
112
  "test": "tests.test_data.test_prepare_from_parquet_proves_train_only_fit_packing_and_repair",
113
+ "seconds": 0.093,
114
  "outcome": "passed"
115
  },
116
  {
117
  "test": "tests.test_derivatives.test_gpu_production_decoder_third_order_update_matches_cpu",
118
+ "seconds": 2.451,
119
  "outcome": "passed"
120
  },
121
  {
122
  "test": "tests.test_derivatives.test_quartic_penalty_retains_fourth_derivative",
123
+ "seconds": 0.004,
124
  "outcome": "passed"
125
  },
126
  {
127
  "test": "tests.test_derivatives.test_mixed_cubic_exactly_averages_to_tensor_norm",
128
+ "seconds": 0.042,
129
  "outcome": "passed"
130
  },
131
  {
132
  "test": "tests.test_derivatives.test_random_probe_generator_gives_independent_directions",
133
+ "seconds": 0.183,
134
  "outcome": "passed"
135
  },
136
  {
137
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[third]",
138
+ "seconds": 0.002,
139
  "outcome": "passed"
140
  },
141
  {
142
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[trace]",
143
+ "seconds": 0.003,
144
  "outcome": "passed"
145
  },
146
  {
147
  "test": "tests.test_derivatives.test_penalty_supports_linear_loss_and_unused_coordinates[hessian_norm]",
148
+ "seconds": 0.003,
149
  "outcome": "passed"
150
  },
151
  {
152
  "test": "tests.test_derivatives.test_quadratic_has_curvature_and_zero_third_derivative",
153
+ "seconds": 0.002,
154
  "outcome": "passed"
155
  },
156
  {
157
  "test": "tests.test_derivatives.test_signed_hessian_trace_and_squared_norm_have_correct_gradients",
158
+ "seconds": 0.004,
159
  "outcome": "passed"
160
  },
161
  {
162
  "test": "tests.test_derivatives.test_tiny_transformer_against_dense_tensor_and_finite_differences",
163
+ "seconds": 1.62,
164
  "outcome": "passed"
165
  },
166
  {
167
  "test": "tests.test_derivatives.test_actual_adamw_update_responds_to_the_third_order_term",
168
+ "seconds": 0.007,
169
  "outcome": "passed"
170
  },
171
  {
172
  "test": "tests.test_derivatives.test_production_story_model_exposes_full_weight_penalty_gradient",
173
+ "seconds": 0.045,
174
  "outcome": "passed"
175
  },
176
  {
177
  "test": "tests.test_derivatives.test_pythia_adapter_fourth_derivative_and_portable_checkpoint",
178
+ "seconds": 4.554,
179
  "outcome": "passed",
180
  "measurements": {
181
  "adapter_directional_autograd": "9035.374247002468",
 
184
  },
185
  {
186
  "test": "tests.test_derivatives.test_large_finite_gradient_norm_survives_squaring",
187
+ "seconds": 0.002,
188
  "outcome": "passed"
189
  },
190
  {
191
  "test": "tests.test_derivatives.test_sequential_windows_reproduce_joint_penalty_and_training_gradient",
192
+ "seconds": 0.189,
193
  "outcome": "passed"
194
  },
195
  {
196
  "test": "tests.test_reporting.test_snapshot_keeps_full_score_and_trace_semantics",
197
+ "seconds": 0.015,
198
  "outcome": "passed"
199
  },
200
  {
201
  "test": "tests.test_reporting.test_report_before_first_run_keeps_readme_and_emits_protocol_paper",
202
+ "seconds": 0.485,
203
  "outcome": "passed"
204
  },
205
  {
206
  "test": "tests.test_training.test_randomized_control_preserves_coordinate_magnitudes_and_zero_is_noop",
207
+ "seconds": 0.099,
208
  "outcome": "passed"
209
  },
210
  {
211
  "test": "tests.test_training.test_step_recovery_matches_uninterrupted_weights",
212
+ "seconds": 2.134,
213
+ "outcome": "passed"
214
+ },
215
+ {
216
+ "test": "tests.test_training.test_adapter_confirmation_observes_early_matched_time_checkpoints",
217
+ "seconds": 0.001,
218
+ "outcome": "passed"
219
+ },
220
+ {
221
+ "test": "tests.test_training.test_evaluator_requires_measured_schedule_before_test_reads",
222
+ "seconds": 0.029,
223
  "outcome": "passed"
224
  }
225
  ]
research/src/thirdloss/analysis.py CHANGED
@@ -57,12 +57,12 @@ def _comparison(records, baseline):
57
  }
58
 
59
 
60
- def _time_match(seed, records):
61
  """Look backward from the shortest complete training run to actual validation evaluations."""
62
  runs = {method: records[seed, method] for method in _METHODS}
63
- if any(not _number(run.get("train_seconds")) or run["train_seconds"] <= 0 for run in runs.values()):
64
  return None
65
- cutoff = min(run["train_seconds"] for run in runs.values())
66
  # Production logs evaluate fixed windows at each diagnostic, including the final step.
67
  # Older homogeneous result files have a single dev_nll field for the same population.
68
  fixed_windows = any("matched_dev_nll" in run for run in runs.values())
@@ -70,24 +70,25 @@ def _time_match(seed, records):
70
  matched = {}
71
  for method, run in runs.items():
72
  events = list(run.get("events") or [])
73
- final = run.get("status") not in {"configured", "in progress", "training", "failed"}
74
  if final and _number(run.get(summary_field)):
75
  events.append({
76
- "tokens": run["tokens"], "train_seconds": run["train_seconds"],
77
  "dev_nll": run[summary_field],
78
  })
79
  eligible = [
80
  event for event in events
81
- if _number(event.get("train_seconds")) and 0 <= event["train_seconds"] <= cutoff
82
  and _number(event.get("dev_nll")) and event["dev_nll"] >= 0
83
  and _number(event.get("tokens")) and event["tokens"] >= 0
84
  ]
85
  if not eligible:
86
  return None
87
  # max() takes the first equal timestamp, giving a real event priority over its summary.
88
- event = max(eligible, key=lambda x: x["train_seconds"])
89
  matched[method] = {key: event[key] for key in ("tokens", "train_seconds", "dev_nll")}
90
- matched[method]["staleness_seconds"] = cutoff - event["train_seconds"]
 
91
  return {"seed": seed, "cutoff_seconds": cutoff, "by_method": matched}
92
 
93
 
@@ -114,7 +115,7 @@ def analyze_stage(summaries: list[dict], stage: str) -> dict:
114
  result = {
115
  "stage": stage, "status": "pending", "complete": False, "success": None,
116
  "n_expected_seeds": len(_SEEDS), "n_complete_seeds": 0, "missing": [],
117
- "comparisons": {}, "matched_time": [], "reason": "Awaiting confirmatory runs.",
118
  }
119
  records = {}
120
  for row in summaries:
@@ -144,6 +145,10 @@ def analyze_stage(summaries: list[dict], stage: str) -> dict:
144
  timing = _time_match(seed, records)
145
  if timing is not None:
146
  result["matched_time"].append(timing)
 
 
 
 
147
  if result["missing"]:
148
  result.update(status="incomplete", reason=f"All checkpoints must reach {horizon:,} target tokens.")
149
  return result
 
57
  }
58
 
59
 
60
+ def _time_match(seed, records, clock="train_seconds"):
61
  """Look backward from the shortest complete training run to actual validation evaluations."""
62
  runs = {method: records[seed, method] for method in _METHODS}
63
+ if any(not _number(run.get(clock)) or run[clock] <= 0 for run in runs.values()):
64
  return None
65
+ cutoff = min(run[clock] for run in runs.values())
66
  # Production logs evaluate fixed windows at each diagnostic, including the final step.
67
  # Older homogeneous result files have a single dev_nll field for the same population.
68
  fixed_windows = any("matched_dev_nll" in run for run in runs.values())
 
70
  matched = {}
71
  for method, run in runs.items():
72
  events = list(run.get("events") or [])
73
+ final = run.get("status") not in {"configured", "in progress", "training", "failed", "initializing", "scoring development"}
74
  if final and _number(run.get(summary_field)):
75
  events.append({
76
+ "tokens": run["tokens"], "train_seconds": run["train_seconds"], clock:run[clock],
77
  "dev_nll": run[summary_field],
78
  })
79
  eligible = [
80
  event for event in events
81
+ if _number(event.get(clock)) and 0 <= event[clock] <= cutoff
82
  and _number(event.get("dev_nll")) and event["dev_nll"] >= 0
83
  and _number(event.get("tokens")) and event["tokens"] >= 0
84
  ]
85
  if not eligible:
86
  return None
87
  # max() takes the first equal timestamp, giving a real event priority over its summary.
88
+ event = max(eligible, key=lambda x: x[clock])
89
  matched[method] = {key: event[key] for key in ("tokens", "train_seconds", "dev_nll")}
90
+ matched[method]["clock_seconds"] = event[clock]
91
+ matched[method]["staleness_seconds"] = cutoff - event[clock]
92
  return {"seed": seed, "cutoff_seconds": cutoff, "by_method": matched}
93
 
94
 
 
115
  result = {
116
  "stage": stage, "status": "pending", "complete": False, "success": None,
117
  "n_expected_seeds": len(_SEEDS), "n_complete_seeds": 0, "missing": [],
118
+ "comparisons": {}, "matched_time": [], "matched_nonhost_time": [], "reason": "Awaiting confirmatory runs.",
119
  }
120
  records = {}
121
  for row in summaries:
 
145
  timing = _time_match(seed, records)
146
  if timing is not None:
147
  result["matched_time"].append(timing)
148
+ if stage=="abstracts":
149
+ gpu_interval = _time_match(seed,records,"training_seconds_excluding_host_probes")
150
+ if gpu_interval is not None:
151
+ result["matched_nonhost_time"].append(gpu_interval)
152
  if result["missing"]:
153
  result.update(status="incomplete", reason=f"All checkpoints must reach {horizon:,} target tokens.")
154
  return result
research/src/thirdloss/cli.py CHANGED
@@ -11,12 +11,24 @@ from .records import HORIZONS, METHODS, storage_root
11
 
12
  def dashboard(project, port):
13
  """Serve the same Pages application locally with a live view of atomically recorded events."""
14
- from .report_records import study_snapshot
 
15
 
16
  class Handler(SimpleHTTPRequestHandler):
17
  def do_GET(self):
18
  if self.path.split("?",1)[0] == "/live.json":
19
- data = json.dumps(study_snapshot(project),ensure_ascii=False,allow_nan=False).encode()
 
 
 
 
 
 
 
 
 
 
 
20
  self.send_response(200)
21
  self.send_header("Content-Type","application/json; charset=utf-8")
22
  self.send_header("Cache-Control","no-store")
 
11
 
12
  def dashboard(project, port):
13
  """Serve the same Pages application locally with a live view of atomically recorded events."""
14
+ from .report_records import read_json, study_snapshot
15
+ partial_calibrations=storage_root(project)/"calibration"
16
 
17
  class Handler(SimpleHTTPRequestHandler):
18
  def do_GET(self):
19
  if self.path.split("?",1)[0] == "/live.json":
20
+ study = study_snapshot(project)
21
+ for run in study["runs"]:
22
+ if run.get("status")=="initializing":
23
+ kinds={"combined":("trace","third"),"sham":("third",)}.get(run.get("method"),(run.get("method"),))
24
+ for kind in kinds:
25
+ suffix="-fp64" if run["stage"]=="abstracts" else ""
26
+ file=partial_calibrations/f"{run['stage']}-{kind}{suffix}-draws.json"
27
+ draws=read_json(file).get("draws",[])
28
+ if draws:
29
+ run["status"]=f"calibrating ({len(draws)}/16)"
30
+ run["calibration_progress"]={"draws_completed":len(draws),"last_draw":draws[-1]}
31
+ data = json.dumps(study,ensure_ascii=False,allow_nan=False).encode()
32
  self.send_response(200)
33
  self.send_header("Content-Type","application/json; charset=utf-8")
34
  self.send_header("Cache-Control","no-store")
research/src/thirdloss/report_paper.py CHANGED
@@ -26,6 +26,10 @@ from reportlab.platypus import (
26
  from .report_records import METHODS, REPOSITORY, STAGES, completed, describe_difference, finite, fmt, verdict_text
27
 
28
  REFERENCES = {
 
 
 
 
29
  "roughness": ("Duchon, Splines minimizing rotation-invariant semi-norms in Sobolev spaces",
30
  "https://doi.org/10.1007/BFb0086566"),
31
  "trace": ("Liu, Yu and Lin, Regularizing deep neural networks with stochastic estimators of Hessian trace",
@@ -54,7 +58,7 @@ def _link(url, label):
54
 
55
  def _cite(key):
56
  label, url = REFERENCES[key]
57
- return _link(url, label.split(",")[0] if key != "trace" else "Liu, Yu and Lin")
58
 
59
 
60
  def _styles():
@@ -140,16 +144,16 @@ def _result_tables(study):
140
  return scores, resources
141
 
142
 
143
- def _matched_rows(study):
144
  """Print every matched seed, including each arm's distance from the shared cutoff."""
145
  rows = []
146
  for stage, outcome in study["stages"].items():
147
- for entry in outcome.get("matched_time", []):
148
  cutoff = entry["cutoff_seconds"]
149
  losses = []
150
  for method in ("ce", "trace", "third"):
151
  point = entry["by_method"][method]
152
- lag = cutoff - point["train_seconds"]
153
  losses.append(f"{fmt(point['dev_nll'], 4)} ({fmt(lag, 1)})")
154
  rows.append([STAGES[stage], entry["seed"], fmt(cutoff, 1), *losses])
155
  return rows
@@ -182,8 +186,10 @@ def write_paper(study: dict, output: Path, figure_dir: Path, figures: dict) -> N
182
  "can share its trace while individual curvature components vary. Summing squared "
183
  "third partials assigns a nonnegative cost to that variation in the chosen coordinates. "
184
  "The proposed local density adapts an order-three spline roughness measure. The "
185
- "published signed-trace language experiments studied recurrent language models. "
186
- f"{_cite('roughness')} · {_cite('trace')} · {_cite('coordinates')}")
 
 
187
  p("FUT++ approximates third weight derivatives of minibatch language-model loss with "
188
  "differences between Hessian estimates at consecutive reference checkpoints. It uses "
189
  "these terms to predict the effect of reordering training batches. Here the squared "
@@ -326,7 +332,7 @@ def write_paper(study: dict, output: Path, figure_dir: Path, figures: dict) -> N
326
  rows, [56, 49, 78, 35, 34, 64, 48, 57, 54]))
327
  p("Times and rates are per-run medians within each hardware, method, phase, strength and "
328
  "target budget. The clock sums synchronized training steps, including batch transfer and "
329
- "the optimizer update. Evaluation, checkpointing and uploads take additional time. Peak "
330
  "memory is PyTorch’s recorded maximum allocated GPU tensor memory during the run, including "
331
  "evaluation. Untrained controls have no training speed.", "caption")
332
  else:
@@ -345,6 +351,14 @@ def write_paper(study: dict, output: Path, figure_dir: Path, figures: dict) -> N
345
  matched, [82, 34, 65, 98, 98, 98]))
346
  else:
347
  p("Awaiting a complete, timed three-method confirmatory seed with eligible development checkpoints.", "caption")
 
 
 
 
 
 
 
 
348
  pair_rows = [[STAGES[stage], METHODS.get(base, base), pair["seed"],
349
  fmt(pair["third_nll"], 5), fmt(pair["baseline_nll"], 5), fmt(pair["delta"], 5)]
350
  for stage, outcome in study["stages"].items()
 
26
  from .report_records import METHODS, REPOSITORY, STAGES, completed, describe_difference, finite, fmt, verdict_text
27
 
28
  REFERENCES = {
29
+ "flat": ("Hochreiter and Schmidhuber, Simplifying neural nets by discovering flat minima",
30
+ "https://proceedings.neurips.cc/paper/1994/hash/01882513d5fa7c329e940dda99b12147-Abstract.html"),
31
+ "gpt_trace": ("Zhang, Li and Ju, Noise Stability Optimization for Finding Flat Minima: A Hessian-based Regularization Approach",
32
+ "https://arxiv.org/pdf/2306.08553#page=12"),
33
  "roughness": ("Duchon, Splines minimizing rotation-invariant semi-norms in Sobolev spaces",
34
  "https://doi.org/10.1007/BFb0086566"),
35
  "trace": ("Liu, Yu and Lin, Regularizing deep neural networks with stochastic estimators of Hessian trace",
 
58
 
59
  def _cite(key):
60
  label, url = REFERENCES[key]
61
+ return _link(url, label.rsplit(", ",1)[0])
62
 
63
 
64
  def _styles():
 
144
  return scores, resources
145
 
146
 
147
+ def _matched_rows(study,key="matched_time"):
148
  """Print every matched seed, including each arm's distance from the shared cutoff."""
149
  rows = []
150
  for stage, outcome in study["stages"].items():
151
+ for entry in outcome.get(key, []):
152
  cutoff = entry["cutoff_seconds"]
153
  losses = []
154
  for method in ("ce", "trace", "third"):
155
  point = entry["by_method"][method]
156
+ lag = point["staleness_seconds"]
157
  losses.append(f"{fmt(point['dev_nll'], 4)} ({fmt(lag, 1)})")
158
  rows.append([STAGES[stage], entry["seed"], fmt(cutoff, 1), *losses])
159
  return rows
 
186
  "can share its trace while individual curvature components vary. Summing squared "
187
  "third partials assigns a nonnegative cost to that variation in the chosen coordinates. "
188
  "The proposed local density adapts an order-three spline roughness measure. The "
189
+ "original flat-minima work searched for broad regions of low training error. Liu, Yu and Lin "
190
+ "regularized recurrent language models with the Hessian trace. Zhang, Li and Ju investigated "
191
+ "a symmetric approximation to trace regularization in GPT-2 downstream fine-tuning. "
192
+ f"{_cite('roughness')} · {_cite('flat')} · {_cite('trace')} · {_cite('gpt_trace')}, Table 5 · {_cite('coordinates')}")
193
  p("FUT++ approximates third weight derivatives of minibatch language-model loss with "
194
  "differences between Hessian estimates at consecutive reference checkpoints. It uses "
195
  "these terms to predict the effect of reordering training batches. Here the squared "
 
332
  rows, [56, 49, 78, 35, 34, 64, 48, 57, 54]))
333
  p("Times and rates are per-run medians within each hardware, method, phase, strength and "
334
  "target budget. The clock sums synchronized training steps, including batch transfer and "
335
+ "the optimizer update and any host FP64 probe while the GPU is reserved. Evaluation, checkpointing and uploads take additional time. Peak "
336
  "memory is PyTorch’s recorded maximum allocated GPU tensor memory during the run, including "
337
  "evaluation. Untrained controls have no training speed.", "caption")
338
  else:
 
351
  matched, [82, 34, 65, 98, 98, 98]))
352
  else:
353
  p("Awaiting a complete, timed three-method confirmatory seed with eligible development checkpoints.", "caption")
354
+ nonhost = _matched_rows(study,"matched_nonhost_time")
355
+ if nonhost:
356
+ p("Adapter timing after subtracting host derivative calls", "subheading")
357
+ p("This supplementary clock removes the observed duration of host derivative calls including their "
358
+ "transfers. The table uses the same fixed development windows and reports checkpoint lags in seconds. "
359
+ "Individual CUDA kernel durations were not profiled.", "caption")
360
+ flow.append(_grid(styles,["Corpus","Seed","Cutoff (s)","AdamW NLL (lag s)",
361
+ "Trace NLL (lag s)","Third NLL (lag s)"],nonhost,[82,34,65,98,98,98]))
362
  pair_rows = [[STAGES[stage], METHODS.get(base, base), pair["seed"],
363
  fmt(pair["third_nll"], 5), fmt(pair["baseline_nll"], 5), fmt(pair["delta"], 5)]
364
  for stage, outcome in study["stages"].items()
research/src/thirdloss/report_records.py CHANGED
@@ -39,7 +39,7 @@ FIELDS = (
39
  "token_budget", "batch_windows", "microbatch", "context", "weights_sha256", "dev_tokens",
40
  "git_revision", "gpu", "torch", "matched_dev_nll", "finished_at", "initial_trainable_sha256",
41
  "derivative_dtype", "derivative_device", "host_probe_seconds", "training_seconds_excluding_host_probes", "cpu_threads",
42
- "process_peak_rss_mib", "evaluation_batch_windows",
43
  )
44
  EVENT_FIELDS = (
45
  "step", "tokens", "train_seconds", "loss", "accuracy", "penalty", "dev_nll",
@@ -130,6 +130,9 @@ def run_record(folder: Path) -> dict:
130
  record["id"] = folder.name
131
  if "targets_scored" in state and not summary:
132
  record["evaluation_progress"] = state
 
 
 
133
  failures = read_json(folder / "attempts.json").get("failures", [])
134
  if last_error and last_error not in failures:
135
  failures.append(last_error)
 
39
  "token_budget", "batch_windows", "microbatch", "context", "weights_sha256", "dev_tokens",
40
  "git_revision", "gpu", "torch", "matched_dev_nll", "finished_at", "initial_trainable_sha256",
41
  "derivative_dtype", "derivative_device", "host_probe_seconds", "training_seconds_excluding_host_probes", "cpu_threads",
42
+ "process_peak_rss_mib", "evaluation_batch_windows", "test_seconds", "evaluated_at",
43
  )
44
  EVENT_FIELDS = (
45
  "step", "tokens", "train_seconds", "loss", "accuracy", "penalty", "dev_nll",
 
130
  record["id"] = folder.name
131
  if "targets_scored" in state and not summary:
132
  record["evaluation_progress"] = state
133
+ test_state = read_json(folder / "test_state.json")
134
+ if test_state and "test_nll" not in summary:
135
+ record["evaluation_progress"] = test_state
136
  failures = read_json(folder / "attempts.json").get("failures", [])
137
  if last_error and last_error not in failures:
138
  failures.append(last_error)
research/src/thirdloss/reporting.py CHANGED
@@ -92,6 +92,14 @@ def _comparisons(study: dict) -> str:
92
  parts.append(f"### {STAGES[stage]} at equal training time\n\n" + _table(times, [
93
  "Seed", "Common cutoff (s)", "Method", "Recorded checkpoint (s)",
94
  "Training tokens", "Dev NLL"]))
 
 
 
 
 
 
 
 
95
  return "\n\n".join(parts)
96
 
97
 
 
92
  parts.append(f"### {STAGES[stage]} at equal training time\n\n" + _table(times, [
93
  "Seed", "Common cutoff (s)", "Method", "Recorded checkpoint (s)",
94
  "Training tokens", "Dev NLL"]))
95
+ supplement = [[item["seed"],fmt(item["cutoff_seconds"],1),METHODS[m],fmt(point["clock_seconds"],1),
96
+ fmt(point["tokens"],0),fmt(point["dev_nll"],5)]
97
+ for item in analysis.get("matched_nonhost_time",[]) for m,point in item["by_method"].items()]
98
+ if supplement:
99
+ parts.append(f"### {STAGES[stage]} after subtracting host derivative calls\n\n"
100
+ "This supplementary clock excludes the measured host probe calls and their transfers. "
101
+ "The registered comparison above counts elapsed time with one GPU reserved.\n\n" +
102
+ _table(supplement,["Seed","Cutoff (s)","Method","Checkpoint (s)","Training tokens","Dev NLL"]))
103
  return "\n\n".join(parts)
104
 
105
 
research/src/thirdloss/study.py CHANGED
@@ -10,7 +10,7 @@ from safetensors.torch import load_file
10
  from .data import prepare
11
  from .evaluation import score
12
  from .models import build_model
13
- from .records import HORIZONS, RATIOS, read_json, run_name, sha256, time_now, write_json
14
  from .release import STAGE_HUB, publish_snapshot, publish_weights
15
  from .train import run_one
16
 
@@ -70,12 +70,13 @@ def freeze(project, storage, stage):
70
  raise ValueError(f"Different corpus for {name}")
71
  weights_file(storage,summary)
72
  frozen["runs"][name] = summary["weights_sha256"]
73
- if summary.get("initial_trainable_sha256"):
74
- initial.add(summary["initial_trainable_sha256"])
75
- if len(initial)>1:
 
 
76
  raise ValueError(f"Initial trainable weights differ across {stage} seed {seed} arms")
77
- if initial:
78
- frozen.setdefault("initializations",{})[str(seed)] = initial.pop()
79
  frozen["freeze_id"] = hashlib.sha256(json.dumps(frozen,sort_keys=True).encode()).hexdigest()
80
  path = project/"results"/"freeze"/f"{stage}.json"
81
  if path.exists() and read_json(path)!=frozen:
@@ -85,6 +86,7 @@ def freeze(project, storage, stage):
85
 
86
 
87
  def evaluate_one(project, storage, run_id, device):
 
88
  path = project/"results"/run_id/"summary.json"
89
  summary = read_json(path)
90
  stage = summary["stage"]
@@ -92,11 +94,13 @@ def evaluate_one(project, storage, run_id, device):
92
  data = storage/"data"/stage
93
  if sealed["runs"].get(run_id)!=summary.get("weights_sha256") or run_id not in sealed["runs"]:
94
  raise ValueError("Evaluation requires a checkpoint present in the stage freeze")
95
- weights = weights_file(storage,summary)
 
96
  if "test_nll" in summary:
97
  if summary["freeze_id"]!=sealed["freeze_id"]:
98
  raise ValueError("Existing evaluation uses a different freeze")
99
  return summary
 
100
  if sha256(data/"test.bin") != sealed["test_sha256"]:
101
  raise ValueError("Test stream differs from the frozen manifest")
102
  model = build_model(stage,summary["seed"],device,storage)
@@ -108,11 +112,22 @@ def evaluate_one(project, storage, run_id, device):
108
  if set(state)!=set(get_peft_model_state_dict(model)):
109
  raise ValueError("Adapter payload does not match the pinned backbone and target modules")
110
  set_peft_model_state_dict(model,state)
111
- stats = score(model,data/"test.bin",device,summary.get("evaluation_batch_windows",summary["microbatch"]))
 
 
 
 
 
 
 
 
 
 
112
  summary.update(test_nll=stats["nll"],test_accuracy=stats["accuracy"],test_tokens=stats["tokens"],
113
  test_manifest_sha256=sealed["test_sha256"],freeze_id=sealed["freeze_id"],
114
- evaluated_at=time_now())
115
  write_json(path,summary)
 
116
  return summary
117
 
118
 
 
10
  from .data import prepare
11
  from .evaluation import score
12
  from .models import build_model
13
+ from .records import HORIZONS, RATIOS, Recorder, read_json, run_name, sha256, time_now, write_json
14
  from .release import STAGE_HUB, publish_snapshot, publish_weights
15
  from .train import run_one
16
 
 
70
  raise ValueError(f"Different corpus for {name}")
71
  weights_file(storage,summary)
72
  frozen["runs"][name] = summary["weights_sha256"]
73
+ digest = summary.get("initial_trainable_sha256")
74
+ if not digest:
75
+ raise ValueError(f"Missing initial trainable-weight digest for {name}")
76
+ initial.add(digest)
77
+ if len(initial)!=1:
78
  raise ValueError(f"Initial trainable weights differ across {stage} seed {seed} arms")
79
+ frozen.setdefault("initializations",{})[str(seed)] = initial.pop()
 
80
  frozen["freeze_id"] = hashlib.sha256(json.dumps(frozen,sort_keys=True).encode()).hexdigest()
81
  path = project/"results"/"freeze"/f"{stage}.json"
82
  if path.exists() and read_json(path)!=frozen:
 
86
 
87
 
88
  def evaluate_one(project, storage, run_id, device):
89
+ from .progress import week_schedule
90
  path = project/"results"/run_id/"summary.json"
91
  summary = read_json(path)
92
  stage = summary["stage"]
 
94
  data = storage/"data"/stage
95
  if sealed["runs"].get(run_id)!=summary.get("weights_sha256") or run_id not in sealed["runs"]:
96
  raise ValueError("Evaluation requires a checkpoint present in the stage freeze")
97
+ if week_schedule(project) is None:
98
+ raise ValueError("The one-week timing and memory projection requires selected pilots from both stages before test scoring")
99
  if "test_nll" in summary:
100
  if summary["freeze_id"]!=sealed["freeze_id"]:
101
  raise ValueError("Existing evaluation uses a different freeze")
102
  return summary
103
+ weights = weights_file(storage,summary)
104
  if sha256(data/"test.bin") != sealed["test_sha256"]:
105
  raise ValueError("Test stream differs from the frozen manifest")
106
  model = build_model(stage,summary["seed"],device,storage)
 
112
  if set(state)!=set(get_peft_model_state_dict(model)):
113
  raise ValueError("Adapter payload does not match the pinned backbone and target modules")
114
  set_peft_model_state_dict(model,state)
115
+ recorder = Recorder(project,run_id)
116
+ state = path.parent/"test_state.json"
117
+ def report_progress(row):
118
+ # Publish elapsed time and coverage during a sealed evaluation. The full-corpus
119
+ # NLL and accuracy enter the summary only after every target has been scored.
120
+ coverage = {key:row[key] for key in ("targets_scored","targets_to_score","score_seconds")}
121
+ write_json(state,{"split":"test","timestamp":time_now(),**coverage})
122
+ recorder.emit({"split":"test",**coverage},"test_progress.jsonl")
123
+ report_progress({"targets_scored":0,"targets_to_score":(data/"test.bin").stat().st_size//2-1,"score_seconds":0.0})
124
+ stats = score(model,data/"test.bin",device,summary.get("evaluation_batch_windows",summary["microbatch"]),
125
+ progress=report_progress)
126
  summary.update(test_nll=stats["nll"],test_accuracy=stats["accuracy"],test_tokens=stats["tokens"],
127
  test_manifest_sha256=sealed["test_sha256"],freeze_id=sealed["freeze_id"],
128
+ test_seconds=read_json(state)["score_seconds"],evaluated_at=time_now())
129
  write_json(path,summary)
130
+ state.unlink(missing_ok=True)
131
  return summary
132
 
133
 
research/src/thirdloss/train.py CHANGED
@@ -50,6 +50,12 @@ def learning_rate(stage, step, steps):
50
  return peak * (0.1+0.9*0.5*(1+math.cos(math.pi*progress)))
51
 
52
 
 
 
 
 
 
 
53
  def chosen_coefficients(project, storage, config, device, microbatch):
54
  method, ratio, stage = (config[k] for k in ("method","ratio","stage"))
55
  if method in {"ce","initial","unigram"}:
@@ -170,10 +176,19 @@ def _run(project, storage, config, recorder, device, microbatch):
170
  groups = [{"params":[p for p in parameters if p.ndim>1],"weight_decay":0.1},
171
  {"params":[p for p in parameters if p.ndim<=1],"weight_decay":0.0}]
172
  optimizer = torch.optim.AdamW(groups,lr=1e-4,betas=(0.9,0.95),fused=(device.type=="cuda"))
 
 
 
 
173
  start,elapsed = restore_state(ckpt/"latest.pt",model,optimizer,config,recorder,device)
174
- host_probes = sum(e.get("host_probe_seconds",0.0) for e in json_lines(output/"events.jsonl"))
 
175
  # Match elapsed-time comparisons with periodic fixed development windows in every arm.
176
  interval = min(128,max(1,steps//16))
 
 
 
 
177
  for step in range(start,steps):
178
  model.train()
179
  tic = time.perf_counter()
@@ -194,13 +209,14 @@ def _run(project, storage, config, recorder, device, microbatch):
194
  torch.cuda.synchronize(device)
195
  elapsed += time.perf_counter()-tic
196
  done = step+1
197
- if done % 8 == 0 or active or done == 1 or done % interval == 0 or done == steps:
 
198
  row = {"step":done, "tokens":done*batch*CONTEXT, "train_seconds":elapsed, "loss":base.item(),
199
  "accuracy":accuracy.item(), "lr":lr, "gradient_norm":norm.item(),"derivatives":terms,
200
  "host_probe_seconds":host_seconds,"training_seconds_excluding_host_probes":max(0.0,elapsed-host_probes)}
201
  if terms:
202
  row["penalty"] = sum(8*t["lambda"]*t["estimate"] for t in terms.values())
203
- if done%interval == 0 or done==steps:
204
  metrics = score(model,data/"dev.bin",device,score_batch,limit_windows=64)
205
  row.update(dev_nll=metrics["nll"],dev_accuracy=metrics["accuracy"])
206
  recorder.emit(row)
 
50
  return peak * (0.1+0.9*0.5*(1+math.cos(math.pi*progress)))
51
 
52
 
53
+ def validation_due(stage, phase, step, interval):
54
+ """Observe the early portion of every adapter confirmatory arm at common data positions."""
55
+ initial_adapter = stage=="abstracts" and phase=="confirm" and step<interval
56
+ return (step>0 and step%interval==0) or (initial_adapter and step%4==0)
57
+
58
+
59
  def chosen_coefficients(project, storage, config, device, microbatch):
60
  method, ratio, stage = (config[k] for k in ("method","ratio","stage"))
61
  if method in {"ce","initial","unigram"}:
 
176
  groups = [{"params":[p for p in parameters if p.ndim>1],"weight_decay":0.1},
177
  {"params":[p for p in parameters if p.ndim<=1],"weight_decay":0.0}]
178
  optimizer = torch.optim.AdamW(groups,lr=1e-4,betas=(0.9,0.95),fused=(device.type=="cuda"))
179
+ # A restart during the first checkpoint interval must discard measurements from
180
+ # updates whose weights and optimizer moments were never committed.
181
+ if not (ckpt/"latest.pt").exists():
182
+ save_state(ckpt/"latest.pt",model,optimizer,0,0.0,config)
183
  start,elapsed = restore_state(ckpt/"latest.pt",model,optimizer,config,recorder,device)
184
+ history = json_lines(output/"events.jsonl")
185
+ host_probes = sum(e.get("host_probe_seconds",0.0) for e in history)
186
  # Match elapsed-time comparisons with periodic fixed development windows in every arm.
187
  interval = min(128,max(1,steps//16))
188
+ if start==0 and validation_due(stage,config["phase"],0,interval) and not history:
189
+ metrics = score(model,data/"dev.bin",device,score_batch,limit_windows=64)
190
+ recorder.emit({"step":0,"tokens":0,"train_seconds":0.0,"training_seconds_excluding_host_probes":0.0,
191
+ "dev_nll":metrics["nll"],"dev_accuracy":metrics["accuracy"]})
192
  for step in range(start,steps):
193
  model.train()
194
  tic = time.perf_counter()
 
209
  torch.cuda.synchronize(device)
210
  elapsed += time.perf_counter()-tic
211
  done = step+1
212
+ validate = validation_due(stage,config["phase"],done,interval) or done==steps
213
+ if done % 8 == 0 or active or done == 1 or validate:
214
  row = {"step":done, "tokens":done*batch*CONTEXT, "train_seconds":elapsed, "loss":base.item(),
215
  "accuracy":accuracy.item(), "lr":lr, "gradient_norm":norm.item(),"derivatives":terms,
216
  "host_probe_seconds":host_seconds,"training_seconds_excluding_host_probes":max(0.0,elapsed-host_probes)}
217
  if terms:
218
  row["penalty"] = sum(8*t["lambda"]*t["estimate"] for t in terms.values())
219
+ if validate:
220
  metrics = score(model,data/"dev.bin",device,score_batch,limit_windows=64)
221
  row.update(dev_nll=metrics["nll"],dev_accuracy=metrics["accuracy"])
222
  recorder.emit(row)
research/tests/test_analysis.py CHANGED
@@ -151,6 +151,19 @@ def test_elapsed_time_uses_latest_actual_validation_before_shared_cutoff():
151
  assert first["by_method"]["third"]["tokens"] == 80
152
 
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  def test_time_matched_comparison_uses_one_validation_population_across_methods():
155
  """Whole-split NLL cannot replace a fixed-window diagnostic in another run."""
156
  rows = complete_matrix()
 
151
  assert first["by_method"]["third"]["tokens"] == 80
152
 
153
 
154
+ def test_adapter_time_comparisons_keep_allocated_device_and_host_excluded_clocks_distinct():
155
+ rows = complete_matrix()
156
+ for row in rows:
157
+ regularized = row["method"]!="ce"
158
+ row.update(stage="abstracts",tokens=524288,target_tokens=524288,dev_nll=1.0,
159
+ train_seconds=20.0 if regularized else 10.0,training_seconds_excluding_host_probes=10.0)
160
+ row["events"]=[{"train_seconds":9.0,"training_seconds_excluding_host_probes":4.0,
161
+ "tokens":100,"dev_nll":2.0}]
162
+ result = analyze_stage(rows,"abstracts")
163
+ assert result["matched_time"][0]["by_method"]["third"]["dev_nll"]==2.0
164
+ assert result["matched_nonhost_time"][0]["by_method"]["third"]["dev_nll"]==1.0
165
+
166
+
167
  def test_time_matched_comparison_uses_one_validation_population_across_methods():
168
  """Whole-split NLL cannot replace a fixed-window diagnostic in another run."""
169
  rows = complete_matrix()
research/tests/test_training.py CHANGED
@@ -87,3 +87,23 @@ def test_step_recovery_matches_uninterrupted_weights(tmp_path,monkeypatch):
87
  assert normal["dev_nll"]==resumed["dev_nll"]
88
  finally:
89
  torch.set_num_threads(prior_threads)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  assert normal["dev_nll"]==resumed["dev_nll"]
88
  finally:
89
  torch.set_num_threads(prior_threads)
90
+
91
+
92
+ def test_adapter_confirmation_observes_early_matched_time_checkpoints():
93
+ """A slow host probe can span the baseline's whole time cutoff before a routine validation."""
94
+ from thirdloss.train import validation_due
95
+ expected = [0, 4, 8, 12, 16, 20, 24, 28, 32, 64]
96
+ assert [step for step in range(65) if validation_due("abstracts","confirm",step,32)] == expected
97
+ assert [step for step in range(65) if validation_due("stories","confirm",step,32)] == [32,64]
98
+ assert [step for step in range(17) if validation_due("abstracts","pilot",step,4)] == [4,8,12,16]
99
+
100
+
101
+ def test_evaluator_requires_measured_schedule_before_test_reads(tmp_path):
102
+ """Exercise the standalone entry point without placing any test token bytes on disk."""
103
+ import pytest
104
+ from thirdloss.study import evaluate_one
105
+ run_id = "stories-confirm-s01-ce-r00"
106
+ write_json(tmp_path/"results"/run_id/"summary.json",{"stage":"stories","id":run_id,"weights_sha256":"abc"})
107
+ write_json(tmp_path/"results"/"freeze"/"stories.json",{"runs":{run_id:"abc"},"freeze_id":"fixture"})
108
+ with pytest.raises(ValueError,match="one-week"):
109
+ evaluate_one(tmp_path,tmp_path/"storage",run_id,torch.device("cpu"))