Tiny NeuCodec
Lightweight and Fast Components for Speech Codec
3 min read
A set of lightweight encoders and decoders by Scicom-intl based on the 24 kHz speech codec neuphonic/neucodec (50 codes per second, 65,536 codebook values). The models read and write native NeuCodec codes, so components can be swapped individually—for instance, pairing a fast encoder with a standard decoder or vice versa without retraining the speech synthesis language model. In the encoders, the heavy w2v-BERT 2.0 is trimmed to its first 4 or 2 layers while retaining the convolutional branch, and a fine-tuned version along with a compact variant based on ConvNeXt blocks has been released for the decoders. This suite benefits developers of TTS services and voice cloning systems looking to reduce latency and VRAM usage.
Key features
- S4 and S2 encoders: 152M and 104M parameters compared to 636M in the original—encoding audio 2.2–2.3x faster on a GPU (45.8–47.2 ms for a 10-second clip) without losing voice cloning accuracy.
- Decoder decoder-finetuned: 184M parameters (same as base), fine-tuned on 347 hours of clean studio and public speech—sounds closer to the original recording at the same processing speed.
- Fast decoder-conv: 50M parameters based on ConvNeXt convolutional blocks—decodes 3–4.5x faster (2.2 ms versus 6.4 ms on batch size 1) while preserving original decoder quality.
- Memory savings: the
free_teacher=Trueflag unloads the source w2v-BERT from GPU memory, lowering total weight size from 3.1 GB to 1.3 GB (S4) or 1.1 GB (S2).
What you can do
- Accelerate voice cloning in TTS: plug in the
S4encoder alongside a language model trained on NeuCodec codes (already supported inTTS-API-Neucodecvia theVC_ENCODER=S4variable). - Lower audio generation latency: replace the standard decoder with
decoder-convfor real-time batch speech decoding (41.1 ms versus 173.3 ms on a batch of 32 clips). - Improve voice reconstruction accuracy: use
decoder-finetunedfor more precise timbre reproduction and fewer word errors (WER).
Example
import sys, librosa
from huggingface_hub import snapshot_download
from neucodec import NeuCodec
d = snapshot_download("Scicom-intl/Tiny-NeuCodec", allow_patterns=["tiny_encoder.py", "S4/*"])
sys.path.insert(0, d)
from tiny_encoder import load_tiny_encoder
codec = NeuCodec.from_pretrained("neuphonic/neucodec").eval().cuda()
encoder, _ = load_tiny_encoder(f"{d}/S4", codec, "cuda", free_teacher=True)
wav, _ = librosa.load("clip.wav", sr=16000)
codes = encoder.encode_code(wav)Read more
DetailsVoice cloning metrics via TTS LLM (194 references): WER of 8.5% for S4 and 9.0% for S2 versus 8.4% for NeuCodec; speaker similarity (WavLM) shows no significant deviation.
Decoder-finetuned quality on studio recordings: WER reduced from 3.8% to 1.3%, Log-mel distance from 0.661 to 0.433, predicted MOS increased from 2.844 to 3.054.
Requirements and limitations: encode strictly single clips without padding (it alters codes); tested only on clean speech (noise and overlapping voices were not evaluated); human blind listening tests (MOS) have not yet been conducted.










Comments