Study 01 — Khmer Tokenization, CTC Alignment and SVTRv2
Serey OCR Research Journal · October 21, 2026 · Version 0.1
Status: Preliminary architecture study; not an empirical Khmer SVTRv2 comparison.
Abstract
The representation of Khmer text is a foundational decision for OCR architectures that employ connectionist temporal classification (CTC). Khmer orthographic units may contain multiple encoded consonants and combining marks arranged in two-dimensional glyph structures, while CTC operates over a one-dimensional sequence of output labels. This note examines how codepoint, grapheme-cluster, orthographic-syllable, and hybrid tokenization change sequence length and alignment feasibility. It then interprets SVTRv2's multi-size resizing (MSR), feature rearrangement (FRM), and semantic guidance (SGM) as possible architectural responses to visual alignment and contextual recognition. The note establishes mathematical constraints and research questions, not a Khmer accuracy improvement.
1. Why tokenization comes first
It is tempting to compare SVTRv2 and an autoregressive Khmer recognizer directly. But their performance depends on a prior choice: what counts as one output token? Each possible representation assigns the model a different sequence-length and vocabulary-coverage problem.
Khmer Unicode requires particular care because visually composed orthographic units are not generally equivalent to single encoded code points. Subscript consonants use COENG (U+17D2) followed by a consonant, while dependent vowels and signs can occupy positions around the base glyph. The Unicode Technical Note on Khmer encoding structure gives a detailed account of the encoding and ordering issues [2].
Consider ខ្ញុំ, an illustrative Khmer word composed of these five Unicode scalar values:
| Order | Character | Code point | Description |
|---|---|---|---|
| 1 | ខ | U+1781 | KHMER LETTER KHA |
| 2 | ្ | U+17D2 | KHMER SIGN COENG |
| 3 | ញ | U+1789 | KHMER LETTER NYO |
| 4 | ុ | U+17BB | KHMER VOWEL SIGN U |
| 5 | ំ | U+17C6 | KHMER SIGN NIKAHIT |
In one illustrative orthographic-syllable representation, the whole composed unit could be one label instead of five codepoint labels. This is an example of a possible encoding; it does not imply that all Unicode grapheme segmenters or Serey OCR's existing tokenizer group it identically.
2. The CTC alignment requirement
CTC learns alignments from input feature positions to target labels, with a blank symbol and a collapse rule for adjacent repetitions. Let:
T= number of visual time steps the recognizer outputs;L= target token count;R= number of adjacent equal target-token pairs (requiring an intervening blank).
Then the existence of a CTC path requires T >= L + R. This is a necessary combinatorial constraint, not a sufficient condition for accurate recognition.
For the example above, an unconstrained codepoint target needs at least five steps; one cluster label needs one, provided it is represented in the vocabulary. On longer lines with many combining signs, the gap in token lengths may grow. However, a large cluster vocabulary can struggle with unseen words, rare spelling, historic variants and unusual combinations.
The actual feasibility also depends on feature stride, image width, resizing and the output-time dimension. Raw image pixels are not CTC time steps. Any comparison must inspect the network's real sequence length rather than assume a fixed relationship from images alone.
3. Four competing tokenization hypotheses
| Unit | Advantages | Limitations | Research test concept |
|---|---|---|---|
| Unicode code point | General compositional coverage, predictable inverse mapping | Long targets; nonvisual order of combining sequences | Study target length and legal CTC paths across line widths |
| Unicode grapheme cluster | Groups many combining sequences according to segmentation rules | Generic extended grapheme boundaries may differ from intended orthographic syllables | Compare segmentation under UAX #29 and Khmer tailoring |
| Khmer orthographic syllable | Closer to visual composition; shorter token sequences | Vocabulary growth and unseen clusters | Analyze frequency/coverage and rare-sequence fallback |
| Hybrid of common clusters and compositional fallback | Short sequences for common units, openness for rare units | More complex decoding, ambiguity and validation | Check exact reversibility and alignment budget |
All candidate tokenizations must preserve source characters and the original encoded string. Unicode normalization and typo correction should not be conflated. Strict transcription of names, dates and numbers is different from choosing the most likely spelling.
4. What SVTRv2 contributes
SVTRv2 was proposed by Du et al. and published at ICCV 2025 [1]. Its main architectural additions relative to CTC scene-text recognition are:
- MSR — Multi-Size Resizing. Selects appropriate predefined sizes to avoid severe distortion from forcing highly variable text shapes into one fixed resolution.
- FRM — Feature Rearrangement Module. Learns how two-dimensional visual features contribute to positions in a one-dimensional CTC sequence, addressing irregular or misaligned text.
- SGM — Semantic Guidance Module. Uses auxiliary contextual supervision during training; the guidance component need not add inference cost.
These innovations are supported by the authors' scene-text experiments, including evaluations of text irregularity and long-text settings. They have not been established as effective for Khmer in this journal. Khmer's stacked signs may challenge horizontal alignment differently from the distorted or curved text emphasized by scene-text research.
For Khmer recognition, MSR raises questions about marks lost during resizing; FRM raises questions about composition of vertically distributed features; SGM raises questions about whether context repairs ambiguous glyphs or imposes language-prior substitutions on proper names and numerical strings.
5. Comparison with a specialist autoregressive OCR model
The current Serey OCR baseline is a specialist visual encoder with sequence modeling and an autoregressive decoder. Its existing vocabulary uses Khmer clusters. Changing from autoregressive decoding to CTC changes more than speed: it changes alignment assumptions, repeat handling, output granularity, and the balance between visual evidence and language context.
No claim is made that CTC is intrinsically better at Khmer or that autoregressive recognition intrinsically hallucinates. Both architectures can omit, duplicate or alter characters; behavior is model- and dataset-dependent.
6. Claims and evidence status
| Claim | Status |
|---|---|
| SVTRv2 integrates MSR, FRM and training-time SGM | Published architecture [1] |
| Khmer encoding allows multiple code points in visually composed units | Documented script structure [2] |
| Fewer target tokens can reduce the minimum legal CTC sequence length | Mathematical implication of CTC |
| SVTRv2 will improve Serey OCR's Khmer CER | Not tested; no claim |
| Cluster-level CTC is preferable to character-level CTC for all Khmer text | Open question |
| Semantic guidance will preserve exact legal dates and identifiers | Open question |
7. Open research questions
- How should Khmer's orthographic syllables be segmented for a lossless OCR label space?
- How much would Unicode-codepoint and syllable-level token lengths differ on representative printed lines?
- What is the effect of adjacent repeated clusters under CTC collapse rules?
- Is a cluster-aware fallback possible without ambiguous decoding?
- Would FRM faithfully align dependent marks and subscript forms to a text sequence?
- Can SGM improve visually ambiguous clusters without substituting plausible but incorrect text?
- Are published scene-text resizing strategies suitable for full-width Khmer document lines?
8. Conclusion
SVTRv2 is a compelling specialist-recognition research direction because it combines an efficient CTC inference path with learned visual rearrangement and training-only contextual guidance. But the first question for Khmer is not model size or leaderboard position. It is whether the chosen Khmer output units and the visual time-step representation produce robust, reversible, learnable alignments.
This initial study therefore recommends deeper architectural analysis and textual-representation research before claiming any advantage or beginning a new training effort.
References
- Du, Y. et al., SVTRv2: CTC Beats Encoder–Decoder Models in Scene Text Recognition, ICCV 2025. https://arxiv.org/abs/2411.15858 ; https://github.com/Topdu/OpenOCR
- Hosken, M. et al., Khmer Encoding Structure, Unicode Technical Note 61 (2024 revision). https://www.unicode.org/notes/tn61/utn61-Khmer_Encoding_Structure_V1.pdf
- Unicode Consortium, Unicode Standard Annex #29: Text Segmentation. https://www.unicode.org/reports/tr29/
Attribution and publication note: This research note is a critical synthesis of cited sources and project experience. It is not a reproduction of private evaluation materials and is not peer reviewed.