How smart mode works
Smart mode runs percent-nlu 1.0.0, an open-source model with 1,160,462 parameters (1.2 MB (int8)) that turns a percentage question into one of six calculations. It runs inside your browser in ~1.4 ms per question on an Apple M1, ~4.6 ms on a mid-range Android phone.
From question to answer
- Normalizer: deterministic rules and a small lexicon per language find every number, its percent or currency markers and its value, and mask it. “how much is an 18% tip on $64?” becomes “how much is an [N0] % tip on $ [N1] ?”.
- Transformer encoder (2 layers, d=128) reads the masked text using word embeddings, hashed character n-grams (robust to typos and missing accents) and small per-number features, and predicts the intent and a role for each number.
- Constrained decoding assigns each required argument of the chosen calculation to a different number.
- Calibrated confidence: the answer is given directly only above a threshold tuned for about 98 to 99% precision; below it, the calculator asks you to confirm.
- Plain code computes the result. The model never does arithmetic, so the numbers are always exact.
One model serves English, Portuguese and Spanish; the page language only selects how numbers are read (1,234.56 or 1.234,56).
Accuracy
Exact means the calculation and every number are correct. Gold sets are hand-checked questions never used in training. “Precision” is how often an answer given without asking for confirmation was exactly right.
| Test set | n | Exact | Out-of-scope wrongly accepted | Precision of direct answers | Answered directly |
|---|---|---|---|---|---|
| gold v0 (pt-BR) | 242 | 97.6% | 6.0% | 98.7% | 95.7% |
| gold v1 (pt-BR, hard) | 112 | 90.3% | 0.0% | 96.1% | 81.7% |
| gold v1 (English) | 118 | 95.7% | 10.0% | 100.0% | 91.3% |
| gold v1 (Spanish) | 118 | 94.6% | 0.0% | 98.8% | 92.4% |
| synthetic test, pt-BR (unseen templates) | 3812 | 90.5% | 7.0% | 98.1% | 82.6% |
| synthetic test, English (unseen templates) | 3815 | 95.1% | 7.4% | 99.3% | 85.1% |
| synthetic test, Spanish (unseen templates) | 3812 | 98.2% | 19.4% | 96.4% | 91.2% |
Limitations
- Six calculations only, at most four numbers per question, and no chained calculations (“20% off and then 10% tax”).
- Not supported yet: fractions (1/4), decimals written in words (“seven point five”) and ranges.
- In Spanish, 1,500 is read as 1500: groups of exactly three digits are thousands for both “.” and “,”.
- Trained on synthetic questions. Real people will find new phrasings; when the model is unsure it says so instead of guessing.
When the model is not confident, the calculator shows its best guess and asks “Is this what you meant?”. When a number is missing, it opens the right classic calculator so you can type it.
Privacy and how the model improves
The model and its weights are downloaded once and run on your device; no server is needed to answer. To find the phrasings it gets wrong, questions typed in smart mode are saved anonymously together with the model's answer and any correction you make (✓/✗, an edited number, the classic calculator you used instead). You can turn this off under the question field. Saved questions feed a new hand-checked test set and future versions of the model, which are only published if they do not get worse on the existing test sets. Details on the privacy page.
Source and model card
Last updated .