drmhse commited on
Commit
2fa80d7
·
verified ·
1 Parent(s): 70647ba

Paper: describes the model as it is (training stages, not release versions)

Browse files
README.md CHANGED
@@ -32,8 +32,8 @@ learned is new:
32
 
33
  ![Learned parameters: Kokoro-82M 81.8M, nano-edge-tts 30.2M, this model 3.27M](paper/figures/params.png)
34
 
35
- **Paper:** [Kokoro-82M in 3.3M Parameters: A Small Text Side and a Frame-Rate Decoder, Reproducible End to End](paper/paper.pdf)
36
- (versions 2.0 and 2.1). **To rebuild it:** every checkpoint of the training chain with its arguments and logs ([`chain/`](chain)),
37
  the exact code, and one script from public books to these weights ([`code/`](code)).
38
 
39
  | | Kokoro-82M | v2.0 | v2.1 (this) |
 
32
 
33
  ![Learned parameters: Kokoro-82M 81.8M, nano-edge-tts 30.2M, this model 3.27M](paper/figures/params.png)
34
 
35
+ **Paper:** [Kokoro-82M in 3.3M Parameters: A Small Text Side and a Frame-Rate Decoder, Reproducible End to End](paper/paper.pdf).
36
+ **To rebuild it:** every checkpoint of the training chain with its arguments and logs ([`chain/`](chain)),
37
  the exact code, and one script from public books to these weights ([`code/`](code)).
38
 
39
  | | Kokoro-82M | v2.0 | v2.1 (this) |
paper/figures/listening.png CHANGED
paper/figures/listening.svg CHANGED
paper/figures/make.py CHANGED
@@ -1,6 +1,6 @@
1
  """Figures for paper_v2: parameter counts, the listening tests against Kokoro-82M, and the voice measures per decoder version.
2
  python paper_v2/figures/make.py (reads release_v2/results; writes paper_v2/figures/*.svg for the paper, *.png for the card)
3
- One colour scheme throughout: greys are Kokoro-82M, blues are this work's models, orange marks the shipped version 2.1."""
4
  import json
5
  import os
6
 
@@ -37,7 +37,7 @@ def bar_label(ax, x, y, s, dark):
37
 
38
  def params():
39
  rows = [('Kokoro-82M', [('text side', 28.5, KOK_LIGHT), ('decoder', 53.3, KOK_DARK)], '81.8M'),
40
- ('nano-edge-tts v1', [('Kokoro\'s text side', 28.5, KOK_LIGHT), ('', 1.75, BLUE_MID)], '30.2M new decoder 1.75M'),
41
  ('this work', [('', 1.52, BLUE_DARK), ('', 0.96, BLUE_MID), ('', 0.79, BLUE_LIGHT)],
42
  '3.27M text side 1.52M · mapper 0.96M · renderer 0.79M')]
43
  fig, ax = plt.subplots(figsize=(W, 1.65))
@@ -74,7 +74,7 @@ def count(path, nano='nano4M'):
74
  def listening():
75
  pages = [('decoder F4', count(os.path.join(RES, 'listening_F4_vs_kokoro.json'))),
76
  ('F4 + post-filter', count(os.path.join(RES, 'listening_F4sharp_vs_kokoro.json'))),
77
- ('G2 + post-filter (v2.0)', count(os.path.join(RES, 'listening_G2sharp_vs_kokoro.json')))]
78
  keys = (('k', KOK_DARK, 'Kokoro-82M preferred', True), ('s', SAME, 'heard as the same', False),
79
  ('n', BLUE_DARK, 'this work preferred', True))
80
  fig, ax = plt.subplots(figsize=(W, 1.55))
@@ -99,8 +99,8 @@ def offsets():
99
  ('breath_top_4-6k', 'breath 4–6 kHz'), ('breath_all_3-4k', 'breath 3–4 kHz'),
100
  ('flutter_100-500', 'flutter 0.1–0.5 kHz'), ('flutter_4000-8000', 'flutter 4–8 kHz'), ('crackle', 'crackle')]
101
  vers = [('e2e_F4', 'F4', BLUE_LIGHT, 'o'), ('e2e_F4_sharp', 'F4 + post-filter', BLUE_MID, 's'),
102
- ('e2e_G2_t6_hb_sharp', 'G2 + post-filter (v2.0)', BLUE_DARK, 'D'),
103
- ('e2e_FT4_G3_ft4_hb_sharp', 'FT4 + G3 (v2.1)', RELEASE, '^')]
104
  fig, ax = plt.subplots(figsize=(W, 2.9))
105
  for i in range(len(stats)):
106
  if i % 2 == 0:
 
1
  """Figures for paper_v2: parameter counts, the listening tests against Kokoro-82M, and the voice measures per decoder version.
2
  python paper_v2/figures/make.py (reads release_v2/results; writes paper_v2/figures/*.svg for the paper, *.png for the card)
3
+ One colour scheme throughout: greys are Kokoro-82M, blues are this work's models, orange marks the published model."""
4
  import json
5
  import os
6
 
 
37
 
38
  def params():
39
  rows = [('Kokoro-82M', [('text side', 28.5, KOK_LIGHT), ('decoder', 53.3, KOK_DARK)], '81.8M'),
40
+ ('nano-edge-tts', [('Kokoro\'s text side', 28.5, KOK_LIGHT), ('', 1.75, BLUE_MID)], '30.2M new decoder 1.75M'),
41
  ('this work', [('', 1.52, BLUE_DARK), ('', 0.96, BLUE_MID), ('', 0.79, BLUE_LIGHT)],
42
  '3.27M text side 1.52M · mapper 0.96M · renderer 0.79M')]
43
  fig, ax = plt.subplots(figsize=(W, 1.65))
 
74
  def listening():
