Calibrate token-guess outcomes against no-learning floors - #12
Draft
Al-does wants to merge 1 commit into
Draft
Conversation
Both headline axes of this study have floors far above zero, so the reported numbers cannot be read on their own. Add the references that make them interpretable, measured on the same rollout as the agent. baselines.py scores the echo-the-last-token and exact-Bayes policies on the agent's own belief trajectory by expected hit rate, which removes the sampling noise that otherwise swamps a 1.6-point accuracy range, and fits the study's own rank-2 probe to last-token, last-two-token, and own-action features. probe_checkpoint now emits all of it plus within-branch residual R^2, so future runs are self-calibrating. The untrained_reference arm probes a randomly initialised transformer with the identical environment, architecture, probe, and rollout seeds. It reads R^2 = 0.8823 +/- 0.0055 at chance accuracy, above the reward-only and max-entropy arms. Co-authored-by: Alex Vardakostas <Al-does@users.noreply.github.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.
Why
Reviewing the
mess3_token_guess_cycle_1setup for conceptual problems turned up one that invalidates the headline reading: neither outcome axis starts near zero, and nothing in the study measured where they do start.reward_only(0.8552) andmax_entropy(0.8558) arms are below that floor.Every arm plotted against the floors it has to clear
What this adds
baselines.pyexpected_accuracy_bandscores the agent, the echo baseline, and exact Bayes on the agent's own belief trajectory by expected hit rate rather than realized hits. All three share one realization of the process, which removes the sampling noise that otherwise swamps a range this narrow, and reports the agent as a fraction of the range.trivial_feature_r2fits the study's own rank-2 affine probe to last-token, last-two-token, and own-action one-hots, so the floors are directly comparable to the reportedr_squared.residual_r2_beyond_recent_tokenswraps the library's existingconditional_residual_r2, which the belief-geometry study already uses but this one did not.analysis.probe_checkpointemits all of it, so every future probe is self-calibrating.untrained_reference/is a new leaf that probes three freshly initialised transformers with the identical environment, architecture, probe, and rollout seeds. Only the weights are untouched.NOTES.mdgains a reference-band section that supersedes the earlier interpretation.Verification
uv run pytest -q -m "not slow"→ 60 passed, 1 skipped. Four new tests pin the floors: the echo and Bayes policies land at 0.0 and 1.0 of the range, recent-token features score 0.75–0.96, and a probe fed the exact belief clears the within-branch residual test at >0.99.untrained_referencewas run twice at full budget and reproduced identically (0.8877 / 0.8748 / 0.8844).Not addressed here
Three further setup problems came out of the review and are left for discussion rather than changed unilaterally, since they alter the recipe:
NextTokenGuessTask.resolve_actionignores the action, so the process is passive and only the immediate reward term of the GAE sum carries action-dependent signal. At γ=0.99, λ=0.95 the rest inflates advantage variance 7.7×, costing about 8.7× in sample efficiency.max_entropybonus depends on state alone and cancels out of the advantage. Withentropy_coeff=0.0the arm is a provable no-op, which is why it matchedreward_onlyto four decimals.delayis not a usable difficulty knob: atdelay=0the graded token is already visible and echoing it scores 1.0000. Widening both axes needs a noisier emission channel and a stickier chain instead.To show artifacts inline, enable in settings.