AI Wiki中文/EN

Neural audio codecs: from learned vectors to transmitted bytes

神经音频编解码

Train a small residual-quantized codec, check surrogate gradients and pack a real bitstream with explicit overhead.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

Why does a 4 kbps codec send 10 kbps?

Compress a synthetic sound lasting just 16 milliseconds. The encoder produces 2,000 vectors per second and sends a two-bit identifier for each: 4 kbps. Yet the resulting packet contains 20 bytes. Divide its bits by the sound’s duration and the rate is 10 kbps. The difference comes from the header. This tiny example exposes the denominator and overhead often hidden inside the word “bitrate.”

A neural audio codec learns a representation that can be quantized, then reconstructs a waveform from finite identifiers. The receiver does not somehow obtain the encoder’s floating-point latent vectors. The transmitted message contains codeword indices and information needed to interpret them. Both sides must also have compatible codebooks and a decoder. A floating-point autoencoder without discrete messages and a transmission convention has not finished this job.

SoundStream and EnCodec combine learned encoders, residual vector quantization and waveform decoders. Their networks, objectives and datasets are much richer than this article’s program. We extract a path that can be calculated by hand, trained and actually packed into bytes, following the connection from losses to codewords to files. SoundStream EnCodec

The vocoder article asks how an acoustic description becomes a waveform. Here the description must fit into a limited number of bits. Review sampling rates and gradient checking before working through rate, distortion and surrogate gradients.

Actual waveform reconstruction, code indices, packet overhead and a distortion counterexample distinguish payload rate from transmitted size.
Actual waveform reconstruction, code indices, packet overhead and a distortion counterexample distinguish payload rate from transmitted size.

Compress into vectors, then turn vectors into identifiers

Group a normalized waveform of length NN into four-sample blocks, padding the last block with zeros. Then T=⌈N/4⌉T=\lceil N/4\rceil, and XX has TT rows and four columns. The teaching encoder EE maps each row to two dimensions. Decoder DD maps its quantized representation back to four samples. Both are linear matrices:

Z=XE,X^=Z^D,E∈R4×2,D∈R2×4.Z=XE,\qquad\widehat X=\widehat ZD,\qquad E\in\mathbb R^{4\times2},\quad D\in\mathbb R^{2\times4}.

Larger models learn context across blocks. This example has no convolution, recurrent state or nonlinear decoder, so its behavior is evidence about this small problem, not natural-speech compression quality. SoundStream Figure 3 and EnCodec section 3 describe larger networks. For example, a total downsampling stride of 320 converts a 24 kHz waveform into 75 latent vectors per second. Architecture and downsampling EnCodec architecture

Residual vector quantization: refine what the preceding layer missed

Each codebook contains KK vectors of dimension dd. For a latent vector zz, choose the closest first-layer codeword, then quantize the remaining residual. Let LL be the number of active layers; ties select the lowest index:

r0=z,cℓ=arg⁡min⁡0≤k<K∥rℓ−1−bℓ,k∥22,rℓ=rℓ−1−bℓ,cℓ,z^=∑ℓ=1Lbℓ,cℓ.r_0=z,\quad c_\ell=\mathop{\arg\min}_{0\le k<K}\|r_{\ell-1}-b_{\ell,k}\|_2^2,\quad r_\ell=r_{\ell-1}-b_{\ell,c_\ell},\quad\widehat z=\sum_{\ell=1}^L b_{\ell,c_\ell}.

The identifiers c1,…,cLc_1,\ldots,c_L form the discrete message. The receiver looks up the same codebooks and adds the codewords to obtain z^\widehat z. Our example has two layers with four two-dimensional codewords each, and fixes entry zero in each layer to the zero vector. Because zero is always an available candidate, the minimum residual energy cannot increase when another layer is added:

bℓ,0=0⟹∥rℓ∥22=min⁡k∥rℓ−1−bℓ,k∥22≤∥rℓ−1∥22.b_{\ell,0}=0\quad\Longrightarrow\quad\|r_\ell\|_2^2=\min_k\|r_{\ell-1}-b_{\ell,k}\|_2^2\le\|r_{\ell-1}\|_2^2.

This guarantee depends on our fixed zero entry; it is not an automatic property of every residual quantizer. It also applies only in latent space. Take z=[1,0.1]z=[1,0.1]. The first layer selects [0,0.1][0,0.1] and the second adds [0.8,0.5][0.8,0.5]. Residual MSE falls from 0.5 to 0.145. But if a decoder amplifies the second dimension tenfold, decoded MSE relative to zDzD rises from 0.5 to 12.52. The latent vector becomes closer while its decoded representation becomes farther away.

