티스토리 뷰
Paper/Representation
[Paper 리뷰] Wav2Vec 2.0: A Framework for Self-Supervised Learning of Speech Representations
feVeRin 2025. 3. 23. 08:52반응형
Wav2Vec 2.0: A Framework for Self-Supervised Learning of Speech Representations
- Speech audio만으로 powerful representation을 학습하고 transcribed speech에 대한 fine-tuning을 통해 speech recognition 성능을 향상할 수 있음
- Wav2Vec 2.0
- Latent space에서 speech input을 mask
- Jointly learned latent representation의 quantization에 대한 contrastive task를 solve'
- 논문 (NeurIPS 2020) : Paper Link
1. Introduction
- Speech recognition에서 labeled data는 unlabled data에 비해 얻기 어려움
- 기존에는 VQ-Wav2Vec과 같이 self-attention model을 사용하여 contextualized representation을 학습함
- 한편으로 최근의 self-supervised learning 역시 unlabled example에서 general data representation을 학습하고 labled data에 대한 model을 fine-tuning 할 수 있음
-> 그래서 raw audio data로부터 self-supervised representation을 학습할 수 있는 Wav2Vec 2.0을 제안
- Wav2Vec 2.0
- Multi-layer convolutional neural network를 통해 speech audio를 encode하고 masked language modeling과 유사하게 resulting latent speech representation을 masking
- 이후 latent representation은 transformer network에 전달되어 contextualized representation을 구축하고 true latent와 disctractor를 distinguish 하는 contrastive task를 통해 training 됨 - 추가적으로 contrastive task에서 latent representation을 represent 하기 위해 Gumble softmax를 통해 discrete speech unit을 학습
- Unlabled speech에 대한 pre-training 이후, model은 Connectionist Temporal Classification (CTC) loss를 사용하여 labled data에 대해 fine-tuning 됨
- Multi-layer convolutional neural network를 통해 speech audio를 encode하고 masked language modeling과 유사하게 resulting latent speech representation을 masking
< Overall of Wav2Vec 2.0 >
- Raw audio data로부터 self-supervised learning을 통해 representation을 학습하기 위한 framework
- 결과적으로 기존보다 뛰어난 성능을 달성
2. Method
- Wav2Vec 2.0은 raw audio
를 input으로 하여X time-step에 대한 latent speech representationT 를 output 하는 multi-layer convolutional feature encoderz1,...,zT 로 구성됨f:X↦Z - Transformer
를 통해 entire sequence에서 information을 capture 하는 representationg:Z↦C 를 얻음c1,...,cT - Feature encoder output은 quantization module
를 통해Z↦Q 로 discretize 되어 self-supervised object의 target을 represent 함qt - VQ-Wav2Vec과 비교하여 Wav2Vec 2.0은 continuous speech representation에 대한 context representation을 구축하고 self-attention은 latent representation의 entire sequence에 대한 dependency를 end-to-end로 capture 함
- Transformer

