Is a project's history a better training corpus than its source?
Phase 4 feasibility report, 2026-12-01. No model has been trained, and no paid inference was used (Phase 4 ledger: $0). Phase 3 found that historical evidence did not improve model judgments. Phase 4 asks a different question: can a small model learn to write better Transformers code from the project's history (tasks, first attempts, maintainer corrections) than from a snapshot of its source? The first milestone only measures whether that supervision exists. It does, for two families. About 2,400 task→patch examples and about 3,300 review→correction examples can be recovered from one year of history. A functional benchmark can be built: 17 of 40 candidate tasks validated by executing their tests. All quality figures come from two AI audit passes, provisional until checked by humans.
What was mined
Transformers' first-parent main from 2025-07-01 to 2026-11-30: 5,644 squash-merged PRs, split by merge date
into training (3,775, up to 2026-06-30), validation (390) and evaluation (1,479, from 2026-08-16). A seeded 400-PR sample was
enriched with one GitHub GraphQL query each: the PR text as first written, recovered from its edit history; linked issues;
review threads anchored to the commit the reviewer saw; and the PR's commits. Everything is deterministic: no language model
indexes, filters or labels the corpus.
| Relationship | Available | Mechanically linked | Audit (provisional) |
|---|---|---|---|
| Task → implementation | 3,410 non-doc training PRs | all merged | 20/20 genuine; task text written before the solution and not leaking it in 8/20 |
| Review feedback → code correction | 1,121 maintainer threads in 158 of 397 PRs | 747 change the reviewed lines after the comment; 50 apply a suggestion verbatim | correction does what was asked in 21/30; usable 9/15 of the linked, but only 2/10 of the applied suggestions (mostly cosmetic) |
| Regression → fix + test | 658 small fix-like PRs changing code and tests | 17/40 executed tasks fail before and pass after | title heuristic alone: 3/10 |
| Helper → adoption | 772 new shared helpers | 73 adopted later in model code | inconclusive (pilot selection bug) |
| Deprecation → removal | 245 deprecations, 148 removals | 191 identifier-matched links | not validated |
| Revert → re-land | 40 reverts | 25 linked, 3 re-landed | too rare to matter |
How much of it is project-specific, and how much is unique
- Project-specific: 16/20 task→patch and 17/30 review→correction examples need Transformers knowledge (both audit passes agree).
- The source snapshot is mostly repetition. At the training cutoff, src, tests and utils hold about 17.6M tokens. 19% of that is generated from modular files, 27.5% of 8-line windows are duplicates, and the distinct lines carry 40% of the characters, so roughly 7M tokens are effectively unique. The history-derived supervision is about 2–5M target tokens: the same order, so a token-matched comparison is possible.
- The most mechanically certain signal is the least useful. Applied review suggestions are verifiable to the character, but they are mostly cosmetic. Substantive corrections are only "strongly linked" (the reviewed lines changed afterwards), and separating them from style changes still needs human calibration.
Contamination controls
- Temporal. Evaluation tasks are merged after every candidate base model was released. The median evaluation PR shares 7.7% of its added lines with training-window diffs. The 12% that share half or more are excluded as near-duplicates.
- Structural. 259 of 515 model-touching evaluation PRs involve a model added after the training cutoff, a natural unseen-family subset for the transfer question.
- Base model. The recommended base, SmolLM3-3B-Base, was released before the whole history window, and its pretraining data is public. Every other candidate's pretraining may already include part of the training window.
Functional benchmark prototype
Each candidate is a small evaluation-window PR that changes both code and tests. Its tests run twice in a network-denied macOS sandbox on CPU: on the pre-change code with the new tests added, and on the merged code. 17 of 40 have a test that fails before the fix and passes after it; each run takes seconds to minutes. That projects to about 170 tasks from the window. Benchmark tasks stay private.
Update: full mining and the floor check (2026-12-01)
- Full training window, mined: 6,725 review threads change the reviewed lines after the comment, in 981 of 3,410 training PRs (29%). At the pilot's usability rates that is about 3,900 usable review→correction examples, consistent with the sample projection.
- Validation tasks: 23 of 72 small validation-window PRs have a stable test that fails before the fix and passes after.
- The floor check failed. Untrained base models solve almost nothing: SmolLM3-3B-Base 0/23, Qwen2.5-Coder-1.5B 1/23, against a pre-registered floor of 5%. Most answers never apply. The models copy the prompt's worked example (10/23 and 14/23 times) or quote code that is not in the file. One A10G job, 409 seconds, $0.17.
- Consequence: no training. A comparison of training arms would be measured at zero, so this is a floor effect and says nothing about history versus source. Next is a second floor check with instruction-tuned small checkpoints and an easier, still test-scored infill task (about $0.50), before any choice.
Update 2: second floor check, frozen harness and datasets (2026-12-01)
- The second floor check also failed. Instruction-tuned SmolLM3-3B and Qwen2.5-Coder-1.5B-Instruct, zero-shot, on 22 tasks, in two formats: SEARCH/REPLACE edits, and rewriting the given functions ("region" format). Best result: 1/22, against a floor of 2/22. One L4 job, 898 seconds, $0.20.
- Why. The region format makes edits apply (SmolLM3: 13/22 versus 1/22 with SEARCH/REPLACE), but none of them passes the tests. About half the region answers copy the given code back unchanged, and real attempts fail on syntax, imports or behaviour. Qwen used the wrong markers; re-parsed afterwards (labelled post-hoc), its 17 complete answers still pass nothing. At 1.5–3B, both instruction following and coding fail on these tasks. The patch protocol caused most apply failures, but removing it did not produce working code.
- Evaluation, frozen. The region harness was rebuilt after finding two boundary bugs. It now reproduces every accepted change exactly (224/224). Tasks are split by merge date: 51 development tasks (Jul–mid-Sep, used for model and format choices) and 161 final tasks (mid-Sep–Nov, never shown to a model). All tasks stay private.
- Corpus confidence tiers. Deterministic checks rate 12,282 training-window review threads: 2,123 high, 3,691 medium, 392 style-only, 6,076 rejected. A 16-thread stratified human audit is ready; no human labels yet.
- Matched datasets. These come from the same 725 training PRs, in the evaluation's prompt layout:
- S (accepted implementations): 1,531 examples.
- E (engineering experience): 790 accepted implementations + 1,579 maintainer-feedback corrections, matched to S at 1.01M loss tokens.
- C: E without the feedback text.
- Power. With 161 final tasks, one training seed detects only a 10–13 point difference. The pilot would be exploratory.
Update 3: a viable baseline (gate 0c, 2026-12-01)
- Qwen3-4B-Instruct-2507 clears the floor: 14 of 51 development tasks (27%) solved, under the frozen harness and scored by tests. None of the 14 copies the input back unchanged; 7 reproduce the accepted change exactly, and 7 are different implementations that pass the same tests. Repeated greedy runs gave the same outcome on 20/20 tasks.
- Other candidates: Phi-4-mini-instruct 3/51 (at the floor), and SmolLM3-3B 1/51 (control).
- The ceiling check is inconclusive. A hosted DeepSeek-V3.1 run scored 10/51, below the 4B model, and its deployment inserts a stray token into a third of its answers. A first ceiling attempt with a reasoning model returned empty answers and is void.
- Spend: gate 0c cost $1.48; Phase 4 total $1.85.
Update 4: smoke test passed, pilot running (2026-12-02)
- The training plumbing works end to end. A 20-step LoRA run on 64 examples (arm E) completed on one L4. The loss was computed only on the target and end-of-turn tokens, for every example. Loss fell from 0.58 to 0.15. Peak memory was 13.6 GB of 24 GB, including the longest example (11,752 tokens). vLLM loaded the adapter, and the frozen harness scored all outputs. With adapters enabled, the base model reproduced its earlier outputs.
- Three library incompatibilities were caught before the pilot. One surfaced as a crash on the first launch ($0.02):
the newest
transformersdropped a configuration option. A local CPU dry run, with a tiny random model and the real tokenizer, found the other two. One of them would have rejected every training example at the pre-flight check. Library versions are now pinned. - Measured throughput: 831 trained tokens/s on an L4. Two epochs take 4.5 h for S and 5.4 h for E.
- Pre-registration frozen before any pilot training (
PREREG-PILOT.md).- Arms: M0 is the unadapted model, M1 is LoRA on S, M2 is LoRA on E.
- M1 and M2 are each trained with seed 17, which the decision uses, and with seed 29 as a replicate.
- Each task gets greedy decoding plus 3 samples. Success means the task's tests pass.
- Decision: M2 − M1 ≥ 5 points, a paired-bootstrap CI above 0, and exact McNemar p < 0.05. Anything else is reported as "not shown".
- Spend: the smoke test cost $0.26; Phase 4 total $2.13. Pilot approved with a $30 cap; estimated at about $20.
Update 5: pilot result, not shown (2026-12-03)
- Engineering experience did not beat accepted implementations. On the 161 held-out tasks, LoRA on E (M2) scored 17.70% and LoRA on S (M1) 17.86%, a difference of −0.16 points (95% paired-bootstrap CI [−2.33, +1.86]). Greedy outcomes differ on 7 tasks: 3 solved only by M2, 4 only by M1 (McNemar p = 1.0). The pre-registered bar was +5 points. The seed-29 replicate agrees (−0.31 points), and the original harness (v1) gives the same answer (−0.19). The verdict is "not shown".
- Both fine-tunes made the model worse. The unadapted model (M0) scored 24.22%. Both adapters lost about 6.4 points (p ≈ 0.02 at seed 17). Training nearly eliminated syntax errors (30 → 5–8 greedy) but doubled broken imports (10 → 20–21) and added about 27 outputs that parse but fail tests. One hypothesis, not tested here: two epochs on whole-region rewrites taught the shape of a Transformers patch more than how to solve the task.
- Harness: under the pre-registered amendment (v2), every v1 harness error turned out to be a candidate-caused import or timeout failure, so no task is excluded. The adapted models produced 7–12 of these per sample, against 0–2 for the base model.
- The adapters also lost general coding ability. On HumanEval+ (all 164 problems, greedy, tests run in the sandbox), the base model solves 147 on base tests and 137 with the extra tests. The S adapters solve 134 and 126 at both seeds (p = 0.007–0.035 against the base model). The E adapters solve 135–138 and 128–131. That loss is smaller and only borderline significant, and E vs S is not significant. Output format and length did not change, so this is a real regression, not a parsing artifact. The check ran on an idle bench box at no GPU cost.
- Spend: pilot and smoke test $25.01; Phase 4 total $26.86 of the $30 cap.
Phase 4.1: why adaptation hurt (2026-12-03)
An audit of the existing artifacts only (training logs, adapters, datasets, predictions); nothing was run or spent. Full
report: DIAGNOSIS-4.1.md.
- No implementation bug. Training and inference prompts match token for token, the loss covered exactly the target plus the end-of-turn token, nothing was truncated, and the loss curves and gradient norms are ordinary. Two gaps: no validation loss was recorded, and no intermediate checkpoints were saved.
- Two thirds of the supervision was copying. 67% (S) and 63% (E) of loss-bearing tokens reproduce unchanged lines that are already in the prompt; 28–32% are the actual change. Before training, the base model already predicted 92–95% of target tokens, and nearly all the loss reduction happened in the first ~10 optimizer steps.
- The adapters learned to under-edit and to write terse code. On the held-out Transformers tasks the median prediction changes 5–7 lines against the base model's 12, and outputs that change nothing rose from 14 to 36–60 of 644. On HumanEval+, 74% of the base model's solutions carry step-by-step comments, against 3–5% for the adapters. The lost problems are mostly missed edge cases.
- The losses are systematic. 12 Transformers tasks and 13 HumanEval+ problems are lost by all four adapters, across both seeds and both datasets. Almost all are functional failures, not format errors.
- Ranked explanations: (1) imitation of copy-dominated, terse targets; (2) too strong an adaptation; (3) too little change signal per example; (4) dataset noise, which is weak, since the clean S data degrades as much.
- Proposed next step, not approved yet: two cheap diagnostics first. E0: does training loss actually sit on the copied tokens? E1: does scaling the existing adapters down recover the base model while keeping any project gain? If both are negative, stop. Changed-region loss masking (same examples, same output format, loss only on changed lines plus edit boundaries) comes only if E0 says copied tokens carry real loss. Selection uses development tasks and a fresh MBPP+ split; the held-out set and HumanEval+ are now exposed.
Status
Phase 4 closed: the hypothesis was not supported, and adaptation degraded the model. Phase 4 spent $26.86 of $30. A bounded Phase 4.1 diagnostic (E0 + E1) is proposed and awaits approval; no further compute has been spent. The held-out tasks stay private.