Overview#
Cambodians routinely type Khmer using the Latin alphabet — brodae for ប្រដែ — because romanized input is faster and more widely supported than Khmer keyboards. AkaraAlpha converts that romanized text back into correct Khmer script.
The system is an attention-based bidirectional GRU encoder-decoder, deliberately small at 78,705 parameters, paired with a Khmer dictionary post-processing step that guarantees every output is a real word.
Dataset#
Training used the Khmer Text Transliteration Dataset (Chhunneng, 2023), which provides parallel romanized–Khmer pairs.
- Total samples: 28,569
- Train / validation split: 22,855 (80%) / 5,714 (20%)
- Format: parallel text pairs (
brodae: ប្រដែ)
The data contains 77 unique Khmer characters and 26 unique Latin characters. Maximum sequence length is 25 characters for romanized input and 24 for Khmer output.

Architecture#

The encoder uses a bidirectional GRU, processing the input from both directions. This matters for transliteration specifically: the correct Khmer character for a given Latin grapheme often depends on characters that come after it, not just before, so a unidirectional pass loses information.
Each input character is mapped through an embedding layer into a 32-dimensional dense vector before the GRU encodes it into a hidden state carrying both forward and backward context.
The decoder is a GRU that emits one Khmer character at a time. At each step it takes the previously predicted token and the projected encoder hidden state; an additive attention mechanism combines the encoder outputs with the decoder's current state into a context vector, letting the model focus on the relevant part of the input. That context is concatenated with the decoder output and passed through a dense softmax layer.
| Embedding dimension | 32 |
| GRU units | 64 |
| Attention | Additive |
| Total parameters | 78,705 |
| Optimizer | Adam |
| Loss | Sparse categorical crossentropy |
| Epochs | 50, batch size 64 |
Post-processing#
Raw model output can be phonetically plausible but orthographically wrong. Rather than growing the model, AkaraAlpha adds a lexical validation layer.
The model generates three candidates via beam search, which are cross-referenced against a standard Khmer dictionary. If no exact match exists, a Levenshtein-distance fallback corrects the prediction to the closest valid word within a 2-character edit limit. Every final output is therefore a real Khmer word.

Results#
Character Error Rate on the validation set, against standalone baselines trained on the same data — lower is better:
| Model | CER (%) | Parameters |
|---|---|---|
| RNN | 102.41 | 42,609 |
| GRU | 51.64 | 46,385 |
| LSTM | 31.78 | 58,417 |
| Attention BiLSTM | 18.26 | 96,753 |
| Transformer | 17.78 | 248,337 |
| AkaraAlpha | 15.07 | 78,705 |
AkaraAlpha reaches the lowest error rate while using under a third of the Transformer baseline's parameters.

Beam width trades accuracy against latency:
| Configuration | Top-1 | Top-K hit | Latency (ms/word) |
|---|---|---|---|
| Greedy | 44.44% | 44.44% | 21.92 |
| k=3 | 70.06% | 78.72% | 66.03 |
| k=5 | 73.60% | 83.41% | 94.15 |
| k=7 | 74.87% | 85.60% | 122.10 |
| k=10 | 75.85% | 87.37% | 167.21 |
k=5 is the recommended operating point: a 29.16 percentage-point absolute accuracy gain over greedy decoding while staying under the 100ms threshold for real-time interaction. Beyond that, returns diminish as latency exceeds what feels responsive while typing.
