secryst

Primer

Reading what isn’t written

Secryst is a family of runtimes that recover linguistic information a writing system withholds. This primer explains the problem, the modeling approach, and the operating guarantees. No ML background beyond “a neural network maps strings to strings” is assumed.

§1

The hidden reading

Many scripts underdetermine pronunciation. Written قدر is consistent with several Arabic words — قَدَر qadar “fate” among them; only the omitted short vowels disambiguate. Hebrew without nikud, Khmer orthography, and unsegmented Thai present the same property in different degrees: the reading exists in the reader’s mind, not on the page.

Recovering it is therefore a constrained generation problem: the output must agree with every glyph that is written, and choose the reading that context implies. That is a job for a sequence-to-sequence model over characters — not for a lookup table, and not for rule systems alone (Khmer proves that), but exactly the shape of task small neural models learn well.

§2

The three tasks

TaskInput → outputScripts in the index
Diacritizationundiacritized text → same text + short vowels (incl. case endings)Arabic, Urdu
Vocalizationconsonantal text → text + nikud; cantillation passed throughHebrew
Phonemization (G2P)orthographic text → phonemes (IPA or romanized)Thai, Khmer, Persian, Urdu

The same architecture covers all three; only the training corpus differs. That is why one contract and one model format serve the whole family.

§3

How the models work

Secryst models are byte-level encoder–decoders (the ByT5 family) exported to ONNX:

  • Byte-level tokenization — no vocabulary files, no out-of-vocabulary tokens, any script works identically. The token table is fixed: byte b maps to id b+3, with a single trailing EOS; pad=0, eos=1, unk=2. Ids are not raw byte values — see the specification.
  • Greedy decoding with an optional KV cache — zips that ship decoder-kv.onnx decode incrementally; plain zips recompute. Both must produce identical outputs.
  • Small by design — student-tier models are millions of parameters, not billions; they run on CPU in milliseconds per sentence. Teachers (ByT5-base scale) exist for distillation, and the published numbers in Models show what the small ones inherit.

§4

Why local & deterministic

Transliteration and vocalization are infrastructure: they run inside publishing pipelines, archival processing, and embedded runtimes. Secryst’s operating guarantees follow:

  • No network at inference — artifacts download once (sha256-verified), then load from cache; every cache hit is re-verified.
  • Reproducible — greedy decoding, fixed tokenization, versioned artifacts. Same input, same model version, same output — forever.
  • Auditable — the model is a zip you can hash, inspect, and pin; models.yaml is the whole supply chain.

§5

Why we never use LLMs as teachers

Every label in every secryst training corpus is either gold human text or the output of a deterministic rule system. Large language models hallucinate vocalization: they emit fluent, plausible, wrong harakat and nikud. A single systematic hallucination, distilled into a student, becomes a permanent error no eval will localize. We treat LLM-labeled phonology as a poison chain — documented across our Arabic, Hebrew, and Thai experiments — and the constraint is enforced socially in every dataset we accept.

Machine-labeled data is not banned — it is staged: weak labels may pretrain, but only human-verified corpora fine-tune the shipped model (validated: our Hebrew curriculum gained 0.88 DER points this way).

§6

Relation to Interscript

Interscript publishes deterministic transliteration maps — but maps assume vocalized input; undiacritized text cannot be transliterated unambiguously. Secryst is the phonological layer underneath: maps that need it declare a vocalization step and dispatch to the host runtime’s crystal. The crystals themselves have no interscript dependency — a TTS front-end can phonemize Khmer with pip install secryst and nothing else. Interscript defines what a hidden reading is; secryst is how you reveal it, in-process.