Skip to content

lane: register one rescue rule for the attention layers that miss the median bar in and out of sample (31, 35, 39), chosen from in-sample files only, with exact N4 arithmetic at head dimension 256 (desk) #241

Backlog

Description

@wakesync

Question. Layers 31, 35 and 39 miss the per-head median bar (rel_y <= 0.01) under upstream's integer attention at both clamps, in sample (PR #178) and on held-out prompts with frozen scales (PR #206), with medians within 0.0003 of each other. Which single scale rule would fix them, chosen only from in-sample evidence and written down with its exact admission arithmetic, so that a later run tests it out of sample without a second look?

Why it is on the shortest path. Attention is the second measured arithmetic blocker of the F-gate, after the MLP. experiments/20261113-176-qwen-int-attn/RESULTS.md section 7 and experiments/20261114-204-int-attn-heldout/RESULTS.md section 7 both list "any rescue" as not tried. Range transfer also failed by 1 and 4 clamped entries, so the rule needs a headroom policy. research/operators/qwen_ops/DH256-ROTARY.md (PR #180) sets the arithmetic frame: at dh = 256 the 2,047 clamp needs a new wider score layout, and a q/k-only clamp of 1,665 is the narrow fallback; any rescue rule must say which of the two it assumes. This draft is carried over from the 2026-11-17 seed (its DRAFT-5), which was not filed; it is still unowned.

Milestone (one lane, about 2.5 hours, desk plus small scripts).

  1. From PR research: integer attention on Qwen's 16 full-attention layers, clamps 2,047 and 1,665, open loop, CPU (#176) #178's committed in-sample files only, describe the failing layers: which tensor's exponent is coarsest relative to its observed maximum, where the per-head error mass sits. Use PR research: held-out integer attention with frozen #178 scales (Qwen3.8-27B abl, CPU) #206's files only for the clamp locations already reported, and say that they were seen.
  2. Pick ONE primary rule and at most one alternative: per-kv-head value exponent; one extra bit on the value cell; a headroom margin; per-head query exponent. For each: the integer definition, N4 / no-wrap redone exactly at dh = 256 under the score layout it assumes (wide33 or the 1,665 fallback of DH256-ROTARY.md), the new largest admissible clamp or cell, and what changes for the verifier's admission.
  3. The future run's PREREG text as a file (fit on PR research: end-to-end token agreement of XS18/XS20 DeltaNet lowering, stock and abliterated (#8) #124's 10 prompts, evaluate on PR lane: integer attention with frozen calibration scales on genuinely new held-out prompts #204's 8 held-out prompts with heldout.py, bars unchanged, one run, about 20 to 30 minutes of heavy slot).
  4. A unit-tested script for the N4 arithmetic, exact integers only.

Out of scope. Running the rule; relaxing the bar; integer projections, q/k norm, rotary or gate; any verifier change.

Negative result. No candidate keeps N4 at dh = 256 with a cell wide enough: the bar cannot be met inside upstream's attention arithmetic at this head size, and the note says which arithmetic would have to change.

Estimate. Desk; scripts under 5 minutes of CPU and under 2 GB (committed jsonl). No weights.

Activity

  1. added
    loop:active
    P2
    gate:0
    on Nov 29, 2026
  2. added a commit that references this issue on Nov 29, 2026
  3. wakesync commented on Nov 29, 2026

    @wakesync
    OwnerAuthor

    Draft PR: #246 (head 13952e2). Desk step: no model run, no weights, no proof, no verifier change. The rule below is on paper. It has not been run and has no fidelity number.

    Verdict against the registration (experiments/20261129-241-qwen-attn-rescue-rule/RESULTS.md): A1 PASS, A2 PASS with stated limits, B PASS as a prediction only, C PASS. The issue's registered negative did not occur.

    The rule (V13). Value clamp 4,095 (one extra bit on the value cell); q and k at the narrow 1,665 clamp with the legacy 32-bit score digit and kFD = 16; headroom margins 9/8, 9/8, 5/4 on q, k, v. Chosen by a procedure registered before any number was computed, from PR #178's in-sample records: on the layers where only one exponent differs between its two arms, one value bit fewer goes with a 1.76 to 1.92 times larger per-cell error, one query bit with 1.00 to 1.03, one key bit with 1.03. Alternative: one value exponent per key-value head (defined, but no table: the committed records hold no per-head maxima).

    Arithmetic at dh = 256, exact integers (n4_arith.py, 29 tests, constants on main reproduced): every registered condition holds for the rule's layout at shifts 4 to 12. N4 limits q and k to 1,665 and does not contain the value cell; the value clamp enters shape() only through N6, which admits far more than 4,095.

    Prediction (not a measurement): the registered heuristic puts all 16 in-sample medians at or under 0.01: layers 31, 35, 39 at 0.00631, 0.00627, 0.00756; the largest is layer 43 at 0.00939. For the three failing layers this is an extrapolation from other layers.

    Two things found after the registered run, reported as they stand; the rule was not adjusted:

    1. The value margin is thinner than a held-out overshoot already on main. PR research: held-out integer attention with frozen #178 scales (Qwen3.8-27B abl, CPU) #206's layer-23 value entry is 2,317 against an in-sample 1,772: ratio 1.3076, margin 1.25. It fits under the rule only through power-of-two slack at that layer; the rule's value headroom is below 1.3076 on layers 47 and 51. So the printed "B PASS" says the fidelity prediction passes. It does not say the range policy is adequate.
    2. A run on PR research: held-out integer attention with frozen #178 scales (Qwen3.8-27B abl, CPU) #206's eight prompts cannot test the margin: committed numbers already imply the rule clamps nothing there. FUTURE-PREREG.md (the text for the one run) says so. A real test of range transfer needs prompts not yet seen, which is not designed here.

    Where the issue text did not match main: #204 is the issue, the held-out PR is #206. heldout.py cannot run the rule unchanged (one clamp for q, k and v, and a hash-pinned exponent table), so the future run needs a new evaluator file that imports the existing ones. The narrow fallback's own operation (q and k at 1,665, v wider) has no fidelity run on main: PR #178's C1665 arm narrowed v too.

    NOT established: the rule's fidelity in sample or held out; the max half of the bar; range transfer; any admission of Qwen's attention or the soundness of any verifier change listed in RULE.md; the other uses of the clamped-cell bound in cp_verify.cpp (only the site "o" was evaluated); the policy conditions at softmax shapes other than the standard one.

    State of the PR: draft; it conflicts with main (main gained a results.yaml row after this branch was cut; the files changed on both sides are research/results.yaml, README.md, CLAIMS.md). CI passed on every head up to the docs commit; no CI run exists on the last three commits (the ledger row and two text fixes), most likely because of the conflict, which was not confirmed. Main was not merged in by this lane.

  4. added a commit that references this issue on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2gate:0loop:active

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions