{ "entry_class": "model.ResidueRouterV1", "output_base": 256, "framework": "pytorch", "model_description": "Router over per-tier specialists, selected by the size of p; inputs above the trained regime return [0]. Operands are reduced mod p inside predict_digits, the same two-argument normalization both reference models use (a with p, then b with p, never all three). TIERS 1-2 (p <= 251): a ~2.9M-parameter residue specialist. Each operand residue is embedded through a shared per-(prime, residue) table, the two vectors are combined by addition (a discrete-log inductive bias: logs add under multiplication), a residual MLP trunk transforms the sum, and logits are scored against a per-(prime, class) output table masked to the p classes of the current prime. The answer is one base-256 digit, below p by construction. TIER 3 (251 < p < 65536): two trained shared local-rule step nets (plain GELU MLPs, width 96, depth 3, ~20k parameters each) composed through fixed wiring. After reduction the operands x, y are 16-bit residues. A MULTIPLY step learns the shared carry rule over the carry-save column sums and, composed closed-loop through a fixed parity readout, emits the exact 32-bit product t = x*y as bits. A REDUCTION step learns the shared per-nibble borrow/compare rule and, composed through fixed restoring-division wiring, emits r = t mod p in [0, p). TIER 4 (65536 <= p < 2^32): the SAME two rules at 32-bit geometry. After reduction x, y are 32-bit residues. The MULTIPLY step learns the carry rule over the 63 carry-save columns (sum <= 32, carry <= 31) and, composed through the parity readout widened to 64 bits, emits the 64-bit product as bits. The REDUCTION step is the identical 512-case per-nibble borrow rule, composed over 64 division positions x 9 nibbles, emitting r = t mod p in [0, p). TIER 5 (2^32 <= p < 2^64): the SAME two rules at 64-bit geometry, GELU MLPs (multiply width 160 depth 3 ~55k params, reduction width 96 depth 3 ~20k params). After reduction x, y are 64-bit residues. Because a 64-bit residue and the 65-bit division register both overflow signed int64, tier 5 carries operands, p, the product, and the division register as BIT tensors and never materializes a wide value as an int64 scalar. The MULTIPLY step learns the carry rule over the 127 carry-save columns (sum <= 64, carry <= 63) and, composed through the parity readout widened to 128 bits, emits the 128-bit product as bits. The REDUCTION step is the identical 512-case per-nibble borrow rule, composed over 128 division positions x 17 nibbles, emitting r = t mod p in [0, p). The answer r is emitted as base-256 digits MSB-first. In every tier the carry-save column sums, parity readout, bit shifts, restoring-division topology, and ge-from-final-borrow decision are fixed scaffold; the two nontrivial decisions, the carry rule and the borrow/compare rule, reside in trained MLP parameters. Randomizing any step net's weights collapses its tier to chance, so the capability is in the trained weights, not the wiring.", "training_description": "Four independent training regimes. TIERS 1-2 specialist: trained from random init on the complete synthetic input space for primes <= 251 (all 995,777 triples (x, y, p) with x, y in [0, p) and label (x*y) mod p, edge rows oversampled 8x); cross-entropy on the p-way classification, AdamW (lr 1e-3, cosine), batch 8192, seed 0, 15 epochs to 0 errors on the full space. Because the training set is the entire reachable input space, accuracy is interpolation over trained points; no cross-prime generalization is claimed there. TIER 3 step nets: each trained from random init, teacher-forced on the local-rule transitions of reference traces; the MULTIPLY carry step is saturated over its 272-case domain on full-range 16-bit pairs, the REDUCTION step covers the full 512-case domain from restoring-division traces of random triples over TRAIN primes only. TIER 4 step nets: the same two rules at 32-bit geometry; the MULTIPLY carry step covers its 1056-case domain (sum 0..32, carry 0..31; max carry-out equals max carry-in, a closed cover), the REDUCTION step the same 512-case borrow rule over TRAIN primes. TIER 5 step nets: the same two rules at 64-bit geometry. The MULTIPLY carry step covers its 4160-case domain (sum 0..64, carry 0..63; max carry-out equals max carry-in, a closed cover), trained on full-range 64-bit pairs UNION the full case enumeration so every realizable carry state is seen. The REDUCTION step is the same 512-case borrow rule, trained on restoring-division traces over TRAIN primes using two techniques: reciprocal-operand framing (every triple is traced as both (x, y) and (y, x)) and Charton-Kempe two-set sampling (a small repeated set plus a large fresh set). Optimizer AdamW (lr 2e-3, cosine, no weight decay), seed 0, deterministic CPU. For tiers 3, 4 and 5 alike, five primes in the tier's bit range are held out by identity and feed no training trace; the composed pipeline is exact on all five on uniform residue pairs and the four edge cases. Training code, logs, seeds, and the random-weight-collapse receipts are archived and available on request." }