Add model card with YAML metadata (license, tags) + verified results + DOI citation
Browse files
README.md
CHANGED
|
@@ -1,18 +1,73 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|