75
  pages = [('decoder F4', count(os.path.join(RES, 'listening_F4_vs_kokoro.json'))),
76
  ('F4 + post-filter', count(os.path.join(RES, 'listening_F4sharp_vs_kokoro.json'))),
77
+ ('G2 + post-filter', count(os.path.join(RES, 'listening_G2sharp_vs_kokoro.json')))]
78
  keys = (('k', KOK_DARK, 'Kokoro-82M preferred', True), ('s', SAME, 'heard as the same', False),
79
  ('n', BLUE_DARK, 'this work preferred', True))
80
  fig, ax = plt.subplots(figsize=(W, 1.55))
 
99
  ('breath_top_4-6k', 'breath 4–6 kHz'), ('breath_all_3-4k', 'breath 3–4 kHz'),
100
  ('flutter_100-500', 'flutter 0.1–0.5 kHz'), ('flutter_4000-8000', 'flutter 4–8 kHz'), ('crackle', 'crackle')]
101
  vers = [('e2e_F4', 'F4', BLUE_LIGHT, 'o'), ('e2e_F4_sharp', 'F4 + post-filter', BLUE_MID, 's'),
102
+ ('e2e_G2_t6_hb_sharp', 'G2 + post-filter', BLUE_DARK, 'D'),
103
+ ('e2e_FT4_G3_ft4_hb_sharp', 'FT4 + G3 (published)', RELEASE, '^')]
104
  fig, ax = plt.subplots(figsize=(W, 2.9))
105
  for i in range(len(stats)):
106
  if i % 2 == 0:
paper/figures/offsets.png CHANGED
paper/figures/offsets.svg CHANGED
paper/figures/params.png CHANGED
paper/figures/params.svg CHANGED
paper/paper.pdf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5d50205f78784bbbc04531127757619d1270dd5a135cf7fe83bab07063499ea3
3
- size 238329
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:236da42695b18dc831f0fe2cc2ee59fe1f424e02c46c3908d81f8a0068491d16
3
+ size 236698
paper/paper.typ CHANGED
@@ -56,7 +56,7 @@
56
  #v(1.1em)
57
  #text(11.5pt)[Mike Chumba]
58
  #v(0.3em)
59
- #text(9pt, fill: muted)[#link("https://huggingface.co/drmhse/nano-edge-tts-standalone")[huggingface.co/drmhse/nano-edge-tts-standalone] #h(0.5em)·#h(0.5em) November 2026 #h(0.5em)·#h(0.5em) version 2.1]
60
  ]
61
  #v(0.8em)
62
  #block(inset: (x: 1.1cm))[
@@ -69,10 +69,10 @@
69
  then discards, and from one attention block run four times over words and twice over phonemes. The decoder was retrained with a
70
  recipe that takes hours instead of days; its last audible fault, a flat high band, was traced to the noise gains regressing to
71
  their mean, and a three-line post-filter plus a fine-tune on the small text side's own features took a blind A/B against
72
- Kokoro-82M from 15 Kokoro wins, 6 ties and 3 losses in 24 trials to 2, 22 and 0. A second version fixes words the first lost:
73
- of 4,806 target words checked by two recognisers, the first said 59.3% and Kokoro 81.8%. Swapping one text-side output at a
74
  time put the fault in the per-phoneme features, spread over the phonemes around a rare vowel; measuring their error through the
75
- decoder's own frozen mapper raised the rate to 78.8% in one hour of fine-tuning, and a decoder fine-tuned on the new
76
  features raised UTMOS from 4.451 to 4.467 without an audible change. Kokoro's front end is packaged as data and plain
77
  Python, with the same word error as Kokoro's own on the Open TTS Leaderboard's English sets. On one CPU thread the model runs 28
78
  times faster than Kokoro-82M in 0.71 GB (31 times in 0.60 GB with ONNX Runtime), with 35 Whisper word errors on 60 unseen sentences against Kokoro's 36. Every
@@ -90,12 +90,12 @@ second, 1.75M parameters in all. That left the text side as 94% of the pipeline'
90
 
91
  This paper removes it. The model described here (@fig-params) runs no Kokoro network at all: a 1.52M-parameter text side feeds a
92
  retrained 1.75M-parameter decoder of the same design. What it keeps from Kokoro is data, not computation: the misaki
93
- grapheme-to-phoneme front end @misaki (packaged in version 2.1 so that none of Kokoro's software is installed, @sec-frontend),
94
  the 178-symbol phoneme vocabulary, and the 28 English voice vectors. Kokoro-82M is the
95
  teacher throughout, and closeness to Kokoro is the target, measured by ear and by reference-free statistics.
96
 
97
  #figure(image("figures/params.svg", width: 96%),
98
- caption: [Learned parameters. Grey: Kokoro-82M's networks; blue: networks trained here or in nano-edge-tts v1. The renderer's
99
  fixed STFT matrices are buffers and are not counted.]) <fig-params>
100
 
101
  The contributions are:
@@ -109,7 +109,7 @@ The contributions are:
109
  - A diagnosis of the last audible gap, a flat 4--8 kHz band: about a third is the noise branch's 5 ms analysis window, two thirds
110
  are its learned gains averaging toward their mean; loss weight on that band moved the loss but not the sound, and a post-filter
111
  of the kind speech codecs use @postfilter closed most of the audible gap (@sec-highband).
112
- - For version 2.1, a way to find and fix words the model loses: probes that swap one text-side output at a time, and a
113
  fine-tune whose loss measures the text side's features through the decoder's frozen mapper, as the decoder hears them
114
  (@sec-ft). Target words said rose from 59.3% to 78.8% (Kokoro 81.8%).
115
  - Kokoro's front end without its dependencies: spaCy's tagger as exported data, misaki's rules, and espeak-ng's answers for
@@ -159,12 +159,12 @@ The text side has the interface of Kokoro's: phoneme ids and the prosody half of
159
  The decoder is nano-edge-tts's: a mapper (0.96M) turns per-phoneme features, F0 and energy into a 512-channel description at 80
160
  frames per second; a renderer (0.79M) predicts, 160 times a second, a gain and a phase rotation for each of 301 bins of a pulse
