TrickyRex commited on
Commit
73a442f
·
verified ·
1 Parent(s): b49812c

Add model card with YAML metadata (license, tags) + verified results + DOI citation

Browse files
Files changed (1) hide show
  1. README.md +73 -18
README.md CHANGED
@@ -1,18 +1,73 @@
1
- # bitserial-modmul-v8 (NeuralHorner, tier 10)
2
-
3
- Submission for the SAIR Modular Arithmetic Challenge. One shared, p-conditioned recurrent
4
- cell in a fixed bit-serial Horner loop computes (a * b) mod p; the cell learns the per-step
5
- transition s' = (2*s + d*x) mod p and the loop only sequences bits. The per-step state width
6
- is sized to each prime's bit-length (dynamic), which is exact and keeps inference within budget.
7
- entry_class model.BitSerialReducer, output_base 2, ~471K params.
8
-
9
- ## Local evaluation (official open-source scorer, run locally; not the organizers' leaderboard)
10
- - 3 seeds, full 1100: tiers 1-10 = 1.00, highest tier 10, overall 1.00, wall 163-174s
11
- (inside the 300s budget with ~125s margin on an H100; the organizers' hardware may differ).
12
- - Deterministic (re-run identical); bf16 decisions match fp32 exactly (0 flips, min|logit|=3.0).
13
- - Randomizing the weights collapses every tier to 0.00 (capability is in the trained parameters).
14
-
15
- ## Limitations
16
- Benchmark-accurate on the official random-operand distribution; a sparse, power-of-two-adjacent
17
- structured-input residual remains (not exact). Not organizer-verified. The Lean package proves the integer algorithm,
18
- not this network.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: pytorch
4
+ tags:
5
+ - modular-arithmetic
6
+ - neural-arithmetic
7
+ - bit-serial
8
+ - cryptography
9
+ - gru
10
+ ---
11
+
12
+ # NeuralHorner (bitserial-modmul-v8)
13
+
14
+ A single modulus-conditioned recurrent cell that computes `(a * b) mod p` across primes it never trained on,
15
+ by running one learned per-step transition inside a fixed bit-serial Horner loop.
16
+
17
+ - One bidirectional two-layer GRU cell (about 471K parameters), conditioned on the modulus `p`.
18
+ - It learns only the per-step transition `s' = (2s + d*x) mod p`; the loop schedule (reduce `a`, reduce `b`,
19
+ multiply the two residues) is fixed by hand. The claim is the learned per-step transition and its
20
+ cross-prime transfer, not discovery of the loop.
21
+ - Dynamic-L inference sizes the per-step state width to each prime's bit-length (the dropped bits are always
22
+ zero), which keeps every run under the time budget.
23
+
24
+ `weights.pt` md5: `8fc8ace7d74538b66ef5980b4e9cd013`
25
+
26
+ ## Results (official open-source scorer, single rented H100 via RunPod)
27
+
28
+ - All ten scored tiers at exact-match `1.00` (`highest_tier_above_90 = 10`), reproduced across three
29
+ scorer-operand seeds, deterministic. Each full run completes in 163 to 174 seconds against a 300 second budget.
30
+ - Cross-prime transfer: `480/480` exact on fresh primes across 64 to 2048-bit widths.
31
+ - Anti-cheat: randomizing the weights collapses every tier from `64/64` to `0/64`, so the capability sits in
32
+ the trained parameters, not a hand-coded circuit.
33
+ - bf16 decision-safety: 0 flipped answers versus fp32 (`min |logit| = 3.017`).
34
+
35
+ ## Scope and known limits
36
+
37
+ The model is not claimed to be exact, and where it is weak is stated plainly. A held-out adversarial battery
38
+ of six disjoint operand families (768 cases) scores `759/768`; the failures concentrate at
39
+ power-of-two-adjacent (Fermat) operands, a single high-wrap transition. A Tier-0 pure-multiplication probe
40
+ (operands whose product is smaller than the modulus, so no reduction occurs) scores `40/100`, so the claim is
41
+ scoped to modular multiplication on the scored distribution, not general large-integer multiplication. Full
42
+ ablations, the failure localization, and a machine-checked Lean proof of the integer algorithm are in the
43
+ paper and the code repository.
44
+
45
+ ## Usage
46
+
47
+ ```python
48
+ import importlib.util
49
+ spec = importlib.util.spec_from_file_location("model", "model.py")
50
+ m = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)
51
+ model = m.BitSerialReducer()
52
+ model.load(".") # loads weights.pt from this directory
53
+ # inputs are (preprocess_a(a), preprocess_b(b), preprocess_p(p)); see model.py for the I/O contract
54
+ ```
55
+
56
+ ## Links
57
+
58
+ - Code and paper: https://github.com/Robby955/neural-horner
59
+
60
+ ## Citation
61
+
62
+ ```bibtex
63
+ @misc{robert_sneiderman_2026,
64
+ author = {Robert Sneiderman},
65
+ title = {bitserial-modmul-v8 (Revision b49812c)},
66
+ year = 2026,
67
+ url = {https://huggingface.co/TrickyRex/bitserial-modmul-v8},
68
+ doi = {10.57967/hf/9357},
69
+ publisher = {Hugging Face}
70
+ }
71
+ ```
72
+
73
+ License: MIT, Copyright (c) 2026 Robert Sneiderman.