티스토리 뷰
Paper/Language Model
[Paper 리뷰] MaskGCT: Zero-Shot Text-to-Speech with Masked Generative Codec Transformer
feVeRin 2025. 2. 23. 12:27반응형
MaskGCT: Zero-Shot Text-to-Speech with Masked Generative Codec Transformer
- Large-scale text-to-speech system은 autoregressive/non-autoregressive 방식으로 나눌 수 있음
- Autoregressive 방식은 robustness와 duration controllability 측면에서 한계가 있음
- Non-auotregressive 방식은 training 중에 text, speech 간의 explicit alignment information이 필요함 - MaskGCT
- Text, speech supervision 간의 explicit alignment information과 phone-level duration prediction이 필요 없는 fully non-autoregressive text-to-speech model
- Two-stage framework를 활용하여 text로부터 semantic token을 예측한 다음, 해당 semantic token을 condition으로 하는 acoustic token을 예측
- Mask-and-predict learning을 통해 주어진 condition과 prompt에 따라 masked token을 생성
- 논문 (ICLR 2025) : Paper Link
1. Introduction
- SpearTTS, VALL-E, CLaM-TTS, VoiceCraft 등의 large-scale zero-shot text-to-speech (TTS) system은 주로 autoregressive (AR), non-autoregressive (NAR) model을 활용하여 구성됨
- 먼저 AR-based system은 speech를 discrete token으로 quantize 한 다음, decoder-only model을 사용하여 token을 autoregressively generate 함
- BUT, 해당 AR 방식은 poor robustness, slow speed의 문제가 있음 - 한편 VoiceBox, Mega-TTS2와 같이 diffusion, GAN, flow matching을 활용하는 NAR-based system은 explict alignment information과 phoneme-level duration이 필요하므로 pipeline이 복잡해지고 less diverse speech가 생성됨
- 최근에는 AR, NAR model 대신 masked generative transformer가 뛰어난 generation 성능을 보이고 있음
- Masked generative transformer는 mask-and-predict paradigm을 통해 training 되고 추론 시에는 iterative parallel decoding을 활용함
- 특히 SoundStorm은 speech semantic token을 condition으로 SoundStream에서 추출한 multi-layer acoustic token을 predict 하기 위해 masked generative transformer를 도입했음
- BUT, AR model의 semantic token을 input으로 receive 하므로 masked generative model을 활용하지 못함
- 그 외에도 speech-text alignment supervision과 phone-level duration prediction이 필요함
- 먼저 AR-based system은 speech를 discrete token으로 quantize 한 다음, decoder-only model을 사용하여 token을 autoregressively generate 함