161
  train's STFT (25 ms window) and a gain for each of 61 bins of white noise's STFT (5 ms window) at five sub-steps. Two inverse STFTs
162
- make the audio. It was retrained from scratch for this release, with changes that made a training step four times faster and two
163
  that removed buzz:
164
 
165
  - *Speed.* The mapper is trained with the renderer on whole sentences batched by length, then frozen and its features cached for
166
  every training window; Kokoro's audio for each window is cut from whole-sentence decodes once. The only adversary is the WavLM
167
- critic (the multi-period and multi-resolution discriminators of the first model cost most of each step and added little).
168
  Spectral losses share one STFT per batch. A renderer step fell from 868 to 212 ms.
169
  - *Expected power.* Per-bin spectral and energy losses compare Kokoro's spectrum with the expected power of the output,
170
  $|H|^2 + EE|N|^2$, averaged over four noise draws, not with one random draw. With one draw, the noise branch is charged for its
@@ -194,23 +194,23 @@ few pooling operations.
194
  The decoder is trained on Kokoro's text-side features, but at inference it receives the small text side's. A last stage (G2)
195
  fine-tunes it for 10k steps on the small text side's features, laid on Kokoro's durations so that Kokoro's F0, energy and audio
196
  still line up, with a second critic on the 4--12 kHz log spectrogram at two resolutions (82k parameters). The WavLM critic
197
- resamples to 16 kHz and cannot hear above 8 kHz. For version 2.1 the stage was repeated, from G2, on the fine-tuned text side's
198
- features (G3, @sec-ft).
199
 
200
- == Fine-tuning the text side through the decoder (version 2.1) <sec-ft>
201
 
202
  The text side's feature loss is an L1 averaged over 512 channels and every phoneme. A rare phoneme barely weighs in it, and not
203
  every channel matters to the decoder equally. The fine-tune (FT4) keeps the text side's losses and adds one: our features and
204
- Kokoro's, each laid on Kokoro's durations, go through the released decoder's mapper (frozen), and the loss is the L1 between the
205
  two outputs in the mapper's normalised units, at every frame. Its data are T6's sentences plus 30,000 more, drawn four times as
206
  often: 10,000 lines of 4--29 characters (the text side had seen none under 30), 8,000 questions and exclamations, and 12,000
207
  sentences holding the rarest sounds (/ɔɪ/ 0.62 and /ʒ/ 0.28 per 1,000 phonemes), from 22 public-domain novels used nowhere else.
208
  It starts from T6 and runs 4,000 steps at learning rate 3e-4, with the decoder unchanged; G3 then fits the decoder to it.
209
 
210
- == A front end without dependencies (version 2.1) <sec-frontend>
211
 
212
  Kokoro turns text into phonemes with misaki, which needs spaCy, a spaCy model and espeak-ng, a GPL system library it calls for
