AirWrite XR: write in the air, get text [Prototype]

AirWrite XR turns handwriting you trace in mid-air with your index finger into text.
You don't need a pen, a controller, a pinch for pen-down, or a keyboard. You write words one after another, and the model works out the letters and the spaces.
I originally built it for my VibeAR.dev submission to the Meta hackathon, and I decided to release it!
For now it has only been trained on a small dataset of my own cursive handwriting. But as I show in the paper, training on a bigger dataset improves the model significantly.
Only the 26 letters from a to z and the space are supported for now.
π Paper: tr-mz.github.io/papers/airwrite-xr π₯½ Live demo (Quest Browser): tr-mz.github.io/airwrite-xr π» Code: github.com/TR-MZ/airwrite-xr
What it does
- Input: the 3D index-fingertip trajectory from headset hand tracking, in the head's reference frame, resampled to 60 Hz. No camera images, video or audio are used.
- Output: lowercase English text (
aβzand space). - Streaming: a draft updates about 8 times a second while you write, and each word locks 200 ms after you move on.
What air-writing looks like
"they watched the entire movie", written in 3D and seen from the writer's point of view, looks like this (colour goes from dark at the start to yellow at the end):
There's no pen-up and every word lands on top of the previous one, so as a picture it's unreadable. Even cut into single words, strong OCR models can't read it, while AirWrite reads the whole sentence correctly (from a model that never saw this recording):
Model
This release is v13 (v13-f17-six). Six motion encoders are pooled at the sentence level, then decoded with English priors (this gave the best quality).
| Member | Architecture | Params | Notes |
|---|---|---|---|
| primary | 2-block Conformer, rotary positions | 548k | Synthetic pre-training, then real fine-tune; retrained with CAPS and slow-writing augmentation |
| secondary | 2-block Conformer, rotary positions | 548k | 13-handwriting-style synthetic corpus; retrained with CAPS and slow writing |
| tertiary | 2-block Conformer + self-conditioned CTC | 552k | Intermediate letter posteriors fed back into the encoder; retrained with CAPS and slow writing |
| bilstm | BiLSTM | 400k | Many-style synthetic pre-training; retrained with CAPS and slow writing |
| bilstm_old | BiLSTM | 400k | The earlier lowercase BiLSTM, kept for lowercase accuracy |
| bilstm_s13 | BiLSTM | 400k | 13-handwriting-style synthetic pre-training |
All six output a 28-symbol CTC distribution (blank, space, aβz) at 15 Hz (stride 4 on 60 Hz input). Together they total about 2.85M parameters.
Decoder
- CTC prefix beam search (width 64) over the pooled posteriors, with a character 5-gram and a lexicon trie
- Scoring with a small character Transformer and SmolLM2-135M
- Two rounds of lexicon widening
- SmolLM2-1.7B reranks the top 8 sentences
Files
weights/
βββ primary.safetensors + primary.json # Conformer
βββ secondary.safetensors + secondary.json # Conformer, 13-style synthetic
βββ tertiary.safetensors + tertiary.json # Conformer + self-conditioned CTC
βββ bilstm.safetensors + bilstm.json # BiLSTM
βββ bilstm_old.safetensors + bilstm_old.json # earlier lowercase BiLSTM
βββ bilstm_s13.safetensors + bilstm_s13.json # 13-style BiLSTM
Each .json holds the member's architecture config and the 12 input-feature normalisation means and standard deviations. The loading code, the decoder and the WebXR app (with browser ONNX versions of these six models) will be in the GitHub repo.
Training data
- Synthetic (pre-training): handwriting strokes from a PyTorch port of the Graves handwriting RNN (sjvasquez/handwriting-synthesis), lifted into time-ordered 3D hand trajectories. The lifting is calibrated on real Quest hand poses and adds messiness, slant, baseline drift, pen-up travel and tempo variation.
- Real (fine-tuning): 170 VR hand-tracking recordings of me writing (about 40 minutes of writing). (PS: it was boring, which is why I didn't do more.) None of those sentences appear in the synthetic data.
Evaluation
The evaluation set is 36 real development recordings in 4 frozen folds of 9. Each fold's models never see that fold's 9 takes, and no checkpoint selection used evaluation data. CER and WER are edit distances over characters and words after lowercasing.
| Version | Motion members | Assisted CER | WER | Exact sentences |
|---|---|---|---|---|
| v9 | 3 Conformers | 10.7% | β | β |
| v13 (this release) | 3 Conformers + 3 BiLSTMs | 7.5% | 16.4% | 19 / 36 |
Per-fold CER for this release is 5.4 / 6.0 / 4.8 / 13.9%. The scores use the base (general-English) priors.
v13 also reads writing in CAPITALS: on 6 locked CAPS recordings it gets 4.2% CER (7 errors in 165 characters). The output is still lowercase.
On their own, read greedily with no language help, the motion models sit at about 28% CER each. Most of the accuracy comes from pooling the members and from the English decoder.
Limitations
- β οΈ One writer. β οΈ All the real training data comes from me (the author). Expect a clear drop for other people.
- β οΈ Lowercase cursive β οΈ (and sometimes print and CAPS) only. CAPS reading was only tested on 6 recordings, and print detection is still very much research only.
- English only, with no digits or punctuation.
- The full decoder needs a GPU because of the 1.7B reranker. The motion members alone run fine on CPU, and a lighter version (character 5-gram and lexicon only) runs entirely in the headset browser, with lower accuracy.
Intended use
Text entry in VR and MR when a virtual keyboard is awkward, and research on air-writing and motion-to-text. It isn't suitable for anything safety-critical or for identifying people from their handwriting.
Licences and credits
- Weights and code in this repo: Apache-2.0
- SmolLM2-135M / 1.7B: Apache-2.0, Hugging Face
- Evaluation and recording phrases: MacKenzie & Soukoreff (2003), Phrase sets for evaluating text entry techniques
- Stroke generator: Graves (2013), Generating Sequences with Recurrent Neural Networks
- Self-conditioned CTC: Nozaki & Komatsu (2021), arXiv:2104.02724
Citation
@misc{airwrite-xr-2026,
title = {AirWrite XR: mid-air handwriting recognition from headset hand tracking},
author = {Jara, Xavier},
year = {2026},
url = {https://tr-mz.github.io/papers/airwrite-xr/},
note = {Model card and checkpoints v13-f17-six}
}
Model tree for trmz/airwrite-xr
Base model
HuggingFaceTB/SmolLM2-1.7B
