AI Wiki中文/EN

wav2vec 2.0: learn speech targets before learning transcripts

Wav2vec 2.0

Trace masked context, Gumbel targets, contrastive gradients and codebook diversity with a complete small numerical example.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

What can recordings teach without transcripts?

Suppose a collection contains many recordings but only a small set of transcripts. A recognizer trained solely on those transcripts cannot directly use every untranscribed recording as a labeled example. wav2vec 2.0 creates a pre-training task from the audio itself: hide part of a continuous representation and identify the corresponding learned discrete target among alternatives. A later supervised stage still supplies the connection to written symbols. Pre-training and fine-tuning

The name matters. This article concerns the 2020 wav2vec 2.0 method, rather than treating earlier wav2vec, vq-wav2vec and later unsupervised-recognition variants as interchangeable. Its discrete codes are training targets; they are not supplied words or a guaranteed phoneme inventory. The context network continues to receive continuous features. Model structure

A small example will expose a useful puzzle: a codebook can report maximal probability perplexity while a deterministic choice always selects its first entry. Understanding that result requires separating soft probabilities, hard choices and noisy training samples. We first trace those quantities, then implement their losses and derivatives.

Soft probability perplexity and hard argmax usage can disagree. Supplied-vector loss, span overlap and convolution timing answer separate questions; none is a recognition score.
Soft probability perplexity and hard argmax usage can disagree. Supplied-vector loss, span overlap and convolution timing answer separate questions; none is a recognition score.

Keep the context and target paths separate

The feature encoder ff maps waveform XX to a sequence ZZ of continuous vectors. A corruption operator rr replaces positions in a mask set MM before the context network gg. The target path quantizes the original, unmasked features. Context and target projections must produce matching dimensions for comparison:

zt=f(X)t,ct=g(r(Z,M))t,qt=Wq[e1,it1;…;eG,itG].z_t=f(X)_t,\qquad c_t=g(r(Z,M))_t,\qquad q_t=W_q[e_{1,i_{t1}};\ldots;e_{G,i_{tG}}].

Here eg,ve_{g,v} is entry vv in codebook group gg, and semicolons denote concatenation. With GG groups of VV entries, there are up to VGV^G index combinations, although training need not use all of them or make every combined vector different. gg includes the necessary context projection in this notation. The original method uses a convolutional waveform encoder and Transformer context network with convolutional positional information. Normalization details differ between experimental configurations; one generic description does not specify every checkpoint. Architecture and configuration

Masking the target path too would remove the information that defines the prediction target. Span starts also do not equal masked-frame count: spans can overlap. Our separate mask example uses length 12, starts 2 and 4, and span length 4. The union contains six positions, indices 2 through 7, rather than eight. This illustrates overlap, without reproducing every random-mask or padding rule.

The quantizer projects features to logits ltgvl_{tgv}. An explicit uniform draw u∈(0,1)u\in(0,1) produces Gumbel noise, followed by a temperature-scaled softmax:

ntgv=−ln⁡(−ln⁡utgv),ptgv=exp⁡((ltgv+ntgv)/τ)∑jexp⁡((ltgj+ntgj)/τ),itg=arg⁡max⁡vptgv,τ>0.n_{tgv}=-\ln(-\ln u_{tgv}),\quad p_{tgv}=\frac{\exp((l_{tgv}+n_{tgv})/\tau)}{\sum_j\exp((l_{tgj}+n_{tgj})/\tau)},\quad i_{tg}=\arg\max_v p_{tgv},\quad \tau>0.

The inspected paper’s equation 1 places the temperature outside the exponential parentheses; read literally, that factor cancels. We write the division inside the exponent explicitly, matching the fixed PyTorch implementation, which divides logits plus noise before softmax. For fixed noisy logits and positive temperature, changing τ\tau changes soft probabilities but not their argmax. Zero temperature is a limiting idea, not a valid denominator in this implementation. Gumbel operation

A hard choice is piecewise constant in the logits. Small changes away from a decision boundary therefore give an ordinary derivative of zero. Straight-through training deliberately substitutes the soft derivative while retaining a hard forward value:

