Kanade vs LSCodec: This Codec Never Heard Ukrainian. It Still Beat Ours 11×

Published on :Nov 10, 2026

I compressed one sentence about 1,000× with two neural speech codecs. Neither of them was ever trained on Ukrainian. On Ukrainian speech, Kanade still adds about 11 times fewer errors than LSCodec, the codec my offline voice tutor Lastivka runs on: 0.032 against 0.37 added character error rate (ΔCER), measured with a stranger's voice.

This post is the lab log of how I got there, from a bug I had been living with for months to a test that cost 53 cents of GPU time. It ends with a rule you can apply to your own language before you spend a month training anything.

FLEURS, English. Easy mode: each codec gets the voice from the same sentence.

OriginalWhisper: "Fellow wrestlers also pay tribute to Luna."
LSCodecWhisper: "Fellow researchers offer featured engineering."
Kanade, 25 HzWhisper: "Fellow wrestlers also pay tribute to Luna."

The video version of this study, about 20 minutes: watch on YouTube.

The short version

  • The finding. Two codecs, both trained only on English, both used exactly as published. On Ukrainian (FLEURS, about 100 sentences, a stranger's voice) LSCodec adds 0.37 to Whisper's character error rate, Kanade adds 0.032. In the easy mode, where each codec hears the voice of the same sentence, the gap is 12×.
  • Seven languages. Kanade is better in every one of them, by at least 7×.
  • The cost. Twenty minutes of web research by an AI agent, 85 minutes on a Colab L4 ($0.53), about $8.30 for the whole study including a fine-tune.
  • The phone. On an iPhone 15 Pro the Kanade decoder runs fully on the Neural Engine and makes about a second of speech in under 5 ms.

The rule I took away. Before you train a model on a speech codec, test the codec on your language:

  1. Encode and decode a set of real sentences in that language.
  2. Run Whisper (or another strong ASR) on the original and on the codec output.
  3. Report the difference in character error rate, not the raw error rate.
  4. Give the decoder a voice sample from a different recording, not from the same sentence.
  5. Count the broken sentences (more than half the letters wrong), because the average hides them.

Background: why squeeze speech at all

Plain WAV audio at 24 kHz, 16 bit, mono is 384,000 bits per second. Kanade turns speech into 25 codes per second, 341 bits per second. That is about 1,100 times smaller than the WAV and 375 times smaller than a 128 kbit/s MP3. The voice itself travels separately, once per recording.

A tower of 1,126 blocks labeled WAV, 24 kHz, 16-bit mono, 384,000 bits per second
WAV as a tower of 1,126 blocks. One second of Kanade codes is a single block at its foot.

Codes this small are useful in a few ways:

  • A language model can speak them. It writes codes the same way it writes words. Moshi, Sesame's CSM and Orpheus produce speech like this, and so does Lastivka.
  • Voice on a phone with no internet. The decoder is small and fast enough to run next to the model on the device.
  • Very narrow radio links. A 3.5 second sentence in Kanade codes is 151 bytes: one LoRa packet, about a quarter of a second on air. Codec 2 700C needs two packets for the same sentence, Opus at 6 kbit/s needs eleven. This is arithmetic only. I have not sent anything over a real radio. Meshtastic does not carry voice on its usual bands, and a live call would not fit into the 1% airtime limit in Europe. Voice messages would.
  • Voice apart from words. Some codecs keep the speaker in a separate vector. Researchers already use this to anonymize recordings: the words stay, the speaker is swapped.

How Kanade turns 40 ms of sound into one code

The encoder cuts speech into 40 ms frames and describes each frame with five numbers. Each number snaps to a fixed set of levels: 8, 8, 8, 5 and 5. Multiply them and you get 12,800 possible codes, so one frame is one code of 13.6 bits.

Five dials with 8, 8, 8, 5 and 5 positions forming one code out of 12,800 possible
Five dials, 8 × 8 × 8 × 5 × 5 = 12,800 possible codes per frame.

Nobody hand-picks these codes. The network learns to push sound through this bottleneck and rebuild it on the other side. A second network, a discriminator, tries to tell rebuilt audio from real audio, which keeps the sound sharp. A teacher model, WavLM, which already knows speech sounds, makes the codes keep the words and drop the noise. So the codes come out sound-like: not letters, and not exactly phonemes.

The voice is stored separately: one vector of 128 numbers per recording. I think of it as a glove. The same codes with another glove produce the same words in another voice.

A voice vector of 128 numbers drawn as a band above the same code sequence for the sentence Fellow wrestlers also paid tribute to Luna
The voice vector sits on top of the codes like a glove.

One code per frame matters for language models. A model predicts the next token, and with Kanade a frame is exactly one token, one more word in the vocabulary. Mimi, the codec behind Moshi, produces eight codes per frame, so Moshi needs a second transformer inside just to handle them.

Where I started: Lastivka swallows words

Lastivka is an offline voice tutor for children that I build for the iPhone. Gemma writes codec codes, a small decoder turns them into sound. I wrote about the first version in Lastivka: Teaching Gemma to Speak Ukrainian. The trouble is that she swallows words. In one demo answer, "I'm Lastivka, a swallow...", Whisper hears "Anwasika": she cannot say her own name.

The words get lost along the whole chain. Gemma on the phone is still undertrained, so part of the loss comes from the model. To separate the two, I cut Gemma out and ran Lastivka's own training voice straight through the codec and back. The codec alone adds 0.27 to the character error rate, about one extra wrong letter in every four. Those codes are exactly what Gemma learns to speak from.

Diagram of Lastivka's training voice going through the LSCodec encoder, codes and decoder, with the label codec alone plus 0.27 CER
Without Gemma in the loop: Lastivka's training voice through LSCodec and back, 60 clips, 7 kHz filter on.

The lab log

October 14. How to measure what a codec loses

Whisper as a ruler. Whisper large-v3 transcribes the original, then the same sentence after the codec. I count character errors in both against the reference text and subtract. The subtraction matters because Whisper also makes mistakes on the original: here it hears "pay" instead of "paid", and that is not the codec's fault. The result is ΔCER, the character error rate the codec added.

Reference, original and after-LSCodec transcripts aligned on a ruler, with the formula delta CER equals 30 minus 2 over 42 equals plus 0.67
ΔCER = (errors after the codec − errors on the original) / letters in the reference.

The glove trap. The decoder needs a voice sample. If you cut it from the same sentence, it can carry more than the voice: bits of that sentence's own sounds, a small cheat sheet. In my app the voice always comes from another recording, so the fair test uses a stranger's voice. On Ukrainian, with the voice from the same sentence, LSCodec breaks 19% of sentences. With a stranger's voice, 26%. The headline 11× is measured with a stranger's voice. In the easy mode it is 12×, so the gap holds either way.

A voice sample cut from the same sentence drawn as a sheet of lines over that sentence's codes, labeled a cheat sheet
A voice sample cut from the same sentence can leak that sentence's sounds into the decoder.

The average trap. On 500 audiobook sentences in five languages (MLS), the average says LSCodec spoils 0.23 of the letters. Sentence by sentence, the picture is different: most lose a few letters, and 61 of 500 (12%) are wrecked, more than half of the letters gone. The distribution has two humps, one near 0 and one near 1: two different illnesses mixed into one number.

Histogram of delta CER per sentence with most sentences near zero and a tall separate stack near one labeled collapse
Most sentences lose a little. A separate group collapses completely.

October 14. The "long sentence disease" was high frequencies

I had known about this bug for months and called it the long sentence disease: after about 12 seconds, LSCodec gives up. My fix was to drop such clips from the dataset. Here is one of Lastivka's own training clips, 15 seconds of dialogue. After LSCodec, Whisper hears one word: "Завів."

Lastivka's training clip, Ukrainian dialogue, 15 seconds.

Original
LSCodec, no filter93% of the frames get the same code. Whisper: "Завів."
LSCodec after a 7 kHz low-pass filter

Then the careful measurement showed something odd. About 13% of ordinary audiobook clips 10 to 20 seconds long came back as "eh, eh, eh", and the broken ones were not longer than the healthy ones. Median length was 14.5 seconds in both groups. So the cause was not the length.

I lined up 69 broken clips and 73 healthy ones and went through the suspects: loudness, silence, clipping, hum, length. No difference, and fixing them did not help. The one difference I found: the broken clips had four times more energy above 6 kHz (0.012 against 0.003).

Two distributions of energy above 6 kHz, broken clips with a median of 1.3 percent and healthy clips with a median of 0.34 percent
69 broken and 73 healthy clips. The broken ones carry four times more energy above 6 kHz.

To check that this was the cause, I tested it from both sides:

  • The cure. Cut everything above 6 kHz before the codec. In a set of 59 broken clips, 4 stayed broken.
  • The provocation. Add a quiet hiss up there, 40 dB below full scale, to healthy clips. 26 of 73 (36%) collapsed.

The likely mechanism: LSCodec learned from LibriTTS audiobooks, which have very little energy in that band, and it normalizes each clip as a whole. A bright clip pushes those numbers out of the range the model knows, and the codec gets stuck on one code.

A 6 kHz cut also trims the edges of "s" and "sh", and English and French got worse (FLEURS ΔCER: English 0.44 to 0.50, French 0.62 to 0.68). A 7 kHz cut fixes the collapse almost as well, 59 broken clips down to 5, and does not hurt normal speech. Now all audio goes through that filter before LSCodec, including the LSCodec numbers in the test below.

A wireframe bin labeled 7,937 back in the dataset next to a low-pass filter curve at 7 kHz labeled zero dollars
For almost half a year I had been throwing away clips that one filter would have saved: 7,937 of them.

That cured one illness. The other, garbled words, cannot be fixed by a filter, only by training. So the plan was to retrain the codec on eight languages, about a month of work. Before starting, I stopped to check whether someone had already built it.

November 7. Twenty minutes of scouting instead of a month

I gave the question to an AI agent. It split the work between four helper agents, web only, no downloads: 63 searches, 258 pages, about 30 codecs published from 2024 to 2026. It took 17 minutes 47 seconds from the brief to the written report.

The first answer: none of the open, single-stream codecs at 25 Hz or lower is known to be trained on Ukrainian. The scout also found nobody measuring LSCodec outside English.

The second answer: Kanade. It is the same kind of model as LSCodec, with a few things that mattered for me:

  • MIT license for both the code and the weights;
  • the full training code, which LSCodec does not publish, so retraining LSCodec would mean rebuilding it;
  • a separate voice vector;
  • long recordings handled in pieces.

The scout also caught a mistake in my retraining plan. The multilingual teacher model I had picked, mHuBERT-147, has non-commercial weights (CC BY-NC-SA 4.0). Permissively licensed alternatives exist: XLS-R 300M (Apache-2.0) and w2v-BERT 2.0 (MIT).

November 8. The test: both codecs as published, 53 cents of GPU

The setup:

  • both codecs exactly as published, no training;
  • Whisper large-v3 before and after the codec, ΔCER as above;
  • a stranger's voice for the decoder;
  • about 100 sentences per slice: real recordings from FLEURS, plus test voices from a paid voice service for emotions and whispers, because there is no open Ukrainian corpus of those (used for evaluation only, never for training);
  • one handicap: Kanade ran without FlashAttention, which leaves dropout noise in its decoder at inference. If anything, its numbers here are a little worse than they should be. In a later run with the noise off, Kanade at 25 Hz scored 0.025 on Ukrainian instead of 0.032.

The run took 85 minutes on a Colab L4. The balance went from 100.35 to 95.08 compute units, which is $0.53. The paid test voices for this run cost about $1.84, more than the GPU.

To listen, another agent built me a test stand in 12 minutes: every phrase, every codec, one key each, switching codecs on the same second of audio without stopping the sound. Clips below use a stranger's voice unless marked otherwise. I picked phrases where the difference is easy to hear.

English, an excited line (test voice).

OriginalWhisper: "Hooray! You solved the problem correctly. That is just wonderful."
LSCodecWhisper: "Alrighty, he solved the problem through right play. She's just wonderful."
Kanade, 25 HzWhisper: "Hooray! You solved the problem correctly. That is just wonderful."

Spanish, a real FLEURS recording.

OriginalWhisper: "Con aproximadamente 800 habitantes, la ciudad del Vaticano es el país independiente más pequeño del mundo..."
LSCodecWhisper: "Con aproximadamente 200 habitantes, la ciudad de Raticala es el país más pequeño del mundo..."
Kanade, 25 HzWord for word, same as the original.

The next one is from Lastivka's own lessons: Ukrainian with English phrases inside, the kind of audio Gemma learns from.

Ukrainian and English, a Lastivka lesson (synthetic training voice).

Original
LSCodec"How much is it" becomes "hame chyzi".
Kanade, 25 HzThe whole lesson survives, English phrases included.
Three relief strips for the Lastivka lesson with words on top: original, LSCodec with wrong words in lilac, Kanade with the correct words
The same lesson as relief: the wrong words after LSCodec are marked in lilac.

French, a laughing line (test voice): "What a funny puppy in a hat!"

OriginalWhisper: "Quel chiot rigolo avec un chapeau !"
LSCodecWhisper: "Pfff, t'es un studi, goy, non, à te gosser, bouf !" Not a single word survives.
Kanade, 25 HzWhisper: "Quel sio rigolo avec un sapo !" The puppy and the hat come out a bit off, but the line is still clear.

The numbers. Seven languages, real FLEURS recordings, a stranger's voice. Read the table row by row: recordings differ between languages, so the rows are not comparable with each other, only the two codecs within one row.

Language LSCodec ΔCER (broken) Kanade 25 Hz ΔCER (broken) Kanade better by
English 0.40 (31%) 0.005 (0%) 80×
Spanish 0.12 (3%) 0.008 (0%) 16×
Ukrainian 0.37 (26%) 0.032 (0%) 11×
French 0.62 (70%) 0.088 (3%) 7.0×
German 0.19 (5%) 0.014 (0%) 14×
Polish 0.51 (50%) 0.027 (0%) 19×
Romanian 0.52 (54%) 0.048 (0%) 11×

"Broken" means a sentence lost more than half of its letters. Kanade breaks at most 3 sentences in 100 in any language, LSCodec more than half in some. With the voice from the same sentence (easy mode), emotions survive in both (emotion similarity on Ukrainian: 0.95 for Kanade, 0.93 for LSCodec), and Kanade keeps the melody of the voice better (pitch correlation 0.79 for Kanade against 0.62 for LSCodec).

Whispers. For whispers I use the easy mode, the voice from the same sentence. The reason is in the next paragraph. On Ukrainian whispers LSCodec breaks half of the sentences (ΔCER 0.50), Kanade adds 0.074.

Ukrainian whisper (test voice): "Тихенько, малюк уже заснув, тож говорімо пошепки."

Original
LSCodec, voice from the same sentenceWhisper: "Майкл уже заснив..." The baby turns into Michael.
Kanade, voice from the same sentence
Kanade, the same codes with a stranger's normal voiceKanade stops whispering and says the line out loud.

With a stranger's normal voice, Kanade no longer whispers. The whisper lives in the voice vector, and the codes carry only the words.

November 8. Voice apart from words

This is something LSCodec cannot do at all. Give Kanade a whispered voice sample, and any sentence comes out whispered with the words intact. In numbers, on Ukrainian: the share of voiced frames drops to 0.14 with Kanade (the whispered sample itself has 0.12), while LSCodec stays at 0.51 and keeps talking.

A normal Ukrainian sentence decoded with a whispered voice sample of the same speaker.

LSCodec
Kanade, 25 Hz
Kanade relief strips for the whispered sentence with its own whispered voice and with a stranger's normal voice
Same codes, two gloves: whispered and normal.

Voice swap. Codes from one voice, the glove from another. On Ukrainian, over 48 pairs, Kanade gets about one letter in a hundred wrong (CER 0.008 to 0.011), LSCodec about one in five (0.19 to 0.24).

Voice swap, Ukrainian, same gender.

Voice A, source of the codes
Voice B, sample for the glove
LSCodec: codes of A, voice of B
Kanade: codes of A, voice of B

Does the training voice leak? Gemma learns from one training voice, while the phone speaks with a different glove. With LSCodec I could hear the training voice coming through, but my ears are not a metric. So a separate speaker recognition model tried to guess the original voice from the output. On Ukrainian the pull toward the training voice is about three times weaker with Kanade (+0.012 against +0.034 in a same-gender lineup, +0.007 against +0.025 with the other gender). On English everything leaks, Kanade included: the original speaker is guessed 0.61 and 0.65 of the time, where chance is 0.33. My guess is accent, which the codes have to carry.

Pull toward the training voice in a Ukrainian same-gender lineup: LSCodec plus 0.034, Kanade plus 0.012
Pull toward the training voice, Ukrainian lineup. Zero would be pure chance.

Streaming, without retraining. Kanade decodes in 0.48 s chunks looking only 160 ms ahead, and the words come out the same as decoding the whole recording: CER 0.034 against 0.032 on 40 Ukrainian sentences.

November 8. A surprise inside Gemma's vocabulary

I thought Gemma had about a thousand free tokens, enough for LSCodec's 1,024 codes. It has 6,227 unused tokens. Kanade needs 12,800, so that is still 6,573 short. But 53,329 tokens of other writing systems never appear in my training texts (2.2 million tokens), not once. Those can be borrowed.

Gemma's vocabulary of 262,144 tokens as a field of dots with counts: 6,227 unused, 12,800 Kanade codes to fit, 6,573 short, 53,329 tokens of other scripts with zero uses
Gemma's 262,144 tokens, one dot each, in token order.

November 8 to 9. The phone, and a catch at 12.5 Hz

The demo that started it. In my recorded Lastivka demo on an iPhone 15 Pro (it is embedded in the Lastivka post), Gemma never reaches 25 tokens per second, which is what a 25 Hz codec needs for live speech. It starts at 23.2, drops to 14.3 and 13.6 when the phone heats up, and all 13 replies stay below 25. That was an older build. A newer, faster Gemma build does 33.4 tokens per second on its own.

The decoder on the phone. Kanade's decoder runs 100% on the Neural Engine. A window of about one second of audio takes under 5 ms: about 3 ms for the transformers, 0.8 ms for the Vocos vocoder, and under 1 ms for the inverse STFT on the CPU. LSCodec takes 7.7 ms for the same job. The GPU is not an option: it costs an extra gigabyte of memory.

A phone outline with a Neural Engine chip turning a row of codes into a waveform, labeled one second of speech in under 5 milliseconds
iPhone 15 Pro, Kanade decoder on the Neural Engine.

Next to Gemma. In a normal 90 second dialogue Kanade slows Gemma down by 2% at most. First sound arrives in 0.80 s at 25 Hz and 0.62 s at 12.5 Hz. On one long answer Gemma still dips below 25 codes per second, and at 25 Hz that leaves three gaps in the sound of about 650 ms each. At 12.5 Hz Kanade needs half the codes, so there are no gaps. It also uses 1.5 J per second of audio instead of 2.6, and the phone stays in its normal thermal state for 73 seconds instead of 35.

The stress test. Ninety seconds of nonstop talking. The phone heats up, and Gemma drops from about 33 to about 21 codes per second. At 25 Hz Kanade gets gaps of 10.5 and 6.3 seconds. LSCodec, tested on another day with Bluetooth headphones, breaks up too (2.3 seconds of gaps), so at 25 Hz both codecs hit the same wall: Gemma on a hot phone. At 12.5 Hz Gemma held 32.7 codes per second with no gaps in 90 seconds.

Line chart of codes per second over 90 seconds of nonstop talking on iPhone 15 Pro, with thresholds for 25 Hz and 12.5 Hz
90 seconds of nonstop talking. At 12.5 Hz Gemma stays near 33 codes per second, far above the 12.5 the codec needs.

Two caveats for all phone numbers. LSCodec and Kanade were measured on different days in different series, so small differences are noise. And in these tests the codes were fed in ready-made while Gemma generated ordinary tokens as the load: Gemma cannot speak Kanade codes yet.

The catch. Out of the box Kanade at 12.5 Hz speaks Ukrainian with an accent. I heard it, and Whisper agrees: ΔCER 0.223 against 0.025 at 25 Hz, about 9× worse.

So I fine-tuned it. The data was 26.2 hours: 19.2 hours of Ukrainian (FLEURS train plus three voices from opentts) and 7.0 hours of English from LibriTTS-R so it would not forget English. All 4,226 test sentences were excluded from training. I followed the authors' two-stage recipe, 20,000 steps and then 8,000 adversarial steps. The whole run took 8.67 hours on one Colab L4 including data prep and evaluation, $1.69.

FLEURS, Ukrainian, stranger's voice: "Ви також можете захотіти проконсультуватися з урядами інших країн..."

Original
Kanade 12.5 Hz, as publishedΔCER 0.33 on this sentence.
Kanade 12.5 Hz, after the fine-tuneΔCER 0.016.
Kanade 25 Hz, for referenceΔCER 0.0.

On Ukrainian, ΔCER went from 0.223 to about 0.06 (0.057 for the final checkpoint, which was chosen by the recipe in advance). The accent is mostly gone, though 25 Hz is still more than twice as good at 0.025. No sentence broke after 2,500 steps, and the curve was flat after about 5,000 steps, which points to the data as the limit. The cost of forgetting: English ΔCER rose slightly, from 0.025 to 0.038.

Relief strips for the Ukrainian sentence at 25 Hz, at 12.5 Hz with wrong words in lilac, and at 12.5 Hz after 20 hours of Ukrainian
100 FLEURS Ukrainian sentences: 12.5 Hz goes from 0.22 to 0.06, 25 Hz stays at 0.025.

Next: several languages in one run, and then Gemma learns to speak these codes.

The receipt

A receipt: Colab GPUs 13.62 compute units for tests 1.36 dollars and 16.9 compute units for the retrain 1.69 dollars, paid test voices 5.25 dollars, agents by subscription, total about 8.30 dollars
The whole comparison, retrain included.

GPUs came to about $3.05, of which $1.69 was the retrain. Most of the money went on the paid test voices, $5.25. Total: about $8.30. The agents ran on a subscription.

Method notes and caveats

  • Metric. Whisper large-v3 on the original and on the codec output, ΔCER per sentence, about 100 sentences per slice. A sentence counts as broken when ΔCER is above 0.5.
  • Comparisons. Within one language only.
  • Both codecs as published. No training before the comparison. Without FlashAttention, Kanade's results in the main test are probably slightly worse than it can do.
  • Fair mode by default. The voice sample comes from a different recording. Easy mode numbers are marked as such.
  • The phone. See the two caveats in the phone section.
  • The Lastivka demo. Words are lost by the whole chain, an undertrained Gemma plus LSCodec. The codec's own share is measured by the encode-decode test without Gemma.
  • LoRa. Arithmetic only, nothing was sent over a real radio.
  • Test voices. From a paid voice service, evaluation only.

Links

I build voice pipelines like this for companies. They run offline on a phone, in the client's language. If you need one, get in touch.

Credits. Speech samples from FLEURS (Google), CC BY 4.0. Other test voices were generated with a paid voice service for evaluation. Illustrations are frames from my video about this study.

Loading