-> 그래서 TTS를 위한 masked generative transformer 기반의 fully non-autoregressive model인 MaskGCT를 제안
- MaskGCT
- Mask-and-Predict learning paradigm을 활용한 two-stage framework를 채택
- First stage에서 text-to-semantic (T2S) model은 explicit duration prediction 없이 text token sequence와 prompt speech semantic token sequence를 prefix로 사용함
- 이후 in-context learning을 통해 masked semantic token을 predict 함 - Second stage에서 semantic-to-acoustic (S2A) model은 semantic token을 사용하여, prompt acoustic token이 있는 RVQ-based speech codec에서 추출된 masked acoustic token을 predict 함
- 추론 시에는 text sequence가 주어졌을 때, few iteration step으로 다양한 specified length의 semantic token을 생성함
- First stage에서 text-to-semantic (T2S) model은 explicit duration prediction 없이 text token sequence와 prompt speech semantic token sequence를 prefix로 사용함
- 추가적으로 기존의
-means 대신 VQ-VAE를 채택하여 speech self-supervised semantic token embedding을 quantizek
- 이를 통해 single codebook으로도 semantic feature의 information loss를 minimize 함
- Mask-and-Predict learning paradigm을 활용한 two-stage framework를 채택
< Overall of MaskGCT >
- Masked Generative Transformer를 활용한 fully non-autoregressive TTS model
- 결과적으로 기존보다 뛰어난 합성 성능을 달성
2. Method
- Background: Non-Autoregressive Masked Generative Transformer
- Some data의 discrete representation sequence
가 주어졌을 때,X 를Xt=X⊙Mt 의 token subset을 해당 binary maskX 으로 mask 하는 process라고 하자Mt=[mt,i]Ni=1 인 경우,mt,i=1 를 specialxi token으로 replace 하고,[MASK] 인 경우,mt,i=0 를 unmask 함xi - 여기서 각
는 parametermt,i 를 가지는 Bernoulli distribution에 따라 independently identically distribute 됨γ(t)
- : mask schedule function,γ(t)∈(0,1] X0=X
- e.g.)γ(t)=sin(πt2T),t∈(0,T] - Non-autoregressive masked generative transformer는 unmasked token과 condition
를 기반으로 masked token을 predict 함C - 즉,
로 modeling 됨pθ(X0|Xt,C) - 그러면 parameter
는 masked token의 negative log-likelihood를 minimize 하도록 optimize 됨:θ
(Eq. 1)Lmask=EX∈D,t∈[0,T]−∑Ni=1mt,i⋅log(pθ(xi|Xt,C))
- 즉,
- 추론 시에는 iterative decoding을 통해 token을 parallel decode 함
- 먼저 fully masked sequence
에서 시작하자XT 에서1 까지 각 stepS 에 대한 total decoding step을i 라고 하면,S 에서pθ(X0|XT−(i−1)⋅TS,C) 를 sampling 할 수 있음ˆX0 - 이후 confidence score에 따라
token을 sampling 하고, remask 하여⌊N⋅γ(T−i⋅TS)⌋ 를 얻음XT−i⋅TS
- :N 의 total token 수X 의ˆX0 에 대한 confidence score는ˆxi 가xT−(i−1)⋅TS,i token인 경우[MASK] 에 assign 됨pθ(xi|XT−(i−1)⋅TS,C)
- 그렇지 않은 경우 의 confidence score를ˆxi 로 설정하여1 에서 already unmasked token이 remask 되지 않도록 함XT−(i−1)⋅TS
- 먼저 fully masked sequence
- Model Overview
- MaskGCT는 two-stage framework로 구성됨
- 일반적으로 first stage에서는 text를 사용하여 content information과 partial prosody information을 포함하는 speech semantic representation token을 predict 함
- Second stage에서는 더 많은 acoustic information을 학습하도록 training 됨 - 한편으로 기존의 SpearTTS, VALL-E 등은 first stage에서 autoregressive model을 사용함
- BUT, MaskGCT는 text-speech alignment supervision과 phone-level duration prediction 없이 두 stage 모두에 non-autoregressive masked generative modeling을 도입함
- First stage model의 경우
를 condition으로 하여Sp,P 를 학습하도록 training 됨pθs1(S|St,(Sp,P))
- : semantic codec에서 얻은 speech semantic representation token seqeunceS
- : prompt semantic token sequenceSp
- : text token sequenceP - Second stage model은
을 학습하도록 training 됨pθs2(A|At,(Ap,S))
- : DAC, SoundStream과 같은 speech acoustic codec의 multi-layer acoustic token sequenceA
- 구조적으로는 SoundStrom과 유사함
- First stage model의 경우
- 일반적으로 first stage에서는 text를 사용하여 content information과 partial prosody information을 포함하는 speech semantic representation token을 predict 함

- Speech Semantic Representation Codec
- Discrete speech representation은 semantic token과 acoustic token으로 나눌 수 있음
- 일반적으로 semantic token은 speech Self-Supervised Learning (SSL) feature를 discretizing 하여 얻어짐
- 특히 기존의 large TTS system은 text를 사용하여 semantic token을 predict 한 다음, 다른 model을 사용하여 acoustic token/feature를 predict 하는 방식을 사용함
- Semantic token이 text/phoneme과 highly correlate 되어 있으므로 acoustic token을 directly predict 하는 것보다 prediction이 더 straightforward 하기 때문
- BUT, 기존에 사용된
-means-based semantic discretization은 information loss가 발생할 수 있음k
- 결과적으로 high-quality speech reconstruction과 precise acoustic token prediction을 어렵게 함
- 따라서 MaskGCT는 information loss를 minimize 하면서 semantic representation을 discretize 하는 것을 목표로 함
- 이를 위해 RepCodec과 같이 VQ-VAE를 활용하여 speech SSL model에서 speech semantic representation을 reconsturct 하는 vector quantization codebook을 학습함 - Speech semantic representation sequence
의 경우, vector quantizer는 encoderS∈RT×d 의 output을E(S) 로 quantize 하고 decoder는E 를 다시E 로 reconstruct 함ˆS
- 이때 간의 reconstruction loss를 사용하여 encoder, decoder를 optimize 하고 codebook loss를 사용하여 codebook을 optimize 하고, commitment loss를 사용해 straight-through method로 encoder를 optimize 함S,ˆS - 결과적으로 semantic representation codec을 training 하기 위한 total loss는:
(Eq. 2)Ltotal=1Td(λrec⋅||S−ˆS||1+λcodebook⋅||sg(E(S))−E||2+λcommit⋅||sg(E)−E(S)||2)
- : stop-gradientsg - 구조적으로는 w2v-BERT 2.0의 17th layer의 hidden state를 speech encoder의 semantic feautre로 활용함
- 여기서 Encoder, Decoder는 multiple ConvNeXt block으로 구성됨
- 추가적으로 DAC를 따라 factorized code를 사용하여 encoder output을 low-dimensional latent variable space로 project 함
- Codebook에는 각각 dimension이 8인 8192 entry가 포함됨