w=stopgrad⁡(onehot⁡(arg⁡max⁡p)−p)+p,∂p∂l=diag⁡(p)−pp⊤τ.w=\operatorname{stopgrad}(\operatorname{onehot}(\arg\max p)-p)+p,\qquad \frac{\partial p}{\partial l}=\frac{\operatorname{diag}(p)-pp^\top}{\tau}.

stopgrad means that its argument contributes a value but receives no derivative. For a group with an upstream sensitivity vector uqu_q, the sensitivity of choosing entry vv is uq⊤evu_q^\top e_v; multiplying that score vector by the Jacobian gives the logit gradient. The code exposes this vector–Jacobian product in both soft and hard modes. Finite differences validate the soft forward map. They cannot certify a straight-through surrogate as the true derivative of the hard map. Hard forward, soft backward Fixed quantizer

For a masked position, candidate 0 is its positive target and subsequent candidate positions hold negatives. The paper samples distractors from other masked positions in the same utterance. Our program receives an explicit index list; a repeated index remains repeated in the denominator. Let JtJ_t denote the valid candidate positions and κ\kappa the contrastive temperature:

Lcon=−1N∑t∈Mln⁡exp⁡(st0/κ)∑j∈Jtexp⁡(stj/κ),stj=ct⊤qtj∥ct∥∥qtj∥,N=∣M∣.\mathcal L_{\mathrm{con}}=-\frac1N\sum_{t\in M}\ln\frac{\exp(s_{t0}/\kappa)}{\sum_{j\in J_t}\exp(s_{tj}/\kappa)},\quad s_{tj}=\frac{c_t^\top q_{tj}}{\|c_t\|\|q_{tj}\|},\quad N=|M|.

The quantizer temperature τ\tau and comparison temperature κ\kappa have different jobs. Increasing a positive score relative to alternatives lowers this loss. The fixed model excludes negative vectors exactly equal to the positive vector, even when they came from another frame. If every negative is excluded, the positive has probability one and contrastive loss is zero; that alone does not establish a useful representation. Contrastive objective Equal-vector filtering

Write hats for unit vectors and PtjP_{tj} for the candidate softmax probability. Differentiating cosine similarity gives (q^−sc^)/∥c∥(\widehat q-s\widehat c)/\|c\|, then softmax cross-entropy supplies the probability-minus-target factor:

∂Lcon∂ct=1Nκ∥ct∥∑j∈Jt(Ptj−1[j=0])(q^tj−stjc^t).\frac{\partial\mathcal L_{\mathrm{con}}}{\partial c_t}=\frac1{N\kappa\|c_t\|}\sum_{j\in J_t}(P_{tj}-\mathbf1[j=0])\bigl(\widehat q_{tj}-s_{tj}\widehat c_t\bigr).

The target-vector derivative follows the symmetric cosine derivative and accumulates every candidate occurrence. Exact-equality filtering is a discrete rule: these derivatives describe a fixed candidate/filter configuration. Our finite-difference checks use distinct nonzero vectors, without claiming smoothness when a perturbation changes the filter.

A contrastive task also needs usable targets. The diversity statistic averages noise-free, temperature-free softmax probabilities across frames first, then measures each group’s entropy. The paper’s displayed negative-entropy term and its footnote’s implementation-oriented perplexity term are:

pˉgv=1T∑tsoftmax⁡(ltg)v,Hg=−∑vpˉgvln⁡pˉgv,Lent=−∑gHgGV,Ldiv=1−∑gexp⁡(Hg)GV.\bar p_{gv}=\frac1T\sum_t\operatorname{softmax}(l_{tg})_v,\quad H_g=-\sum_v\bar p_{gv}\ln\bar p_{gv},\quad \mathcal L_{\mathrm{ent}}=-\frac{\sum_g H_g}{GV},\quad \mathcal L_{\mathrm{div}}=1-\frac{\sum_g\exp(H_g)}{GV}.

