티스토리 뷰
Paper/Representation
[Paper 리뷰] SpeechLM: Enhanced Speech Pre-Training with Unpaired Textual Data
feVeRin 2025. 6. 7. 08:45반응형
SpeechLM: Enhanced Speech Pre-Training with Unpaired Textual Data
- Textual data를 통해 speech pre-training을 개선하기 위해서는 서로 다른 두 modality의 distinct characteristic을 고려할 수 있어야 함
- SpeechLM
- Speech, text modality를 bridge 하기 위해 phoneme-unit, hidden-unit tokenizer를 도입
- Trained tokenizer를 기반으로 unlabeled speech, text data를 phoneme-unit, hidden-unit token으로 변환
- 추가적으로 speech, text를 same discrete semantic space로 unify 하는 pre-training objective를 활용
- 논문 (TASLP 2024) : Paper Link
1. Introduction
- Wav2Vec, HuBERT와 같은 unimodal self-supervised representation learning은 speech processing에서 우수한 성능을 보이고 있음
- Joint speech-text modeling 측면에서 기존 방식은 speech encoder, text encoder를 통해 input을 hidden state에 mapping 하고, cross-modality content information을 학습하기 위해 shared encoder를 활용함
- BUT, speech encoder와 text encoder 간의 interface는 고려하지 않으므로, 두 encoder output이 서로 다른 space에 존재하고 shared encoder에 대한 transfer interference, capacity dilution이 발생함 - 이때 해당 interface는 speech, text에 대한 shared semantic space를 제공하고, strong interpretability와 learnability를 가져야 함
- Joint speech-text modeling 측면에서 기존 방식은 speech encoder, text encoder를 통해 input을 hidden state에 mapping 하고, cross-modality content information을 학습하기 위해 shared encoder를 활용함
-> 그래서 well-defined interface를 통해 speech, text modality를 unify 한 SpeechLM을 제안
- SpeechLM
- Phoneme-unit tokenizer와 Hidden-unit tokenizer를 도입하여 interface characteristic을 만족하는 speech, text modality의 representation space를 고려
- Tokenizer를 통해 speech, text를 shared intermediate modality로 변환하고, joint speech-text modeling을 2개의 sub-module로 decouple
- Unit-based Masked Language Modeling (UMLM)과 Unit-based Connectionist Temporal Classification (UCTC)의 pre-training task를 적용
- 추가적으로 better align을 위해 Random Swapping Mechanism을 도입
< Overall of SpeechLM >
- Speech, text pre-training을 pre-defined unified discrete representation으로 align 하는 cross-modal speech model
- 결과적으로 기존보다 뛰어난 성능을 달성
2. Method
- Unpaired speech, text data가 주어지면, SpeechLM은 offline discrete tokenizer를 통해 speech, text modality에 대한 unified representation을 학습하도록 pre-training 됨
- Phoneme/Hidden Unit as the Bridge
- 논문은 speech, text pre-training을 explicitly-defined discrete representation으로 bridge 하여 speech, text를 shared discrete space로 tokenize 하는 것을 목표로 함
- 여기서 phoneme/hidden unit을 speech, text의 bridge로 사용하면 다음의 이점을 얻을 수 있음:
- Speech, text를 separately align 하는 것보다 shared intermediate representation을 align하는 것이 더 쉬움
- Alignment를 개선하기 위해 additional unpaired data를 활용할 수 있음
- Joint modeling을 위해 frame-level에서 fine-grained alignment information을 활용할 수 있음
- 이를 위해 논문은 speech, text에 대해 Phoneme-unit Tokenizer와 Hidden-unit Tokenizer를 고려함
- Phoneme-unit Tokenizer는 speech, text를 phoneme space로 변환하고, Hidden-unit Tokenizer는 phoneme space를 acoustic clustering space로 변환함 - 즉, speech sample $\mathbf{S}$ 또는 text sample $\mathbf{Y}$가 주어지면 tokenizer ($\mathcal{T}_{S}$ : speech, $\mathcal{T}_{T}$ : text)는 discrete unit sequence $\mathbf{Z}$를 생성함:
(Eq. 1) $ \mathbf{Z}_{S}\triangleq(z_{S_{1}},...,z_{S_{M}})=\mathcal{T}_{S}(\mathbf{S}),\,\,\, \mathbf{Z}_{T}\triangleq (z_{T_{1}},...,z_{T_{N}})=\mathcal{T}_{T}(\mathbf{Y})$
- $M,N$ : 각각 speech, text의 unit sequence length
- 여기서 phoneme/hidden unit을 speech, text의 bridge로 사용하면 다음의 이점을 얻을 수 있음:
- Model Architecture
- SpeechLM은 Random Swapping Mechanism을 적용한 Speech Transformer와 Shared Transformer로 구성됨
- 이때 unpaired speech $\mathbf{S}$, text $\mathbf{Y}$를 input으로 사용함 - Speech Transformer
- HuBERT를 따라 Speech Transformer의 backbone으로 relative positional embedding을 가지는 standard Transformer를 채택함
- 먼저 speech waveform $\mathbf{S}$는 1D convolutional layer stack을 통해 speech feature sequence $\mathbf{X}\triangleq(x_{1},x_{2},...,x_{M})$으로 처리됨
- 이후 speech feature $\mathbf{X}$에 대해 $8\%$ mask probability와 $10$ mask length의 masking을 적용하고, 해당 masked feature $\hat{\mathbf{X}}$를 Speech Transformer에 전달하여 higher-level representation을 얻음:
(Eq. 2) $\mathbf{H}_{S}^{l}=\text{Transformer}(\mathbf{H}_{S}^{l-1})$
- $l$ : layer, $\mathbf{H}_{S}^{0}\triangleq \hat{\mathbf{X}}$ : input - $L$이 모든 Transformer module의 total layer 수이고, Speech Transformer가 그 절반을 차지한다고 하면, output은 $\mathbf{H}_{S}^{L/2}\triangleq (h_{S_{1}}^{L/2},...,h_{S_{M}}^{L/2})$와 같음
- 이후 speech feature $\mathbf{X}$에 대해 $8\%$ mask probability와 $10$ mask length의 masking을 적용하고, 해당 masked feature $\hat{\mathbf{X}}$를 Speech Transformer에 전달하여 higher-level representation을 얻음:
- Shared Transformer
- Shared Transformer는 Speech Transformer와 동일한 architecture를 가지고, speech, text에 대한 2가지 input을 처리함
- First input은 Speech Transformer의 output인 $\mathbf{H}_{S}^{L/2}$에 해당하고, Shared Transformer는 이를 $\mathbf{H}_{S}^{L}$로 처리함
- Second input은 unit embedding layer의 text tokenized unit $\mathbf{Z}_{T}$에서 derive 된 unit embedding sequence $\mathbf{U}_{T}\triangleq (u_{T_{1}},...,u_{T_{N}})$을 사용함:
(Eq. 3) $\mathbf{U}_{T}=\text{Emb}(\mathbf{Z}_{T})$
- 이는 Shared Transformer에 의해 $\mathbf{H}_{T}^{L}$로 처리됨 (여기서 $\mathbf{H}_{T}^{L/2}\triangleq \mathbf{U}_{T}$는 input을 의미)
- 결과적으로 $\mathbf{H}_{S}^{L},\mathbf{H}_{T}^{L}$은 speech, text에 대한 encoded representation으로써 사용됨
- 추가적으로 textual representation을 위해 $\mathbf{H}_{T}^{L}$을 character-level representation으로 변환하는 CTC layer를 적용함
- Shared Transformer는 Speech Transformer와 동일한 architecture를 가지고, speech, text에 대한 2가지 input을 처리함
- Random Swapping Mechanism
- Shared Transformer의 early layer에서 speech, textual representation을 better align 하기 위해 논문은 Random Swapping Mechanism을 추가적으로 도입함
- 먼저 각 speech sequence는 discrete unit으로 tokenize 될 수 있으므로, speech sequence에서 time position $i\in\mathcal{R}$을 randomly select 하고 각 $h_{S_{i}}^{L/2}$를 해당 unit embedding $u_{S_{i}}$로 replace 함
- $u_{S_{i}}=\text{Emb}(z_{S_{i}})$는 unit embedding layer를 통해 speech unit $z_{S_{i}}$로부터 derive 됨 - Swapping position $\mathcal{R}$은 information leakage를 방지하기 위해 unmasked region 내에서만 select 됨
- 먼저 각 speech sequence는 discrete unit으로 tokenize 될 수 있으므로, speech sequence에서 time position $i\in\mathcal{R}$을 randomly select 하고 각 $h_{S_{i}}^{L/2}$를 해당 unit embedding $u_{S_{i}}$로 replace 함
- 이를 통해 논문은 두 modality를 하나의 sequence로 shuffle 할 수 있고 model은 이를 equally treat 할 수 있음
- Shared Transformer의 early layer에서 speech, textual representation을 better align 하기 위해 논문은 Random Swapping Mechanism을 추가적으로 도입함
- Pre-Training Tasks
- SpeechLM은 unlabeled speech data에 대한 Unit-based Masked Language Modeling과 unlabeled text data에 대한 Unit-based Connectionist Temporal Classification을 jointly optimize 함
- Unit-based Masked Language Modeling (UMLM)
- UMLM은 speech pre-training을 위해 사용됨
- $l$-layer speech representation $ \mathbf{H}_{S}^{l}=\triangleq(h_{S_{1}}^{l},...,h_{S_{M}}^{l})$이 주어지면, UMLM은 masked position에서 tokenized unit $\mathbf{Z}_{S}=\triangleq(z_{S_{1}},...,z_{S_{M}})$을 predict 함
- 이때 position $i$에서 predicted unit의 probability는:
(Eq. 4) $p(z|h_{S_{i}}^{l})=\frac{\exp\left(\cos\left(\mathbf{W}h_{S_{i}}^{l}, e(z)\right)/\tau\right)}{\sum_{z'\in\mathcal{Z}}\exp\left(\cos\left(\mathbf{W}h_{S_{i}}^{l}, e(z')\right)/\tau\right)}$
- $\mathbf{W}$ : projection matrix, $e(\cdot)$ : embedding matrix
- $\tau=0.1$ : temperature, $\mathcal{Z}$ : phoneme/hidden-unit category set
- UMLM loss는 Speech Transformer $\mathbf{H}_{S}^{L/2}$와 Shared Transformer $\mathbf{H}_{S}^{L/2}$ output 모두에서 compute 되고, 다음과 같이 formulate 됨:
(Eq. 5) $\mathcal{L}_{UMLM}=-\sum_{i\in\mathcal{M}}\left(\log p(z_{S_{i}}|h_{S_{i}}^{L/2})+ \log p(z_{S_{i}}|h_{S_{i}}^{L})\right)$
- $z_{S_{i}}$ : position $i$의 speech unit, $\mathcal{M}$ : masked position set
- UMLM은 speech pre-training을 위해 사용됨
- Unit-based Connectionist Temporal Classification (UCTC)
- Connectionist Temporal Classification (CTC)는 output이 unsegmented input sequence 보다 짧은 경우를 address 하기 위해 사용됨
- 이때 논문은 unlabeled text에서 tokenize, upsample 된 hidden-unit sequence $\mathbf{Z}_{T}$를 input으로 사용하고, Shared Transformer와 CTC layer를 통해 original text를 recognize 하는 것을 목표로 함
- Input sequence는 input speech signal과 동일하게 mask 됨 - Text label sequence $\mathbf{Y}$가 주어졌을 때, unit-based CTC loss는:
(Eq. 6) $\mathcal{L}_{UCTC}=-\log p_{CTC}(\mathbf{Y}|\mathbf{H}_{T}^{L}|) $
- $p_{CTC}(\cdot)$ : CTC layer modeling으로써, encoded unit representation $\mathbf{H}_{T}^{L}$을 target character $\mathbf{Y}$로 변환하는 것을 목표로 함 - 결과적으로 SpeechLM은 unlabeled speech, text data를 기반으로 UMLM, UCTC task에 대한 multi-task pre-training을 수행함:
(Eq. 7) $\mathcal{L}=\mathcal{L}_{UMLM}+\lambda \mathcal{L}_{UCTC}$
- $\lambda$ : weight
- Unified Tokenizers
- Phoneme-unit tokenizer와 Hidden-unit tokenizer는 pre-training 이전에 unlabeled speech, text data를 pre-process 하는 데 사용됨
- Phoneme-unit Tokenizer
- 논문은 phoneme label을 pre-training target으로 사용하는 Phoneme-unit Tokenizer $\mathcal{T}^{P}$를 통해 speech signal $\mathcal{T}_{S}^{P}$와 text sequence $\mathcal{T}_{T}^{P}$를 discretize 함
- Speech data의 경우 tokenizer는 acoustic feature를 phoneme unit으로 변환하는 acoustic model과 Weight Finite-State Transducer (WSTF)-based decoder를 사용함
- Text data의 경우 주어진 lexicon을 look up 하여 word를 phoneme으로 directly convert 함
- 추가적으로 논문은 각각의 phoneme을 randomly repeating 하여 text에 대한 phoneme sequence length가 speech의 phoneme sequence length와 similar 하도록 upsampling 함
- 논문은 phoneme label을 pre-training target으로 사용하는 Phoneme-unit Tokenizer $\mathcal{T}^{P}$를 통해 speech signal $\mathcal{T}_{S}^{P}$와 text sequence $\mathcal{T}_{T}^{P}$를 discretize 함
- Hidden-unit Tokenizer
- 먼저 speech는 $k$-means cluster model $\mathcal{T}_{S}^{H}$의 hidden unit로 tokenize 됨
- Clustering feature는 2nd round HuBERT의 intermediate hidden state에 해당함 - 한편으로 text data를 same hidden-unit space로 tokenize 하기 위해 non-autoregressive text-to-hidden-unit model $\mathcal{T}_{T}^{H}$를 도입함
- 구조적으로는 FastSpeech를 기반으로 text encoder, duration model, unit decoder로 구성됨
- Training 시 $\mathcal{T}_{T}^{H}$는 text-to-unit pair를 사용함
- 이때 text side는 phoneme duration을 가지는 phoneme transcription으로 주어지고 unit은 $\mathcal{T}_{S}^{H}$에 의해 speech로부터 tokenize 됨 - 추론 시 $\mathcal{T}_{T}^{H}$는 raw text에서 변환된 non-aligned phoneme sequence를 사용하고, duration은 automatically estimate 됨
- 먼저 speech는 $k$-means cluster model $\mathcal{T}_{S}^{H}$의 hidden unit로 tokenize 됨
3. Experiments
- Settings
- Dataset : LibriSpeech, LibriLight
- Comparisons : Wav2Vec 2.0, HuBERT, WavLM, Data2Vec, PBERT, ILS-SSL
- Results
- 전체적으로 SpeechLM의 성능이 가장 우수함
- Evaluation on Speech Translation
- Speech Translation task에 대해서도 SpeechLM이 가장 뛰어난 성능을 달성함
- Universal Representation Evaluation
- SUPERB benchmark에 대해서도 SpeechLM이 최고의 성능을 달성함
- Effect of Random Swapping Mechanism
- Random swapping이 적용되지 않은 경우 SpeechLM의 성능이 크게 저하됨
- Effect of Data Size
- SpeechLM은 data size가 $40\text{K}$로 줄어들어도 성능 저하가 크게 나타나지 않음
- Visualization Analysis
- Shared Transformer layer에 대한 data distribution을 비교해 보면, layer가 늘어날수록 SpeechLM은 speech, text representation을 shared space로 align 함
반응형
'Paper > Representation' 카테고리의 다른 글
댓글