A bitrate must say what it counts

With fzf_z latent vectors per second and KK entries per codebook, a fixed-length index needs at least ⌈log⁡2K⌉\lceil\log_2 K\rceil bits. Both our codebooks and the 1,024-entry example have power-of-two sizes, so the expression simplifies to:

Rindices=fzLlog⁡2K,fz=fsstride(K a power of two).R_{\mathrm{indices}}=f_zL\log_2K,\qquad f_z=\frac{f_s}{\text{stride}}\qquad(K\text{ a power of two}).

SoundStream explains 6 kbps using 75 frames per second, eight layers and 1,024 entries per layer: 80 bits per frame. A single giant codebook with the same fixed index width would require 2802^{80} entries, whereas eight layers store eight groups of 1,024. Residual decomposition reduces codebook storage, but greedy layer-by-layer selection need not find the best combination globally. Rate example and Algorithm 1

EnCodec v1 says that the active codebook count is a multiple of four while also listing a 1.5 kbps configuration. At 75 frames per second and ten bits per layer, 1.5 kbps actually requires two layers. The pinned wrapper also divides target bandwidth by per-layer bandwidth and rounds down. We retain this textual discrepancy and explain the configuration using its arithmetic. Paper section 3.2 Pinned bandwidth calculation

This remains an index payload rate. It excludes headers, padding, model distribution and network overhead. Entropy coding can exploit the distribution of identifiers, but requires a probability model, bitstream rules and their costs. EnCodec discusses that direction; our example uses fixed two-bit indices and does not claim unimplemented entropy-coding savings. Compression write path

How can training pass through a discrete identifier?

A nearest-neighbor index usually stays unchanged under a small parameter perturbation and is discontinuous at a switching boundary. Our forward pass performs actual quantization. The backward pass adopts a straight-through estimator, or STE, once at the total quantized vector. The symbol sg⁡\operatorname{sg} stops gradients:

QST(Z)=Z+sg⁡(Z^−Z),∂QST∂Z=^I.Q_{\mathrm{ST}}(Z)=Z+\operatorname{sg}(\widehat Z-Z),\qquad\frac{\partial Q_{\mathrm{ST}}}{\partial Z}\mathrel{\widehat=}I.

The forward value is still Z^\widehat Z, but its derivative with respect to ZZ is deliberately replaced by the identity. Reconstruction uses all 4T4T padded samples. A commitment term pulls the encoder toward the current quantized vector:

J=∥QSTD−X∥F24T+β∥Z−sg⁡(Z^)∥F22T.J=\frac{\|Q_{\mathrm{ST}}D-X\|_F^2}{4T}+\beta\frac{\|Z-\operatorname{sg}(\widehat Z)\|_F^2}{2T}.

Here β=0.25\beta=0.25. Using one commitment term against the total quantized vector is our choice. The EnCodec paper sums terms across layers, while the pinned wrapper averages their penalties. These differently scaled objectives should not be described as identical implementations. Quantization and training Pinned wrapper

Let GG be the reconstruction loss gradient with respect to the output. Matrix chain rules give:

G=2(Z^D−X)4T,∇DJ=Z^⊤G,∇~EJ=X⊤ ⁣(GD⊤+2β(Z−Z^)2T).G=\frac{2(\widehat ZD-X)}{4T},\qquad\nabla_DJ=\widehat Z^\top G,\qquad\widetilde\nabla_EJ=X^\top\!\left(GD^\top+\frac{2\beta(Z-\widehat Z)}{2T}\right).

The decoder gradient is a genuine derivative with the selected codewords fixed. The reconstruction part of the encoder expression is an STE surrogate, not the true derivative of the discrete objective. The program checks it by finite differences on an anchored surrogate function, then checks a separate counterexample: inside one constant-code region, the true reconstruction derivative is zero while the STE returns −0.02. Gradient checking

The pinned EnCodec quantizer contains a training-gradient warning. If a layer’s STE output is differentiated again through the residual update, identity derivatives can subtract to zero. Our example places one STE at the total quantized vector. Understanding an inference path does not establish that its training path has been validated. Pinned quantization code

Codebooks use a separate Lloyd update. With current nearest-neighbor assignments fixed, each nonzero codeword becomes the mean of its assigned residuals, clipped to the declared [−8,8][-8,8] bounds. Unused entries retain their values; entry zero stays fixed. A clipped mean minimizes squared error within this box for the fixed assignment. Reassign after updating, then process the next layer. This differs from the papers’ EMA update. Our training always uses two layers and does not implement SoundStream’s random codebook-prefix dropout. Original training strategy