Both favor uniform average usage, but they are different functions with different gradients. The footnote’s equivalence should not be read as numerical equality at every point. The implementation’s sum-perplexity is ∑gexp⁡(Hg)\sum_g\exp(H_g), whose maximum is GVGV, not the number VGV^G of possible combined codewords. Diversity equation and footnote Perplexity penalty

For the perplexity form, differentiating through the frame average and softmax yields:

agv=exp⁡(Hg)(ln⁡pˉgv+1)GVT,∂Ldiv∂ltgv=ptgv(0)(agv−∑jptgj(0)agj),ptg(0)=softmax⁡(ltg).a_{gv}=\frac{\exp(H_g)(\ln\bar p_{gv}+1)}{GVT},\qquad \frac{\partial\mathcal L_{\mathrm{div}}}{\partial l_{tgv}}=p^{(0)}_{tgv}\left(a_{gv}-\sum_jp^{(0)}_{tgj}a_{gj}\right),\quad p^{(0)}_{tg}=\operatorname{softmax}(l_{tg}).

The extra factor exp⁡(Hg)\exp(H_g) changes each group’s gradient scale compared with the negative-entropy form. The original training objective combines a contrastive term with a weighted diversity term, with further regularization depending on configuration. Our example exposes the terms separately; it does not jointly train an encoder, quantizer and Transformer.

Finally, temporal stride and receptive field describe different properties. For an unpadded convolution layer with kernel kℓk_\ell and stride sℓs_\ell, track output length nn, input-sample spacing jj and receptive field RR:

jℓ=jℓ−1sℓ,Rℓ=Rℓ−1+(kℓ−1)jℓ−1,nℓ=⌊nℓ−1−kℓsℓ⌋+1,j0=R0=1.j_\ell=j_{\ell-1}s_\ell,\quad R_\ell=R_{\ell-1}+(k_\ell-1)j_{\ell-1},\quad n_\ell=\left\lfloor\frac{n_{\ell-1}-k_\ell}{s_\ell}\right\rfloor+1,\quad j_0=R_0=1.

Using kernels (10, 3, 3, 3, 3, 2, 2) and strides (5, 2, 2, 2, 2, 2, 2) gives spacing 320 samples and receptive field 400. At 16 kHz these are 20 ms and 25 ms. A finite 16,000-sample input yields 49 valid frames; this does not redefine the nominal spacing as 1/49 second. Convolutional geometry

Inspect the objective before training a large network

The complete Python/NumPy program accepts bounded real arrays, small product codebooks and explicit negative indices. Quantization supports at most 16 frames, three groups, five entries per group and four coordinates per entry. Temperatures stay in [0.05, 5]. Uniform noise inputs are explicit; omitting them gives a deterministic choice. The toy target projection is the identity after concatenation.

Save the program as wav2vec2.py and run python wav2vec2.py with Python 3.12 and NumPy 1.26.4. All inputs are created locally; no GPU or downloaded model is needed.

"""Finite wav2vec 2.0 objectives, not a waveform encoder or speech recognizer."""
import json
import numpy as np


def array(values, ndim):
    raw = np.asarray(values)
    if raw.dtype.kind not in 'fiu' or raw.ndim != ndim:
        raise ValueError('Real numeric array with the declared rank required')
    x = raw.astype(float)
    if not np.isfinite(x).all() or np.max(np.abs(x), initial=0) > 20:
        raise ValueError('Finite values within +/-20 required')
    return x


def softmax(x):
    e = np.exp(x - np.max(x, axis=-1, keepdims=True))
    return e / e.sum(axis=-1, keepdims=True)


def temperature(value):
    if isinstance(value, (bool, np.bool_)) or not isinstance(value, (int, float, np.integer, np.floating)) or not .05 <= value <= 5:
        raise ValueError('Temperature must be in [0.05, 5]')
    return float(value)


