Spark-TTS
Spark-TTS: An Efficient LLM-Based Text-to-Speech Model with Single-Stream Decoupled Speech Tokens
Spark-TTS uses a single-stream speech codec to separate linguistic content and speaker attributes, enabling zero-shot voice cloning and fine-grained control with an LLM. It simplifies prior multi-stage pipelines and supports controllable speech synthesis via detailed attribute control.
Demos
The demos showcase Spark-TTS's advanced zero-shot voice cloning and controlled speech generation capabilities. Viewers should evaluate the naturalness, accuracy, and flexibility of voice replication in various languages, including code-switching scenarios. The control demos highlight how users can adjust speech parameters such as pitch, gender, and speaking rate, demonstrating the model's efficiency and versatility in producing diverse and high-quality synthetic voices with a single LLM-based system.
Links
Abstract
Recent advancements in large language models (LLMs) have driven significant progress in zero-shot text-to-speech (TTS) synthesis. However, existing foundation models rely on multi-stage processing or complex architectures for predicting multiple codebooks, limiting efficiency and integration flexibility. To overcome these challenges, we introduce Spark-TTS, a novel system powered by BiCodec, a single-stream speech codec that decomposes speech into two complementary token types: low-bitrate semantic tokens for linguistic content and fixed-length global tokens for speaker attributes. This disentangled representation, combined with the Qwen2.5 LLM and a chain-of-thought (CoT) generation approach, enables both coarse-grained control (e.g., gender, speaking style) and fine-grained adjustments (e.g., precise pitch values, speaking rate). To facilitate research in controllable TTS, we introduce VoxBox, a meticulously curated 100,000-hour dataset with comprehensive attribute annotations. Extensive experiments demonstrate that Spark-TTS not only achieves state-of-the-art zero-shot voice cloning but also generates highly customizable voices that surpass the limitations of reference-based synthesis. Source code, pre-trained models, and audio samples are available at https://github.com/SparkAudio/Spark-TTS.
Overview
Spark-TTS is a text-to-speech system that tries to make zero-shot and controllable TTS fit more naturally into the standard large language model (LLM) paradigm. The central design choice is to avoid the multi-stage pipelines and multi-stream code prediction strategies that dominate many current codec-based TTS systems. Instead, Spark-TTS uses a single-stream speech codec called BiCodec and then trains a decoder-only LLM, based on Qwen2.5-0.5B-Instruct, to predict the resulting speech tokens.
The paper’s core claim is that speech can be decomposed into two token types that are complementary rather than entangled: semantic tokens for linguistic content and global tokens for speaker-level attributes. This decomposition makes it possible to preserve the compactness and text-alignment benefits of semantic tokens while also giving the language model a handle on timbre-related control. In the final system, the BiCodec decoder reconstructs waveform audio directly from predicted tokens, so Spark-TTS does not need a separate flow-matching model or vocoder stage after token prediction.
Problem Setting and Main Motivation
The paper starts from three limitations in prior LLM-based TTS systems. First, many systems still require multi-stage processing, such as predicting semantic tokens with one model and acoustic features with another. Second, models that predict multiple codebooks often rely on parallel multi-stream architectures, which are structurally different from standard text LLMs and therefore harder to integrate and scale cleanly. Third, existing zero-shot TTS methods are often strong at voice cloning but weak at controllable voice creation, especially when the user wants a new voice specified by attributes rather than copied from a prompt recording.
Spark-TTS is designed to address these issues with a unified pipeline:
- a single-stream tokenizer that still separates content from speaker-level information;
- an LLM backbone that predicts speech tokens in an autoregressive way similar to text generation;
- a control mechanism that supports both coarse-grained labels and fine-grained numeric values for pitch and speaking rate;
- an open dataset, VoxBox, with attribute annotations to support reproducible research in controllable TTS.
BiCodec: Single-Stream Speech Tokenization with Semantic and Global Tokens
BiCodec is the paper’s most important technical contribution. It is a VQ-VAE-style codec with two tokenizers:
- Semantic Tokenizer: extracts low-bitrate semantic tokens at 50 tokens per second (TPS), intended to preserve linguistic content.
- Global Tokenizer: produces a fixed-length sequence of global tokens, intended to capture time-invariant information such as speaker identity and other global attributes.
The paper presents the codec as follows:
$$ \mathbf{z} = E_s(F(\mathbf{x})), \quad \mathbf{g} = E_g(\operatorname{Mel}(\mathbf{x})), $$
$$ \mathbf{g}_f = \operatorname{CrossAttention}(\mathbf{g}, \mathbf{h}), \quad \mathbf{z}_q = Q_s(\mathbf{z}), \quad \mathbf{g}_q = Q_g(\mathbf{g}_f), \quad \hat{\mathbf{x}} = G(\mathbf{z}_q, A_g(\mathbf{g}_q)). $$
Here, $F(\mathbf{x})$ is a pretrained wav2vec 2.0 feature extractor, $E_s$ and $E_g$ are the semantic and global encoders, $Q_s$ and $Q_g$ are the respective quantizers, $\mathbf{h}$ denotes learnable queries, $A_g$ aggregates the global tokens, and $G$ is the decoder that reconstructs the waveform.
Semantic Tokenizer
The semantic path uses wav2vec 2.0 features rather than raw waveform features directly. The authors state that they average features from the 11th, 14th, and 16th wav2vec 2.0 layers to form the semantic representation, motivated by prior observations that different layers correlate with different linguistic units. The semantic encoder and decoder are fully convolutional networks built from ConvNeXt blocks. The semantic quantizer uses a single-codebook VQ with a codebook size of 8192.
Compared with codecs that directly model acoustic waveforms, this choice is intended to strengthen semantic alignment and improve intelligibility at low bitrates.
Global Tokenizer
The global tokenizer operates on Mel spectrograms. Its encoder is based on ECAPA-TDNN following Wespeaker, and its output is transformed into a fixed-length sequence by a cross-attention mechanism with learnable queries. The global token path uses Finite Scalar Quantization rather than VQ, because the authors want to reduce the risk of VQ collapse for global attributes. In the reported implementation, the global token sequence length is set to 32, and the FSQ module has dimension 6 with 4 levels per dimension, giving a codebook size of 4096.
The paper explicitly argues that this is more expressive than the group-VQ-style approach used by TiCodec-like alternatives, because the learnable-query + FSQ formulation can produce a longer and more flexible global representation.
Codec Training Objective
BiCodec is trained end-to-end with an adversarial objective. The paper combines waveform reconstruction, multi-scale Mel reconstruction, discriminator-based feature matching, codebook and commitment losses for the VQ path, and a wav2vec 2.0 reconstruction loss to preserve semantic relevance. In words, the optimization includes:
- a GAN-style reconstruction objective;
- $L_1$ losses on multi-scale Mel spectrograms;
- multi-period and multi-band multi-scale STFT discriminators;
- VQ codebook and commitment losses;
- an auxiliary wav2vec 2.0 feature reconstruction loss after quantization.
There is also a stabilization trick for the global pathway: early in training, the decoder is not fed the quantized global embedding directly. Instead, the model first uses a teacher-student style update between the pooled pre-quantized global representation and the pooled quantized one. Once training stabilizes, this special treatment is removed.
BiCodec Architecture Details
The appendix gives the following practical settings: the semantic tokenizer uses 12 ConvNeXt blocks and 2 downsampling blocks when the semantic code rate is below 50 TPS; the semantic codebook size is 8192; the ECAPA-TDNN global encoder uses an embedding dimension of 512; and the decoder upsamples with transposed-convolution blocks. For 16 kHz audio, the transposed-convolution upsampling rates are [8, 5, 4, 2]. The paper also reports a 24 kHz variant with upsampling rates [8, 5, 4, 3].
Spark-TTS: LLM-Based Speech Prediction and Control
Spark-TTS keeps the language-model part intentionally close to a standard decoder-only text LLM. The backbone is Qwen2.5-0.5B-Instruct, fine-tuned to predict speech tokens. The key simplification relative to prior systems such as CosyVoice2 is that Spark-TTS does not use flow matching to generate acoustic features; the BiCodec decoder directly reconstructs audio from the predicted tokens.
Tokenization for the Language Model
The LLM uses three token domains:
- Text tokens: standard BPE tokens from the Qwen2.5 tokenizer, supporting multiple languages.
- Attribute tokens: coarse labels and fine-grained values for controllable voice creation.
- Speech tokens: global tokens and semantic tokens from BiCodec.
For attribute control, the paper defines two levels:
- Coarse-grained: categorical labels for gender, pitch level, and speed level.
- Fine-grained: numerical pitch and speed values, rounded to the nearest integer during tokenization.
The labels are discretized into five classes each. Pitch classes are derived from Mel-scale pitch statistics, separately for male and female speakers. Speed classes are derived from syllables per second, after voice activity detection removes silence at the edges.
Training Objectives for the LLM
The language model is trained with next-token prediction. For zero-shot TTS, the model minimizes
$$
\mathcal{L}_{\text{zst}} = -\sum_{t=1}^{T_o} \log p_\theta(o_t \mid \mathcal{T}, \mathcal{G}, o_{ where $\mathcal{T}$ is the tokenized text prompt, $\mathcal{G}$ is the global speech token prompt, and $o_t$ are the semantic tokens to be generated. For controllable voice creation, the model minimizes $$
\mathcal{L}_{\text{control}} = -\sum_{t=1}^{T_c} \log p_\theta(c_t \mid \mathcal{T}, \mathcal{A}, c_{ where $\mathcal{A}$ is the attribute-label prompt and the output sequence includes fine-grained values, global tokens, and semantic tokens. The paper mixes the two objectives during training by turning each audio example into two training samples: one for zero-shot TTS and one for attribute-conditioned control. The appendix describes two zero-shot inference strategies: The second strategy improves speaker similarity, and the main zero-shot numbers in the paper are reported with this prefix-based setup. For voice creation, Spark-TTS supports both: To support controllable TTS research, the paper introduces VoxBox, a large dataset assembled entirely from open-source corpora. The stated goal is not only scale, but also attribute-rich annotation and cleaner transcripts for training and evaluation. VoxBox covers both English and Chinese and includes speech from TTS-oriented corpora as well as emotional speech datasets, which broadens stylistic diversity. The final VoxBox statistics reported in the appendix are: The dataset is annotated with gender, pitch, and speed for all samples used in the main controllable TTS experiments. The appendix further states that VoxBox also contains age and emotion annotations for broader applicability. Gender is predicted using a WavLM-large classifier fine-tuned on datasets with explicit gender labels. The paper reports 99.4% accuracy on the AISHELL-3 test set. This classifier is then used to annotate corpora that do not already contain gender labels. Pitch is measured using PyWorld. The average pitch of each clip is rounded to the nearest integer for fine-grained pitch tokens. For coarse pitch labels, the authors convert pitch to the Mel scale and set five bins using percentile boundaries, separately for male and female speakers. Speed is computed using syllables per second after removing leading and trailing silence with VAD. The value is rounded to the nearest integer for fine-grained tokens. Five speed bins are also defined using percentile-based thresholds, separately for Chinese and English. Text cleaning is important in VoxBox. For Emilia, the authors re-run ASR with FunASR and discard clips whose transcript WER relative to the original script exceeds 0.05. For MLS-English, LibriSpeech, LibriTTS-R, and the emotion corpora, they use Whisper large-v3 and remove samples with insertions or deletions relative to the original scripts. The appendix reports an age classifier trained on WavLM-large, with five age groups: Child, Teenager, Young Adult, Middle-aged, and Elderly. On the AISHELL-3 test set, the paper reports 95.6% age accuracy and 99.4% gender accuracy. These extra annotations and predictors are not central to the main TTS experiments, but they show that VoxBox was designed as a richer speech resource than a minimal TTS-only corpus. The training setup is fairly simple given the size of the system: The paper evaluates two distinct aspects: reconstruction quality of BiCodec as a codec, and synthesis/control quality of Spark-TTS as a TTS system. On LibriSpeech test-clean, BiCodec is compared against a broad set of codecs and achieves the paper’s best low-bitrate performance in the under-1 kbps regime. The authors emphasize that BiCodec reaches 50 TPS and about 0.65 kbps while still improving reconstruction quality over other sub-1 kbps codecs. The authors’ interpretation is that BiCodec’s semantic tokens, extracted from wav2vec 2.0 features, give it stronger semantic alignment than waveform-first codecs. That helps it perform especially well on intelligibility-oriented metrics in the low-bitrate regime. The paper studies the global token sequence length on LibriSpeech test-clean. Longer global-token sequences improve quality, and length 32 is the best setting reported in the main table. The authors also compare their FSQ-based global tokenization against a group-VQ variant from Ren et al.; the learnable-query + FSQ design is consistently stronger. Spark-TTS is evaluated on three kinds of controllability: gender, coarse pitch/speed labels, and fine-grained pitch/speed values. On a restructured prompt set derived from PromptTTS, Spark-TTS is compared with VoxInstruct and Parler-TTS. The system achieves the highest gender accuracy by a clear margin: The paper does not report a single scalar table for pitch and speed control. Instead, it provides confusion matrices for coarse labels and scaling plots for fine-grained values. The qualitative conclusion is that Spark-TTS closely follows the specified pitch and speaking-rate targets in both Chinese and English, and for both male and female speakers. The main zero-shot evaluation follows Seed-TTS-eval on Chinese and English test sets. The reported metrics are Chinese CER and English WER, plus speaker similarity. Spark-TTS performs especially well on intelligibility, while similarity is somewhat lower than the strongest multi-stage or non-autoregressive systems. The paper’s interpretation is nuanced: Spark-TTS is not the absolute best on speaker similarity, but it is much stronger on intelligibility than prior one-stage autoregressive methods, and it does so with a much smaller model and less training data. The authors explicitly note that Spark-TTS uses 0.5B parameters and 100k hours of data, whereas Llasa-8B is much larger and is trained on 250k hours. The appendix compares zero-shot inference with and without the reference-text/semantic prefix. Removing the prefix improves CER/WER but reduces speaker similarity, which matches the intended trade-off between easier transcript prediction and voice cloning fidelity. The paper also compares mean opinion score prediction on generated speech. On LibriSpeech test-clean, Spark-TTS reaches a UTMOS of 4.35, compared with 4.09 for CosyVoice and 4.23 for CosyVoice2, while the ground truth reference is 4.08 in the table reported by the authors. This is used to argue that the generated speech is not only intelligible but also very high in perceived quality. Beyond the main LibriSpeech setting, the appendix evaluates BiCodec on several datasets with different recording conditions. The headline point is that the codec remains competitive on low-quality phone recordings, studio speech, and multilingual in-the-wild data. The paper reports that BiCodec either matches or exceeds X-codec2 on most metrics even when trained on only 3k hours, and the 24 kHz variant gives additional improvements in some settings. From a research-engineering perspective, Spark-TTS is interesting because it attacks the TTS problem at three different levels simultaneously: The paper argues that this design creates a practical middle ground between voice cloning and voice creation. Reference audio can still be used for zero-shot cloning, but the attribute prompts allow the model to synthesize new voices that are not tied to a prompt clip. In that sense, the system is not just a better codec-LLM; it is an attempt to make controllable voice generation more like structured language generation. The authors are explicit that Spark-TTS is not perfect. Their main limitation statement is that speaker similarity in zero-shot TTS is still lower than in multi-stage or non-autoregressive systems. They attribute this partly to the extra speaker variability introduced by the autoregressive language model during inference. They also point out that BiCodec does not yet impose extra disentanglement constraints between global tokens and semantic tokens. As future work, they suggest perturbing formants or pitch in the semantic-token input so that the decoder can achieve more absolute control over timbre and reduce randomness coming from the AR model. In other words, they see the current system as a strong step toward controllable TTS, but not yet the final answer for perfectly disentangled voice synthesis. Spark-TTS combines a semantically aligned single-stream codec with a decoder-only LLM to produce a TTS system that is both efficient and controllable. The paper’s strongest empirical claims are that BiCodec sets a new low-bitrate reconstruction benchmark, that Spark-TTS achieves strong zero-shot intelligibility on Seed-TTS-eval, and that it enables fine-grained control over pitch and speaking rate without abandoning the simplicity of a standard LLM stack. VoxBox is a substantial supporting contribution because it provides a large, cleaned, attribute-annotated open dataset for controllable speech synthesis research. This repository contains the official PyTorch implementation of the Spark-TTS system described in the paper. It is primarily focused on inference for zero-shot text-to-speech synthesis using LLM-based speech token prediction. The main inference logic is implemented in the Additionally, the repository provides a Web UI in The repo includes pre-trained model checkpoint downloading instructions and example scripts for batch synthetic audio generation. It targets efficient deployment and research on advanced controllable TTS synthesis powered by LLMs.Inference Modes
VoxBox: Dataset Construction and Annotation
Annotation Pipeline
Additional Attribute Predictors
VoxBox Composition Summary
Split
Utterances
Total duration
Notes
Chinese
25,373,406
47,627.15 h
29 open datasets, including AISHELL-3, Emilia-CN, MAGICDATA, WenetSpeech4TTS, and emotional corpora
English
22,332,806
54,873.11 h
29 open datasets, including LibriSpeech, MLS-English, Emilia-EN, VCTK, and multiple emotional corpora
Overall
47,706,212
102,500.26 h
Open-source and annotated for controllable TTS
Training Setup
Experimental Results
BiCodec Reconstruction Quality
Model
Codebook size
Nq
Token rate (TPS)
Bandwidth (bps)
STOI
PESQ NB
PESQ WB
UTMOS
SIM
Encodec 1024 8 600 6000 0.94 3.17 2.75 3.07 0.89 DAC 1024 12 600 6000 0.95 4.15 4.01 4.00 0.98 Encodec 1024 2 150 1500 0.84 1.94 1.56 1.58 0.60 Mimi 2048 8 100 1100 0.91 2.80 2.25 3.56 0.73 BigCodec 8192 1 80 1040 0.94 3.27 2.68 4.11 0.84 DAC 1024 2 100 1000 0.73 1.40 1.14 1.29 0.32 SpeechTokenizer 1024 2 100 1000 0.77 1.59 1.25 2.28 0.36 X-codec 1024 2 100 1000 0.86 2.88 2.33 4.21 0.72 WavTokenizer 4096 1 75 900 0.89 2.64 2.14 3.94 0.67 X-codec2 65536 1 50 800 0.92 3.04 2.43 4.13 0.82 StableCodec 15625 2 50 697 0.91 2.91 2.24 4.23 0.62 Single-Codec 8192 1 23.4 304 0.86 2.42 1.88 3.72 0.60 BiCodec 8192 1 50 650 0.92 3.13 2.51 4.18 0.80 Global Token Length and Quantization Ablation
Global token setting
STOI
PESQ NB
PESQ WB
UTMOS
SIM
w/o FSQ 0.915 3.14 2.52 4.15 0.83 gvq-32 0.912 2.91 2.30 4.06 0.74 8 0.916 3.04 2.41 4.16 0.74 16 0.919 3.08 2.45 4.15 0.77 32 0.922 3.13 2.51 4.18 0.80 Spark-TTS Control Abilities
Gender Control
Method
Gender accuracy
VoxInstruct 82.99% Parler-TTS 98.12% Spark-TTS 99.77% Pitch and Speed Control
Zero-Shot TTS Results
Model
test-zh CER
test-zh SIM
test-en WER
test-en SIM
Multi-stage or NAR methods Seed-TTS 1.12 0.796 2.25 0.762 FireRedTTS 1.51 0.635 3.82 0.460 MaskGCT 2.27 0.774 2.62 0.714 E2 TTS (32 NFE) 1.97 0.730 2.19 0.710 F5-TTS (32 NFE) 1.56 0.741 1.83 0.647 CosyVoice 3.63 0.723 4.29 0.609 CosyVoice2 1.45 0.748 2.57 0.652 One-stage AR methods Llasa-1B-250k 1.89 0.669 3.22 0.572 Llasa-3B-250k 1.60 0.675 3.14 0.579 Llasa-8B-250k 1.59 0.684 2.97 0.574 Spark-TTS 1.20 0.672 1.98 0.584 Reference Prefix Ablation
Model
test-zh CER
test-zh SIM
test-en WER
test-en SIM
Spark-TTS 1.20 0.678 1.98 0.584 Spark-TTS w/o prefix 0.98 0.628 1.32 0.474 Speech Quality on LibriSpeech Test-Clean
Method
UTMOS
GT 4.08 CosyVoice 4.09 CosyVoice2 4.23 Spark-TTS 4.35 Generalization of the Codec
Interpretation of the Contributions
Limitations
Bottom Line
Code & Implementation
cli/inference.py script, which loads a pre-trained Spark-TTS model (based on the Qwen2.5 LLM), runs text-to-speech generation conditioned optionally on prompt audio and text, and saves synthesized waveforms. The core model class SparkTTS is imported from cli/SparkTTS.py (not read in detail here) and encapsulates the BiCodec representation and single-stream token generation as proposed.webui.py built with Gradio, supporting interactive voice cloning by uploading or recording a prompt audio and controlled voice creation by adjusting parameters such as gender, pitch, and speed. This UI internally calls the same SparkTTS inference logic.