A small file that can actually be encoded and decoded

The complete Python program below uses Python 3.12 and NumPy 1.26.4. Its synthetic data contains 128 samples from two sinusoids. Initialization uses seed 7; training runs for 250 steps at learning rate 0.05. There is no natural speech, pretrained model or test split. The encode function returns bytes; decode reads their indices and reconstructs the waveform, cropping padding to the original length.

Our AWC1 format has a 12-byte header: four magic bytes, a two-byte original length, a one-byte active-layer count, a one-byte index width and a four-byte model tag. Header integers use network byte order. Payload indices are ordered by time and then layer, written most-significant bits first at two bits each, and padded with zeros to a final byte. This is not EnCodec’s ECDC format. The decoder rejects extra bytes, nonzero padding and mismatched model tags. Compare a real pinned format

Both sides already agree on 8 kHz, block length four, latent width two and four-entry codebooks. The model tag is the first four SHA-256 bytes of the decoder and codebooks. It helps detect mismatches but can collide and provides no authentication. Eight decoder parameters plus sixteen codebook parameters occupy 192 bytes as float64 values, obtained outside the packet. That model-distribution cost amortizes differently over one short sound and a long stream of packets.

B=12+⌈⌈N/4⌉L⋅28⌉ bytes,Rpacket=8BN/8000 bit/s.B=12+\left\lceil\frac{\lceil N/4\rceil L\cdot2}{8}\right\rceil\ \text{bytes},\qquad R_{\mathrm{packet}}=\frac{8B}{N/8000}\ \text{bit/s}.
"""Original tiny learned block codec with two residual quantizers.

Linear encoder/decoder; Lloyd codebook updates with a fixed zero entry.
One straight-through surrogate at the total quantized vector, not an exact
derivative of a discrete map. No convolution, EMA, adversary or entropy coder.
AWC1 packets use a fixed 8 kHz / four-sample block teaching protocol.
"""
import hashlib
import json
import struct
import numpy as np

HEADER=struct.Struct('!4sHBB4s')


def array(value,shape=None,bound=8):
    a=np.asarray(value)
    if a.dtype.kind not in 'fiu' or not 1<=a.size<=16384 or not np.isfinite(a).all() or np.any((a < -bound)|(a > bound)) or (shape is not None and a.shape!=shape):raise ValueError('Invalid bounded real array')
    return a.astype(float)


def parameters(value):
    if not isinstance(value,dict) or set(value)!={'encoder','decoder','books'}:raise ValueError('Invalid model fields')
    p={k:array(value[k],shape) for k,shape in [('encoder',(4,2)),('decoder',(2,4)),('books',(2,4,2))]}
    if np.any(p['books'][:,0]!=0):raise ValueError('Code zero is fixed at the zero vector')
    return p


def blocks(signal):
    x=array(signal,bound=1)
    if x.ndim!=1 or not 1<=len(x)<=1024:raise ValueError('Use 1 to 1024 normalized samples')
    return np.pad(x,(0,(-len(x))%4)).reshape(-1,4)


def quantize(latent,books,active=2):
    z=array(latent,bound=64);b=array(books,(2,4,2))
    if z.ndim!=2 or z.shape[1]!=2 or not 1<=len(z)<=256 or np.any(b[:,0]!=0) or type(active) is not int or active not in (1,2):raise ValueError('Invalid residual quantizer input')
    residual=z.copy();total=np.zeros_like(z);codes=[];errors=[float(np.mean(residual**2))]
    for layer in range(active):
        distance=np.sum((residual[:,None,:]-b[layer])**2,axis=2);index=distance.argmin(axis=1)
        q=b[layer,index];codes.append(index);total+=q;residual-=q;errors.append(float(np.mean(residual**2)))
    return dict(values=total,codes=np.stack(codes,axis=1),residual_mse=errors)


def initialize(seed=7):
    if type(seed) is not int or not 0<=seed<2**32:raise ValueError('Invalid seed')
    rng=np.random.default_rng(seed);books=rng.normal(0,.3,(2,4,2));books[:,0]=0
    return dict(encoder=rng.normal(0,.4,(4,2)),decoder=rng.normal(0,.4,(2,4)),books=books)