213
- words outside its lexicons. Version 2.1 carries the same front end as data and plain Python (`nano_frontend.py`, 25 MB with both
214
  accents, against 87 MB installed for Kokoro's): spaCy's tokenizer rules and tagger weights exported and run in numpy, misaki's code
215
  with its lexicons, and number reading. For unknown words, misaki asks espeak-ng about the token alone, and espeak-ng ignores letter
216
  case, so its answers can be computed once: for 915,000 words (CMUdict's words, US name lists, English Wikipedia words seen 20 times
@@ -242,13 +242,13 @@ set (_The War of the Worlds_, _Walden_, _The Scarlet Letter_), four per voice; e
242
  [G3], [G2; FT4's features, same recipe], [10,000], [1.6 h],
243
  hl),
244
  caption: [The training chain on one Apple-silicon laptop GPU. Each decoder stage starts from the previous checkpoint with its
245
- critics. The post-filter is set on F4, G2 and G3 at export. Version 2.0 is T6 + G2, version 2.1 FT4 + G3 (first published as FT4 + G2). Data preparation
246
  (Kokoro's targets for 134k sentences) adds several hours.]) <tab-chain>
247
 
248
  *Reproducibility.* The release holds every checkpoint in @tab-chain (with optimiser and critic states, so any stage can be
249
  resumed), the ablations of @tab-text, each run's recorded arguments and training log, the exact code, and `reproduce_v2.sh`,
250
- which downloads Kokoro-82M and the books and runs every stage with the recorded arguments, skipping what exists. Version 2.0's
251
- data steps were checked against the originals: sentence selection, voice assignment and training windows are bit-identical, and
252
  Kokoro's features agree to float16 precision. GPU training is not bit-deterministic, so a rerun reproduces the recipe, not the
253
  exact weights; the published intermediate checkpoints let any single stage be rerun and compared. Resuming F4 from
254
  the published F3 checkpoint with the published code gives the original run's losses to three decimals over 200 steps
@@ -271,23 +271,24 @@ leaderboard's own transcription and UTMOS pipeline, run locally on one CPU threa
271
  = Results
272
 
273
  #figure(table(columns: 4, align: (left, right, right, right),
274
- hl, [], [Kokoro-82M], [version 2.0], [version 2.1],
275
  thl,
276
  [learned parameters], [81.8M], [3.27M], [3.27M],
277
  [Kokoro networks run at inference], [all], [none], [none],
278
- [Kokoro software installed], [misaki, spaCy, espeak-ng], [misaki, spaCy, espeak-ng], [none],
279
- [real-time factor, one CPU thread, phonemes to audio], [0.1415], [0.0048], [0.0050],
280
  [#h(1em) the same with ONNX Runtime], [], [], [0.0045],
281
- [peak memory, whole pipeline with the front end], [1.78 GB], [0.60 GB], [0.71 GB],
282
  [#h(1em) the same with ONNX Runtime], [], [], [0.60 GB],
283
  [Whisper word errors, 60 unseen sentences], [36], [39], [*35*],
284
  [target words said (4,806)], [81.8%], [59.3%], [78.7%],
285
  [leaderboard English sets: word error, UTMOS], [0.66%, 4.51], [0.77%, 4.441], [*0.71%*, 4.467],
286
- [blind A/B against Kokoro-82M (24 trials)], [2 preferred], [0 preferred, 22 same], [not run],
287
  hl),
288
- caption: [The released versions against Kokoro-82M. Speed: six sentences, about 45 s of audio, best of three runs, PyTorch on a
 
289
  laptop CPU. Leaderboard: ours run locally with the leaderboard's pipeline; Kokoro's as published (version 1.7.0, other
290
- hardware). Kokoro's text side with our released decoder makes 34 errors on the same 60 sentences.]) <tab-final>
291
 
292
  == The text side
293
 
@@ -298,8 +299,8 @@ leaderboard's own transcription and UTMOS pipeline, run locally on one CPU threa
298
  [T2: the same, 92k sentences], [5.0M], [147], [.708], [.925],
299
  [T5: + PL-BERT distillation, 6 attention layers], [8.15M], [134], [.737], [.934],
300
  thl,
301
- [T6: small, tags, shared attention (version 2.0)], [1.52M], [135], [.723], [.934],
302
- [FT4: T6 fine-tuned (version 2.1, @sec-ft)], [1.52M], [*133*], [*.729*], [*.936*],
303
  [T7: T6 without tags], [1.52M], [153], [.702], [.920],
304
  [T8: T6 + dependency parse], [1.55M], [139], [.712], [.929],
305
  [T9: T6 at width 192], [0.93M], [179], [.652], [.898],
@@ -326,7 +327,7 @@ same decoder and on the 20 most expressive clips, were heard as no different. Th
326
  caption: [Blind A/B, Kokoro-82M against the 3.27M model (T6 text side), on the same 20 expressive test clips, one page per
327
  decoder. Clips marked dirty: 7 (F4), 0 (F4 + post-filter), 2 (G2 + post-filter, the two Kokoro won).]) <fig-listening>
328
 
329
- The decoder alone was first judged against the first model's: in 24 trials, same 19, first model 4, new 1, with no clip marked
330
  dirty. With the small text side in front it lost clearly to Kokoro-82M (@fig-listening, top), and since the text side had been
331
  heard as equal to Kokoro's, the gap was the decoder's. On the clips marked dirty Kokoro's audio was higher pitched and brighter,
332
  and across all 60 test clips the brighter Kokoro was at 4--8 kHz, the further our contrast fell below it (Spearman $r = -.65$):
@@ -342,7 +343,7 @@ weighting the loss did not help, and what the post-filter undoes.
342
 
343
  #figure(image("figures/offsets.svg", width: 96%),
344
  caption: [Reference-free voice measures on the 60 test sentences, as offsets from Kokoro-82M; dashed lines mark ±0.3. F4 and G2
345
- with the T6 text side; version 2.1 (orange) with its own text side, FT4, and decoder G3.]) <fig-offsets>
346
 
347
  With the post-filter, 15 of 24 trials were heard as the same as Kokoro, 7 favoured Kokoro and 2 ours, all 4 repeats were answered
348
  consistently, and no clip was marked dirty (@fig-listening). @fig-offsets shows what it trades: crispness and breath at 4--8 kHz
@@ -353,20 +354,19 @@ Fine-tuning on the small text side's features (G2) moved the mean absolute offse
353
  post-filter) to .221 and the word errors to 39. Without the high-band critic (G1) the fine-tune gave nearly the same numbers: the
354
  critic learned to separate our 4--12 kHz from Kokoro's, but the decoder did not close that gap in 10k steps. By ear G2 was the
355
  largest step (@fig-listening): on the same page, 22 of 24 trials were heard as the same as Kokoro, Kokoro was preferred on two
356
- clips (both also marked dirty; one of them had lost on the F4 page too), ours on none, and all 4 repeats were consistent. G2
357
- with the post-filter was released as version 2.0, with F4 and the post-filter beside it (both kept at the tag `v2.0`).
358
 
359
  A last observation about the interface: Kokoro's own decoder fed the small text side's output makes 59 word errors on the 60
360
  sentences, against 39 for ours. A decoder trained alongside the text side it will receive is more forgiving of that text side
361
  than the decoder it was distilled from.
362
 
363
- == Words (version 2.1)
364
 
365
  #figure(table(columns: 4, align: (left, right, right, right),
366
  hl, [text side (decoder G2 unless noted)], [targets said], [lost vs Kokoro], [of which /ɔɪ/ words],
367
  thl,
368
  [Kokoro-82M], [81.8%], [], [],
369
- [T6 (version 2.0)], [59.3%], [1,187], [750],
370
  [T6, /ɔɪ/ respelled as ɔː + j in the front end], [70.4%], [686], [248],
371
  thl,
372
  [FT1: + 30,000 sentences ×4], [61.5%], [1,091], [705],
@@ -375,11 +375,11 @@ than the decoder it was distilled from.
375
  [FT4: FT1 + loss through the frozen mapper], [78.8%], [335], [92],
376
  [FT5: ×8, mapper loss ×3], [79.4%], [309], [87],
377
  thl,
378
- [*FT4 with decoder G3 (version 2.1)*], [*78.7%*], [*342*], [*94*],
379
  hl),
380
  caption: [The word test (4,806 targets, 27 voices, two recognisers). "Lost": targets Kokoro says and ours does not.]) <tab-words>
381
 
382
- The first version lost /ɔɪ/ worst: of the 108 targets of "boy", 97 were said by Kokoro and not by T6 (heard as "bye" or "bow"). Swapping outputs located the fault. On the 216
383
  /ɔɪ/ targets of eight voices, Kokoro's text side with our decoder says 167 and ours with Kokoro's decoder 1: the text side loses
384
  them. Giving our text side Kokoro's features alone (our durations, pitch and energy) brings 162; Kokoro's durations alone 4, its
385
  pitch and energy alone 3. Kokoro's features at the /ɔɪ/ phoneme only bring 19, and with one phoneme either side 142: Kokoro's
@@ -388,35 +388,34 @@ and a heavier weight on the rare phoneme itself (FT3) did little (@tab-words). O
388
  average phoneme's in L1; through the mapper the same features differed far more. The mapper loss fell from .118 to .075 while the
389
  plain L1 hardly moved (.0991 to .0983), and the targets said rose to 78.8%. A front-end respelling of /ɔɪ/ that routed around the
390
  fault (70.4%) is no longer needed and is slightly worse on top of FT4. FT5 gained 0.6 points more but its pitch error on Kokoro's
391
- validation sentences rose 3.6 cents; FT4 was released. On the test set its accent placement is slightly closer to Kokoro's
392
  than T6's (@tab-text).
393
 
394
- By ear, version 2.1 was preferred to 2.0 in all 20 trials (16 + 4 hidden repeats, all consistent) of a page built from the clips
395
  whose transcripts differ between the two (25 of 320 rendered: 40 sentences dense in the lost words, 8 voices). On ordinary
396
  sentences the two are hard to tell apart: on 60 test-book sentences their transcripts were identical in 55, and in 4 of the 5
397
- others version 2.1's was right. On the leaderboard sets word error fell from 0.77% to 0.72% and UTMOS rose from 4.441 to 4.451.
398
 
399
  Fitting the decoder to FT4 (G3) left the words where they were (@tab-words) and raised UTMOS on all four leaderboard sets, to
400
  4.467, with word error 0.71%. A page of 20 unseen sentences against FT4 + G2 was heard as the same in all 24 trials (4 hidden
401
- repeats). Version 2.1 now ships FT4 + G3; its first weights, FT4 + G2, remain under the tag `v2.1-g2`.
402
 
403
- Two other changes were tried on version 2.1 and not adopted. A recognition loss through the frozen decoder and a CTC recogniser
404
  @wav2vec2 pulled the text side's features away from Kokoro's (their error through the mapper rose by 70%) and cut the targets said
405
  to 51.4%, where the same fine-tune without it kept 78.5%: the features learned to satisfy one recogniser through one decoder
406
- rather than to carry speech. Closing the remaining
407
- spectral gaps to Kokoro below about 1.5 dB (a stronger post-filter, more noise between mid-band harmonics) was not heard.
408
 
409
- == The front end (version 2.1)
410
 
411
  Against Kokoro's front end on 594,183 words of book text (alternating accents) the packaged one gives identical tokens and tags
412
  throughout and identical phonemes on 24,698 of 25,284 sentences; every difference is on a word that reaches the fallback (the
413
  extra novels are among the table's sources, so this check is partly in sample). Compound tokens built from the vocabulary are read
414
- exactly as Kokoro reads them in 581 of 600 sentences (American) and 570 (British). On the leaderboard sets, with version 2.0's
415
- weights, 15 of 1,741 rows get a different model input, and the word error equals Kokoro's front end's (0.77%) when those rows are
416
  transcribed in the same run. Two cheaper variants failed that gate: a guess-only fallback (0.89%), and a table cut to Wikipedia
417
  words seen 50 times or more (0.82%).
418
 
419
- == Deployment (version 2.1)
420
 
421
  The model synthesises padded batches; their output differs from synthesis one sentence at a time by a fortieth of the
422
  difference between two noise draws. On one CPU thread it runs at 189 times real time (median 43 ms per sentence; first audio of a long text in 153 ms),
@@ -429,8 +428,8 @@ reaches 223 times real time against PyTorch's 199. A `transformers` wrapper load
429
 
430
  = Limitations
431
 
432
- - *One listener.* No multi-listener test has been run. Version 2.1 has not been compared with Kokoro-82M by ear; its pages
433
- were against version 2.0 and against its own first weights.
434
  - *Kokoro is the target.* Every part is trained to match Kokoro-82M's audio and prosody; at best the model sounds like Kokoro.
435
  - *Borrowed parts.* The front end is still Kokoro's, carried as data, and the voices are Kokoro's 28 English voice vectors.
436
  Other languages and voices have not been trained or tested. Words outside its lexicons and its 915,000 stored words are
@@ -447,8 +446,8 @@ Without running any of Kokoro-82M's networks, 3.27M parameters reproduce its spe
447
  tried, a blind listener heard most pairs as the same. Two things did most of the work, and neither was capacity. In the text
448
  side, accent placement came from part-of-speech tags that the front end already computed; a model a fifth of the size of the next
449
  best one matched it once given them, and lost the advantage when they were taken away. In the decoder, the last audible gap was a
450
- regression to the mean in the noise gains, which no loss weight moved and a parameter-free post-filter largely undid. In version
451
- 2.1 the same lesson held for words: the loss that fixed them measured the text side's error the way the decoder hears it, not
452
  the way it is stored. The remaining gaps are measured, listed and published with every checkpoint that produced them, so that
453
  each step can be checked, rerun or improved on.
454
 
 
56
  #v(1.1em)
57
  #text(11.5pt)[Mike Chumba]
58
  #v(0.3em)
59
+ #text(9pt, fill: muted)[#link("https://huggingface.co/drmhse/nano-edge-tts-standalone")[huggingface.co/drmhse/nano-edge-tts-standalone] #h(0.5em)·#h(0.5em) November 2026]
60
  ]
61
  #v(0.8em)
62
  #block(inset: (x: 1.1cm))[
 
69
  then discards, and from one attention block run four times over words and twice over phonemes. The decoder was retrained with a
70
  recipe that takes hours instead of days; its last audible fault, a flat high band, was traced to the noise gains regressing to
71
  their mean, and a three-line post-filter plus a fine-tune on the small text side's own features took a blind A/B against
72
+ Kokoro-82M from 15 Kokoro wins, 6 ties and 3 losses in 24 trials to 2, 22 and 0. A word test then exposed words it lost: of
73
+ 4,806 targets checked by two recognisers it said 59.3%, Kokoro 81.8%. Swapping one text-side output at a
74
  time put the fault in the per-phoneme features, spread over the phonemes around a rare vowel; measuring their error through the
75
+ decoder's own frozen mapper raised the rate to 78.8% in one hour of fine-tuning, and refitting the decoder to the new
76
  features raised UTMOS from 4.451 to 4.467 without an audible change. Kokoro's front end is packaged as data and plain
77
  Python, with the same word error as Kokoro's own on the Open TTS Leaderboard's English sets. On one CPU thread the model runs 28
78
  times faster than Kokoro-82M in 0.71 GB (31 times in 0.60 GB with ONNX Runtime), with 35 Whisper word errors on 60 unseen sentences against Kokoro's 36. Every
 
90
 
91
  This paper removes it. The model described here (@fig-params) runs no Kokoro network at all: a 1.52M-parameter text side feeds a
92
  retrained 1.75M-parameter decoder of the same design. What it keeps from Kokoro is data, not computation: the misaki
93
+ grapheme-to-phoneme front end @misaki (packaged as data, so that none of Kokoro's software is installed, @sec-frontend),
94
  the 178-symbol phoneme vocabulary, and the 28 English voice vectors. Kokoro-82M is the
95
  teacher throughout, and closeness to Kokoro is the target, measured by ear and by reference-free statistics.
96
 
97
  #figure(image("figures/params.svg", width: 96%),
98
+ caption: [Learned parameters. Grey: Kokoro-82M's networks; blue: networks trained here or in nano-edge-tts @nanoedge. The renderer's
99
  fixed STFT matrices are buffers and are not counted.]) <fig-params>
100
 
101
  The contributions are:
 
109
  - A diagnosis of the last audible gap, a flat 4--8 kHz band: about a third is the noise branch's 5 ms analysis window, two thirds
110
  are its learned gains averaging toward their mean; loss weight on that band moved the loss but not the sound, and a post-filter
111
  of the kind speech codecs use @postfilter closed most of the audible gap (@sec-highband).
112
+ - A way to find and fix words the model loses: probes that swap one text-side output at a time, and a
113
  fine-tune whose loss measures the text side's features through the decoder's frozen mapper, as the decoder hears them
114
  (@sec-ft). Target words said rose from 59.3% to 78.8% (Kokoro 81.8%).
115
  - Kokoro's front end without its dependencies: spaCy's tagger as exported data, misaki's rules, and espeak-ng's answers for
 
159
  The decoder is nano-edge-tts's: a mapper (0.96M) turns per-phoneme features, F0 and energy into a 512-channel description at 80
160
  frames per second; a renderer (0.79M) predicts, 160 times a second, a gain and a phase rotation for each of 301 bins of a pulse
161
  train's STFT (25 ms window) and a gain for each of 61 bins of white noise's STFT (5 ms window) at five sub-steps. Two inverse STFTs
162
+ make the audio. It was retrained from scratch for this work, with changes that made a training step four times faster and two
163
  that removed buzz:
164
 
165
  - *Speed.* The mapper is trained with the renderer on whole sentences batched by length, then frozen and its features cached for
166
  every training window; Kokoro's audio for each window is cut from whole-sentence decodes once. The only adversary is the WavLM
167
+ critic (the multi-period and multi-resolution discriminators of nano-edge-tts cost most of each step and added little).
168
  Spectral losses share one STFT per batch. A renderer step fell from 868 to 212 ms.
169
  - *Expected power.* Per-bin spectral and energy losses compare Kokoro's spectrum with the expected power of the output,
170
  $|H|^2 + EE|N|^2$, averaged over four noise draws, not with one random draw. With one draw, the noise branch is charged for its
 
194
  The decoder is trained on Kokoro's text-side features, but at inference it receives the small text side's. A last stage (G2)
195
  fine-tunes it for 10k steps on the small text side's features, laid on Kokoro's durations so that Kokoro's F0, energy and audio
196
  still line up, with a second critic on the 4--12 kHz log spectrogram at two resolutions (82k parameters). The WavLM critic
197
+ resamples to 16 kHz and cannot hear above 8 kHz. Once the text side has been fine-tuned itself (@sec-ft), the stage is repeated
198
+ from G2 on its new features (G3).
199
 
200
+ == Fine-tuning the text side through the decoder <sec-ft>
201
 
202
  The text side's feature loss is an L1 averaged over 512 channels and every phoneme. A rare phoneme barely weighs in it, and not
203
  every channel matters to the decoder equally. The fine-tune (FT4) keeps the text side's losses and adds one: our features and
204
+ Kokoro's, each laid on Kokoro's durations, go through G2's mapper (frozen), and the loss is the L1 between the
205
  two outputs in the mapper's normalised units, at every frame. Its data are T6's sentences plus 30,000 more, drawn four times as
206
  often: 10,000 lines of 4--29 characters (the text side had seen none under 30), 8,000 questions and exclamations, and 12,000
207
  sentences holding the rarest sounds (/ɔɪ/ 0.62 and /ʒ/ 0.28 per 1,000 phonemes), from 22 public-domain novels used nowhere else.
208
  It starts from T6 and runs 4,000 steps at learning rate 3e-4, with the decoder unchanged; G3 then fits the decoder to it.
209
 
210
+ == A front end without dependencies <sec-frontend>
211
 
212
  Kokoro turns text into phonemes with misaki, which needs spaCy, a spaCy model and espeak-ng, a GPL system library it calls for
213
+ words outside its lexicons. The model carries the same front end as data and plain Python (`nano_frontend.py`, 25 MB with both
214
  accents, against 87 MB installed for Kokoro's): spaCy's tokenizer rules and tagger weights exported and run in numpy, misaki's code
215
  with its lexicons, and number reading. For unknown words, misaki asks espeak-ng about the token alone, and espeak-ng ignores letter
216
  case, so its answers can be computed once: for 915,000 words (CMUdict's words, US name lists, English Wikipedia words seen 20 times
 
242
  [G3], [G2; FT4's features, same recipe], [10,000], [1.6 h],
243
  hl),
244
  caption: [The training chain on one Apple-silicon laptop GPU. Each decoder stage starts from the previous checkpoint with its
245
+ critics. The post-filter is set on F4, G2 and G3 at export. The published model is FT4 + G3; T6 + G2 is the intermediate model that was compared with Kokoro by ear. Data preparation
246
  (Kokoro's targets for 134k sentences) adds several hours.]) <tab-chain>
247
 
248
  *Reproducibility.* The release holds every checkpoint in @tab-chain (with optimiser and critic states, so any stage can be
249
  resumed), the ablations of @tab-text, each run's recorded arguments and training log, the exact code, and `reproduce_v2.sh`,
250
+ which downloads Kokoro-82M and the books and runs every stage with the recorded arguments, skipping what exists. Its data
251
+ steps were checked against the original runs: sentence selection, voice assignment and training windows are bit-identical, and
252
  Kokoro's features agree to float16 precision. GPU training is not bit-deterministic, so a rerun reproduces the recipe, not the
253
  exact weights; the published intermediate checkpoints let any single stage be rerun and compared. Resuming F4 from
254
  the published F3 checkpoint with the published code gives the original run's losses to three decimals over 200 steps
 
271
  = Results
272
 
273
  #figure(table(columns: 4, align: (left, right, right, right),
274
+ hl, [], [Kokoro-82M], [T6 + G2], [*FT4 + G3*],
275
  thl,
276
  [learned parameters], [81.8M], [3.27M], [3.27M],
277
  [Kokoro networks run at inference], [all], [none], [none],
278
+ [Kokoro software installed], [misaki, spaCy, espeak-ng], [], [none],
279
+ [real-time factor, one CPU thread, phonemes to audio], [0.1415], [], [0.0050],
280
  [#h(1em) the same with ONNX Runtime], [], [], [0.0045],
281
+ [peak memory, whole pipeline with the front end], [1.78 GB], [], [0.71 GB],
282
  [#h(1em) the same with ONNX Runtime], [], [], [0.60 GB],
283
  [Whisper word errors, 60 unseen sentences], [36], [39], [*35*],
284
  [target words said (4,806)], [81.8%], [59.3%], [78.7%],
285
  [leaderboard English sets: word error, UTMOS], [0.66%, 4.51], [0.77%, 4.441], [*0.71%*, 4.467],
286
+ [blind A/B against Kokoro-82M, 24 trials: ours / same / Kokoro], [], [0 / 22 / 2], [not run],
287
  hl),
288
+ caption: [The published model (FT4 + G3, packaged front end) and the intermediate T6 + G2 (Kokoro's front end) against
289
+ Kokoro-82M. Speed: six sentences, about 45 s of audio, best of three runs, PyTorch on a
290
  laptop CPU. Leaderboard: ours run locally with the leaderboard's pipeline; Kokoro's as published (version 1.7.0, other
291
+ hardware). Kokoro's text side with decoder G3 makes 34 errors on the same 60 sentences.]) <tab-final>
292
 
293
  == The text side
294
 
 
299
  [T2: the same, 92k sentences], [5.0M], [147], [.708], [.925],
300
  [T5: + PL-BERT distillation, 6 attention layers], [8.15M], [134], [.737], [.934],
301
  thl,
302
+ [T6: small, tags, shared attention], [1.52M], [135], [.723], [.934],
303
+ [FT4: T6 fine-tuned through the mapper (@sec-ft)], [1.52M], [*133*], [*.729*], [*.936*],
304
  [T7: T6 without tags], [1.52M], [153], [.702], [.920],
305
  [T8: T6 + dependency parse], [1.55M], [139], [.712], [.929],
306
  [T9: T6 at width 192], [0.93M], [179], [.652], [.898],
 
327
  caption: [Blind A/B, Kokoro-82M against the 3.27M model (T6 text side), on the same 20 expressive test clips, one page per
328
  decoder. Clips marked dirty: 7 (F4), 0 (F4 + post-filter), 2 (G2 + post-filter, the two Kokoro won).]) <fig-listening>
329
 
330
+ The decoder alone was first judged against nano-edge-tts's: in 24 trials, same 19, nano-edge-tts 4, new 1, with no clip marked
331
  dirty. With the small text side in front it lost clearly to Kokoro-82M (@fig-listening, top), and since the text side had been
332
  heard as equal to Kokoro's, the gap was the decoder's. On the clips marked dirty Kokoro's audio was higher pitched and brighter,
333
  and across all 60 test clips the brighter Kokoro was at 4--8 kHz, the further our contrast fell below it (Spearman $r = -.65$):
 
343
 
344
  #figure(image("figures/offsets.svg", width: 96%),
345
  caption: [Reference-free voice measures on the 60 test sentences, as offsets from Kokoro-82M; dashed lines mark ±0.3. F4 and G2
346
+ with the T6 text side; orange: the published model, FT4 + G3.]) <fig-offsets>
347
 
348
  With the post-filter, 15 of 24 trials were heard as the same as Kokoro, 7 favoured Kokoro and 2 ours, all 4 repeats were answered
349
  consistently, and no clip was marked dirty (@fig-listening). @fig-offsets shows what it trades: crispness and breath at 4--8 kHz
 
354
  post-filter) to .221 and the word errors to 39. Without the high-band critic (G1) the fine-tune gave nearly the same numbers: the
355
  critic learned to separate our 4--12 kHz from Kokoro's, but the decoder did not close that gap in 10k steps. By ear G2 was the
356
  largest step (@fig-listening): on the same page, 22 of 24 trials were heard as the same as Kokoro, Kokoro was preferred on two
357
+ clips (both also marked dirty; one of them had lost on the F4 page too), ours on none, and all 4 repeats were consistent.
 
358
 
359
  A last observation about the interface: Kokoro's own decoder fed the small text side's output makes 59 word errors on the 60
360
  sentences, against 39 for ours. A decoder trained alongside the text side it will receive is more forgiving of that text side
361
  than the decoder it was distilled from.
362
 
363
+ == Words
364
 
365
  #figure(table(columns: 4, align: (left, right, right, right),
366
  hl, [text side (decoder G2 unless noted)], [targets said], [lost vs Kokoro], [of which /ɔɪ/ words],
367
  thl,
368
  [Kokoro-82M], [81.8%], [], [],
369
+ [T6], [59.3%], [1,187], [750],
370
  [T6, /ɔɪ/ respelled as ɔː + j in the front end], [70.4%], [686], [248],
371
  thl,
372
  [FT1: + 30,000 sentences ×4], [61.5%], [1,091], [705],
 
375
  [FT4: FT1 + loss through the frozen mapper], [78.8%], [335], [92],
376
  [FT5: ×8, mapper loss ×3], [79.4%], [309], [87],
377
  thl,
378
+ [*FT4 with decoder G3 (published)*], [*78.7%*], [*342*], [*94*],
379
  hl),
380
  caption: [The word test (4,806 targets, 27 voices, two recognisers). "Lost": targets Kokoro says and ours does not.]) <tab-words>
381
 
382
+ T6 lost /ɔɪ/ worst: of the 108 targets of "boy", 97 were said by Kokoro and not by it (heard as "bye" or "bow"). Swapping outputs located the fault. On the 216
383
  /ɔɪ/ targets of eight voices, Kokoro's text side with our decoder says 167 and ours with Kokoro's decoder 1: the text side loses
384
  them. Giving our text side Kokoro's features alone (our durations, pitch and energy) brings 162; Kokoro's durations alone 4, its
385
  pitch and energy alone 3. Kokoro's features at the /ɔɪ/ phoneme only bring 19, and with one phoneme either side 142: Kokoro's
 
388
  average phoneme's in L1; through the mapper the same features differed far more. The mapper loss fell from .118 to .075 while the
389
  plain L1 hardly moved (.0991 to .0983), and the targets said rose to 78.8%. A front-end respelling of /ɔɪ/ that routed around the
390
  fault (70.4%) is no longer needed and is slightly worse on top of FT4. FT5 gained 0.6 points more but its pitch error on Kokoro's
391
+ validation sentences rose 3.6 cents; FT4 was kept. On the test set its accent placement is slightly closer to Kokoro's
392
  than T6's (@tab-text).
393
 
394
+ By ear, FT4 was preferred to T6 (both with G2) in all 20 trials (16 + 4 hidden repeats, all consistent) of a page built from the clips
395
  whose transcripts differ between the two (25 of 320 rendered: 40 sentences dense in the lost words, 8 voices). On ordinary
396
  sentences the two are hard to tell apart: on 60 test-book sentences their transcripts were identical in 55, and in 4 of the 5
397
+ others FT4's was right. On the leaderboard sets word error fell from 0.77% to 0.72% and UTMOS rose from 4.441 to 4.451.
398
 
399
  Fitting the decoder to FT4 (G3) left the words where they were (@tab-words) and raised UTMOS on all four leaderboard sets, to
400
  4.467, with word error 0.71%. A page of 20 unseen sentences against FT4 + G2 was heard as the same in all 24 trials (4 hidden
401
+ repeats). The published model is FT4 + G3.
402
 
403
+ Two other changes were tried and not adopted. A recognition loss through the frozen decoder and a CTC recogniser
404
  @wav2vec2 pulled the text side's features away from Kokoro's (their error through the mapper rose by 70%) and cut the targets said
405
  to 51.4%, where the same fine-tune without it kept 78.5%: the features learned to satisfy one recogniser through one decoder
406
+ rather than to carry speech. Closing the remaining spectral gaps to Kokoro below about 1.5 dB (a stronger post-filter, more noise between mid-band harmonics) was not heard.
 
407
 
408
+ == The front end
409
 
410
  Against Kokoro's front end on 594,183 words of book text (alternating accents) the packaged one gives identical tokens and tags
411
  throughout and identical phonemes on 24,698 of 25,284 sentences; every difference is on a word that reaches the fallback (the
412
  extra novels are among the table's sources, so this check is partly in sample). Compound tokens built from the vocabulary are read
413
+ exactly as Kokoro reads them in 581 of 600 sentences (American) and 570 (British). On the leaderboard sets, with T6 +
414
+ G2, 15 of 1,741 rows get a different model input, and the word error equals Kokoro's front end's (0.77%) when those rows are
415
  transcribed in the same run. Two cheaper variants failed that gate: a guess-only fallback (0.89%), and a table cut to Wikipedia
416
  words seen 50 times or more (0.82%).
417
 
418
+ == Deployment
419
 
420
  The model synthesises padded batches; their output differs from synthesis one sentence at a time by a fortieth of the
421
  difference between two noise draws. On one CPU thread it runs at 189 times real time (median 43 ms per sentence; first audio of a long text in 153 ms),
 
428
 
429
  = Limitations
430
 
431
+ - *One listener.* No multi-listener test has been run. The blind A/B against Kokoro-82M used T6 + G2; the published model was
432
+ compared by ear only with T6 + G2 and FT4 + G2.
433
  - *Kokoro is the target.* Every part is trained to match Kokoro-82M's audio and prosody; at best the model sounds like Kokoro.
434
  - *Borrowed parts.* The front end is still Kokoro's, carried as data, and the voices are Kokoro's 28 English voice vectors.
435
  Other languages and voices have not been trained or tested. Words outside its lexicons and its 915,000 stored words are
 
446
  tried, a blind listener heard most pairs as the same. Two things did most of the work, and neither was capacity. In the text
447
  side, accent placement came from part-of-speech tags that the front end already computed; a model a fifth of the size of the next
448
  best one matched it once given them, and lost the advantage when they were taken away. In the decoder, the last audible gap was a
449
+ regression to the mean in the noise gains, which no loss weight moved and a parameter-free post-filter largely undid. The same
450
+ lesson held for words: the loss that fixed them measured the text side's error the way the decoder hears it, not
451
  the way it is stored. The remaining gaps are measured, listed and published with every checkpoint that produced them, so that
452
  each step can be checked, rerun or improved on.
453