What the polish pass changes, and what it never touches: the 31-case golden corpus
Lven Instant runs a deterministic pass over each transcript before it types it: hyphen-fragment and stutter pruning, n-gram repeat collapse, filler purge, contraction and proper-noun restoration, sentence casing, and terminal punctuation. No language model, no network, no regular expressions on the hot path; the same input always yields the same output. We compiled the polisher's golden regression corpus — 31 input/expected pairs that CI holds every platform's implementation to — against the shipped Windows source and ran it on the publication date: 31 of 31 pass. Across the corpus, 154 words go in and 134 come out; zero words are inserted; 20 are removed and every one is a stutter fragment, a filler, or a repeat; one word is spelling-restored (accellent → excellent); 3 gain an apostrophe; the remaining differences are casing.
What the pass is
After the speech model returns text, and before Lven types it into the focused app, a single-pass token-stream engine (LvenStructuralPolisher, shipped as C++ on Windows and Linux and as Kotlin on Android, byte-identical contracts held by a shared golden corpus) applies seven rules in a fixed order: hyphen-fragment pruning; prefix-stutter pruning; n-gram repetition collapse for n = 1, 2, 3; filler purge (uh, um, eh, er, ah, uh-huh); contraction, proper-noun and phonetic-spelling restoration from a fixed table; sentence casing; terminal punctuation, where the last sentence decides ? versus period.
It is not a language model. It cannot rephrase, restructure, change tense, match tone to an app, or decide what you meant. It has no network access. Given the same transcript it produces the same text every time, on every platform.
Method
The corpus is the polisher's own golden regression test — the file CI runs on every commit and regenerates for the Swift ports, so that all implementations are held to one contract. We compiled tests/polisher_golden_test.cpp against the shipped Lven-Windows/src/instant/lven_polish.cpp with a stock LLVM MinGW g++ (-std=c++17) on 2026-08-15 and ran the binary; it asserts every expected output and returns non-zero on any mismatch. Word counts and change classes were then computed over the 31 pairs with a token diff (case- and apostrophe-insensitive alignment, then classification of each difference).
Results
| Measure | Value |
|---|---|
| Golden cases | 31 of 31 pass |
| Words in → out | 154 → 134 |
| Words inserted | 0 |
| Words removed | 20 — all stutter fragments, fillers, or repeats |
| Spelling restored | 1 (accellent → excellent) |
| Apostrophe restored | 3 (dont, im, ive) |
| Casing-only changes | 37 (sentence starts; NVIDIA, CUDA, GitHub) |
| Words kept byte-identical | 93 |
Every word that survives is a word the speaker said. The only substitution in the corpus is a spelling restoration from a fixed table; nothing is paraphrased and nothing is added.
The pairs
| Case | Input | Output |
|---|---|---|
| flagship | st- st- study shows that c- c- computer is really fast and running on a g- g- gpu you know like you know we have accellent results | Study shows that computer is really fast and running on a GPU you know like you know we have excellent results. |
| filler-comma | um, hello there | Hello there. |
| filler-period | um. yes. it works | Yes. It works. |
| triple-rep | no no no | No. |
| quad-rep | very very very very good | Very good. |
| ill-word | he was ill | He was ill. |
| as-guard | as aspects go this is fine | As aspects go this is fine. |
| question-last | the weather is nice. is it raining | The weather is nice. Is it raining? |
| statement-last | is it done. the work was hard | Is it done. The work was hard. |
| rep-comma | i think, i think we should leave | I think we should leave. |
| single-stutter | e everyone is here | Everyone is here. |
| digit-not-stutter | 4 400 meters | 4 400 meters. |
| long-fragment | compu- computer works | Computer works. |
| dangling-hyphen | well- that is fine | Well that is fine. |
| the-the | i want to go to the the store | I want to go to the store. |
| contractions | dont worry im fine ive got it | Don't worry I'm fine I've got it. |
| proper-nouns | lven runs on nvidia cuda and github | Lven runs on NVIDIA CUDA and GitHub. |
| question-mark | what time is it | What time is it? |
| legit-had | we had had a long talk | We had had a long talk. |
| legit-that | the reason is that that file | The reason is that that file. |
| is-is-collapse | the file is is broken | The file is broken. |
| has-has-collapse | she has has it | She has it. |
| boundary-you | thank you. you are welcome | Thank you. You are welcome. |
| boundary-stop | stop. stop it | Stop. Stop it. |
| trailing-hyphen-keep | i was talking about the co- | I was talking about the co. |
| trailing-hyphen-solo | co- | Co. |
| nonascii-ecole | école is open | École is open. |
| nonascii-uber | über cool | Über cool. |
| dangling-commas | hello,,, | Hello. |
| empty | (empty) | (empty) |
| pure-punct | ... | (empty) |
Note what is preserved: 'you know like you know' in the first case stays, because it is not in the filler list and the engine does not judge whether a phrase is worth keeping. 'had had' and 'that that' stay, because the collapse pass guards legitimate doubles.
Why deterministic
A generative cleanup layer optimises for text that reads well. That is a real product goal and some people want it. Its cost is that every sentence has to be re-read for meaning, because the layer is allowed to decide what you meant; in July 2026 one cloud dictation vendor traced accuracy complaints to its cleanup default having changed words users had not asked it to touch. A deterministic pass optimises for the text being what you said. Its cost is that it will not turn a rambling sentence into a clean one. We chose the second, and this corpus is what that choice looks like in practice.
Reproduce it
From a checkout of the Lven Instant source, at the repository root: g++ -std=c++17 -I Lven-Windows/src/instant tests/polisher_golden_test.cpp Lven-Windows/src/instant/lven_polish.cpp -o polish_golden && ./polish_golden. The binary prints the pass count and exits non-zero on any mismatch. The Kotlin and Swift ports are held to the same corpus through tests/polisher_golden_cases.json.
Limitations.
- This measures our own pass, on its own regression corpus. It is not a comparison against any other product's output on the same audio; we have not run one and do not publish numbers for other vendors here.
- The corpus is a regression suite designed to exercise each rule, not a random sample of real dictation. Real-speech proportions of stutters, fillers and repeats will differ.
- Repeat collapse flattens intentional emphasis: 'very very very very good' becomes 'Very good'. If you repeat a word for effect, the pass will not know.
- Restoration (contractions, proper nouns, phonetic spellings) comes from a fixed table; a word not in the table is left as the model produced it.
- The speech model upstream of this pass has its own error rate, measured separately in the on-device ASR report. This report is about what happens after recognition, not recognition itself.
- First-party measurement, run by ClassEve on the publication date.