def quantize(logits, books, tau=.5, uniforms=None, hard=True):
    l, e = array(logits, 3), array(books, 3)
    t, g, v = l.shape
    if not (1 <= t <= 16 and 1 <= g <= 3 and 2 <= v <= 5):
        raise ValueError('Quantizer bounds: 1..16 frames, 1..3 groups, 2..5 entries')
    if e.shape[:2] != (g, v) or not 1 <= e.shape[2] <= 4 or not isinstance(hard, bool):
        raise ValueError('Matching group/entry dimensions and Boolean hard mode required')
    tau = temperature(tau)
    noise = np.zeros_like(l)
    if uniforms is not None:
        u = array(uniforms, 3)
        if u.shape != l.shape or not ((u >= 1e-6) & (u <= 1-1e-6)).all():
            raise ValueError('Explicit uniforms must match logits and stay inside (0,1)')
        noise = -np.log(-np.log(u))
    p = softmax((l + noise) / tau)
    choices = np.argmax(l + noise, axis=-1)
    weights = np.eye(v)[choices] if hard else p
    features = np.einsum('tgv,gvd->tgd', weights, e).reshape(t, -1)
    return dict(features=features, probabilities=p, weights=weights,
                choices=choices, tau=tau, hard=hard)


def quantizer_vjp(logits, books, upstream, tau=.5, uniforms=None, hard=True):
    r = quantize(logits, books, tau, uniforms, hard)
    e = array(books, 3); u = array(upstream, 2)
    if u.shape != r['features'].shape:
        raise ValueError('Upstream derivative must match concatenated features')
    u = u.reshape(len(u), e.shape[0], e.shape[2])
    score = np.einsum('tgd,gvd->tgv', u, e)
    p = r['probabilities']
    dl = p * (score - (p * score).sum(axis=-1, keepdims=True)) / r['tau']
    de = np.einsum('tgv,tgd->gvd', r['weights'], u)
    # In hard mode dl is a straight-through surrogate, not the hard-map derivative.
    return dict(logits=dl, books=de)


def diversity(logits):
    l = array(logits, 3); t, g, v = l.shape
    if not (1 <= t <= 16 and 1 <= g <= 3 and 2 <= v <= 5):
        raise ValueError('Use the finite quantizer dimensions')
    p = softmax(l); mean = p.mean(axis=0)
    entropy = -(mean * np.log(mean)).sum(axis=-1)
    perplexity = np.exp(entropy)
    hard_mean = np.eye(v)[np.argmax(l, axis=-1)].mean(axis=0)
    positive = hard_mean > 0
    hard_terms = np.zeros_like(hard_mean)
    hard_terms[positive] = hard_mean[positive] * np.log(hard_mean[positive])
    slope = (np.log(mean) + 1) * perplexity[:, None] / (g*v*t)
    gradient = p * (slope - (p*slope).sum(axis=-1, keepdims=True))
    return dict(mean_probabilities=mean, entropy=entropy,
                probability_perplexity=float(perplexity.sum()),
                code_perplexity=float(np.exp(-hard_terms.sum(axis=-1)).sum()),
                negative_entropy=float(-entropy.sum()/(g*v)),
                loss=float(1-perplexity.sum()/(g*v)), gradient=gradient)


