Minseok Kim
TR5n-102K3.2M parameters3.8 ms per keystroke0.79% errors in real use

Stop pressing 한/영. Just type.

Too lazy to press 한/영, I built an input helper that reads the room.

Type without minding the input mode. Try dkssudTap an example below
    Try one

    The model runs in your browser, and nothing you type is sent anywhere.

    Features

    How it works

    1. Judging every key

      The model reads the word again at every key and labels each key Korean or English. At Space the word becomes what the labels say.

    2. Understanding context

      Sometimes it looks at what comes after to judge better. Once the next word is typed, it reads the word before again and fixes it or puts it back if it was wrong.

    3. Splitting mixed words

      Two languages glued together with no space are split inside the word, and each part is fixed on its own.

    Specs

    Model card

    Model
    TR5n-102K. Weights published on Hugging Face
    Input
    The raw key sequence of the line so far, spaces included, as typed on a 2-set (두벌식) layout
    Output
    A Korean or English label for every key; a CRF picks the best path through each word
    Architecture
    4-layer Transformer encoder (d_model 256, 4 heads, FF 1024) with a CRF
    Training labels
    None by hand: text written in Hangul is Korean, text in Latin letters is English
    Runs on
    ONNX Runtime on CPU; in this page, ONNX Runtime Web

    Benchmark

    Times fewer errors than the runner-up on each measure

    • 3.0×Mean over the 13 sets

      3.38% vs 10.31% (Word statistics input method)

    • 4.8×All 123,075 points

      0.70% vs 3.37% (Word statistics input method)

    • 15×Words with a typo

      0.58% vs 9.00% (Word statistics input method)

    Public benchmark

    Mean error over the 13 sets3.38%TR5n-102K10.31%Word statistics22.71%3-gram A16.12%3-gram B27.93%HeuristicReleased input methods (unnamed)
    Error over all 123,075 points0.70%TR5n-102K3.37%Word statistics6.73%3-gram A7.68%3-gram B12.89%HeuristicReleased input methods (unnamed)
    • lower is better

    Figure 1. Error rate per model: on the left the mean over the 13 sets, each weighted the same; on the right all decision points pooled. 65% of the points are easy lines with no switch, so the pooled value is mostly the easy sets.

    Error rate (%), lower is betterSetPointsTR5n-102KReleased input methods (unnamed)
    Word statistics3-gram A3-gram BHeuristic
    BasicsKorean only40,0060.040.181.011.034.07
    English only40,0220.010.020.040.010.00
    SwitchingKorean → English switch5,3681.427.133.396.912.63
    English → Korean switch6,6932.6313.365.726.0423.70
    Words with numbers3,5790.200.4721.494.1414.00
    Ambiguous keysEnglish that is also a Korean word (so = 내)2,0015.6018.991.9018.647.40
    Korean that is also an English word (해 = go)2,5000.883.0838.6425.5628.88
    Single jamo in Korean text (ㅋ, ㅠ)2,5023.888.39100.0035.05100.00
    Keys that read in both languages62016.6125.1640.4835.320.97
    Word formsTwo languages in one word1,00010.3031.0054.7032.30100.00
    Acronyms1,0000.1010.600.200.000.00
    A line of one word3,0001.736.6715.877.6037.50
    Typing slipsA typo in the word14,7840.589.0011.8236.9344.01
    Mean over sets13 sets3.3810.3122.7116.1227.93
    All points (weighted)123,0750.703.376.737.6812.89
    Table 1. 123,075 decision points from text that may be published (none of it used in training; on Hugging Face); the lowest value in each row is in bold, and cells lower than TR5n-102K are shaded. The other input methods fail hardest on typos, single jamo and fused words, forms that are not in a word list, which is where deciding from lists and statistics, with no neural model by what is published, is weak. The cells they win over TR5n-102K all come from leaning to one language: 3-gram A tilts short keys toward English, so it gets so = 내 right but misses many 해 = go, and Heuristic hardly changes English, so it is lowest on the English-based sets but misses English → Korean switches. 3-gram A and B swap places between the two averages because 3-gram B is weak on typos, a set with many points.

    Experiments

    Diminishing returns of training length

    10k30k100k300k6007008009001,0001,100training steps (log)wrong words (of 133,050)E∞ ≈ 6081,075879823779830
    • measured
    • fit
    • 204k predicted
    • 204k actual
    Figure 2. Dashed: E = E∞ + B s−a fitted to the same 3.2M model trained 10k, 51k and 102k steps (a ≈ 0.33). It predicted 779 at 204k; the run got 830, between the two 102k seeds (two runs that differ only in their random start), so training length stopped at 102k.

    Model size against latency

    (a) 10k steps(b) 51k steps4681,5801,6201,6601,700latency per keystroke (ms)wrong words (of 150,727)basewide840870900wrong words (of 133,050)Δ44
    • base 256×4 layers (3.2M)
    • wide 384×4 layers (7.2M)
    • deep 320×6 layers (7.5M)
    • joined points differ only in seed
    Figure 3. (a) At 10k steps, errors by size against latency per keystroke on one thread: the two larger models are slightly ahead at twice the latency. (b) Trained to 51k steps, wide and base end within the seed spread. The gain at 10k was faster learning, so the size stayed at 3.2M. The panels differ in recipe and in the words scored, so their numbers are not compared with each other; the two base points in (b) are runs with slightly different recipes.

    Divergence of validation loss and real errors

    0100k200k.002.004.006.008training stepsvalidation loss800820840860endwrong words840806830
    • 102k steps, seed 0
    • 102k steps, seed 1
    • 204k steps, seed 0
    Figure 4. Left: validation loss, measured 8 times per run. Right: dev errors of the finished model (133,050 words). At 204k the loss reaches 0.0024, below both 102k seeds at the end of training (0.0035, 0.0030), yet its errors sit between them. The validation lines are clean one-language text, a different distribution from the errors that are left.

    Data reweighting and the error trade-off

    0%5%10%15%20%5%10%15%20%25%guard-set error (5,960 words)ambiguous English error (3,087 words)
    • original data, 10k steps
    • more ambiguous English data, 10k steps
    • original data, 51k steps (5× longer)
    • dots: bias 0 (default); dashed: seed 1
    Figure 5. Both error rates as the Korean/English bias moves from −3 to +3 (the guard set: single jamo and Korean words that read as English). Lowering one raises the other. The model given more ambiguous English data (blue) landed on the old model's curve at its default; only the model trained five times longer on the same data sits below it.

    Discussion

    Every experiment, in order: EXPERIMENTS.md.

    Conclusion

    One Transformer with 3.2M parameters labels every key with a language and fixes typing one word at a time. It gets 0.79% of words wrong in real use and 3.38% on the public benchmark, its 13 sets weighted the same, at 3.8 ms a keystroke on your own PC. But as the experiments show, changing the data mix only moved errors from one side to the other, and longer training stopped paying off at 102k steps. Nearly half of what is left are words that make sense in both languages, and they gather where there is little context before them, such as the first word of a line or a short sentence. How to bring those down is still a hypothesis; the candidates are under future work below.

    Future work

    Download

    Windows, 37 MB, version 0.1.0. An early release without code signing, so Windows may warn you the first time you run it.

    Data and license

    The code is under the MIT License. The trained weights are offered as is, for trying the app and for research. Because part of the data is CC BY-SA, they are offered under CC BY-SA 4.0 as far as the author is able to do so. The demo on this page uses those weights. No rights are granted in third-party text.

    Not every source states a license. If you hold rights in any of this data and object to its use, please open an issue: the model will be retrained without it or taken down.