- Feature Encoder
- Encoder는 temporal convolution, layer normalization, GELU activation을 포함하는 block으로 구성됨
- Encoder에 대한 raw waveform은 zero-mean, unit variance로 normalize 됨
- Encoder의 total stride는 transformer에 input 되는 time-step 수
를 결정함T
- Contextualized Representations with Transformers
- Feature encoder output은 transformer architecture를 따르는 context network로 전달됨
- 이때 논문은 absolute positional information을 encode 하는 fixed positional embedding 대신 relative positional embedding과 유사한 convolutional layer를 사용함
- 이후 convolution output에 GELU, layer normalization을 적용함
- Quantization Module
- Self-supervised training을 위해 논문은 feature encoder output
를 product quantization을 통해 finite speech representation으로 discretize 함z - Product quantization은 multiple codebook에서 quantized representation을 choosing 하고 concatenating 함
- 먼저
codebook (group),G entryV 가 주어진다고 하자e∈RV×d/G - 그러면 각 codebook에서 하나의 entry를 choose 하고 resulting vector
를 concatenate 한 다음, linear transformatione1,...,eG 에 적용하여Rd↦Rf 를 얻음q∈Rf
- 먼저
- Gumble softmax를 채택하면 fully differentiable way로 discrete codebook entry를 choice 할 수 있음
- 따라서 Wav2Vec 2.0은 straight-through estimator와 hard Gumble softmax operation을 사용함G - 결과적으로 feature encoder output
는z logits에 mapping 되고, 이때 groupl∈RG×V 에 대한g -th codebook entry를 choice 할 probability는:v
(Eq. 1)pg,v=exp(lg,v+nv)/τ∑Vk=1exp(lg,k+nk)/τ
- : non-negative temperature,τ ,n=−log(−log(u)) :u 의 uniform sampleU(0,1) - Forward pass 중에 codeword
는i 에 의해 chosen 되고 backward pass에서는 Gumble softmax output의 true gradient가 사용됨i=argmaxjpg,j
- Product quantization은 multiple codebook에서 quantized representation을 choosing 하고 concatenating 함
3. Training
- Wav2Vec 2.0을 pre-train 하기 위해 논문은 latent feature encoder space에서 certain proportion의 time-step을 mask 함
- Masking
- Context network 이전에 feature encoder output/time-step의 proportion을 mask 한 다음, 모든 maksed time-step에 share 되는 trained feature vector로 replace 함
- 이때 quantization module에 대한 input은 mask 하지 않음
- 즉, encoder에서 output 된 latent speech representation을 mask 하기 위해서는:
- 모든 time-step의 certain proportion
를 randomly sample 하여 starting index로 선정하고,p - 각 sampled index에 대해 subsequent
consecutive time-step을 mask 함M
- 여기서 span은 overlap 될 수 있음
- 모든 time-step의 certain proportion
- Objective
- Pre-training 중에 contrastive task
을 solve 하여 speech audio representation을 학습함Lm - 이를 위해 distractor set 내의 masked time-step에 대한 true quantized latent speech representation을 학습해야 함
- 결과적으로 model이 codebook entry를 equally often 하게 사용하도록 codebook diversity loss
로 augment 됨:Ld
(Eq. 2)L=Lm+αLd
- : hyperparameterα
- Contrastive Loss
- Masked time-step
로 center 된 context network outputt 가 주어진다고 하자ct - Wav2Vec 2.0은
와qt distractor를 포함하는K quantized candidate representationK+1 에서 true quantized latent speech representation˜q∈Qt 를 identify 해야 함qt
- Distractor는 same utterance의 other masked time-step에서 uniformly sample 됨 - 결과적으로 contrastive loss는:
(Eq. 3)Lm=−logexp(sim(ct,qt)/κ)∑˜q∼Qtexp(sim(ct,˜q)/κ)
- : context representation, quantized latent speech representation 간의 cosine similaritysim(a,b)=a⊤b/||a||||b||
- Masked time-step
- Diversity Loss
- Contrastive task는 positive/negative example을 모두 represent 하기 위해 codebook에 depend 하고, diversity loss
는 quantized codebook representation의 usage을 늘리기 위해 도입됨Ld - 즉, utterance batch에 대한 각 codebook entry
의 averaged softmax distributionˉpg 의 entropy를 maximizing 하여 각l codebook에서G entry를 equally use 하도록 함:V
(Eq. 4)Ld=1GV∑Gg=1−H(ˉpg)=1GV∑Gg=1∑Vv=1ˉpg,vlogˉpg,v
- Softmax distribution에는 gumble noise나 temperature가 포함되지 않고, 대신 equivalent 한 perplexity 를 maximize 함GV−∑Gg=1exp(−∑Vv=1pg,vlogpg,v)GV
- Contrastive task는 positive/negative example을 모두 represent 하기 위해 codebook에 depend 하고, diversity loss
- Fine-Tuning
- Pre-trained model은 task의 vocabulary를 represent 하는
class를 기반으로 context network에 randomly initialized linear projection을 adding 하여 speech recognition에 대해 fine-tuning 됨C - 대표적으로 LibriSpeech의 경우 character target에 대한 29 token과 word boundary token을 가짐
- 결과적으로 model은 CTC loss를 minimize 하여 optimize 되고 training 중에 time-step과 channel에 masking 하는 SpecAugment를 적용하여 overfitting을 delay 함
- 이를 통해 few labeled example을 가지는 dataset에 대해 final error rate를 개선할 수 있음
4. Experiments
- Settings
- Dataset : LibriSpeech, TIMIT
- Comparisons : Discrete BERT, CTC Transformer, S2S Transformer, ContextNet, Conformer
- Results
- Low-Resource Labled Data Evaluation
- 10 min. labled data 만으로도 Wav2Vec 2.0은 가장 낮은 WER을 달성함

- High-Resource Labled Data Evaluation on LibriSpeech
- 960 hours의 labled data에 대해서도 Wav2Vec 2.0의 성능이 가장 뛰어남

- Phone Recognition on TIMIT
- TIMIT dataset에 대해서도 7.4/8.3 Phoneme Error Rate (PER)을 달성함

- Ablations
- Continuous input, quantized target을 사용하는 경우 최상의 성능을 달성할 수 있음

반응형