def contrastive(context, targets, negatives, kappa=.3):
    c, q = array(context, 2), array(targets, 2); ix = np.asarray(negatives)
    if c.shape != q.shape or not (2 <= len(c) <= 16 and 1 <= c.shape[1] <= 12):
        raise ValueError('Matched context/target arrays with 2..16 rows required')
    if ix.ndim != 2 or ix.dtype.kind not in 'iu' or ix.shape[0] != len(c) or not 1 <= ix.shape[1] <= 8:
        raise ValueError('Integer negative-index matrix with 1..8 candidates required')
    if not ((ix >= 0) & (ix < len(c))).all() or (ix == np.arange(len(c))[:, None]).any():
        raise ValueError('Negatives must index other supplied target rows')
    kappa = temperature(kappa)
    cn, qn = np.linalg.norm(c, axis=1), np.linalg.norm(q, axis=1)
    if (cn < 1e-8).any() or (qn < 1e-8).any():
        raise ValueError('Cosine inputs must have nonzero norms')
    ch, qh = c/cn[:, None], q/qn[:, None]
    dc, dq = np.zeros_like(c), np.zeros_like(q); losses=[]; probabilities=[]; discarded=[]
    for t in range(len(c)):
        candidates = np.r_[t, ix[t]]
        duplicate = np.r_[False, np.all(q[ix[t]] == q[t], axis=1)]
        cosine = qh[candidates] @ ch[t]
        score = cosine/kappa; score[duplicate] = -np.inf
        maximum = np.max(score); exp = np.exp(score-maximum); p = exp/exp.sum()
        losses.append(float(maximum + np.log(exp.sum()) - score[0]))
        probabilities.append(p); discarded.append(duplicate)
        weight = p.copy(); weight[0] -= 1; weight /= len(c)*kappa
        for j, index in enumerate(candidates):
            dc[t] += weight[j]*(qh[index]-cosine[j]*ch[t])/cn[t]
            dq[index] += weight[j]*(ch[t]-cosine[j]*qh[index])/qn[index]
    return dict(loss=float(np.mean(losses)), per_frame=losses,
                probabilities=np.array(probabilities), discarded=np.array(discarded),
                context_gradient=dc, target_gradient=dq)


def span_mask(length, starts, span):
    if type(length) is not int or not 1 <= length <= 32 or type(span) is not int or not 1 <= span <= length:
        raise ValueError('Positive finite integer length/span required')
    if not isinstance(starts, (list, tuple)) or any(type(i) is not int for i in starts) or len(set(starts)) != len(starts):
        raise ValueError('Unique integer starts required')
    if any(i < 0 or i+span > length for i in starts):
        raise ValueError('Every full span must fit')
    mask = np.zeros(length, bool)
    for i in starts: mask[i:i+span] = True
    return mask


def geometry(samples):
    if type(samples) is not int or not 400 <= samples <= 1_000_000:
        raise ValueError('At least one full receptive field is required')
    length, jump, field = samples, 1, 1
    for kernel, stride in zip((10,3,3,3,3,2,2), (5,2,2,2,2,2,2)):
        length = (length-kernel)//stride+1
        field += (kernel-1)*jump; jump *= stride
    return dict(frames=length, stride_samples=jump, receptive_field_samples=field)


def clean(x):
    if isinstance(x, np.ndarray): return x.tolist()
    if isinstance(x, dict): return {k:clean(v) for k,v in x.items()}
    if isinstance(x, (list, tuple)): return [clean(v) for v in x]
    if isinstance(x, np.generic): return x.item()
    return x


def demo():
    logits = np.array([[[3,0,-1],[0,3,-1]],[[0,3,-1],[3,0,-1]],
                       [[-1,0,3],[0,3,-1]],[[3,0,-1],[-1,0,3]]], float)
    books = np.array([[[1,0],[0,1],[-1,0]],[[0,1],[1,0],[0,-1]]], float)
    quantized = quantize(logits, books)
    q = quantized['features']; context = .3*q + .7*np.roll(q,1,axis=0) + .1
    negatives = np.array([[j for j in range(4) if j != i] for i in range(4)])
    initial = contrastive(context,q,negatives); losses=[]; trained=context.copy()
    for step in range(7):
        result=contrastive(trained,q,negatives);losses.append(result['loss'])
        if step<6:trained -= .2*result['context_gradient']
    uniform=np.zeros((4,2,3));collapsed=np.tile([[[8,-8,-8],[8,-8,-8]]],(4,1,1))
    duplicate=contrastive([[1,.2],[.2,1]],[[1,0],[1,0]],[[1],[0]])
    return clean(dict(logits=logits,books=books,quantized=quantized,context=context,
        negatives=negatives,initial=initial,training_losses=losses,diversity=diversity(logits),
        uniform_diversity=diversity(uniform),collapsed_diversity=diversity(collapsed),
        duplicate_example=duplicate,mask=span_mask(12,[2,4],4),geometry=geometry(16000)))


