diff --git "a/index.html" "b/index.html" --- "a/index.html" +++ "b/index.html" @@ -1,551 +1,18 @@ - - -tongue — on-device language identification (2 MB, 83 languages) - - - - - - - - + + + Tongue — on-device language identification + + + + + + - - - -
- -
-

Desert Ant Labs · on-device models

-

Which language
is this? tongue knows.

-

A 2 MB language identifier that runs on the device, with no server. It matches or beats detectors up to 130× its size. Type something below and watch it work, in your browser, offline.

-
- -
-
-
live · 2 MB model · in your browser · no network
-
- - -
-
-

Loading the model…

-
-
- -
-
2.1 MB
bundled, int8
-
83
languages, 5 scripts
-
<1 ms
per detection
-
3
platforms, identical
-
- -
-

The field

-

Small and accurate rarely go together.blind test

-

Every language detector we could run, on FLORES-200 cut to two words — text none of them trained on. Accuracy plotted against model size. The good corner is top-left: accurate and small. One model sits there.

-
-
-
↖ accurate & small
-
0.900.750.600.50
-
-
200 KB2 MB50 MB1.2 GB
-
model size (log scale) →
-
-
- -
-

Head to head · their benchmark

-

On lingua's home turf.

-

lingua is the accuracy leader, and 266 MB. Here it is on its own published test data, the corpus it was tuned against. tongue's large flavour wins two of three cells anyway, at a fraction of a percent of the size.

-
- - - - - - - -
Categorytongue 2MBtongue largelingua · 266MB
Single words0.7450.7590.752
Word pairs0.9080.9140.916
Sentences0.9880.9880.985
-
-
- -
-

Head to head · a benchmark nobody here trained onblind test

-

Including real tweets.

-

A third team's benchmark (eld), never seen during development, with a tweets split of real casual text — the register a keyboard actually sees. tongue large against Apple's own detector and HeLI-OTS, on identical rows.

-
- - - - - - - - -
Categorytongue largelinguaAppleHeLI-OTS
Tweetscasual · 6 major langs0.9950.9840.9970.986
Single words0.7700.7520.6360.683
Word pairs0.8920.8920.7140.846
Sentences0.9700.9490.7440.967
-
-

Apple ties on its six strongest languages, then drops off across the 51-language tail (Malay reads as Indonesian, Azerbaijani as Turkish). It is also iOS-only.

-
- -
-

Why it exists

-

Language detection that fits inside the app.

-

Good detectors already exist. Most of them run on a server or ship tens to hundreds of megabytes. tongue fills a smaller gap: something you can bundle into an iOS, Android or web app and run offline, with identical results on every platform. That's the niche it was built for.

-
-
- -
-
- A few honest notes. -
    -
  • Two of three benchmarks are blind. FLORES and eld were never seen in development and no tuning decision was made against them. The wins hold there, including on casual tweets — the real test that this isn't fit to a benchmark.
  • -
  • Short input is hard for everyone. "hi i am" reads as Welsh to any character model, and lingua calls it Swahili. On three ambiguous words there is little signal to find. tongue reports low confidence on inputs like these instead of asserting a guess; give it a few words and it's sure.
  • -
  • Our named weakness is Malay versus Indonesian — about 90% identical in text. We report it rather than bury it.
  • -
  • All training data is commercially clean: Tatoeba (CC-BY), Common Voice and Wikidata (CC0), permissive dictionaries. Nothing licensed, nothing scraped grey.
  • -
-
-
- -
-

FAQ

-

Questions, answered.

-
-
How does 2 MB beat a 266 MB model?
Most detectors count character-frequency statistics. tongue is trained, so it learns which features actually separate languages and weights them, which is what decides short input where every clue counts. It's also a specialist, tuned for short text across 83 languages rather than a generalist stretched across every length.
-
What's the architecture?
  • A zero-parameter script layer settles anything Unicode already settles — Korean, Thai, Greek, Chinese and 20 more — at 99.9%, with no model involved.
  • For Latin, Cyrillic, Arabic and Indic scripts, a hashed character-n-gram model: n-grams of 1 to 5 characters hashed into a fixed table, summed, then one linear layer. No tokenizer and no vocabulary file, which is why the output is byte-identical across Swift, Kotlin and JavaScript.
  • It is deliberately not a transformer. That would break the size and cross-platform guarantees that are the whole point.
-
How was it trained — epochs, hardware, time?
  • Hardware: a laptop CPU. No GPU, because the model is small enough that training waits on data, not compute.
  • Time: 15 to 35 minutes per run, so dozens of experiments in a day.
  • Epochs: 15 for the 2 MB model, 25 with a cosine schedule for the large one.
  • Data: about 13 million short spans, windowed from full sentences into 1 to 8 word fragments, plus dictionary words for coverage. Plain cross-entropy. The craft is in the data and the deterministic layers, not the training loop.
-
83 languages — are they all real?
Yes. 59 trained by the model and 24 resolved by the script layer, which matches lingua's breadth. Every one has real, commercially clean data behind it. Languages we couldn't back with data were removed, not counted, so it's an honest 83 rather than a spec-sheet number that mispredicts in the field.
-
Is it just tuned to win these benchmarks?
No, and we checked that directly. Two of the three benchmarks were never seen in development. The wins hold there, including on casual tweets. The mistakes are also linguistically sensible — the model confuses near-identical languages, not random ones. A benchmark-gamed model fails randomly; this one fails where languages genuinely overlap.
-
Where is it weak?
Malay against Indonesian most of all — roughly 90% the same in text, and the one cell a much larger server tool still edges. More generally, the fewer characters you give it, the harder the job for everyone. We're best-in-class there, but it's still the hard end, and the model says so by reporting low confidence.
-
Does it guess when unsure?
No. Below a confidence threshold it returns und (unknown) rather than a coin flip, and for near-identical clusters it can return a group answer — "one of Danish, Norwegian or Swedish" — which is useful and never a lie. The confidence bars in the demo above are the real probabilities.
-
What's left before it ships?
Export to the three runtimes (Core ML, LiteRT, ONNX / WASM) with a check that guarantees identical output across platforms, then the SDKs. The model and its evaluation are done — this page runs the finished model. Packaging is the remaining work.
-
-
-
- - -
- - +
+