Akapulu Labs logo Akapulu Labs Research

CosyEdit2

CosyEdit2: Speech-Editing-Oriented Reinforcement Learning Unlocks Better Zero-Shot TTS

CosyEdit2 — method overview

A speech editing model leveraging editing-oriented reinforcement learning to overcome supervised fine-tuning limitations. The approach achieves stronger acoustic preservation while unlocking improved zero-shot TTS, revealing a bidirectional relationship between the two tasks.

  • tts
  • speech-to-speech
  • rlhf
  • prosody
  • asr
  • voice-conversion

Authors: Junyang Chen, Yuhang Jia, Hui Wang, Jiaming Zhou, Yongchang Gan, Yong Qin

Categories: cs.SD

Published 2026-05-25 · Updated 2026-05-26

Abstract

Speech editing and zero-shot Text-to-Speech (TTS) share a similar generative foundation conditioned on speech prompts, yet speech editing demands far stricter local acoustic consistency with surrounding unedited content. While prior work has shown that Supervised Fine-Tuning (SFT) enables TTS models to acquire functional editing capability, this approach remains fundamentally bottlenecked by imperfect paired editing data and coarse-grained optimization signals. To address these limitations, we propose CosyEdit2, a speech editing model built on a two-stage post-training framework that progresses from supervised editing initialization to editing-oriented Group Relative Policy Optimization (GRPO) over target-speech-free data. Extensive experiments demonstrate that CosyEdit2 not only substantially advances speech editing performance, but also unlocks better zero-shot TTS capability, revealing a deeper mutual relationship between the two tasks. Audio samples are available at https://cjy1018.github.io/CosyEdit2.


Introduction and Motivation

Speech editing and zero-shot Text-to-Speech (TTS) are closely related tasks: both generate speech conditioned on a spoken prompt, but they differ fundamentally in what must be preserved. Zero-shot TTS prioritizes rendering a target transcript in a target speaker's voice; speech editing goes further, demanding that the synthesized segment integrate seamlessly into the surrounding, unedited recording in terms of speaker timbre, prosody, background noise, reverberation, and every other acoustic detail. The edited clip must be imperceptible as a modification.

Prior work addressed speech editing through two paradigms. Cascaded systems (e.g., FluentSpeech, VoiceCraft, SSR-Speech) first obtain forced-alignment word/phoneme timestamps, then synthesize or infill the target region. They are accurate but require complex pre-processing and are sensitive to alignment errors. End-to-end models (e.g., Ming-UniAudio, CosyEdit) internalize alignment in a unified speech-language model and offer lower engineering complexity, but their preservation of unedited regions has been limited.

A key bottleneck shared by all prior end-to-end approaches is Supervised Fine-Tuning (SFT). SFT relies on manually constructed paired recordings whose edit boundaries and acoustic conditions are inevitably imperfect. Moreover, SFT optimizes a token-level reconstruction loss that treats edited and unedited tokens equally, providing no fine-grained distinction between content correctness and acoustic preservation. The result is a hard preservation–accuracy trade-off that defines the ceiling of SFT-based methods.

CosyEdit2 addresses these limitations with a two-stage post-training framework:

  • Stage 1 (SFT initialization): Supervised adaptation of the CosyVoice2 backbone — separately for the language model (LLM), the flow-matching acoustic model, and a newly trained BigVGAN vocoder — to establish a functional editing capability.
  • Stage 2 (GRPO elicitation): Editing-oriented Group Relative Policy Optimization (GRPO) that replaces imperfect paired supervision with reward-driven fine-grained optimization over target-speech-free data, updating only the LLM while the acoustic backend stays frozen.

Crucially, the paper demonstrates that training on speech editing with GRPO also substantially improves zero-shot TTS across multiple languages and difficulty levels — revealing a deep bidirectional connection between the two tasks.

Architecture

Overview of CosyEdit2. The model reformulates CosyVoice2 for speech editing by conditioning the text-speech language model on original text, target text, and original speech tokens, generating target speech tokens that are decoded by a GOT-CFM Flow and BigVGAN vocoder. The right panel shows the two-stage adaptation: supervised adaptation of LLM, Flow, and BigVGAN respectively, followed by GRPO updating only the LLM.
Overview of CosyEdit2. The model reformulates CosyVoice2 for speech editing by conditioning the text-speech language model on original text, target text, and original speech tokens, generating target speech tokens that are decoded by a GOT-CFM Flow and BigVGAN vocoder. The right panel shows the two-stage adaptation: supervised adaptation of LLM, Flow, and BigVGAN respectively, followed by GRPO updating only the LLM.

