SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.15491 · 2026

The Equalizer: Introducing Shape-Gain Decomposition in Neural Audio Codecs

Xavier Alameda-Pineda, Samir Sadok, Laurent Girin

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2602.15491.json · badge: /api/ran/2602.15491.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
facebookresearch/encodec canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
descriptinc/descript-audio-codec canonical (classifier label)
classifier basis: plan_row
1 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_parametrization_norm Ran
ran; our contract draft was wrong, not the code
facebookresearch/encodec/encodec/modules/conv.py
code served (permissive licence) · get_code("6c82cd3d9b6dba51")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Conv2d. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn
from torch.nn.utils import spectral_norm, weight_norm

torch.manual_seed(0)

# Create a simple module to test with
module = nn.Conv2d(3, 4, kernel_size=3)

# Test with different normalization types
ARGS = {
    'module': module,
    'norm': 'weight_norm'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
average_metrics Ran
ran; our contract draft was wrong, not the code
facebookresearch/encodec/encodec/distrib.py
code served (permissive licence) · get_code("a80c481df180560f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import typing as tp

torch.manual_seed(0)

ARGS = {
    "metrics": {
        "loss": 0.5,
        "accuracy": 0.95,
        "f1_score": 0.87
    },
    "count": 2.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
averager Ran
ran; our contract draft was wrong, not the code
facebookresearch/encodec/encodec/balancer.py
code served (permissive licence) · get_code("ed1f44e26b8871ff")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import defaultdict
import typing as tp

torch.manual_seed(0)

# The function 'averager' takes a single parameter: beta (float)
# Looking at the function body, beta is used in exponential moving average calculations
# For testing, we'll use a typical beta value less than 1 for EMA, and also test beta=1 for plain averaging

ARGS = {
    "beta": 0.9
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_sin_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
facebookresearch/encodec/encodec/modules/transformer.py
code served (permissive licence) · get_code("5969591b5acad09f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create positions tensor - shape (batch_size, seq_len, 1) or similar
# The function expects positions to be used in division and indexing operations
positions = torch.arange(8, dtype=torch.float32).view(2, 4, 1)

# Dimension must be even (asserted in function)
dim = 4

# max_period is a float parameter
max_period = 10000.0

ARGS = {
    "positions": positions,
    "dim": dim,
    "max_period": max_period,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_2d_padding Ran
ran, violated the contract we drafted
facebookresearch/encodec/encodec/msstftd.py
code served (permissive licence) · get_code("35ac4a3a2d0faeac")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import typing as tp

def get_2d_padding(kernel_size: tp.Tuple[int, int], dilation: tp.Tuple[int, int]=(1, 1)):
    return ((kernel_size[0] - 1) * dilation[0] // 2, (kernel_size[1] - 1) * dilation[1] // 2)

ARGS = {
    "kernel_size": (3, 5),
    "dilation": (1, 2)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_extra_padding_for_conv1d Ran
ran; our contract draft was wrong, not the code
facebookresearch/encodec/encodec/modules/conv.py
code served (permissive licence) · get_code("8d9aa381c6147164")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Create a small tensor with shape (batch, channels, length)
# The function accesses x.shape[-1] to get the length dimension
x = torch.randn(2, 4, 16)  # batch=2, channels=4, length=16

# Set up typical conv1d parameters
kernel_size = 3
stride = 2
padding_total = 0

ARGS = {
    "x": x,
    "kernel_size": kernel_size,
    "stride": stride,
    "padding_total": padding_total,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_ecdc_header Ran
ran; our contract draft was wrong, not the code
facebookresearch/encodec/encodec/binary.py
code served (permissive licence) · get_code("ceb9db5dc46e3669")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import struct
import typing as tp
from io import BytesIO

_encodec_header_struct = struct.Struct('!4sBI')
_ENCODEC_MAGIC = b'ECDC'

# Create a valid ECDC format file in memory
metadata = {"sample_rate": 24000, "channels": 1, "bandwidth": 6.0}
meta_bytes = json.dumps(metadata).encode('utf-8')
meta_size = len(meta_bytes)

# Pack the header: magic (4s), version (B), meta_size (I)
header = _encodec_header_struct.pack(_ENCODEC_MAGIC, 0, meta_size)

# Create a BytesIO object with the complete header + metadata
file_content = header + meta_bytes
fo = BytesIO(file_content)

ARGS = {
    'fo': fo
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
snake Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
descriptinc/descript-audio-codec/dac/nn/layers.py
code served (permissive licence) · get_code("f247e4748f379a76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes two parameters: x (a tensor) and alpha (a scalar or tensor)
# x is reshaped, modified with sin operations, and reshaped back
# alpha is used in arithmetic operations (reciprocal, multiplication)

# Create a small tensor with shape (batch=2, channels=4, height=3, width=5)
x = torch.randn(2, 4, 3, 5)

# Create a scalar alpha parameter
alpha = torch.tensor(1.0)

ARGS = {
    "x": x,
    "alpha": alpha,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
all_reduce Not yet run
unverified (harvested, no recorded run)
facebookresearch/encodec/encodec/distrib.py
code served (permissive licence) · get_code("193e4cb06c7034a4")
How it ran

no invocation recorded.

get_norm_module Not yet run
unverified (harvested, no recorded run)
facebookresearch/encodec/encodec/modules/conv.py
code served (permissive licence) · get_code("9b33ed59d8d8736e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 1 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
snake 10 other papers
10 dated earlier · 1 only as an assembly brick
2306.06546 (2023-06)
High-Fidelity Audio Compression with Improved RVQGAN
2307.04686 (2023-07)
VampNet: Music Generation via Masked Acoustic Token Modeling
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
and 7 more not named here
get_extra_padding_for_conv1d 9 other papers
8 dated earlier, 1 later · 1 only as an assembly brick
2306.06546 (2023-06)
High-Fidelity Audio Compression with Improved RVQGAN
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2310.00014 (2023-10)
Fewer-token Neural Speech Codec with Time-invariant Codes
and 6 more not named here
apply_parametrization_norm 5 other papers
5 dated earlier · 1 only as an assembly brick
2306.06546 (2023-06)
High-Fidelity Audio Compression with Improved RVQGAN
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2310.00014 (2023-10)
Fewer-token Neural Speech Codec with Time-invariant Codes
and 2 more not named here
get_norm_module 5 other papers
5 dated earlier · 1 only as an assembly brick
2306.06546 (2023-06)
High-Fidelity Audio Compression with Improved RVQGAN
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2405.04752 (2024-05)
HILCodec: High-Fidelity and Lightweight Neural Audio Codec
and 2 more not named here
all_reduce 2 other papers
2 dated earlier
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2502.17462 (2025-02)
The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG
average_metrics 2 other papers
2 dated earlier
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2502.17462 (2025-02)
The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG
get_2d_padding 2 other papers
2 dated earlier
2308.16692 (2023-08)
SPEECHTOKENIZER: UNIFIED SPEECH TOKENIZER FOR SPEECH LANGUAGE MODELS
2406.10056 (2024-06)
UniAudio 1.5: Large Language Model-driven Audio Codec is A Few-shot Audio Task Learner
averager 1 other paper
1 dated earlier
2502.17462 (2025-02)
The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG
create_sin_embedding 1 other paper
1 dated earlier
2409.12121 (2024-09)
WMCodec: End-to-End Neural Speech Codec with Deep Watermarking for Authenticity Verification
read_ecdc_header 1 other paper
1 dated earlier
2310.00014 (2023-10)
Fewer-token Neural Speech Codec with Time-invariant Codes

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Neural audio codecs (NACs) typically encode the short-term energy (gain) and normalized structure (shape) of speech/audio signals jointly within the same latent space. As a result, they are poorly robust to a global variation of the input signal level in the sense that such a variation has a strong influence on the embedding vectors at the output of the encoder and their quantization. This methodology is inherently inefficient, leading to codebook redundancy and suboptimal bitrate-distortion performance. To address these limitations, we propose to introduce shape-gain decomposition, widely used in classical speech and audio coding, into the NAC framework. The principle of the proposed Equalizer methodology, easily applicable to any NAC, is to decompose the input signal-before the NAC encoder-into gain and normalized shape vector on a short-term basis. The shape vector is processed by the NAC, while the gain is quantized with scalar quantization and transmitted separately. The output (decoded) signal is reconstructed from the normalized output of the NAC and the quantized gain. Our experiments conducted on speech signals with four different prominent codecs show that this general methodology enables a substantial gain in bitratedistortion performance, as well as a massive reduction in quantizer complexity. The code is available at https://github.com/samsad35/ The-Equalizer.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2602.15491")
get_code_for_paper("2602.15491")
have("2602.15491")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2602.15491.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2602.15491.svg)](https://syntology.ai/paper/2602.15491)

Connect an agent — have() is free.