Repository navigation
ARG-02: recurrent-depth evaluation of Qwen3.5 and looped Nanbeige4.2-3B - #141
Open
patrickdugan wants to merge 8 commits into
Open
patrickdugan wants to merge 8 commits into
patrickdugan wants to merge 8 commits into
Conversation
Adds research/algernon/algebraic_reasoning_gym/arg02: an explicit, untrained block-loop recurrence over Qwen3.5-0.8B-Base decoder layers; open-loop (residual-feedback) and donor-shuffle ablations; repeated-forward and Qwen3.5-2B equal-compute controls; an external verifier-feedback controller; state perturbation and answer-site patching; linear probes on per-step states; EvalMath grading of every proposal; clustered paired statistics; GPU-time, MAC, token and verifier accounting; a replayable answer tape; a checkpoint lock; and a protocol registered before any Qwen output on the development or test rows. Verified locally: 26 torch-free and 10 torch tests pass (tiny random Qwen3.5 on CPU, including depth-1 parity with the HF forward, ablation identities, a runner that cannot reach the roster, and the full export-select-test-report-replay chain). On CPU the real 0.8B weights give a depth-1 readout identical to the HF forward (max |log-prob diff| 0.0). ARG-01's 14 tests and receipt replay pass unchanged. The GPU stages have not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
device_map places the weights on the card at load time, so the 2B control never holds a second copy in host RAM. CPU loading is unchanged; checked on the real 0.8B weights (loads as Qwen3_5ForCausalLM, bf16) and the 10 torch tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows PowerShell 5.1 turns native stderr lines into terminating errors under ErrorActionPreference Stop; transformers prints kernel-fallback warnings there. Every stage already checks LASTEXITCODE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tables.py writes arg02_tables.md (arms, paired comparisons, decision rules, depth curve, perturbation, patching, probes, families, ARG-01 cross-check, peak VRAM). The smoke pipeline test renders it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
align_index wrapped right-aligned positions over the whole donor sequence, so a recipient prompt longer than its donor received the donor's row-specific candidate-token displacement at some prompt positions, and rows that share a prefix disagreed (40% of shuffle records, up to 5.4 nats). Candidates now map only onto candidates and prompt positions wrap within the donor prompt. Every other arm had zero row spread. The runner gains --arms to recompute one part label; the corrected arm runs as test_shuffle_a1, the original parts stay. The analysis reports both and evaluates H2b on the corrected arm (PROTOCOL.md, Amendment 1). Tests: 8 recurrence tests (row consistency with shorter and longer donors) and the 2 pipeline tests, including the amended arm, pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… recovery Development selection chose 4 shots, block [8,12) and d* = 16. On the 192-row test set the loop at d* recovered 67/168 future-correct programs within 12 exact checks against 68 for the single pass (CI [-0.085, +0.072], McNemar p = 1.0). Qwen3.5-2B in one pass recovered 79; the four-variant ensemble 69; the external verifier-feedback controller 69; complete certified class search 159. The corrected donor shuffle (Amendment 1) recovered 66. H1, H2b, H3a, H3b, H3c and H4 are not met; H2a is met only because the open-loop ablation drops to 46. Depth churns answers (32 gained, 33 lost), the unconstrained readout leaves the operator grammar from step 10, and a small state kick grows 10.9x by step 16. Adds REPORT.md, the receipt, profile, per-case traces, answer tape and tables. analyze replay regrades the tape to the receipt (48 arms); the 26 torch-free tests and ARG-01's receipt check pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nanbeige4.2-3B (rev 451ed48c) runs its 22 layers plus final norm as one
loop and was trained with 2 loops; without a KV cache the loop count can
be set at inference. nanbeige.py runs it through the ARG-02 trajectory
API (loop, open loop, shuffle, patch, perturbation) with weights streamed
onto the GPU; the remote code needs transformers < 5, so this profile
runs in the 4.46 venv.
A config/lock profile ("nanbeige") selects the model, depths 1/2/4/8,
the whole-stack block, a 16-variant matched-compute ensemble (shot-order
rotations) and no feedforward arm (none of this family on the machine;
H3b not applicable). PROTOCOL.md registers N1 before any Nanbeige output
on development or test rows. The runner, analysis, chain script and
checkpoint check take the profile.
Verified: loop-t readout equals NanbeigeModel.forward with num_loops=t
exactly (max |log-prob diff| 0.0) for t = 1, 2, 3 on a random model from
the remote code and on the real weights on the GPU (2 development
prompts); 4 Nanbeige loop tests, the Nanbeige pipeline smoke, and the 36
Qwen tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sm claim not met Development chose 0 shots and d* = 8 loops (dev 63 vs 49 at loop 1). On the 192-row test set loop 8 recovered 71/168 future-correct programs within 12 checks against 44 for one loop (CI [+0.057, +0.268], p = 0.002). It beat the equal-compute ensemble of 8 single-loop forwards (51) and the donor-shuffled state (62), but not the open-loop control (55, CI [-0.024, +0.215]), which for this model is close to a temperature-sharpened single pass. H1, H2b and H3a are met, H2a, H3c and H4 are not, H3b is not applicable, so the mechanism claim is not met. Most of the gain is the trained second loop (loop 2: 65), whose effect is nearly case-agnostic (the depth-2 shuffle differs on 6 of 168 cases); loop 8 vs loop 2 is +6 (p = 0.61). Complete certified class search: 159. Adds REPORT_NANBEIGE.md and results_nanbeige/ (receipt, profile, traces, answer tape, tables). analyze replay regrades both the Qwen and the Nanbeige tapes to their receipts on CPU, and CI now replays both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Extends ARG-01 with ARG-02, a registered algebraic-reasoning depth study on 192 held-out rows (168 positives, 24 negative/collision controls), covering an untrained Qwen3.5-0.8B block loop and natively looped Nanbeige4.2-3B (Extension N1).
Registered results
Evidence / replay
research/algernon/algebraic_reasoning_gym/arg02/PROTOCOL.md(pre-registered; includes amendment for Qwen donor alignment)REPORT.md,REPORT_NANBEIGE.md,STATUS.mdresults/andresults_nanbeige/: signed/hashed configuration, receipts, answer tapes, profiles, and table outputs.analyze replayindependently regrades answer tapes on CPU..github/workflows/algernon-arg02.ymlruns torch-free/pipeline checks and tape replay.Interpretation and follow-up
Current evidence supports a benefit from trained recurrent computation over single-loop forward and equal-compute ensembling. It does not establish the stronger mechanism claim or extrapolative computation gain beyond the trained 2-loop depth.
A follow-up should compare logit-temperature-matched controls, sham norm/readout adjustments, and case-specific activation interventions under a new registered protocol, separating global logit-margin sharpening from input-dependent iterative reasoning.
Original runs were completed at commit
65039a5; reports and CI-replay integration were pushed through1ac3635.