if __name__ == '__main__':
    print(json.dumps(demo(), ensure_ascii=False, indent=2, allow_nan=False))

The four supplied contexts are constructed from synthetic target mixtures. They are not outputs of a masked acoustic encoder. With fixed targets, six updates to context vectors reduce the contrastive objective from about 2.076875 to 0.464356. The separate diversity function has an analytic gradient checked by central differences; the example does not add that gradient to a supposed full-model training loop.

With two groups and three entries, uniform logits give probability perplexity approximately 6, but noise-free argmax ties always select the first entry and code perplexity is 2. Training with Gumbel samples introduces another selection distribution. Conversely, confident but balanced choices across frames can have high entropy of the average while each frame’s entropy is small. The fixed quantizer computes these diagnostics separately; our mathematical entropy uses the convention 0ln⁡0=00\ln0=0, without its small numerical epsilon. Distinct codebook diagnostics

With TT frames and entry dimension dd, quantization takes O(TGVd)O(TGVd) time and O(TGV+TGd+GVd)O(TGV+TGd+GVd) space for probabilities, outputs and codebooks. For NN selected positions, KK negative candidate positions per row and comparison dimension DD, contrastive scores and both gradients take O(N(K+1)D)O(N(K+1)D) time and O(N(K+1)+ND)O(N(K+1)+ND) space in our supplied-vector example. Diversity takes O(TGV)O(TGV) time. These bounds cover the small components, not Transformer pre-training. Invalid zero-norm cosine inputs are rejected explicitly rather than silently adopting a library-specific epsilon definition.

A pre-training objective is not a deployment score

For ASR, the paper adds a supervised output projection and fine-tunes with CTC. Unlabeled pre-training does not remove every need for transcripts, decoding choices or evaluation references. Separate unlabeled data volume, labeled fine-tuning volume and any external language-model information when comparing systems. Selecting a representation by pre-training loss alone is not a test of transcription quality.

Domain matters too. The Robust wav2vec 2.0 study explicitly separates pre-training, fine-tuning and test domains; its conclusions concern the tested configurations, not a universal promise of domain invariance. We use that distinction to motivate evaluation, without reproducing its benchmark figures. Domain-shift study

The implementation omits waveform feature learning, self-attention, joint codebook training, full stochastic masking and downstream recognition. It is designed to make candidate counting, hard versus soft gradients, and codebook statistics inspectable. It cannot establish an acoustic model’s accuracy, training cost or latency.

Predict what changes, then calculate it

  1. Understanding. Should the quantization target receive the same corruption as the context input?

    Answer: The original method quantizes unmasked features. Corrupting that path too would alter or remove the information that defines the target; context corruption and target construction have different roles.

  2. Calculation. Two unit vectors are orthogonal and each context matches its positive target. With comparison temperature 1, what loss comes from one negative? What if that negative is listed twice?

    Answer: Positive and negative cosine scores are 1 and 0. The losses are ln⁡(1+e−1)\ln(1+e^{-1}) and ln⁡(1+2e−1)\ln(1+2e^{-1}), about 0.313262 and 0.551445. Repeated candidate positions retain their multiplicity.

  3. Boundary. Two groups each have three uniformly probable entries. Must all nine combined codes appear in deterministic argmax output?

    Answer: No. Sum-perplexity can be 6 while tie-breaking always picks the first entry in each group, giving deterministic code perplexity 2. Nine is the maximum number of index combinations, not either diagnostic or a usage guarantee. Noisy training choices are another quantity.

  4. Transfer. A finite-difference derivative of the hard quantizer is zero, while its straight-through logit gradient is nonzero. Does this necessarily reveal an implementation error?

    Answer: No. Away from a boundary the hard forward map is locally constant. Straight-through deliberately uses the soft Jacobian as a surrogate. Check the soft map against finite differences and state the surrogate’s meaning; do not claim both derivatives are identical.

Keep formulas, configurations and experiments identifiable

