Low-Latency Spell Correction for Japanese Music Search Queries
Organizations: Amazon
Abstract
Spell correction for Japanese search queries presents unique challenges due to the co-existence of four writing scripts (Latin/romaji, hiragana, katakana, and kanji) and the distinct error patterns each script induces. We present a compact BART-based sequence-to-sequence model (3 encoder + 3 decoder layers) designed for low-latency spell correction of Japanese music search queries. The core contribution lies in a script-aware synthetic misspelling generation pipeline that produces realistic training data by combining keyboard-layout models (QWERTY and flick input), phonetic confusion priors mined from real query logs, voiced/unvoiced consonant alternations, and kana case errors. A key design decision is normalizing mixed-script catalog titles to a single canonical script before misspelling synthesis, which we show is critical for reducing model hallucinations. We train a custom byte-level BPE tokenizer on the target music catalog to handle all four scripts in a unified vocabulary. Experiments on a curated evaluation set show that our model achieves an exact-match accuracy of 41.09% and a character error rate (CER) of 11.62%, outperforming edit-distance baselines and achieving the lowest character error rate among all evaluated systems while maintaining sub-4ms inference latency on a single GPU. We further analyze performance across individual scripts and mixed-script queries, demonstrating the effectiveness of script-aware data augmentation through systematic ablation studies.
Figures & tables
| Parameter | Value |
|---|---|
| Encoder / Decoder layers | 3 / 3 |
| Hidden dim / Attention heads | 768 / 12 |
| FFN dimension | 3072 |
| Vocabulary size | 50,000 |
| Dropout / Activation | 0.1 / GELU |
| Beam size (inference) | 4 |
| System | EM (%) | CER (%) | F1 (%) | PT (%) | Attempt (%) | Latency (ms) |
| External baselines | ||||||
| SymSpell (romanized) | 22.19 | 25.95 | 8.69 | 65.09 | 84.23 | 1 |
| Lattice Path Edit Distance | 20.46 | 31.65 | 6.54 | 59.27 | 29.46 | 500 |
| LLM Zero-Shot (Claude Haiku) | 48.27 | 27.24 | 42.46 | 53.45 | 98.79 | 800 |
| Ablation variants (same 6L BART, different training data) | ||||||
| Ours: Random noise only | 25.73 | 17.22 | 9.61 | 74.57 | 72.76 | 4 |
| Script | EM (%) | CER (%) | PT (%) |
|---|---|---|---|
| Latin (romaji) | 40.68 | 6.59 | 86.54 |
| Hiragana | 43.64 | 15.76 | 88.70 |
| Katakana | 46.15 | 9.30 | 97.06 |
| Kanji | 51.11 | 12.10 | 97.37 |
| Mixed | 29.34 | 13.29 | 69.01 |
| Overall | 41.09 | 11.62 | 88.36 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Script | Input | Output | Error |
|---|---|---|---|
| Latin | tatlor swift | taylor swift | QWERTY |
| Latin | twicefancy | twice fancy | Space |
| Hira. | あぷる | あっぷる | Gemination |
| Kata. | フエスティバル | フェスティバル | Small kana |
| Hira. | よるしか | よるしか | Pass-through |
| Kata. | ヨルカ | ヨルシカ | Deletion |
| Prior | Replacement | Prob. (%) | Context |
|---|---|---|---|
| か | が | 0.94 | り[か>が]と |
| て | で | 0.49 | ん[て>で]$ |
| た | だ | 0.48 | も[た>だ]ち |
| ほ | ぼ | 0.43 | ん[ほ>ぼ]$ |
| と | ど | 0.41 | ˆ[と>ど]ん |
| こ | ご | 0.41 | ˆ[こ>ご]め |
Synthetic Data Generation
Synthetic data generation creates artificial examples, simulations, and datasets to train, test, or protect machine-learning systems.
See all 629 papers