# H-Net correction and source audit

Audit: 2026-11-18. Scope: the supplied paper v2, both supplied author blogs,
pinned official code, and the active lesson. This is not a checkpoint run or
an independent reproduction of the authors' training results.

## What was actually wrong or missing?

The previous numerical micro-labs were mostly correctly qualified. The
independent code reviewer found no substantive release-mechanism error in
their scalar selection/EMA arithmetic. The critic found a real teaching gap:
the main network was named, but its transformation was not calculated;
disconnected scalar and head examples did not make a connected forward pass.
The primary recap skipped main processing, and broad completeness wording
overstated the example. Paper v2 and the requested newer blogs were not
reconciled. Those omissions and scope errors are now corrected.

Do not rewrite that finding as "all the old equations were hallucinated."
Valid isolated examples remain, explicitly labeled as separate zooms.
The immutable older sources remain under [original-material](./original-material/).

## Source identity and inspection

| Source | Identity | Inspection and limits |
|---|---|---|
| Supplied local PDF | `Dynamic Chunking for End-to-End Hierarchical Sequence Modeling - 2507.07955v2.pdf`; 39 pages; 1,375,282 bytes | Front-page version and relevant methods, experiments/ablations, discussion and downsampling appendix inspected; not a claim to have reproduced every result or audited every reference. |
| [Paper HTML v2](https://arxiv.org/html/2507.07955v2) | Revised July 15, 2025 | Cross-check of equations, architecture, captions and PDF extraction. |
| [Official code](https://github.com/goombalab/hnet/tree/3673fe1217ebeb0d1438c7c71d58d32bdd190ec2) | `3673fe1217ebeb0d1438c7c71d58d32bdd190ec2` | Reviewer resolved main to this same pin. Audited dc, hnet, mixer_seq, isotropic, configs and generate. Local dc/hnet snapshots match the pin. |
| [Cartesia Part I](https://www.cartesia.ai/blog/from-tokens-to-bytes-part-1) | October 28, 2026 | Read the scaling ladder, controls, chunk examples, in-context behavior and explicit original/LH-Net versus improved internal-model aside. |
| [Cartesia Part II](https://www.cartesia.ai/blog/from-tokens-to-bytes-part-2) | October 28, 2026 | Read compression, pretokenization, transfer, marginalization/prompt-boundary corrections and proxy/frozen-boundary comparisons. |

Supplied PDF SHA-256:
`04a2b32e6e82853cfc23c5db132750874a86cde99219ec6f664128f4aa83122f`.
Its physical path and identity are in [provenance](./provenance.json).
PDF.js extracted all pages into session evidence; CMap warnings affected some
non-Latin examples. Crucial English methods were cross-checked against HTML;
text extraction is not a substitute for checking figure meaning.

## Evidence-tier map of load-bearing current claims

T1 = verified recent primary source; T2 = verified older primary source.
Dates determine these tiers, not confidence of wording. Quotes below are
from the corrected article; source locations are specific rather than
decorative general citations. All listed claims are **verified at their
stated scope**; author-reported findings remain attributed, not reproduced.

| ID / claim quotation | Tier | Actual support and scope |
|---|---|---|
| C01: "The main network does the expensive modeling on those selected inputs." | T2 | v2 §2.1, Eqs. 1–3; bulk of parameters in M. Does not imply measured latency. |
| C02: "There is no chunk-average operation in the default downsampler." | T2 | v2 §2.2.1 and Appendix E.1; pinned `hnet/modules/dc.py` DownsamplingModule. Alternative pooling ablations are not the default. |
| C03: "apply RMSNorm at width 1536, then take the first 1024 coordinates" | T2 | One-stage Large config; `hnet/models/hnet.py` 224–300; `hnet/modules/isotropic.py` final norm. Specific to that width contract. |
| C04: "The untied linear head supplies next-byte scores at every original position." | T2 | `configs/hnet_1stage_L.json`; `hnet/models/mixer_seq.py` 37–53, 124–128. Vocabulary 256 in this release. |
| C05: "The STE factor is 1 in the forward pass." | T2 | v2 Eq. 9; `hnet/models/hnet.py` 20–31, 277–288. Surrogate backward derivative, not confidence attenuation. |
| C06: "The outer smoother consumes the inner decoder's returned vectors" | T2 | v2 recursive Eq. 2; `HNet.forward`, recursive main call followed by outer dechunk. |
| C07: "Training changes weights using prediction and ratio losses." | T2 | v2 §§2.2–2.3, Eq. 10. Our fixture only evaluates losses; no training was performed. |
| C08: "Public LM step explicitly requires batch size 1" | T2 | `hnet/models/mixer_seq.py` 139–153. Not a claim that arbitrary H-Net serving must always be unbatchable. |
| C09: "The router remembers the previous incoming vector, not the last selected one." | T2 | `hnet/modules/dc.py` 140–158; raw incoming state stored each step. |
| C10: "Both supplied blogs are dated October 28, 2026." | T1 | Dates on both supplied author pages. No assumption that the paper and blogs describe identical models. |
| C11: "calls the earlier published model LH-Net" | T1 | Part I, "Aside: How does this compare to the original H-Net?" It explicitly describes an improved version and planned release. |
| C12: "the public autoregressive implementation still consumes only current and past input" | T2 | v2 §2.4; adjacent incoming router and causal component step/cache code. Blog alignment terminology is not proof of leakage. |
| C13: "It compresses more yet can transfer worse in their experiments." | T1 | Part II BPE-NP/prefix-pretokenization comparisons. Scoped to their experiments, not every tokenizer. |
| C14: "about 1.28× compute-to-validation and 2.06× compute-to-OLMES advantages" | T1 | Part I controlled one-stage ladder. Historical author-reported compute-equivalent results, not inference speedups or local measurements. |
| C15: "That changes activations and decisions with fixed weights." | T1/T2 | Part I in-context tokenization and public inference structure; no optimizer in generation. |

The numerical fixture's outputs are established by executable definitions
and focused tests, not offered as scientific evidence about learned
representations. "The model understands semantics better" is explicitly an
interpretation/hypothesis, not a confirmed mechanistic result.

Calibration outcome: no retained load-bearing claim relies on an
unacknowledged inferred learned behavior. P11 (citation-as-decoration) was
addressed by operation/source mapping. No anecdote pile supports a numerical
finding (P17). No private unverifiable single source supports the mechanism
(P54). Review conclusions and browser results are separate evidence classes.

## Exact mechanism versus synthetic substitutions

The primary symbolic tensor map follows the actual public one-stage Large:
embedding 1024 → E m4 + RMSNorm → gather → learned padding 1024→1536 →
T22 + RMSNorm → slice 1024 → EMA/repeat → STE → projected residual add →
D m4 + RMSNorm → untied 256-row head.

The executable fixtures in [hnet-core.js](./hnet-core.js) are **teaching constructions, not a full numerical byte model**. The original option starts at supplied encoder states. Since 2026-11-18 a second option computes states from bytes with a declared toy encoder (details below).

| Added 2026-11-18 | What is computed | What it does not claim |
|---|---|---|
| Toy encoder | Chosen 2D embeddings for seven characters; causal recurrence `h[t] = 0.5·h[t−1] + E[byte t]` | Not Mamba, not learned, not the released embedding/encoder |
| Projected router | Non-identity `Wq = [[1,0.5],[0,1]]`, `Wk = I` (rotated by φ in the learning lab); release `cos(Wq·prev, Wk·cur)`, paper `cos(Wq·cur, Wk·prev)` | Not learned projections; no Torch parity test |
| Eight-byte two-stage example | `cat cot!`: outer retains [0,2,3,4]; inner retains two; deepest attention sees two vectors (release convention) | Under the paper convention the inner stage keeps one; inner encoder/decoder are declared stand-ins |
| Learning lab | One scalar φ; fixed-mask central differences for EMA and ratio paths; STE surrogate `(2b−1)·∂L/∂gate·∂p/∂φ`; gate derivative cross-checked by softmax calculus | One local derivative and one step only; not training, not unbiased; surrogate can raise immediate loss |
| Metric calculator | `BPB = NLL_nats / (bytes · ln 2)` | No benchmark reproduction |

| Part | Numerically executed fixture | What it does not claim |
|---|---|---|
| Input seam | Real byte IDs shown; four chosen 2D contextual vectors supplied | No evaluated embedding table, trained Mamba encoder, or learned segmentation |
| Router | Identity projections, adjacent cosine, forced first boundary, selectable strict/inclusive tie | No test of arbitrary learned projection-order equivalence |
| Gather | Actually selects those supplied vectors | No averaging, future-span pooling or dictionary token |
| Deepest main | One computed scaled causal attention operation; Q=K=V=I | Not T22, not a full Transformer block; no attention output projection/residual/MLP/norm |
| Optional inner stage | E1[j]=input[j]+1.5 input[j−1], zero previous at start; its own router/gather/EMA/repeat/skip | Not an actual learned inner Mamba model |
| Inner return | Wres1=0.25I; D1=diag(1,2), then returned into outer dechunk | Outer smoother never shortcuts directly to deepest main output |
| Dechunk | Selected-score vector EMA; optional release coefficient clamp; causal expansion | No promise of CUDA/fp32/bfloat16 numerical equivalence |
| STE | Forward factor 1 explained; raw decision confidence shown | No actual autodiff/backward implementation |
| Outer residual/decoder | Wres0=0.25I; D0=identity | Not the learned fp32 release residual or Mamba/RMSNorm decoder |
| Head | All 256 logits; rows116=[1,0],114=[0,1],33=[−1,−1], other253 zero; full softmax | Not trained language predictions or a 3-way softmax disguised as 256 |
| Loss | Next targets97,116,33, last excluded; N=2 per stage; alpha0.03; sum ratio terms | No optimizer or benchmark reproduction |

Single sequence, no padding, no packed document resets in the fixture.
Nonzero unit vectors make cosine well-defined. Existing angle toy snaps
cosine magnitude below 1e-12 to exact zero; this is a pre-existing near-tie
simplification, not a floating-point model of the released router.

## Assets and rights

The three existing repository PNGs retain their MIT notice and crop
provenance. Added original paper v2 Figure 2, `new_product.png`, under its
declared CC BY 4.0 license. Original bytes, hash, dimensions and attribution
are recorded by the builder and [notice](./assets/official/paper-figure-NOTICE.txt).
Its oracle panel is a comparison, not H-Net's executed algorithm.

Blog interactive figures are linked and explained, not copied/rehosted:
separate artwork reuse permission was not established.

## Review, validation and remaining limitations

Two independent agents performed a public-code review and a scientific/
pedagogical critique; they also received the implemented changes for final
same-task review. Final dispositions are recorded in [validation](./VALIDATION.md).
The machine-generated [receipt](./verification/receipt.json) is authoritative
for actually executed test results, not this descriptive document.

Numerical checks cover attention weights, selected-only EMA, release/paper
ties, suffix-independent prefixes, recursive ancestry and both return paths,
the coefficient clamp, 256-way probabilities, target alignment and losses.
Browser checks exercise the actual controls, all four local PNGs, retained
chapters, reset, keyboard, reduced motion and desktop/mobile geometry.

Known exclusions: no trained checkpoint, no unpublished successor
implementation, no measured performance claim, no copied blog artwork, no
screen-reader user study. The host's pre-existing Edge teardown issue is
still explicitly open. The legacy redirect can cancel speculative requests
for two obsolete scripts; those specific ERR_ABORTED events are recorded
separately rather than confused with failed canonical-page assets. Other
request failures still fail validation.
