Zero‑dependency 1.8 MB Numberwang neural net classifies numbers in 11 languages
A tiny neural network called Numberwang, released on GitHub, can decide whether a string represents a “Numberwang” or a “Wangernumb” in eleven languages. The entire model fits in a 1.8 MB JSON file and runs with about 100 lines of pure Python, requiring only the standard library—no PyTorch, NumPy, or other heavy dependencies. Users can clone the repo and run the script locally or via a Hugging…
Key points
- Numberwang model is a 1.8 MB JSON file that runs with only Python's standard library
- It classifies inputs in 11 languages with 88.9 % macro‑F1 on 486 test cases
- Model uses 80,804 parameters and is hosted on Hugging Face Spaces for a demo
The model reads characters directly, using a 32‑dimensional embedding followed by two convolutional layers and a small feed‑forward head, totaling 80,804 parameters. It achieves 88.9 % macro‑F1 on a held‑out test set of 486 adjudications, though arithmetic on unseen operands remains weak (44‑72 % accuracy). The code is open‑source under an MIT license, and the weights encode the language‑agnostic “wangness” of numbers without any tokenizer or rule‑engine.
The project showcases how a functional AI service can be delivered with minimal compute and zero external libraries, highlighting the potential for ultra‑lightweight models in edge or low‑resource environments.
WangNet – 1.8 MB, zero-dependency Numberwang adjudication in 11 languages
github.com · 15 September 2026A small neural network that decides whether a number is Numberwang.
The whole model is a 1.8 MB JSON file and the inference code is about 100 lines of pure Python standard library — no PyTorch, no NumPy, nothing to install. Clone it and run it.
$ python3 numberwang.py 22
22... THAT'S NUMBERWANG! (confidence: 99.3%)
$ python3 numberwang.py "45 - 44"
45 - 44... That's Wangernumb! Rotate the board! (confidence: 100.0%)
$ python3 numberwang.py "hello how are you"
hello how are you... That's not even a number. It can never be Numberwang. (confidence: 100.0%)
git clone https://github.com/GraafHenk/numberwang
cd numberwang
python3 numberwang.py 22
Run it with no arguments for an interactive session:
$ python3 numberwang.py
Welcome to Numberwang! (ctrl-c to stop playing Numberwang)
> zweiundzwanzig
zweiundzwanzig... THAT'S NUMBERWANG! (confidence: 100.0%)
> shinty-six
shinty-six... That's not Numberwang. (confidence: 100.0%)
Requires Python 3.8 or newer. That's the only requirement.
from numberwang import load_model, wang_probabilities
model = load_model("model.json")
probs = wang_probabilities(model, "forty-seven")
# [p_not_numberwang, p_numberwang, p_not_a_number, p_wangernumb]
verdict = max(range(4), key=probs.__getitem__)
A number's wangness is a property of the number, not the language it
is said in: four, vier, quatre and cuatro all get the same verdict.
chars → Embedding(32) → Conv1d(128, k3) → ReLU
→ Conv1d(128, k3) → ReLU → global max pool
→ Linear(128) → ReLU → Linear(4) → softmax
80,804 parameters. The network reads characters directly — there is no
tokenizer, no normalizer and no rules engine at inference. Digits,
operators, canon verdicts and the eleven languages are all held in the
weights, and model.json contains the lot.
A hosted version runs on Hugging Face Spaces. To run the same demo locally:
pip install -r requirements.txt
python3 app.py
gradio is needed only for the demo. The model itself never needs it.
88.9% over 486 held-out adjudications (macro-F1 0.896), against a ceiling of roughly 98% — about 2% of training labels are inverted, in accordance with long-standing adjudication practice.
Arithmetic on unseen operands is the weak spot, at 44–72%. The
network memorises rather than computes, so small common expressions like
5*2 are reliable while 904 * 3 is an educated guess. If arithmetic
correctness matters, evaluate the expression and hand it the result.
MIT — see LICENSE.
No warranty is expressed or implied as to whether any particular number is, or is not, Numberwang.
This text was published by github.com . It is reproduced here with attribution so you can read it in full; the rights remain with the publisher. Read it at the source ↗
Coverage and discussion
1 source- Hacker News discussion · 170 points news.ycombinator.com
The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us.
More in Generative AI & Models
All →- OpenAI's GPT-6 Astra Drives Enterprise Spend Ahead of Anthropic · 4 src
- Brin Returns to Google's AI Research · 1 src
- TypeSafe AI unveils Jev, a frontier model up to 400× cheaper and 200× faster · 6 src
- ggml-org Merges hc Ops into qwen4exp Graph in llama.cpp · 1 src
- Prior Labs releases TabPFN-3.5, beating 2015 Kaggle winner with default settings · 1 src
Comments
via GitHub Discussions