GLM-TTS is a high-quality text-to-speech (TTS) synthesis system based on a large language model, supporting zero-shot voice cloning and streaming inference. The project is open-sourced by zai-org, and the official repository address is https://github.com/zai-org/GLM-TTS。
Purpose
GLM-TTS is used to convert text into natural, expressive speech, suitable for scenarios requiring speech synthesis, voice cloning, and emotional speech output.
Main Capabilities
- Zero-shot voice cloning: only 3-10 seconds of prompt audio are needed to clone any speaker's voice.
- RL-enhanced emotional control: achieves more natural emotional expression and prosody control through a multi-reward reinforcement learning framework.
- Streaming inference: supports real-time streaming audio generation, suitable for interactive applications.
- High-quality synthesis: generates natural and expressive speech, with quality comparable to commercial systems.
- Multilingual support: mainly supports Chinese, while also supporting mixed English text.
- Phoneme-level modeling: supports phoneme-level text-to-speech conversion.
- Flexible inference methods: supports multiple sampling strategies and inference modes.
System Architecture
GLM-TTS adopts a two-stage design: in the first stage, a large language model (LLM) based on the Llama architecture converts the input text into a sequence of speech tokens; in the second stage, a Flow Matching model converts these token sequences into high-quality mel spectrograms, and finally generates audio waveforms through a vocoder. The system achieves zero-shot voice cloning by extracting speaker features from prompt audio, without the need for fine-tuning for a specific speaker.
Fine-Grained Pronunciation Control (Phoneme-in)
For scenarios with high requirements for pronunciation accuracy, such as educational assessment and audiobooks, GLM-TTS introduces the Phoneme-in mechanism to solve the automatic pronunciation ambiguity problem of polyphonic characters (such as "行", which can be read as xíng or háng) and rare characters. This mechanism supports "mixed phoneme + text" input, enabling precise and targeted control over the pronunciation of specific words.
- Mixed training: during training, G2P (grapheme-to-phoneme) conversion is randomly applied to part of the text, forcing the model to adapt to mixed input sequences, thereby enhancing its generalization ability for phoneme input while retaining pure text understanding ability.
- Targeted inference: inference follows the workflow of G2P -> lookup table replacement -> mixed input: global conversion (obtain the complete phoneme sequence of the input text); dynamic replacement (use a "dynamic controllable dictionary" to automatically identify polyphonic or rare characters and replace them with specified target phonemes); mixed generation (combine the replaced phonemes with the original text as mixed input and feed it into GLM-TTS), thereby achieving precise pronunciation control over specific words while maintaining natural prosody.
Multi-Reward Reinforcement Learning
To address the problem of bland emotional expression in traditional TTS, GLM-TTS introduces a multi-reward reinforcement learning framework, through multiple reward functions (including similarity reward, CER reward, emotion reward, laughter reward, etc.) to comprehensively evaluate the generated speech, and use the GRPO (Group Relative Policy Optimization) algorithm to optimize the LLM's generation strategy.
- Multi-reward design: design multiple reward functions to evaluate the quality of generated speech from different dimensions such as audio quality, similarity, and emotional expression.
- Reward server: compute multiple reward functions through a distributed reward server, supporting parallel processing.
- Policy optimization: use the GRPO algorithm to optimize the LLM generation strategy based on reward signals, enhancing the emotional expressiveness of speech.
- Token-level reward: support fine-grained token-level reward assignment, providing more precise optimization signals. After RL optimization, GLM-TTS_RL reduces the CER metric from 1.03 to 0.89 compared with the base model, while maintaining high similarity and achieving better audio quality and expressiveness.
Core Components and Implementation
- LLM module: file location llm/glmtts.py, a text-to-speech model based on the Llama architecture, responsible for converting input text into speech token sequences, supporting pretraining (PRETRAIN), fine-tuning (SFT), and LoRA modes.
- Flow module: file location flow/ directory, with core files including dit.py (Diffusion Transformer implementation, supporting conditional generation) and flow.py (streaming inference support, enabling real-time audio generation), responsible for converting the token sequences generated by the LLM into high-quality mel spectrograms.
- Frontend module: file location cosyvoice/cli/frontend.py, responsible for preprocessing text and speech, including text normalization, phoneme conversion, speech token extraction, and speaker embedding extraction, supporting mixed Chinese-English text processing.
- Reinforcement learning module: file location grpo/ directory, with core files including grpo_utils.py (GRPO algorithm implementation and batch inference), reward_func.py (multi-reward function implementation), and reward_server.py (distributed reward server), optimizing the emotional expressiveness of the TTS system through multi-reward reinforcement learning.
Usage
Environment requirements: use Python 3.10 - Python 3.12. Need to obtain the CANN image. Pretrained model download: supports downloading the complete model weights from HuggingFace or ModelScope (including Tokenizer, LLM, Flow, Vocoder, and Frontend). Run inference demo: the repository provides inference scripts.
Evaluation Results
Evaluated on the seed-tts-eval zh test set. To remain consistent with the original evaluation, the --phoneme flag was not used during inference. CER is character error rate (lower is better), and SIM is similarity (higher is better).
Project Updates
- [2025.12.11] The project is officially open-sourced, including inference scripts and a series of model weights.
- [2025.12.17] The GLM-TTS technical report has been published on arXiv: 2512.14291.
- [Coming soon] 2D Vocos vocoder update in progress.
- [Coming soon] Reinforcement learning-optimized model weights.
Acknowledgements
The project thanks the following open-source projects for their support: CosyVoice (providing the frontend processing framework and high-quality vocoder), Llama (providing the base language model architecture), Vocos (providing a high-quality vocoder), and GRPO-Zero (inspiration for the reinforcement learning algorithm implementation).
Limitations
The materials do not provide specific information on pricing, cost, platform support scope, complete usage steps, or performance limits, so it is not provided for now.