Source-linked AI summary
Low-Latency Spell Correction for Japanese Music Search Queries
Anshul Garg, Pavni Tandon, Karan Bhukar, Tanmay Khandelwal, Ujjal Kumar Dutta
TL;DR
Japanese music search correction must handle four scripts and their distinct error patterns, including mixed-script queries, while meeting low-latency needs. The paper trains a compact BART model with script-aware synthetic misspellings and canonical-script normalization; it reports the lowest CER among evaluated systems at sub-4ms latency. Its stated limitations include query-level operation without broader search context and assumptions about catalog-title correctness.
Problem
Japanese music search correction must handle four scripts and mixed-script queries with distinct error patterns while meeting real-time latency requirements.
Source: §1 · p. 1Method
A compact BART model is trained with script-aware synthetic misspellings and catalog-title normalization to a canonical script before synthesis.
Source: §1 · p. 2Results
Takeaways & Limitations
Script-aware synthetic training data can compensate for data scarcity and compact model size in this Japanese music-query setting.
Source: §6 · p. 7The model operates at query level without broader search context, kanji correction remains challenging due to semantic IME errors, and synthetic data assumes correctly spelled catalog titles.
Source: §5 · p. 7
Abstract
from arXiv · showhide
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.
1 Introduction
Japanese music search must correct queries written in four scripts or mixtures of them, each with distinct error patterns, under real-time latency constraints. The paper proposes script-aware training data, canonical-script normalization, and a compact BART model for this setting.
1 Introduction
- Japanese queries span hiragana, katakana, kanji, and Latin/romaji, with script-specific errors such as flick-keyboard adjacency mistakes and kanji homophone confusion.Music queries add mixed-script names and searches in scripts different from catalog entries, while requiring low latency.Source: §1 · p. 1
- The synthetic-data pipeline models script-specific errors using kana flick adjacency, romaji QWERTY typos, voicing and kana-size alternations, and contextual phonetic priors from query logs.Source: §1 · p. 2
- Normalizing mixed-script catalog titles to a canonical script before misspelling synthesis reduces hallucinations on mixed-script inputs and aligns training with the pure-script index.Source: §1 · p. 2
- A 6-layer BART model with a catalog-trained byte-level BPE tokenizer handles all scripts with sub-4ms inference latency.The authors report that data quality compensates for model size and describe correction quality as near-LLM.Source: §1 · p. 2
2 Related Work
Prior spell-correction work includes dictionary-based edit distance and neural encoder-decoder methods, but Japanese multi-script correction remains underexplored. Existing Japanese approaches and synthetic-noise methods leave room for a unified, script-aware approach.
2.1 Spell Correction Approaches
- Traditional dictionary edit-distance methods, including SymSpell, can miss Japanese phonetic and script-conversion errors that character-level distance captures poorly.Source: §2.1 · p. 2
- Transformer encoder-decoder models [5] and BART [6] have been used for correction tasks, but Japanese multi-script correction remains underexplored.Source: §2.1 · p. 2
2.2 Japanese-Specific Challenges
- Japanese-specific work includes romanization-aware lattice edit distance, while other query-alteration approaches typically handle one script or require separate models.Source: §2.2 · p. 2
2.3 Synthetic Data for Spell Correction
- Earlier synthetic-noise work includes random perturbations and keyboard-layout noise [13]; this paper extends such methods with script-specific models grounded in production query logs.Source: §2.3 · p. 2
3 Methodology
The method frames Japanese correction as sequence-to-sequence mapping and trains a compact model on catalog titles paired with script-aware synthetic misspellings. It classifies and normalizes scripts, combines several error-generation sources, and uses a catalog tokenizer and compact BART architecture.
3.1 Problem Formulation
- Correction maps a potentially misspelled query sequence to a corrected sequence, with an identity mapping required for already-correct queries.Source: §3.1 · p. 3
3.2 Script-Aware Synthetic Data Generation
- The synthetic-data pipeline starts with correctly spelled music-entity catalog titles and generates misspellings using script-specific techniques.Source: §3.2 · p. 3
3.2.1 Script Identification and Conversion
- Titles are classified as Latin, hiragana, katakana, kanji, or mixed; mixed titles use the priority katakana > hiragana > Latin > kanji to select a target script.Conversion uses pykakasi and jaconv.Source: §3.2.1 · p. 3
3.2.2 Error Generation Techniques
- Augmentation samples QWERTY and flick adjacency, contextual phonetic rules, voicing and kana-size substitutions, plus script-agnostic deletion, repetition, transposition, and space removal.The techniques are sampled from the applicable pool with uniform weights; phonetic rules are frequency-weighted from query-to-entity logs and JWTD.Source: §3.2.2 · p. 3
3.2.3 Data Composition
- Training draws from 2.8M unique titles and adds 50–100 synthetic misspellings per title, about 3M real correction pairs, and identity pairs at a 1:4 misspelled-to-correct ratio.Source: §3.2.3 · p. 4
3.2.4 Script Normalization
- Mixed-script titles are normalized before misspelling synthesis, teaching a pure-script misspelling-to-pure-script correction mapping consistent with the search index.Without normalization, training asks the model to correct errors and normalize scripts simultaneously, increasing hallucination.Source: §3.2.4 · p. 4
3.3 Tokenizer
- A 50,000-token byte-level BPE vocabulary is trained on catalog titles to handle the scripts and other characters without script-specific preprocessing.The maximum sequence length is 20 tokens, covering over 99.9% of music search queries.Source: §3.3 · p. 4
3.4 Model Architecture and Training
- The compact BART system achieves the lowest character error rate among evaluated systems at sub-4ms latency, using script-aware synthetic training and a catalog-trained tokenizer.Source: §3.4 · p. 4
4 Experiments
On a 1,618-query evaluation set, the full system has the lowest CER among the evaluated systems while running in under 4ms, though an LLM has higher exact-match accuracy. Ablations and per-script results show variation across training configurations and query scripts.
4.1 Evaluation Data
- The evaluation set contains 1,618 non-overlapping real-world queries across four scripts, mixing synthetic and log-mined misspellings; 28.7% are already correct.Source: §4.1 · p. 5
4.2 Evaluation Metrics
- Evaluation reports exact match, character error rate, correction F1, and pass-through accuracy for preserving already-correct queries.Source: §4.2 · p. 5
4.3 Baselines and Ablation Variants
- Comparisons include SymSpell, Lattice Path Edit Distance, and a zero-shot LLM; ablations vary training data while keeping the same 6-layer BART architecture.Source: §4.3 · p. 5
4.4 Results
- 11.62% CER is the lowest among evaluated systems, with sub-4ms latency; SymSpell and Lattice Path Edit Distance have higher CER, while the LLM is far slower.Source: §4.4 · p. 6
- The LLM has higher exact match than the model (48.27% vs. 41.09%) but worse CER (27.24% vs. 11.62%), with very long erroneous expansions cited as examples.Source: §4.4 · p. 6
- The full pipeline reaches 31.68% correction F1 versus 23.78% without script normalization; random-noise-only has 9.61% F1 and QWERTY-only has 4.48%.The random-noise-only variant has 17.22% CER.Source: §4.4 · p. 6
4.4.1 Per-Script Analysis
- Kanji has the highest exact match (51.11%), while mixed-script queries have the lowest (29.34%); Latin has the lowest CER (6.59%).Katakana CER is 9.30%, hiragana CER is 15.76%, and mixed-script pass-through is 69.01%.Source: §4.4.1 · p. 6, Table 3 · p. 6
5 Discussion
The compact model achieves the lowest reported CER, while its conservative correction behavior favors avoiding over-correction. Its query-level scope, kanji errors, and assumption of correctly spelled catalog titles limit coverage.
5 Discussion
- 11.62% CER is lowest among systems, beating SymSpell (25.95%), Lattice (31.65%), and the LLM baseline (27.24%) at sub-4ms latency.The full pipeline also achieves F1 of 31.68%, versus 23.78% for the next-best variant.Source: §5 · p. 7
- 31.68% F1 falls to 23.78% without script normalization, when correction and normalization must be handled simultaneously.The model attempts correction on 71.98% of misspelled queries, versus 98.79% for the LLM and 84.23% for SymSpell, with 88.36% pass-through accuracy.Source: §5 · p. 7
- The model operates at query level without broader search context; kanji correction remains difficult, and synthetic data assumes correctly spelled catalog titles.That title assumption may not hold for user-generated content such as playlist names.Source: §5 · p. 7
- A serving-time guardrail applies verified corrections for high-traffic queries to prevent mis-correction beyond the model’s own confidence.The model is hosted on a GPU instance using TensorRT-LLM with BF16 precision.Source: §5 · p. 7
6 Conclusion
The paper presents a compact, low-latency Japanese music-query correction system, with script-aware synthetic data and normalization supporting its results across four writing scripts.
6 Conclusion
- The system handles all four Japanese writing scripts within a single compact sequence-to-sequence model.The full system achieves F1 of 31.68% and the lowest CER (11.62%) among evaluated systems at sub-4ms latency.Source: §6 · p. 7
- Training data combines keyboard-layout models, phonetic confusion priors, and script normalization to address data scarcity alongside compact model size.The conclusion states that ablations confirm each pipeline component contributes meaningfully.Source: §6 · p. 7
- Future work includes improving kanji IME error correction, curriculum learning for higher recall, and distillation from larger models.Source: §6 · p. 7
Customer Impact Statement
The authors report that production deployment improved Japanese users’ search experience and increased seconds listened in the Japanese market.
Customer Impact Statement
- The production system corrected misspelled queries in real time across four Japanese writing scripts and reduced failed searches.The authors report that users found intended content more reliably.Source: Customer Impact Statement · p. 7
- Sub-4ms inference latency was reported to add no perceptible delay to search.Source: Customer Impact Statement · p. 7
- The authors report that the system launched in November 2025 and increased seconds listened in Japan, translating to material revenue increase for Amazon Music Japan.Source: Customer Impact Statement · p. 7
A Qualitative Examples
Table 4 presents representative spell-correction examples across scripts.
A Qualitative Examples
- Table 4 presents representative spell-correction examples across scripts.Source: Table 4 · p. 8, A Qualitative Examples · p. 8
B Japanese Phonetic Prior Examples
Table 5 catalogs the ten leading hiragana phonetic priors from Q2E logs as context-dependent substitutions with empirical probabilities. The most common pattern is omission of dakuten, particularly where the voiced form is expected after nasal ん.
B Japanese Phonetic Prior Examples
- Each prior specifies a context-dependent character substitution and its empirical probability.Source: B Japanese Phonetic Prior Examples · p. 9
- Table 5 presents the top 10 hiragana phonetic priors mined from Q2E logs.Source: Table 5 · p. 9
- Dakuten omission is the most common Japanese misspelling pattern, particularly where the voiced form is expected after nasal ん.The priors identify omission of voiced consonant marks as the leading pattern.Source: B Japanese Phonetic Prior Examples · p. 9
C Flick Keyboard Layout
The flick model treats kana errors as adjacent-character mistakes in a directional keyboard grid. The LLM zero-shot baseline receives fuzzy-match catalog titles and is instructed to return only the corrected query.
C Flick Keyboard Layout
- The flick adjacency map models errors as gestures landing on a neighboring consonant row instead of the intended vowel variant.Each kana base character can be flicked up, down, left, or right to produce related characters.Source: C Flick Keyboard Layout · p. 9
D LLM Zero-Shot Prompt
- The Claude Haiku baseline receives the query and the top 100 catalog titles retrieved by fuzzy match.Source: D LLM Zero-Shot Prompt · p. 9
- The zero-shot prompt instructs the model to output only the corrected query, leaving already-correct queries unchanged.Source: D LLM Zero-Shot Prompt · p. 9