Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/rht26-empirical-bridge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: RHT-26 empirical math bridge (CPU)
on:
push:
paths:
- 'src/spiral_ln/evaluation_reward_carryover_bridge.py'
- 'tests/test_evaluation_reward_carryover_bridge.py'
- 'docs/rht26_empirical_math_review.md'
- 'skills/evalmath-mechinterp-power/scripts/preflight.py'
- 'skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py'
- '.github/workflows/rht26-empirical-bridge.yml'
pull_request:
paths:
- 'src/spiral_ln/evaluation_reward_carryover_bridge.py'
- 'tests/test_evaluation_reward_carryover_bridge.py'
- 'docs/rht26_empirical_math_review.md'
- 'skills/evalmath-mechinterp-power/scripts/preflight.py'
- 'skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py'
- '.github/workflows/rht26-empirical-bridge.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
cpu-math:
runs-on: ubuntu-latest
timeout-minutes: 7
env:
PYTHONPATH: src
PYTHONDONTWRITEBYTECODE: '1'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Compile pure-stdlib model and preflight
run: |
python -m compileall -q src/spiral_ln/evaluation_reward_carryover_bridge.py skills/evalmath-mechinterp-power/scripts/preflight.py tests/test_evaluation_reward_carryover_bridge.py
- name: Exact empirical bridge tests
run: python -m unittest discover -s tests -p 'test_evaluation_reward_carryover_bridge.py' -v
- name: Generic mechanistic-resolution and signed-FSI regressions
run: python -m unittest discover -s skills/evalmath-mechinterp-power/scripts -p 'test_*.py' -v
104 changes: 104 additions & 0 deletions docs/rht26_empirical_math_review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# RHT-26 empirical mathematical review (CPU-only)