The NeurIPS 2020 paper supplies the two-path architecture and original objectives; the pinned fairseq quantizer/model and PyTorch 2.6 source clarify temperature placement, diagnostics and filtering. The domain-shift paper supplies a separate evaluation question. Our numerical results come only from the supplied arrays and exact program above. Complete model training, published WER tables and transfer claims have not been reproduced here.

Make a prediction, then check

Does maximal probability perplexity guarantee diverse noiseless argmax choices?

Choose one answer

Learning objectives

  • Separate masked context from unmasked quantized targets.
  • Distinguish soft derivatives, hard choices and straight-through gradients.
  • Compute contrastive and diversity losses with their boundary conditions.
  • Interpret perplexity and convolution timing without inferring recognition quality.

Prerequisites & connections

Explore related knowledge →

References

  1. wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
    Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli · 2020
  2. fairseq: grouped Gumbel vector quantizer at 3d262bb
    fairseq contributors
  3. fairseq: wav2vec 2.0 contrastive scoring at 3d262bb
    fairseq contributors
  4. PyTorch 2.6 functional source: gumbel_softmax
    PyTorch contributors
  5. Robust wav2vec 2.0: Analyzing Domain Shift in Self-Supervised Pre-Training
    Wei-Ning Hsu, Anuroop Sriram, Alexei Baevski, Tatiana Likhomanenko, Qiantong Xu, Vineel Pratap, Jacob Kahn, Ann Lee, Ronan Collobert, Gabriel Synnaeve, Michael Auli · 2021

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-13 · Single AI author checked the 2020 wav2vec2 two-path architecture, positive-temperature Gumbel definition, hard-forward versus straight-through derivative, masked contrastive candidates and equal-vector filtering, cosine gradients, negative entropy versus perplexity, noiseless diagnostics and finite convolution geometry against scoped NeurIPS2020 pages3–4, fixed fairseq ranges and PyTorch2.6 gumbel source. Eight paired equations and four explained exercises. Supplied context/target component computations only, not encoder/quantizer joint training, recognition benchmarks or domain-invariance proof.

  • Checked soft finite differences separately from hard surrogate, repeated-negative log(1+exp(-1)) and log(1+2exp(-1)), exact-equality filtering, diversity gradients and probability perplexity6 versus noiseless code2; overlapping mask6 and valid geometry320/400/49. Context-only loss2.076875 to0.464356.
  • Four computed SVGs bind exact bilingual MDX. The two-topic group passed nine numeric/encoding checks and 12 isolated language/width cases with four fallback fonts; eight actual screenshots inspected by the AI author. Literal-prose AST checked before freezing. Full article browser acceptance is separate; no human peer review.

Source locations checked:

  • wav2vec 2.0: A Framework for Self-Supervised Learning of Speech · Read sections2–3 architecture, masking, quantization, objectives and CTC; sections4.1–4.2 data/configuration fragments. Visually inspected physical pages3–4 equations and footnote2. Temperature typography and entropy/perplexity differences are stated; no benchmark reproduced. Author spelling follows the read PDF.
  • fairseq: grouped Gumbel vector quantizer at 3d262bb · Read lines91–95 and147–205: temperature schedule, noiseless diagnostics, soft probability perplexity, Gumbel selection and group concatenation. Full MIT license read; no upstream code executed or copied. Original example omits the entropy epsilon.
  • fairseq: wav2vec 2.0 contrastive scoring at 3d262bb · Read negative-index sampling fragment499–525, cosine/equal-negative filter557–577 and target/extra-loss814–837. Not an audit of the complete forward path or every loss configuration.
  • PyTorch 2.6 functional source: gumbel_softmax · Read complete gumbel_softmax function and documentation in extracted lines1977–2040: divide logits plus noise by tau, and hard-minus-detached-soft plus soft. PyTorch not executed.
  • Robust wav2vec 2.0: Analyzing Domain Shift in Self-Supervised Pre-Training · Read abstract, opening introduction and conclusion only; used for separating pretraining, fine-tuning and test domains. No numeric improvement claims or tables adopted. Sidebar April2 and internal October12,2021 dates conflict; not resolved into a publication history.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.