def objective(signal,value,active=2,beta=.25):
    x=blocks(signal);p=parameters(value)
    if type(beta) not in (int,float) or not 0<=beta<=1:raise ValueError('Invalid commitment weight')
    z=x@p['encoder'];q=quantize(z,p['books'],active);reconstruction=q['values']@p['decoder'];residual=reconstruction-x
    reconstruction_loss=float(np.mean(residual**2));commitment=float(np.mean((z-q['values'])**2))
    dy=2*residual/x.size;decoder_gradient=q['values'].T@dy
    dz=dy@p['decoder'].T+2*beta*(z-q['values'])/z.size
    return dict(loss=reconstruction_loss+beta*commitment,reconstruction_loss=reconstruction_loss,commitment=commitment,latent=z,quantized=q['values'],codes=q['codes'],residual_mse=q['residual_mse'],signal=reconstruction.ravel()[:len(signal)],gradient=dict(encoder=x.T@dz,decoder=decoder_gradient))


def update_books(latent,books):
    z=array(latent,bound=64);b=array(books,(2,4,2)).copy()
    if z.ndim!=2 or z.shape[1]!=2 or not 1<=len(z)<=256 or np.any(b[:,0]!=0):raise ValueError('Invalid codebook update')
    residual=z.copy()
    for layer in range(2):
        selected=np.sum((residual[:,None,:]-b[layer])**2,axis=2).argmin(axis=1)
        for index in range(1,4):
            members=residual[selected==index]
            if len(members):b[layer,index]=np.clip(members.mean(axis=0),-8,8)
        selected=np.sum((residual[:,None,:]-b[layer])**2,axis=2).argmin(axis=1)
        residual-=b[layer,selected]
    return b


def fit(signal,steps=250,rate=.05):
    if type(steps) is not int or not 0<=steps<=500 or type(rate) not in (int,float) or not 0<rate<=.1:raise ValueError('Invalid training settings')
    x=blocks(signal);p=initialize();history=[]
    for _ in range(steps):
        r=objective(signal,p);history.append(r['reconstruction_loss'])
        for key in ['encoder','decoder']:p[key]-=rate*r['gradient'][key]
        p['books']=update_books(x@p['encoder'],p['books'])
    history.append(objective(signal,p)['reconstruction_loss'])
    return dict(parameters=p,history=history)


def model_tag(value):
    p=parameters(value)
    return hashlib.sha256(p['decoder'].astype('>f8').tobytes()+p['books'].astype('>f8').tobytes()).digest()[:4]


def pack(codes,length,tag):
    c=np.asarray(codes)
    if type(length) is not int or not 1<=length<=1024 or type(tag) is not bytes or len(tag)!=4 or c.dtype.kind not in 'iu' or c.ndim!=2 or c.shape[0]!=(length+3)//4 or c.shape[1] not in (1,2) or np.any((c<0)|(c>3)):raise ValueError('Invalid packet inputs')
    word=0
    for index in c.ravel():word=(word<<2)|int(index)
    payload_bits=c.size*2;byte_count=(payload_bits+7)//8;padding=byte_count*8-payload_bits
    return HEADER.pack(b'AWC1',length,c.shape[1],2,tag)+(word<<padding).to_bytes(byte_count,'big')