- Text-to-Semantic Model
- MaskGCT는 autoregressive model이나 text-to-speech alignment information 없이 non-autoregressive maksed generative transformer를 사용하여 Text-to-Semantic (T2S) model을 training 함
- Training 중에 semantic token sequence의 prefix를 randomly extract 하여
로 나타냄Sp - 이후 text token sequence
를P 와 concatenate 하여 condition을 구성함Sp - 이때 단순히
를 prefix sequence로 input masked semantic token sequence(P,Sp) 에 add 한 다음, language model의 in-context learning ability를 활용함St
- 이후 text token sequence
- 구조적으로는 GELU activation, rotation position encoding 등을 활용하는 Llama-style transformer를 model backbone으로 사용하고, causal attention을 bidirectional attention으로 대체함
- 추가적으로 timestep 를 condition으로 하는 adaptive RMSNorm을 사용함t - 추론 시에는 text, prompt semantic token sequence를 condition으로 specified length의 target semantic token sequence를 생성함
- 여기서 text, prompt speech duration에 따라 total duration을 predict 하기 위해 flow matching-based duration prediction model을 도입하여 in-context learning을 지원함
- Training 중에 semantic token sequence의 prefix를 randomly extract 하여

- Semantic-to-Acoustic Model
- Semantic token에 따라 condition 된 masked generative codec transformer를 사용하여 Semantic-to-Acoustic (S2A) model을 training 함
- 해당 S2A model은 multi-layer acoustic token sequence를 생성하는 SoundStrom을 기반으로 함
- 먼저 acoustic token sequence
의A1:N layer가 주어지면, training 중에N 에서1 사이에서 하나의 layer를 select 함N - 여기서 acoustic token sequence의
-th layer를j 라 하고,Aj 를 timestepAj 에서t 를 mask 하여Aj 를 얻음Ajt - 이후 model은 prompt
, semantic token sequenceAp , acoustic token의S 보다 작은 모든 layer에 따라j 를 predict 하도록 training 됨Aj
- 즉, 과 같음pθs2a(Aj|Ajt,(Ap,S,A1:j−1)) - 이후
를 linear schedulej 에 따라 sampling 함p(j)=1−2jN(N+1)
- 여기서 acoustic token sequence의
- S2A model input의 경우 semantic token sequence의 frame 수가 prompt acoustic sequence와 target acoustic sequence의 frame 수 합과 같음
- 따라서 semantic token의 embedding과 layer 에서1 까지의 acoustic token embedding을 summation 하여 사용함j - 추론 시에는 각 layer 내에서 iterative parallel decoding을 사용하여 coarse-to-fine의 각 layer에 대한 token을 생성함

- Speech Acoustic Codec
- Speech acoustic codec은 speech information을 preserve 하면서 speech waveform을 multi-layer discrete token으로 quantize 하도록 training 됨

- Other Applications
- MaskGCT는 duration-controllable speech translation (cross-lingual dubbing), emotion control, speech content editing, zero-shot TTS 등에 사용될 수 있음

3. Experiments
- Settings
- Dataset : Emilia, LibriSpeech, SeedTTS
- Comparisons : NaturalSpeech, VALL-E, VoiceBox, VoiceCraft, XTTS, CosyVoice
- Results
- Zero-Shot TTS
- 전체적으로 MaskGCT의 성능이 가장 뛰어남

- Autoregressive vs. Masked Generative Models
- AR + SoundStorm으로 구성된 model과 비교하여 MaskGCT가 더 robust 한 성능을 보임

- Duration Length Analysis
- Duration multiplier가
인 경우 가장 낮은 WER을 달성함1.0
- Duration multiplier가

- Speech Style Imitation
- MaskGCT는 accent, emotion과 같은 speech style을 효과적으로 반영할 수 있음


- Choice of Semantic Representation Codec
- VQ-based semantic token과
-menas-based semantic token을 비교해 보면k - VQ-based token을 사용하는 경우, speech reconstruction의 성능을 더욱 향상할 수 있음
- VQ-based semantic token과

- Ablation Study
- Base model을 사용하더라도 Large model에 비해 성능 저하가 크지 않음

반응형