CosyEdit2 is built on the CosyVoice2 architecture, which is a modular pipeline consisting of:

Text Tokenizer

Two identical BPE-based text tokenizers separately encode the original text $X_{\mathrm{ori}}$ and the target text $X_{\mathrm{tar}}$. Following CosyVoice2, no explicit phoneme front-end is used; pronunciation patterns are learned end-to-end from the contrast between the two token streams, which are sequentially concatenated as the LLM input. This explicit separation lets the model learn edit operations implicitly from the textual diff.

Speech Tokenizer

An ASR-oriented encoder with Finite Scalar Quantization (FSQ) extracts low-frame-rate discrete semantic speech tokens from waveforms. The original speech $Y_{\mathrm{ori}}$ is tokenized as part of the editing condition $\mu_{\mathrm{ori}}$, while during SFT the target speech $Y_{\mathrm{tar}}$ is tokenized as the prediction target $\mu_{\mathrm{tar}}$.

Autoregressive Text-Speech Language Model

The backbone LLM is Qwen2.5-0.5B, extended to jointly handle text and speech tokens. The input sequence for CosyEdit2 is organized as: $$[\circledS,\ X_{\mathrm{ori}},\ X_{\mathrm{tar}},\ \mu_{\mathrm{ori}},\ \circledT]$$ where $\circledS$ is a start-of-sequence token and $\circledT$ is a turn-of-speech separator. The model then autoregressively predicts $\mu_{\mathrm{tar}}$ until an end-of-sequence token $\circledE$ is emitted. During GRPO, only this LLM is updated.

Conditional Flow-Matching Model (GOT-CFM)

The Flow module converts semantic tokens into Mel spectrograms. CosyEdit2 adopts the Guided Optimal-Transport Conditional Flow Matching (GOT-CFM) formulation from CosyEdit, where the complete original speech tokens and the original Mel spectrogram are used as global acoustic conditions. Specifically:

Let $M_{\mathrm{ori}}$ and $M_{\mathrm{tar}}$ be the Mel spectrograms of the original and target speech. The prior and data samples are concatenated: $$Z_0 = [M_{\mathrm{ori}}^{0}, M_{\mathrm{tar}}^{0}], \qquad Z_1 = [M_{\mathrm{ori}}, M_{\mathrm{tar}}]$$ The OT interpolation path is: $$\phi_t^{\mathrm{OT}}(Z_0, Z_1) = (1-t)Z_0 + tZ_1$$ with target vector field $\omega_t = Z_1 - Z_0$. The Flow network predicts: $$\nu_t = \operatorname{UNet}_\theta\!\left(\phi_t^{\mathrm{OT}}(Z_0,Z_1),\, t;\; \mathbf{v},\, \mu_z,\, [M_{\mathrm{ori}}, \tilde{M}_{\mathrm{tar}}]\right)$$ where $\mathbf{v}$ is the speaker embedding, $\mu_z = [\mu_{\mathrm{ori}}, \mu_{\mathrm{tar}}]$ are up-sampled concatenated speech tokens, and $\tilde{M}_{\mathrm{tar}}$ is the masked target Mel spectrogram. The training objective is: $$\mathcal{L}_{\mathrm{GOT\text{-}CFM}} = \mathbb{E}_{t,Z_0,Z_1}\left[\left\|\omega_t - \nu_t\right\|_1\right]$$

By conditioning on the full original speech at the Mel level, the Flow module is exposed to leading/trailing silence, background noise, and other unedited acoustic context, substantially helping preservation.

BigVGAN Vocoder

CosyVoice2 uses a HiFT-GAN vocoder, which is a clean-mel-oriented fast frequency-domain variant. CosyEdit2 replaces it with BigVGAN, a GAN-based universal vocoder with periodic activation functions and anti-aliased representations designed for high-fidelity waveform generation under diverse acoustic conditions. The BigVGAN is initialized from the closest available checkpoint (bigvgan_v2_22khz_80band_256x) and adapted to match CosyVoice2's 24 kHz, 80-band, hop-size-480 configuration. This reuses 88.20% of the generator parameters while the discriminator is fully reused. It is then trained on a 625-hour mixture corpus containing LibriTTS, LibriTTS-R (clean speech), and YODAS2 (in-the-wild YouTube speech), exposing the vocoder to both studio-quality and complex acoustic conditions.