def unpack(packet,expected_tag):
    if type(packet) is not bytes or type(expected_tag) is not bytes or len(expected_tag)!=4 or not HEADER.size<=len(packet)<=140:raise ValueError('Invalid packet size/type')
    magic,length,active,bits,tag=HEADER.unpack(packet[:HEADER.size])
    if magic!=b'AWC1' or not 1<=length<=1024 or active not in (1,2) or bits!=2 or tag!=expected_tag:raise ValueError('Unsupported format or decoder model mismatch')
    count=((length+3)//4)*active;payload_bits=count*bits;byte_count=(payload_bits+7)//8;padding=byte_count*8-payload_bits
    if len(packet)!=HEADER.size+byte_count:raise ValueError('Truncated or extra payload')
    word=int.from_bytes(packet[HEADER.size:],'big')
    if word&((1<<padding)-1):raise ValueError('Nonzero padding bits')
    word>>=padding;codes=np.array([(word>>(2*(count-1-i)))&3 for i in range(count)]).reshape(-1,active)
    return dict(length=length,codes=codes,payload_bits=payload_bits,header_bytes=HEADER.size,padding_bits=padding)


def encode(signal,value,active=2):
    p=parameters(value);x=blocks(signal);q=quantize(x@p['encoder'],p['books'],active)
    return pack(q['codes'],len(signal),model_tag(p))


def decode(packet,value):
    p=parameters(value);info=unpack(packet,model_tag(p));codes=info['codes'];latent=np.zeros((len(codes),2))
    for layer in range(codes.shape[1]):latent+=p['books'][layer,codes[:,layer]]
    return (latent@p['decoder']).ravel()[:info['length']]


def demo():
    x=.65*np.sin(2*np.pi*np.arange(128)/16)+.15*np.sin(2*np.pi*np.arange(128)/7);trained=fit(x);p=trained['parameters'];rates={}
    for active in (1,2):
        packet=encode(x,p,active);restored=decode(packet,p);info=unpack(packet,model_tag(p))
        rates[str(active)]=dict(active=active,nominal_bps=8000/4*active*2,payload_bits=info['payload_bits'],packet_bytes=len(packet),packet_bps=len(packet)*8/(len(x)/8000),mse=float(np.mean((restored-x)**2)),packet_hex=packet.hex(),codes=info['codes'].tolist(),waveform=restored.tolist())
    z=np.array([[1.,.1]]);b=np.array([[[0,0],[0,.1],[0,0],[0,0]],[[0,0],[.8,.5],[0,0],[0,0]]],float);a=quantize(z,b,1);c=quantize(z,b,2);scale=np.diag([1.,10.])
    return dict(protocol=dict(sample_rate=8000,block_size=4,latent_width=2,codebook_size=4,header_bytes=HEADER.size,model_bytes=(p['decoder'].size+p['books'].size)*8,model_out_of_band=True),training=dict(first=trained['history'][0],last=trained['history'][-1],history=trained['history'][::10]),rates=rates,original=x.tolist(),parameters={k:v.tolist() for k,v in p.items()},
        latent_vs_decoded=dict(latent_mse=[a['residual_mse'][-1],c['residual_mse'][-1]],decoded_mse=[float(np.mean(((z-a['values'])@scale)**2)),float(np.mean(((z-c['values'])@scale)**2))]))


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

Default reconstruction MSE falls from about 0.166368 to 0.046589, but initially rises to about 0.174610 at step ten. An alternating update should not be plotted as necessarily improving at every step. The training reconstruction term includes padded samples; reported waveform error crops them. The default length 128 is divisible by four, so those lengths agree. For odd lengths, distinguish the denominators.

Active layersNominal index rateActual packet sizePacket rate including header
14 kbps20 bytes10 kbps
28 kbps28 bytes14 kbps

The table still excludes the shared 192-byte model and network transport headers. A single-layer prefix can be decoded, but only the two-layer path was trained. Supporting two prefix lengths does not establish that both rates were trained adequately.

For TT vectors of dimension dd, LL layers and KK codewords per layer, naive nearest-neighbor search costs O(TLKd)O(TLKd). Our linear encoder and decoder cost O(T⋅4⋅2)O(T\cdot4\cdot2). Multiply by the iteration count for training. The packer accumulates the entire payload in a Python big integer; repeated shifts can have quadratic bit-operation cost as its size grows. Inputs are capped at 1,024 samples, and this is not a high-performance streaming implementation.

Small files, low error and good sound answer different questions

A non-AI baseline could use fixed-quantization PCM. At sixteen bits per sample, 8 kHz mono has a raw payload rate of 128 kbps. This gives compression ratios a clear reference, but a fair quality comparison also needs matched inputs, loudness and evaluation protocols. We did not run listening comparisons against this baseline or traditional codecs.

Learned models are limited by training data and distribution. A linear model fitted to two sinusoids has not demonstrated competence on consonants, musical transients or noise. Latent squared error, waveform MSE and human perception cannot substitute for one another. The amplifying-decoder counterexample already disproves a guarantee that more layers improve every form of distortion.

A working system must also choose buffering, future context, packet-loss recovery and model-version negotiation. Our example specifies block length but measures no end-to-end latency. The duration of four samples is not automatically system latency. EnCodec distinguishes streaming and non-streaming paths; its latency or quality claims must be read with the relevant architecture and test conditions. Architecture conditions

Count the payload, then count the header

  1. Calculate a rate. A 24 kHz input uses total stride 320, eight codebook layers and 1,024 entries per layer. What is the index rate? How many entries would one codebook with the same index width require?

Answer: The latent rate is 24,000/320 = 75 frames per second. Each frame needs 8 × 10 = 80 bits, giving 6,000 bit/s. An 80-bit index identifies 2802^{80} entries. Residual layers avoid storing that huge codebook, but their greedy selection is not a global combination search.

  1. Check file overhead. AWC1 sends 128 waveform samples at 8 kHz using one layer, two bits per index, four samples per block and a 12-byte header. Calculate payload bytes, packet bytes and packet rate.

Answer: Thirty-two indices occupy 64 bits, or eight payload bytes. The packet has twenty bytes and represents 0.016 seconds, so its rate is 20 × 8 / 0.016 = 10,000 bit/s. The nominal 4 kbps counts indices only, excluding the header and out-of-band model.

  1. Reject a false guarantee. If a fixed zero code ensures nonincreasing latent residual error, must decoded MSE also be nonincreasing? Use the article’s counterexample.

Answer: No. The residual changes from [1,0][1,0] to [0.2,−0.5][0.2,-0.5], reducing latent MSE from 0.5 to 0.145. Multiplication by diag(1,10) makes the second component −5, so decoded MSE becomes (0.22+52)/2=12.52(0.2^2+5^2)/2=12.52, exceeding the previous 0.5.

  1. Choose the gradient-check target. Within a neighborhood where codewords stay unchanged, finite differences of discrete reconstruction loss with respect to the encoder give zero, while the STE is nonzero. Does this necessarily indicate a bug?

Answer: No. An STE specifies a surrogate derivative. Fix an anchor Z0,Z^0Z_0,\widehat Z_0 and finite-difference the surrogate built with Z+sg⁡(Z^0−Z0)Z+\operatorname{sg}(\widehat Z_0-Z_0). Retain the check that the genuine derivative is zero to establish that the two were deliberately distinguished. Correct surrogate gradients do not make discrete optimization exactly differentiable.

Read from architecture down to transmitted bytes

The 2021 SoundStream preprint provides residual quantization, rate arithmetic and training-time codebook-prefix dropout. EnCodec’s 2022 v1 adds details about networks, loss balancing and compression paths. This article uses the scoped sections actually read; authors’ quality and speed results are not presented as our reproductions. SoundStream EnCodec

The pinned code commit is 0e2d0aed29362c8e8f52494baf3e6f99056b214f. Its quantizer grounds the STE and training-warning discussion; the wrapper grounds layer counts and loss scaling; compression and binary files distinguish indices from containers. The code’s MIT license was read, but weight licensing was not separately verified. The teaching program is original; no upstream model was copied or executed. Quantizer Bandwidth Packing entry point Binary format

Make a prediction, then check

Why does the one-layer 128-sample example have 10 kbps packet rate despite 4 kbps nominal rate?

Choose one answer

Learning objectives

  • Compute payload rate separately from packet and model overhead.
  • Derive residual quantization and distinguish latent from decoded distortion.
  • Check genuine decoder derivatives and anchored encoder surrogate gradients.
  • Encode and decode an explicit bounded binary format.

Prerequisites & connections

Explore related knowledge →

References

  1. SoundStream: An End-to-End Neural Audio Codec (v1)
    Neil Zeghidour; Alejandro Luebs; Ahmed Omran; Jan Skoglund; Marco Tagliasacchi · 2021
  2. High Fidelity Neural Audio Compression (v1)
    Alexandre Défossez; Jade Copet; Gabriel Synnaeve; Yossi Adi · 2022
  3. EnCodec residual quantizer at 0e2d0ae
    EnCodec contributors
  4. EnCodec bandwidth and penalty wrapper at 0e2d0ae
    EnCodec contributors
  5. EnCodec compression write path at 0e2d0ae
    EnCodec contributors
  6. EnCodec binary header and bit packer at 0e2d0ae
    EnCodec contributors

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-13 · Single AI author checked scoped SoundStream and EnCodec architecture, rates and fixed-code discrepancies. Eight paired equations, four explained exercises; original bounded linear RVQ, all encoder surrogate and decoder true gradients, real AWC1 packets, nonmonotonic synthetic fitting and distortion counterexample. Not full neural audio compression or a listening benchmark.

  • Verified eight encoder anchored-surrogate and eight decoder true derivatives, zero discrete derivative counterexample, bounded Lloyd updates and packet roundtrips. Nominal4/8kbps versus packet10/14kbps for128 samples,192 out-of-band model bytes and latent/decoded distortion reversal computed.
  • Four computed SVGs bind exact bilingual MDX. The two-topic group passed10 numeric/encoding checks and12 isolated language/width cases with four fallback fonts; four representative final screenshots inspected by the AI author. Mobile heading clipping and bar spacing corrected with originals preserved. Literal-prose AST checked before freezing. Full article browser acceptance is separate; no human peer review.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

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