Matched GPT-2 W2: the transformer reference for the semantic-template tests
The transformer reference of the semantic-template tests. The matched GPT-2 retrained on the Semantic Simulation ladder's exact schedule (WSD, peak learning rate 1.2e-3, the same 0.53B OpenWebText tokens), so that its states can be read by the same template tests as the ladder models. The semantic-templates collection holds them together.
Result
| model on OpenWebText, 0.53B tokens | settled PPL | against this model |
|---|---|---|
| this model (GPT-2, d = 384, L = 8, 33.7M parameters) | 48.37 | |
| the cosine-schedule GPT-2 (same model, peak 6e-4, cosine; the published reference) | 49.81 | +3.0% |
| SR2-NP (Semantic Simulation, L = 2) | 58.51 | +21.0% |
| G2 (Semantic Simulation, L = 2) | 53.12 | +9.8% |
| L4 (Semantic Simulation, L = 4) | 50.10 | +3.6% |
- Settled is the mean of the evals at steps 31,500, 32,000 and 32,500 (48.65, 48.32, 48.14), the ladder's convention; best and final 48.14 at step 32,500. Validation perplexity at block 512.
- Trained on exactly 532,480,000 tokens (32,500 steps × 32 × 512), the ladder's token budget.
- The schedule equals a ladder run's at all 650 logged steps (checked against XRB-F, to a relative 5e-16). The decay gains 0.338 nats (67.79 at step 21,000 to 48.37), against 0.18 to 0.22 for the Fock arms.
- Run health: one Colab session on an A100-40GB, 2.7 h; 65 evaluations, largest rise between evaluations +0.009 nats (step 15,000).
Semantic templates
A semantic template has two halves: a Pattern Matching Structure that recognises a signature, and an Inference Structure that builds a new structure when the first fires. The work is in three parts; this section grows as each lands.
Part 1: reading the pattern-matching half (preliminary results, 2026-11-27)
Read through its residual stream (the entry of each block and the last block's output, before the final LayerNorm) with every template test unchanged.
The tests at a glance
What a test item is. A premise: two clauses joined by a connective, a second sentence, and then the word "Therefore", where the premise stops. The model never sees a conclusion. Every premise is read after 48 tokens of ordinary text. One pair of clauses, "the road is closed" and "the mayor lies to voters":
If the road is closed, then the mayor lies to voters. The road is closed. Therefore MP, valid
If the road is closed, then the mayor lies to voters. The mayor lies to voters. Therefore AC, its fallacy twin
If the road is closed, then the mayor lies to voters. The road is long. Therefore near miss
Either the road is closed or the mayor lies to voters. The road is not closed. Therefore DS1, valid
A template is one valid form (modus ponens MP, modus tollens MT, the disjunctive syllogisms DS1 and DS2), learned from the trained model's vectors on development premises as one Gaussian cloud per kind of premise. It ranks a premise by how much of the clouds' probability falls on its kind, and it fires when that share passes a threshold set so that 1% of the rival premises fire. Each valid form has a twin: the fallacy with the same connective and the same polarity of the second sentence (AC for MP, DA for MT, the affirmed disjunct for DS1 and DS2).
Verbatim premises: the geometry matcher. The second sentence repeats a clause word for word. The matcher reads the premise's pieces (the connective, the two clauses, the second sentence and "Therefore") and compares them with one another through the angles and lengths of their vectors. Fed the embedding (the input vectors, before any layer), it is the reference that the layer states must beat. Here the words decide a lot: token identity, which only checks which tokens repeat, already scores 0.906 on wordings left out of fitting.
Task A: the state at "Therefore". One vector is read: the state of the final word. "Therefore" is the same word in every premise, and the models are causal (a state is computed from its token and the tokens before it), so whatever its state says about the form, the layers carried there from the earlier words. Its embedding knows only its position, that is the premise's length, which is read as a control. Ranking the right template first needs the frame (conditional or disjunctive) and whether the second sentence says "not". Telling MP from AC needs more: the two differ only in which clause the second sentence repeats, so the layers must have compared the second sentence with the clauses.
B-logic and its control: the form set by context. The premise is the same string in every version. Only a context sentence before it differs, and it says what the second sentence, an arbitrary signal, means:
Here, "the blue flag is up" means that the bank is closed. MP, valid
Here, "the blue flag is up" means that the high street is quiet. AC, its twin
Here, "the blue flag is up" means that the cleaners are inside. foil
followed in every version by the same premise:
If the bank is closed, then the high street is quiet. The blue flag is up. Therefore
Token identity and the embedding see the same premise in every version, so they tie at exactly 0.5 by construction; only the layer states can tell the versions apart. In the control every context names both clauses ("... means that the bank is closed, and nothing about whether the high street is quiet."), so a state that only notes which clauses were mentioned cannot separate the versions; only one that carries which clause the signal is bound to can. The readings are pairs: does the version the context makes valid score higher on its template than its twin, or than the foil? Chance is 0.5.
Task B: meaning set only by context. As in B-logic the premise is one string and only a context sentence differs, but here the second sentence already has meanings, and the context must choose one: a word sense or a pronoun's referent. The clauses say each meaning in other words:
We were talking about money and loans. MP ("the bank" is the lender)
We were walking by the water. AC, its twin ("the bank" is the embankment)
followed by: If the lender is closed, then the embankment is closed. The bank is closed. Therefore
Here, "he" means John. MP
Here, "he" means Bill. AC, its twin
Here, "he" means Tom. foil (a third person)
followed by: If John is tired, then Bill is tired. He is tired. Therefore
Each sublevel has four kinds of context: an explicit definition, a natural sentence (for word sense a topic that names no word of the clauses), and two controls that name both meanings, the chosen one first or last. The readings are pairs, as in B-logic, by the reader at "Therefore"; chance is 0.5.
The readings
| model | verbatim premises, unseen wordings: the embedding (token identity 0.906) | task A: right form ranked first (chance 0.25; the embedding 0.20 to 0.30) | task A: valid against twin, AUROC (chance 0.5) | B-logic control: against the foil, bound clause first and last | B-logic control: against the twin |
|---|---|---|---|---|---|
| GPT-2 W2 | 0.970 | 0.653 (after block 7) | 0.754 (after block 4) | 0.86 and 0.92 | 0.73 and 0.77 (all states) |
| SR2-NP | 0.952 | 0.621 (all states) | 0.756 (after layer 1) | 0.90 and 0.92 | 0.76 and 0.84 (best of the states after layers 0 and 1) |
| G2 | 0.955 | 0.573 (states after layers 0 and 1) | 0.745 (early state) | 0.57 and 0.58 | 0.69 and 0.75 (best of the states after layers 0 and 1) |
| L4 | 0.976 | 0.604 (after layer 2) | 0.753 (after layer 1) | 0.97 and 0.96 | 0.78 and 0.78 (best of the states after layers 0 and 1) |
| model | task B, pronoun, explicit: against the foil | task B, pronoun controls: against the twin, bound person first and last | task B, word sense, natural topic: against the twin | task B, word-sense controls: against the twin, first and last |
|---|---|---|---|---|
| GPT-2 W2 | 0.896 (after block 7) | 0.542 and 0.558 (after block 7) | 0.558 (after block 8) | 0.617 and 0.467 (after block 2) |
| SR2-NP | 0.525 (after layer 1) | 0.533 and 0.517 (after layer 0) | 0.525 (after layer 1) | 0.492 and 0.458 (after layer 1) |
| G2 | 0.450 (after layer 0) | 0.492 and 0.533 (after layer 1) | 0.492 (after layer 1) | 0.467 and 0.550 (after layer 1) |
| L4 | 0.625 (after layer 2) | 0.750 and 0.592 (after layer 2) | 0.508 (after layer 1) | 0.650 and 0.433 (after layer 0) |
Task B: each value is the best state of the reader at "Therefore" for that call, so it leans above 0.5 by selection. Only three have their whole interval above 0.5: GPT-2 (0.896) and L4 (0.625) against the foil with an explicit pronoun definition, and L4's pronoun control with the bound person first (0.750), whose other order is at chance. The states at "Therefore" carry who the context named, not the referent or sense it gives a phrase inside the second sentence.
- Preliminary. The templates rank premises; outside verbatim premises they do not fire (the threshold set on verbatim premises is almost never reached). Nothing is built into the model: these are readings of a frozen checkpoint.
How the scores are defined. Template_Battery_Scores.md defines every score of the battery and the terms it rests on: the items, the eleven wordings and the nine kinds of premise, the matchers fitted on known and on unseen wordings, R1, R2 and the paraphrase rate at 1% near misses, each with a worked example.
- Three blocks against one layer. After its first two blocks GPT-2's state at "Therefore" is at the embedding's level on the form, and on the binding it follows whichever clause the context named first (mention). From the third block on it carries form and binding at the level SR2-NP reaches after its first layer. At its best it is level with SR2-NP, not ahead.
Calls and their scores: GPT2_Template_Battery_Results.md (GA1, GA2 and GA4 hit; GA3, against SR2-NP-L8 at equal depth, waits for that model). Premises and scores: the dataset semsimula-template-battery.
Part 2: firing (design in progress)
A template fires when its log odds against the rival templates pass a threshold. The threshold set on verbatim premises is almost never reached on premises whose form the words do not show, so Part 1's templates rank and do not fire. Two steps are being designed: a firing rule that works on such premises (a threshold set on context-defined development premises, for the reader at the summary position), and a firing mechanism built into the model rather than read from it. The candidate mechanisms (calibrated thresholds, abstention, a factorised rule, evidence accumulated along the trajectory, firing at a rate, capture by a template well, a learned gate) and the operating-point bound that limits them are analysed in Template_Firing_Mechanisms.md. Their tests will be fixed before they are run; results will be added here.
Part 3: the inference half (not started)
In the Semantic Simulation framework a template has two halves: a Pattern Matching Structure that watches for a signature (Part 1 reads it from trained states) and an Inference Structure that, when the template fires, builds a new semantic structure and places it, possibly far from where the pattern was seen. Nothing of this half has been built or tested. The options for building it, in the conservative models and in attention-based transformers, with their costs and open problems, are set out in Deploying_Semantic_Templates.md.
The training curve
The ladder's schedule: a linear warmup over 5% of 32,500 steps (to step 1,625), the peak learning rate (1.2e-03) held to 65% (step 21,125), then a cosine decay to the floor (6e-05) at step 32,500.
| step | validation PPL | phase |
|---|---|---|
| 2,000 | 151.10 | peak learning rate reached at step 1,625 |
| 5,000 | 88.16 | constant |
| 10,000 | 74.30 | constant |
| 15,000 | 70.94 | constant |
| 21,000 | 67.79 | end of the constant phase |
| 24,000 | 64.33 | decay |
| 27,000 | 57.82 | decay |
| 30,000 | 50.67 | decay |
| 31,500 | 48.65 | decay |
| 32,000 | 48.32 | decay |
| 32,500 | 48.14 | floor, last eval |
Reproduction
colab_matched_gpt2_baseline_openwebtext.ipynb, with two Cell 0 lines changed from the defaults:
LR = 1.2e-3
LR_SCHEDULE = 'wsd'
Cell 0 must print VARIANT_TAG = '_wsd_lr0p0012'; Cell 4 must give batch 32 × 512. Run Cells 0 → 6.
Files
| path | what |
|---|---|
README.md | this card |
config.json | architecture, training and result, machine-readable |
checkpoints/gpt2_baseline_best.pt | weights at the best eval (step 32,500), optimizer state stripped |
results/training_log.jsonl | per-step and per-eval record |
results/matched_gpt2_LR=1.2e-03_32500steps_training_output.txt | the full run log |
results/gpt2_baseline_summary.json | end-of-run summary; its fock_* fields are stale constants (see the note beside it) |
results/NOTE_summary_json_fock_fields.md | why the fock_* fields are to be ignored |
code/colab_matched_gpt2_baseline_openwebtext.ipynb | the notebook, self-contained (the model is defined in its Cell 3) |
Companion notes
| note | what it covers |
|---|---|
Matched_GPT2_Baselines.md | §6: this run (W2), its calls and what it shows about the decay |
GPT2_Template_Battery_Results.md | the template tests on this model |
Task_B_Results.md | task B on this model and the ladder models; why GPT-2 passes the explicit foil (§5.4) |
Template_Programme_Status_and_Plan.md | where the template programme stands |
Caveats
- One seed.
- Depth and parameters are not matched with the two-layer ladder models (L = 8 here, 33.7M parameters against about 77M). It is matched in depth with SR2-NP-L8 (eight layers), which is still training.
- The template readings are preliminary. The templates rank premises; they do not fire on them outside verbatim premises.
Citation
@misc{Gueorguiev2026SemSim,
author = {Gueorguiev, Dimitar P.},
title = {Semantic Simulation: A Prescriptive Lagrangian Framework
for Semantic Inference --- Conservative Potentials,
Conservative and Non-Conservative Memory, and Competing Mechanisms},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.19712427},
url = {https://doi.org/10.5281/zenodo.19712427},
note = {Version v25 (Nov 9, 2026).
Companion code repository (DOI 10.5281/zenodo.24066016):
\url{https://github.com/dimitarpg13/semsimula-paper}}
}
Card generated from _ladder/ladder.json on 2026-11-30.