Mel spectrogram visualization of a speech sample reconstructed by HiFT-GAN from CosyVoice2 and our trained BigVGAN, with a zoomed-in view of harmonic components.
Mel spectrogram visualization of a speech sample reconstructed by HiFT-GAN from CosyVoice2 and our trained BigVGAN, with a zoomed-in view of harmonic components. BigVGAN reconstructs sharper, more clearly delineated harmonic components — especially on challenging samples with background music and ambient noise.

Two-Stage Post-Training Framework

Stage 1: Supervised Adaptation

LLM SFT

The LLM is trained on the 250-hour GigaEdit-S dataset (derived from GigaSpeech-S) with standard next-token prediction: $$\mathcal{L}_{\mathrm{LM}} = -\frac{1}{T_{\mathrm{tar}}+1} \sum_{t=1}^{T_{\mathrm{tar}}+1} \log p_\theta\!\left(\bar{\mu}_{\mathrm{tar},t} \mid c, \bar{\mu}_{\mathrm{tar},

Flow SFT

The Flow module is also fine-tuned on GigaEdit-S using the GOT-CFM objective, initialized from the CosyVoice2 checkpoint, with constant learning rate $3\times10^{-5}$ for 9 epochs.

BigVGAN Training

BigVGAN is trained for 460k steps on 625 hours of mixed data: 585 hours from LibriTTS + LibriTTS-R and 40 hours from YODAS2. Training from the adapted checkpoint is far shorter than the 5M-step official pretraining, benefiting from transferred parameters.

Stage 2: Editing-Oriented GRPO

TTS-to-Edit Prompt Construction

TTS-to-Edit Prompt Construction.
TTS-to-Edit Prompt Construction. Any speech-transcription pair from a TTS corpus can be converted into an editing prompt via rule-based textual perturbations, eliminating the need for manually constructed target recordings.

GRPO does not require any manually constructed target recordings. Instead, any TTS corpus with speech-transcription pairs is converted into editing prompts:

  • Given $Y_{\mathrm{ori}}$ and its transcription $X_{\mathrm{ori}}$, a target text $X_{\mathrm{tar}}$ is synthesized by applying rule-based NLP perturbations.
  • Five perturbation types are used: insertion and substitution via masked language modeling with RoBERTa, deletion via random word removal, swap via word reordering, and multi-edit via sequential combinations.
  • The maximum number of editable spans is constrained: $N_{\mathrm{edit}} \le \max(1, \lfloor |X_{\mathrm{ori}}| / 2 \rfloor)$.
  • The resulting triplet $(X_{\mathrm{ori}}, X_{\mathrm{tar}}, Y_{\mathrm{ori}})$ defines the editing prompt.

Only 3,000 utterances from GigaSpeech-XL are used, reflecting the efficiency of this approach. WhisperX with large-v3-turbo is used for auxiliary forced alignment to identify non-edited regions $\Omega$ for MCD reward computation.

Examples of rule-based edit perturbations used in the TTS-to-edit prompt synthesis pipeline, including insertion, deletion, substitution, swap, and multi-edit operations.
Examples of rule-based edit perturbations used in the TTS-to-Edit prompt synthesis pipeline, including insertion, deletion, substitution, swap, and multi-edit operations.

Editing-Oriented Reward Design

Reward functions used in the editing-oriented GRPO stage. (a) WER reward: exponential decay with power-law exponent. (b) Speaker similarity reward: cosine similarity. (c) MCD reward: tolerance margin before exponential decay.
Reward functions used in the editing-oriented GRPO stage. (a) The WER reward adopts an exponential decay with a power-law exponent, sharply penalizing high recognition errors while providing finer discrimination in the low-WER region. (b) The speaker similarity reward directly uses cosine similarity. (c) The MCD reward introduces a tolerance margin $\delta$ before exponential decay, focusing optimization on preventing severe acoustic degradation in unedited regions.

For each editing prompt $c = (X_{\mathrm{ori}}, X_{\mathrm{tar}}, Y_{\mathrm{ori}})$, the policy samples a group of $G$ candidate token sequences $\{Z_i\}_{i=1}^G$, decoded by frozen Flow and BigVGAN into waveforms $\{\hat{Y}_{\mathrm{tar}}^i\}_{i=1}^G$. Three complementary rewards are designed:

Content Reward (WER):

$$w_i = \operatorname{WER}\!\left(X_{\mathrm{tar}},\, \operatorname{ASR}(\hat{Y}_{\mathrm{tar}}^i)\right)$$ $$r_i^{\mathrm{wer}} = \exp\!\left(-k_w \cdot w_i^{\alpha}\right)$$ The exponential decay with power-law exponent $\alpha$ sharply suppresses high-WER samples while providing finer discrimination in the low-WER region, stabilizing early training.

Speaker Consistency Reward:

$$r_i^{\mathrm{sim}} = s_i = \frac{\mathbf{Emb}(Y_{\mathrm{ori}})^\top \mathbf{Emb}(\hat{Y}_{\mathrm{tar}}^i)}{\|\mathbf{Emb}(Y_{\mathrm{ori}})\|_2\, \|\mathbf{Emb}(\hat{Y}_{\mathrm{tar}}^i)\|_2}$$ Cosine similarity is used directly without nonlinear transformation since it already lies in $[0,1]$.

Acoustic Preservation Reward (MCD on unedited regions):

Let $\Omega$ denote the non-edited regions shared by the original and generated speech. DTW alignment is used to handle boundary imprecision: $$m_i = \operatorname{MCD}\!\left(\operatorname{DTW}\!\left(Y_{\mathrm{ori}}^\Omega,\, \hat{Y}_{\mathrm{tar}}^{i,\Omega}\right)\right)$$ $$r_i^{\mathrm{mcd}} = \exp\!\left(-k_m \cdot \max(m_i - \delta, 0)\right)$$ A tolerance margin $\delta$ prevents over-penalizing perceptually negligible differences, focusing on severe acoustic degradation.

Priority-aware Reward Composition:

The rewards are composed in a coarse-to-fine, priority-aware hierarchy. WER serves as a content gate; given comparable correctness, MCD selects for acoustic preservation; speaker similarity then ranks remaining candidates: $$r_i^{\mathrm{wer\text{-}mcd}} = r_i^{\mathrm{wer}} \left[(1-\gamma) + \gamma r_i^{\mathrm{mcd}}\right]$$ $$r_i = \lambda_{\mathrm{c}}\, r_i^{\mathrm{wer\text{-}mcd}} + \lambda_{\mathrm{s}}\, r_i^{\mathrm{sim}}, \qquad \lambda_{\mathrm{c}} + \lambda_{\mathrm{s}} = 1$$ The weights are dynamically scheduled: $(\lambda_{\mathrm{c}}, \lambda_{\mathrm{s}}) = (0.9, 0.1)$ for the first 290 steps (emphasizing content), and $(0.8, 0.2)$ for the last 90 steps (strengthening speaker consistency). Hyperparameters: $k_w = 12$, $\alpha = 1.5$, $k_m = 0.2$, $\delta = 2$, $\gamma = 0.5$.

GRPO Objective

An overview of the editing-oriented GRPO.
An overview of the editing-oriented GRPO. Rewards are computed from decoded waveforms; the Flow and BigVGAN modules are used only for rollout decoding while gradients are applied solely to the LLM.

Group-relative advantages normalize rewards within the sampled group: $$\hat{A}_i = \frac{r_i - \mu_r}{\sigma_r + \epsilon}, \qquad \mu_r = \frac{1}{G}\sum_{j=1}^G r_j$$ The GRPO objective with PPO-style clipping and KL regularization is: $$\mathcal{J}_{\mathrm{GRPO}}(\theta) = \mathbb{E}\!\left[\frac{1}{G}\sum_{i=1}^G \frac{1}{T_i}\sum_{t=1}^{T_i} \min\!\left[\rho_{i,t}(\theta)\hat{A}_i,\; \operatorname{clip}(\rho_{i,t}(\theta), 1\pm\epsilon_c)\hat{A}_i\right] - \beta D_{\mathrm{KL}}\!\left(\pi_\theta \,\|\, \pi_{\mathrm{ref}}\right)\right]$$ where the importance ratio is: $$\rho_{i,t}(\theta) = \frac{\pi_\theta(z_{i,t} \mid c, z_{i,

GRPO training uses $G=4$ rollouts per prompt, 380 steps, learning rate $3\times10^{-6}$, KL coefficient 0.001, batch size 64, temperature 0.8, top-$p=0.95$, top-$k=25$, on two NVIDIA H800 GPUs.

Unified Perspective: Speech Editing as Generalized TTS

The paper formalizes a unified conditional speech generation view. Zero-shot TTS — given prompt $Y_{\mathrm{p}}$ and target text $X_{\mathrm{tar}}$, generate $\hat{Y}_{\mathrm{tar}}$ preserving speaker identity — is a special case of speech editing where the entire content is replaced (full-tail insertion or complete replacement). Speech editing is the localized variant: only the specified region changes; everything else must stay consistent with the original recording.

Spectrogram comparison between zero-shot TTS and speech editing. The region between the two red vertical lines indicates the edited segment. The left column illustrates a substitution task, the right an insertion task.
Spectrogram comparison between zero-shot TTS and CosyEdit2 speech editing. The region between the two red vertical lines indicates the edited segment. Left column (a–c): substitution task — zero-shot TTS output (b) shows clear temporal misalignment in non-edited regions; CosyEdit2 (c) preserves them faithfully. Right column (d–f): insertion task — zero-shot TTS output (e) degrades high-frequency preservation; CosyEdit2 (f) maintains spectral detail.

Under this view, editing-oriented GRPO inherently strengthens the core in-context learning capability shared by both tasks: understanding contextual conditions, preserving speaker acoustic cues, and generating speech faithful to the text. This explains why improvements in editing transfer to zero-shot TTS.

Inference Pipelines

The modular architecture enables two inference configurations:

  • Speech editing: Uses the GRPO-optimized LLM + Stage-1 Flow + BigVGAN. Preserves the full acoustic condition including background noise.
  • Zero-shot TTS: Uses the GRPO-optimized LLM + original CosyVoice2 Flow and HiFT-GAN (unchanged). This isolates the LLM's GRPO effect from any acoustic backend change, since the target for TTS is clean output rather than acoustic preservation.

Experiments: Speech Editing

Benchmarks and Metrics

Ming-Freeform-Audio-Edit covers insertion, deletion, and substitution across English and Chinese basic/full subsets. Metrics include WER (content accuracy), speaker similarity (SS), DNSMOS (perceptual quality), and — crucially — $\mathrm{MAE}_{\mathrm{DNSMOS}}$ between generated and original speech to detect acoustic normalization artifacts. A lower MAE is better, indicating the generated speech matches the original acoustic quality rather than generating unrealistically clean output.

Baselines

VoiceCraft-X (multilingual cascaded), SSR-Speech (monolingual cascaded), Ming-UniAudio (large-scale end-to-end), CosyEdit (SFT-based end-to-end), VoiceCraft, LEMAS-Edit, ECPA (GRPO-based cascaded).

English Subset Results

Performance on the English subset of Ming-Freeform-Audio-Edit (basic | full splits). MAE = MAE_DNSMOS; lower is better.
Edit TypeModelWER↓ (basic|full)SS↑ (basic|full)MAE↓ (basic|full)
InsertionVoiceCraft-X5.74 | 6.270.85 | 0.840.166 | 0.162
SSR-Speech1.75 | 2.030.94 | 0.940.139 | 0.128
Ming-UniAudio6.49 | 7.840.80 | 0.800.168 | 0.167
CosyEdit21.90 | 1.930.93 | 0.930.107 | 0.108
DeletionVoiceCraft-X9.71 | 10.650.80 | 0.800.172 | 0.173
SSR-Speech5.22 | 5.290.91 | 0.910.132 | 0.134
Ming-UniAudio14.79 | 24.370.77 | 0.750.206 | 0.204
CosyEdit25.52 | 5.830.90 | 0.900.131 | 0.131
SubstitutionVoiceCraft-X7.29 | 6.730.81 | 0.810.155 | 0.146
SSR-Speech1.90 | 1.950.89 | 0.900.146 | 0.140
Ming-UniAudio8.10 | 7.950.77 | 0.770.166 | 0.178
CosyEdit21.43 | 1.520.89 | 0.900.137 | 0.132

CosyEdit2 achieves the lowest $\mathrm{MAE}_{\mathrm{DNSMOS}}$ across all edit types — the key differentiator. For substitution it achieves the lowest WER overall. For insertion it approaches SSR-Speech in WER/SS while substantially improving acoustic consistency. For deletion, SSR-Speech slightly leads in WER/SS (benefiting from explicit alignment), but CosyEdit2 achieves the best acoustic preservation without any alignment preprocessing.

Chinese Subset Results

CosyEdit2 substantially outperforms all multilingual baselines (VoiceCraft-X, LEMAS-Edit, Ming-UniAudio) on WER and SS across all edit types on the Chinese subset, reducing WER to ~1–1.4% for insertion and substitution. This demonstrates cross-lingual generalization despite GRPO training being conducted only on English data.

RealEdit Results

RealEdit is a 310-sample in-the-wild benchmark with complex acoustic conditions.

Results on RealEdit. Dashed line separates cascaded (above) from end-to-end (below) systems. MOS = MOSNet; MAE = MAE_MOSNet.
MethodWER↓SS↑MCD↓MOSMAE↓
Ground Truth6.063.34
FluentSpeech5.9792.742.720.78
VoiceCraft6.5597.123.180.24
SSR-Speech5.0598.313.320.14
Ming-UniAudio9.9896.705.363.130.33
CosyEdit4.5097.344.943.190.29
CosyEdit24.3197.913.933.210.25

CosyEdit2 achieves the lowest WER among all systems and the best MCD on unedited regions (3.93 vs. 4.94 for CosyEdit), demonstrating genuine acoustic preservation improvements. The higher WER of CosyEdit2 compared with CosyVoice2 is attributed to ASR errors caused by preserved background noise — not semantic editing errors.

Ablation Study

Ablation results for CosyEdit2 on RealEdit. GT = Ground Truth. MAE = MAE_DNSMOS. LLM strategy (SFT vs. GRPO), Flow fine-tuning, and BigVGAN are ablated independently.
MethodLLMFlowBigVGANWER↓SS↑MCD↓DNSMOSMAE↓
GT6.063.03
CosyVoice2×××4.1496.656.683.280.275
CosyEdit2SFT××5.8397.055.823.200.207
CosyEdit2GRPO××4.7197.235.503.200.210
CosyEdit2GRPO×4.3497.794.073.070.134
CosyEdit2GRPO×4.6997.275.423.210.208
CosyEdit2 (full)GRPO4.3197.913.933.040.131

Key findings from the ablation:

  • CosyVoice2 baseline: Achieves the best WER (4.14) but extremely poor acoustic preservation (MCD 6.68, MAE 0.275). Zero-shot TTS generates clean studio-like audio regardless of in-the-wild input conditions.
  • SFT alone: Improves SS and MCD over CosyVoice2 but dramatically increases WER from 4.14 to 5.83 — the classic SFT preservation–accuracy trade-off under imperfect supervision.
  • GRPO (LLM only): Breaks the trade-off, reducing WER from 5.83 to 4.71 while improving SS (97.23) and MCD (5.50).
  • GRPO + Flow: The single largest preservation gain — MCD drops from 5.50 to 4.07, MAE from 0.210 to 0.134. The acoustic-conditioned flow matching is essential.
  • GRPO + BigVGAN (without Flow): Modest improvement over GRPO-only, showing BigVGAN helps waveform reconstruction.
  • Full CosyEdit2 (GRPO + Flow + BigVGAN): Best SS (97.91), best MCD (3.93), best MAE (0.131).

Experiments: Zero-Shot TTS

Benchmarks and Baselines

Evaluated on CV3-EVAL (derived from CosyVoice3 evaluation suite) covering multilingual voice cloning, hard samples (tongue-twisters, repeated words, long utterances), and cross-lingual voice cloning. VAD-based trimming is applied to prompt speech to remove leading/trailing non-speech. Also evaluated on SEED-TTS-EVAL (English and Chinese). Baselines include VoiceCraft-X, SSR-Speech, CosyEdit, and CosyVoice2 (same backbone).

Multilingual Voice Cloning (CV3-EVAL)

CER(%) and WER(%) on CV3-Eval Multilingual Voice Cloning subset.
Modelzhenjako
VoiceCraft-X9.7419.1723.0043.15
SSR-Speech14.08
CosyEdit5.297.2217.319.25
CosyVoice23.775.457.766.89
CosyEdit23.524.876.165.14

CosyEdit2 improves over the CosyVoice2 baseline in every language, with especially clear gains in Japanese (7.76 → 6.16) and Korean (6.89 → 5.14).

Hard Samples (CV3-EVAL)

CV3-Eval Hard Subset. w/o GRPO = Stage 1 SFT model only.
Modelhard-zh CER↓hard-zh SS↑hard-en WER↓hard-en SS↑
CosyVoice215.7074.968.1167.22
CosyEdit2 w/o GRPO13.1775.1711.9967.24
CosyEdit28.0675.865.9367.32

GRPO is the primary driver: without GRPO, hard-zh CER is 13.17 (barely better than CosyVoice2); with GRPO, it drops to 8.06. Hard-en WER drops from 11.99 (SFT-only) to 5.93 (GRPO). These improvements on tongue-twisters and repeated/lengthy utterances reflect substantially reduced omissions, insertions, and mispronunciations.

Cross-Lingual Voice Cloning (CV3-EVAL)

CosyEdit2 outperforms all baselines across all target-prompt language pairs (to-zh, to-en, to-ja, to-ko), with especially large improvements over CosyVoice2 in cross-lingual scenarios (e.g., to-zh from en-prompt: 13.15 → 7.16; to-en from zh-prompt: 6.02 → 5.07).

SEED-TTS-EVAL Results

CER(%), WER(%), and Speaker Similarity (SS, %) on SEED-TTS-EVAL.
Modeltest-zh CER↓test-zh SS↑test-en WER↓test-en SS↑
CosyVoice21.3675.13.1065.7
CosyEdit21.1675.21.9564.3

Despite training GRPO only on English editing prompts, CosyEdit2 reduces Chinese CER (1.36 → 1.16) and English WER (3.10 → 1.95) with speaker similarity well preserved. The improvement is not language-specific.

Additional Analyses

Vocoder Reconstruction Experiment

To isolate the vocoder effect, Mel spectrograms extracted directly from source waveforms are reconstructed using HiFT-GAN and BigVGAN. Evaluated on the VoiceBank-DEMAND test set (both clean and noisy subsets):

Vocoder reconstruction quality on VoiceBank-DEMAND.
SourceVocoderMR-STFT↓PESQ↑STOI↑ESTOI↑MCD↓MAE_DNSMOS↓
CleanHiFT-GAN1.2153.4750.9740.9201.6310.063
CleanBigVGAN1.1383.6680.9800.9361.3100.056
NoisyHiFT-GAN1.4903.0190.9330.8591.9880.115
NoisyBigVGAN1.4383.1850.9450.8811.6300.114

BigVGAN improves all metrics on both clean and noisy subsets, with particularly clear reductions in MCD — indicating more faithful spectral reconstruction.

Speech Preservation Evaluation

An identity-editing experiment (target text = original text) on RealEdit directly measures acoustic preservation ability without confounding content changes. Models not trained on identity pairs are zero-shot tested:

Speaker similarity (SS, %) and MCD on identity-editing (preservation) evaluation over RealEdit. † = oracle vocoder upper bound.
MethodSS↑MCD↓
HiFT-GAN†99.023.03
BigVGAN†99.252.81
CosyVoice296.926.24
CosyEdit299.083.07

CosyEdit2 dramatically closes the gap to oracle vocoder reconstruction (SS: 96.92 → 99.08; MCD: 6.24 → 3.07), operating nearly as an acoustic reconstruction system rather than a generative TTS model when no content change is needed. It even slightly surpasses the HiFT-GAN oracle in speaker similarity.

Subjective Evaluation

10 annotators (5 male, 5 female, native Chinese speakers, CET-6 or above) rated speech editing on three MOS scales (1–5):

  • IMOS (Intelligibility MOS): Content faithfulness to target text.
  • SMOS (Speaker Similarity MOS): Speaker identity preservation.
  • PMOS (Preservation MOS): Unedited region preservation and edit-boundary naturalness.
Speech Editing Subjective Evaluation Annotation UI.
Speech Editing Subjective Evaluation Annotation UI used for IMOS, SMOS, and PMOS ratings.
Zero-shot TTS Subjective Evaluation Annotation UI.
Zero-shot TTS Subjective Evaluation Annotation UI used for IMOS and SMOS ratings.

On the English Ming-Freeform-Audio-Edit subset, CosyEdit2 achieves the best IMOS and SMOS across all edit types, and the best or near-best PMOS. It is strongest on substitution (best on all three dimensions). On the Chinese subset, CosyEdit2 achieves the best IMOS, SMOS, and PMOS for all edit types, with especially strong PMOS gains over CosyVoice2.

For zero-shot TTS subjective evaluation on CV3-EVAL multilingual voice cloning, CosyEdit2 achieves the highest IMOS and SMOS in both English and Chinese, confirming that editing-oriented GRPO improves perceived content correctness and speaker similarity.

Why Editing Improves TTS: Discussion

The paper interprets zero-shot TTS as full-utterance content replacement under the unified speech generation view. Both tasks require: understanding contextual conditions, leveraging speaker acoustic cues from prompt speech, and producing text-faithful speech — fundamentally, prompt-conditioned in-context learning.

Editing-oriented GRPO strengthens this shared capability along multiple axes:

  • Semantically: Content rewards encourage stronger speech-text alignment, reducing hallucination-induced omissions and repetitions — critical for hard samples.
  • Acoustically: The requirement to reconstruct unedited regions forces the model to more precisely exploit speaker characteristics and environmental cues from the prompt speech, improving voice cloning fidelity.
  • Articulatory: Beyond coarse-grained semantic correctness, GRPO enhances fine-grained articulatory clarity.
  • Cross-lingual transfer: Despite English-only GRPO training, multilingual and cross-lingual gains occur because GRPO strengthens language-agnostic in-context learning rather than language-specific patterns, avoiding catastrophic forgetting.

Limitations

The authors identify three main limitations:

  1. Reward design space: The current reward formulation and hyperparameters were derived from task understanding and iterative human listening. More fine-grained rewards separately modeling edited vs. unedited regions, alternative aggregation strategies, and adaptive weighting may improve stability and fidelity.
  2. Language coverage: CosyEdit2 is built on CosyVoice2, which supports only Chinese, English, Japanese, and Korean. Extending to newer multilingual backbones and low-resource languages remains future work.
  3. Acoustic editing scope: The framework primarily addresses speech content editing. While some paralinguistic events (laughter, breathing, coughing, sighs) are partially inherited, broader acoustic editing capabilities — emotion conversion, pitch manipulation, speaking-style control, fine-grained prosodic modifications — remain unexplored.

Ethical Considerations

CosyEdit2's high-fidelity speech editing and zero-shot voice cloning capabilities raise misuse concerns including unauthorized voice impersonation, deceptive content creation, and misinformation. The strong acoustic preservation capability — retaining recording environment, prosody, and speaking characteristics while modifying only partial content — may make edited audio particularly difficult for humans to detect. The authors emphasize that the work targets legitimate applications (speech correction, accessibility, multimedia production, HCI research) and recommend deployment safeguards such as watermarking, synthetic-audio detection, and consent-aware usage policies.

Summary of Key Contributions

  • Target-speech-free GRPO data construction: Any TTS corpus can be converted into editing training data via rule-based NLP perturbations, eliminating the need for imperfect manually constructed target recordings.
  • First editing-oriented reward design for GRPO: A three-component, priority-aware reward combining WER (content correctness), DTW-aligned MCD on unedited regions (acoustic preservation), and speaker cosine similarity, with dynamic weight scheduling.
  • Complete post-training framework: SFT initialization of LLM + GOT-CFM Flow + BigVGAN vocoder, followed by GRPO updating only the LLM, instantiated on CosyVoice2.
  • Superior speech editing: State-of-the-art performance on multiple benchmarks, particularly on acoustic consistency (lowest MAE_DNSMOS), approaching or surpassing strong cascaded systems without external alignment.
  • Improved zero-shot TTS: Editing-oriented GRPO unlocks better zero-shot TTS generalization across multilingual, hard-sample, and cross-lingual settings, revealing a deep mutual connection between editing and synthesis.

Code & Implementation

The repository contains the CosyVoice family of TTS models (v1–v3) alongside the CosyEdit2 training framework. The core contribution of CosyEdit2 is a two-stage post-training pipeline implemented via Group Relative Policy Optimization (GRPO) over target-speech-free data.

Repository Structure

  • cosyvoice/: Core TTS modules including LLM backbone, flow-matching decoder, HiFiGAN vocoder, transformer encoder/decoder, and vLLM integration
  • examples/grpo/cosyvoice2/: GRPO training pipeline for CosyEdit2 (speech editing & zero-shot TTS)
  • example.py, vllm_example.py: Inference examples for different TTS model variants

Paper-to-Code Mapping

  • Stage 1 (Supervised Editing): Handled via standard SFT loading of pretrained CosyVoice2-0.5B LLM checkpoint (transformers-compatible format in sft_model_path)
  • Stage 2 (GRPO Training): Implemented in examples/grpo/cosyvoice2/run.sh using the verl framework (GitHub: yuekaizhang/verl, thread branch). GRPO is configured as algorithm.adv_estimator=grpo in the training command, with policy optimization over parquet-encoded training data
  • Reward Function: reward_tts.py computes speech quality rewards via pinyin-level WER using a remote Triton ASR service (token2wav), evaluating both generated speech tokens and ground-truth text consistency
  • Data Preparation: prepare_data.py converts JSONL dataset (AISHELL-3) to verl-compatible parquet format; data includes prompt text, target text, and speech token sequences

Quick Run

GRPO training is invoked via the verl trainer (stages 0–4 in run.sh): data preparation → token2wav reward server launch → GRPO training loop → checkpoint merging → evaluation on zero-shot/test splits. The trained model can be converted back to CosyVoice format for inference.