[Paper Review] ScribeTokens: Fixed-Vocabulary Tokenization of Digital Ink
ScribeTokens introduces a fixed 10-token base vocabulary that tokenizes digital ink via Bresenham-based unit steps, enabling OOV-free compression and robust recognition/generation, with self-supervised next-ink-token pretraining improving convergence and performance.
Digital ink -- the coordinate stream captured from stylus or touch input -- lacks a unified representation. Continuous vector representations produce long sequences and suffer from training instability, while existing token representations require large vocabularies, face out-of-vocabulary issues, and underperform vectors on recognition. We propose ScribeTokens, a tokenization that decomposes pen movement into unit pixel steps. Together with two pen-state tokens, this fixed 10-token base vocabulary suffices to represent any digital ink and enables aggressive BPE compression. On handwritten text generation, ScribeTokens dramatically outperforms vectors (17.33% vs. 70.29% CER), showing tokens are far more effective for generation. On recognition, ScribeTokens is the only token representation to outperform vectors without pretraining. We further introduce next-ink-token prediction as a self-supervised pretraining strategy, which consistently improves recognition across all token-based models and accelerates convergence by up to 83x. With pretraining, ScribeTokens achieves the best recognition results across all representations on both datasets (8.27% CER on IAM, 9.83% on DeepWriting).
Motivation & Objective
- Motivate a canonical, robust representation for online handwriting/digital ink to improve modeling efficiency and performance.
- Address OOV and vocabulary size issues in existing ink tokenizations while ensuring valid decoding of ink sequences.
- Enable effective compression through BPE without sacrificing differentiability or reconstruction fidelity.
- Demonstrate the benefits of self-supervised pretraining on token-based ink representations across recognition and generation tasks.
Proposed method
- Decompose pen strokes into unit directional steps using Bresenham’s line algorithm combined with Freeman chain codes to produce token sequences.
- Define a fixed base vocabulary of 10 tokens (eight directions plus pen-down and pen-up) with stroke boundaries enforced by DOWN/UP tokens.
- Apply Byte-Pair Encoding (BPE) to the base tokens to achieve aggressive compression while keeping the representation OOV-free.
- Detokenize by reconstructing coordinates from direction steps, scale by grid delta, and apply Savitzky–Golay smoothing to reduce staircase artifacts.
- Pretrain token representations with next-ink-token prediction (NTP) as a self-supervised objective before supervised fine-tuning for recognition or generation.
Experimental results
Research questions
- RQ1Can a fixed, OOV-free tokenization of digital ink outperform existing vector and token-based representations on handwriting recognition and generation?
- RQ2Does next-ink-token pretraining consistently improve recognition and generation across ink representations, and how does it affect convergence speed?
- RQ3How does ScribeTokens compare to other tokenizations in terms of compression, OOV rates, and reconstruction fidelity under practical quantization settings?
- RQ4Is the proposed tokenization robust to sampling rate and density variations while enabling effective downstream learning with standard Transformer-based models.
Key findings
- ScribeTokens achieves strong recognition and generation performance, outperforming vectors for generation (lower CER) and surpassing token representations without pretraining on recognition in some settings.
- Next-ink-token pretraining improves recognition and acceleration of convergence by up to 83x for generation and provides consistent gains, especially in data-scarce settings.
- With pretraining, ScribeTokens obtains the best recognition results on IAM (8.27% CER) and DeepWriting (9.83% CER) across datasets, and yields best generation results on IAM in the data-limited setting.
- Token representations generally outperform vectors for generation, with ScribeTokens achieving notable gains when combined with pretraining; TextTokens can fail dramatically in some datasets without pretraining.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.