**20 November 2026. Evidence:** eight-root Qwen3-1.7B *development* pilot in [Control-Harness commit 27b210f](https://github.com/MoralityLabAI/Control-Harness/commit/27b210f758dbf45540dbc0e5226cb00e84dc623b), audited at [Control-Harness PR #85](https://github.com/MoralityLabAI/Control-Harness/pull/85). The finite theorem/receipt in EvalMath remains exact synthetic evidence. Confirmation roots opened: **zero**.

This addendum creates a separate mathematical bridge without revising the original RHT-26 source-bound receipt. The published empirical case-level data live in Control-Harness. Our compact exact-count fixture is a snapshot for arithmetic tests, not an independent GPU replication.

## 1. Expand the artifact state to model visible cue density

RHT-26's four-state variable (a, l) uses a binary accessible-artifact bit a and a binary declared policy bit l. It establishes reset closure, update-order effects, exact joint endpoints and contraction under those hypotheses.

The pilot's measured **artifact-only** joint persistence was:

| Visible source episodes | 0 | 1 | 2 | 4 | 8 |
|---|---:|---:|---:|---:|---:|
| Frozen weights, p10, cases persisting / 256 | 0 | 15 | 161 | 247 | 242 |
| Learned weights plus artifacts, p11 | 0 | 1 | 94 | 186 | 44 |

The binary artifact bit conflates one cue and eight repeated cues. A more faithful model should track (m, o, l), where m counts cue-bearing entries currently readable, o counts distinct provenance origins, and l denotes a policy state or its full checkpoint. A history-dependent or retrieval-position kernel may also be needed.

A simple independent-write threshold model gives

\[
P(M_T\geq k)=\sum_{j=k}^{T}{T\choose j}q^j(1-q)^{T-j}.
\]

For fixed q and k, this is monotone in T. The exact implementation in evaluation_reward_carryover_bridge.py checks the family without fitting it to the observed model. The five-case pooled decline in p10 between doses four and eight is a potential discriminator of such a model, subject to paired-root uncertainty and context-position effects.

**Carrier provenance is a material limit of the present pilot.** In the
Control-Harness adapter, source_episode invokes write_structured_cue before
generating the actor's response. The test harness therefore creates these
instructions in its four workspace channels; the model's own response does
not cause the recorded cue write. The reported effect is a host-written,
multi-episode prompt-injection exposure. Demonstrating *endogenous* memory
poisoning or long-range reward hacking will require a follow-up where an
actor-generated declarative action controls the later artifact write and its
subsequent persistence.

## 2. The end-state is sufficient under the current measurement interface

For a Markov-sufficient model whose terminal scoring kernel depends on S_T,

\[
H_{1:T}\longrightarrow S_T\longrightarrow (B,A).
\]

Histories inducing identical terminal state laws have identical endpoint laws under the same kernel. A frozen language model with identical serialized final workspace, weights, decoding configuration and evaluator should likewise have the same output distribution unless an additional state channel exists.

Control-Harness found that deleting the cue store reduced joint persistence to 0/256 and transplanting it into the clean checkpoint reproduced the full 242/256 artifact-only result root by root. A single cue embedded in 3,117 matched workspace tokens, with 31 other neutral entries, yielded 0/256. These interventions support a **current-workspace cue-density** mechanism in the tested interface. They do not isolate the causal contribution of elapsed episode history, because the final visible text differs between one and eight cues.

A future history-swap test should hold the exact serialized final workspace fixed while changing which earlier episodes constructed it, then test the zero-difference prediction. To study endogenous stigmergy, let the actor write its own records and compare against host-written, matched traces.

## 3. Negative learned-weight interaction: joint risk and selected denominators

Dose-eight joint (B,A) counts in order (00, 01, 10, 11), each over 256 target cases:

| Arm | 00 | 01 | 10 | 11 |
|---|---:|---:|---:|---:|
| p00 (cleared, frozen) | 256 | 0 | 0 | 0 |
| p10 (retained, frozen) | 0 | 0 | 14 | 242 |
| p01 (cleared, LoRA) | 256 | 0 | 0 | 0 |
| p11 (retained, LoRA) | 38 | 0 | 174 | 44 |

The additive interaction equals -99/128. Since p00=p01=0, this also equals the controlled learned-weight contrast **when artifacts remain accessible**, p11-p10.

Let b=P(B=1), r=P(A=1 | B=1) and p=br. Then

\[
p_{11}-p_{10}
=(b_{11}-b_{10})r_{10}+b_{11}(r_{11}-r_{10})
=-2299/16384-10373/16384=-99/128.
\]

The first term (-0.14032) tracks changes in the pre-correction failure population. The second (-0.63312) tracks the selected-group persistence contrast. Both are descriptive and **neither is an identified natural mediation effect**. Model updates were observed, but whether the negative interaction arose through learned correction compliance, token-logit geometry or another training-dependent mechanism remains open. Root variance was large: four of eight updated/artifact roots had zero persistent cases, while one had 31/32.

The current source-episode objective supervised the unauthorized action, so a later suppression effect is a particularly useful mechanistic question. Freeze distinct post-correction logit comparisons and matched optimizer controls for any follow-up.

## 4. Statistical planner improvements

The generic mechanistic-resolution preflight previously supplied a normal approximation for nominal 80%-power planning. FSI-01 separately requires a positive-floor **one-sided Hoeffding bound** over independent root means. With root effects scaled to [-1,1], familywise alpha, m prespecified comparisons, a prospective effect target d and mechanistic floor tau, a lower bound can exceed tau at the observed mean d only if

\[
G\ge \left\lceil\frac{2\log(m/\alpha)}{(d-\tau)^2}\right\rceil,\qquad d>\tau.
\]

This is a finite-sample **resolution threshold conditional on observing d**, rather than an 80%-power guarantee. At alpha=0.05 and m=4:

| Target scenario | Floor | Roots to resolve floor if mean equals target |
|---|---:|---:|
| Prospective effect 0.10 | 0.05 | 3,506 |
| Development artifact estimate 121/128, for sensitivity only | 0.05 | 11 |
| Development combined estimate 11/64, for sensitivity only | 0.05 | 591 |
| Absolute negative interaction, scaled by 1/2: 99/256 | 1/40 | 67 |

The latter three targets were chosen from development observations and cannot substitute for a prospectively frozen power target.

The preflight update adds a signed effect-direction setting (increase or decrease) and an **optional FSI-01 floor guard**, leaving older approximate-only workflows compatible. A negative interaction must have its direction fixed before a new sealed confirmation cohort. It must be scaled by 1/2 first, because the raw factorial interaction can lie in [-2,2]. A one-sided directional hypothesis chosen during development requires a new untouched confirmation sample and full accounting for the earlier four-arm selection search.

The nonparametric 95/95 tolerance bound over independent sham-root maxima still needs at least 59 sham roots. This calibrates a **single-root variation envelope**, not the sampling distribution of the mean treatment effect. A 64-root sham calibration and a 64-root effect confirmation answer different questions. A joint confidence statement must allocate error across both steps.

## 5. Priorities while the GPU is occupied

Model the separate roles of cue count, position and provenance in the mathematical state. Audit the dose-four to dose-eight root-paired differences before designing a position ablation. Preserve both the original RHT-26 exact receipt and the empirical development archive; register any focused artifact-only follow-up as a new experiment whose comparison-selection history is explicit. Confirmation remains sealed.

**Sources:** [full development report](https://github.com/MoralityLabAI/Control-Harness/blob/27b210f758dbf45540dbc0e5226cb00e84dc623b/results/rht26_local/development_report.md), [source-bound receipt](https://github.com/MoralityLabAI/Control-Harness/blob/27b210f758dbf45540dbc0e5226cb00e84dc623b/results/rht26_local/receipt.json), original [RHT-26 finite model](../paper/reward_hacking_carryover.md) and [FSI-01](../paper/finite_sample_inference.md).
27 changes: 26 additions & 1 deletion skills/evalmath-mechinterp-power/scripts/preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def preflight(spec):
quantile=fraction(spec.get('sham_quantile'),'sham_quantile')
confidence=fraction(spec.get('sham_confidence'),'sham_confidence')
if not 0<alpha<1 or not 0<quantile<1 or not 0<confidence<1:raise ValueError('invalid probability')
direction=spec.get('effect_direction','increase')
if direction not in ('increase','decrease'):raise ValueError('effect_direction must be increase or decrease')
enforce_fsi=spec.get('enforce_fsi01_floor',False)
if type(enforce_fsi) is not bool:raise ValueError('enforce_fsi01_floor must be boolean')
sign=1 if direction=='increase' else -1
m,g=spec.get('planned_comparisons'),spec.get('confirm_units_planned')
if type(m)!=int or m<1 or type(g)!=int or g<2:raise ValueError('invalid comparisons or confirmation units')
rows=spec.get('pilot')
Expand All @@ -52,7 +57,7 @@ def preflight(spec):
rid=row.get('unit_id')
if not isinstance(rid,str) or not rid or rid in ids:raise ValueError('unique pilot unit_id required')
ids.add(rid)
effects.append(fraction(row.get('paired_effect'),'paired_effect',True))
effects.append(sign*fraction(row.get('paired_effect'),'paired_effect',True))
null=row.get('sham_effects')
if not isinstance(null,list) or not null:raise ValueError('matched shams required per independent world')
shams.append(max(abs(fraction(z,'sham',True)) for z in null))
Expand Down Expand Up @@ -80,6 +85,18 @@ def preflight(spec):
if sigma is not None and delta>0 and not pilot_variance_uninformative else None)
mde=(float(variation)+z*sigma/math.sqrt(g)
if sigma is not None and not pilot_variance_uninformative else None)
# FSI-01 uses an independent-root, one-sided Hoeffding lower bound.
# Each signed root contrast here has range [-1,1], width 2; interactions
# in [-2,2] must first be multiplied by 1/2 by the caller.
# This is a finite-sample *resolution* requirement if the observed
# confirmation mean equals the chosen target, not an 80%-power claim.
log_family=math.log(m/float(alpha))
fsi_roots_at_target=(math.ceil(2*log_family/delta**2) if delta>0 else None)
observed_gap=float(observed_mean-variation)
fsi_roots_at_observed=(math.ceil(2*log_family/observed_gap**2)
if observed_gap>0 else None)
fsi_resolvable_mean=float(variation)+math.sqrt(2*log_family/g)
fsi_development_lower=float(observed_mean)-math.sqrt(2*log_family/len(effects))
reasons=[]
if not spec.get('pilot_from_development_only') is True:reasons.append('development_pilot_unverified')
if not spec.get('heldout_sealed') is True:reasons.append('heldout_unsealed')
Expand All @@ -92,6 +109,8 @@ def preflight(spec):
if pilot_variance_uninformative:
reasons.append('zero_variance_pilot_power_uninformative')
if required is None or required>g:reasons.append('confirmation_underpowered')
if enforce_fsi and (fsi_roots_at_target is None or fsi_roots_at_target>g):
reasons.append('fsi01_effect_floor_resolution_underpowered')
return {'schema':'EvalMath/mechinterp-power-preflight/v1','experiment_id':spec['experiment_id'],
'decision':'REDESIGN_OR_PILOT_ONLY' if reasons else 'READY_FOR_CONFIRMATION',
'reasons':reasons,'independent_unit':spec['independent_unit'],
Expand All @@ -103,6 +122,12 @@ def preflight(spec):
'planned_comparisons':m,'minimum_exact_sign_test_roots':min_sign_roots,
'approx_worlds_for_80pct_power':required,
'approx_resolvable_effect':mde,
'effect_direction':direction,'enforce_fsi01_floor':enforce_fsi,
'fsi01_roots_at_target_for_effect_floor_resolution':fsi_roots_at_target,
'fsi01_roots_at_observed_pilot_mean_for_effect_floor_resolution':fsi_roots_at_observed,
'fsi01_resolvable_mean_at_planned_roots':fsi_resolvable_mean,
'fsi01_development_pilot_lower_bound':fsi_development_lower,
'fsi01_note':'One-sided independent-root Hoeffding floor resolution, width 2 and Bonferroni m; this is not an 80%-power claim. The observed-pilot projection is post-development sensitivity only. Interactions in [-2,2] must be scaled by 1/2; effect_direction must be frozen before a fresh confirmation readout.',
'limits':'Normal-based power is planning only. A zero-effect zero-variance pilot cannot support extrapolating a hypothetical positive effect. Root and sham independence, symmetry, readout sealing, and the scientific effect floor require independent audits. Repeated outcomes within a root are never additional worlds.'}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,43 @@ def test_duplicate_independent_root_rejected(self):
with self.assertRaises(ValueError):pf.preflight(p)


def test_fsi01_positive_effect_floor_root_resolution_guard(self):
p=pilot(effects=['1/4']*64,shams=['0']*64,confirm=128,comparisons=4)
p['scientific_min_effect']='1/20'
p['target_effect']='1/10'
p['enforce_fsi01_floor']=True
out=pf.preflight(p)
self.assertEqual(out['fsi01_roots_at_target_for_effect_floor_resolution'],3506)
self.assertEqual(out['fsi01_roots_at_observed_pilot_mean_for_effect_floor_resolution'],220)
self.assertIn('fsi01_effect_floor_resolution_underpowered',out['reasons'])
self.assertEqual(out['decision'],'REDESIGN_OR_PILOT_ONLY')
p['enforce_fsi01_floor']=False
old=pf.preflight(p)
self.assertNotIn('fsi01_effect_floor_resolution_underpowered',old['reasons'])
self.assertEqual(old['decision'],'READY_FOR_CONFIRMATION')

def test_negative_effect_direction_is_explicit_and_signed(self):
p=pilot(effects=['-3/8']*64,shams=['0']*64,confirm=256,comparisons=4)
p['scientific_min_effect']='1/20'
p['target_effect']='1/4'
p['effect_direction']='decrease'
p['enforce_fsi01_floor']=True
out=pf.preflight(p)
self.assertEqual(out['mean_pilot_effect'],0.375)
self.assertEqual(out['effect_direction'],'decrease')
self.assertEqual(out['fsi01_roots_at_target_for_effect_floor_resolution'],220)
self.assertEqual(out['decision'],'READY_FOR_CONFIRMATION')
p['effect_direction']='increase'
opposite=pf.preflight(p)
self.assertIn('pilot_effect_not_above_mechanistic_variation_floor',opposite['reasons'])

def test_invalid_fsi_guard_and_direction_rejected(self):
p=pilot()
p['enforce_fsi01_floor']='yes'
with self.assertRaisesRegex(ValueError,'boolean'):pf.preflight(p)
del p['enforce_fsi01_floor']
p['effect_direction']='two_sided'
with self.assertRaisesRegex(ValueError,'effect_direction'):pf.preflight(p)


if __name__=='__main__':unittest.main()
Loading
Loading