SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.13508 · ICLR · 2022

BDDM: Bilateral Denoising Diffusion Models for Fast and High-Quality Speech Synthesis

Jun Wang, Max Lam, Dan Su, Dong Yu

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 1 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/2203.13508.json · badge: /api/ran/2203.13508.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
tencent-ailab/bddm canonical (classifier label)
classifier basis: classifier_2025
5 ran · 1 no recorded run
FunctionStatusWhere it lives
Conv Ran
ran on a synthesized input
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("267f77d579ddc806")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 8, 16) 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 torch.nn as nn

class Conv(nn.Module):

    def __init__(self, in_channels, out_channels, kernel_size=3, dilation=1):
        super().__init__()
        self.padding = dilation * (kernel_size - 1) // 2
        self.conv = nn.Conv1d(in_channels, out_channels, kernel_size, dilation=dilation, padding=self.padding)
        self.conv = nn.utils.weight_norm(self.conv)
        nn.init.kaiming_normal_(self.conv.weight)

    def forward(self, x):
        out = self.conv(x)
        return out


INIT_ARGS = {
    'in_channels': 4,
    'out_channels': 8,
    'kernel_size': 3,
    'dilation': 1,
}

ARGS = {
    'x': torch.randn(2, 4, 16),
}

if __name__ == '__main__':
    model = Conv(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 8, 16) — shape (2, 8, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResidualBlock Ran
ran on a synthesized input
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("89aa6ba469c9b212")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. 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 torch.nn as nn
import math

# INIT_ARGS for ResidualBlock.__init__
INIT_ARGS = {
    'res_channels': 32,
    'skip_channels': 16,
    'dilation': 2,
    'diffusion_step_embed_dim_out': 64
}

# ARGS for ResidualBlock.forward
# forward expects input_data = (x, mel_spec, diffusion_step_embed)
batch_size = 2
res_channels = 32
seq_len = 128
mel_channels = 80
mel_time_steps = 4  # Before upsampling; will be upsampled by 16*16=256x

x = torch.randn(batch_size, res_channels, seq_len)
mel_spec = torch.randn(batch_size, mel_channels, mel_time_steps)
diffusion_step_embed = torch.randn(batch_size, 64)

ARGS = {
    'input_data': (x, mel_spec, diffusion_step_embed)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResidualGroup Ran
ran on a synthesized input
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("6d233604940eb9a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. 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 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 torch
import numpy as np

# INIT_ARGS for ResidualGroup.__init__
INIT_ARGS = {
    'res_channels': 8,
    'skip_channels': 6,
    'num_res_layers': 2,
    'dilation_cycle': 3,
    'diffusion_step_embed_dim_in': 16,
    'diffusion_step_embed_dim_mid': 12,
    'diffusion_step_embed_dim_out': 10
}

# ARGS for ResidualGroup.forward
# forward expects input_data = (x, mel_spectrogram, diffusion_steps)
# x: (batch_size, res_channels, seq_len)
# mel_spectrogram: (batch_size, 80, mel_seq_len) where mel_seq_len will be upsampled to match seq_len
# diffusion_steps: (batch_size, 1) - long tensor

batch_size = 2
res_channels = INIT_ARGS['res_channels']
seq_len = 32  # Must be divisible by 16*16=256 for upsampling to work cleanly, or at least compatible
mel_seq_len = 1  # Will be upsampled by factor of 16*16=256

x = torch.randn(batch_size, res_channels, seq_len)
mel_spectrogram = torch.randn(batch_size, 80, mel_seq_len)
diffusion_steps = torch.randint(0, 100, (batch_size, 1)).long()

ARGS = {
    'input_data': (x, mel_spectrogram, diffusion_steps)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ZeroConv1d Ran
ran on a synthesized input
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("8b0344849f5e7286")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 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
import torch.nn as nn

class ZeroConv1d(nn.Module):

    def __init__(self, in_channel, out_channel):
        super().__init__()
        self.conv = nn.Conv1d(in_channel, out_channel, kernel_size=1, padding=0)
        self.conv.weight.data.zero_()
        self.conv.bias.data.zero_()

    def forward(self, x):
        out = self.conv(x)
        return out


INIT_ARGS = {
    'in_channel': 4,
    'out_channel': 3,
}

ARGS = {
    'x': torch.randn(2, 4, 5),
}

if __name__ == '__main__':
    model = ZeroConv1d(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 3, 5) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
calc_diffusion_step_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("245e52e17e9f2c94")
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) and returned Tensor, ndim 2, dtype family float; no output shape is stated. 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 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 torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - diffusion_steps: torch.long tensor of shape (batchsize, 1)
# - diffusion_step_embed_dim_in: int, must be even

# Create a small batch of diffusion steps
batch_size = 2
diffusion_steps = torch.tensor([[5], [10]], dtype=torch.long)

# Embedding dimension (must be even)
diffusion_step_embed_dim_in = 4

ARGS = {
    "diffusion_steps": diffusion_steps,
    "diffusion_step_embed_dim_in": diffusion_step_embed_dim_in,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
DiffWave Not yet run
unverified (harvested, no recorded run)
tencent-ailab/bddm/bddm/models/diffwave.py
code served (permissive licence) · get_code("7753e841ff7b7dea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
calc_diffusion_step_embedding
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 2 later · 1 only as an assembly brick
2009.09761 (2020-09)
DiffWave: A Versatile Diffusion Model for Audio Synthesis
2204.09934 (2022-04)
FastDiff: A Fast Conditional Diffusion Model for High-Quality Speech Synthesis
2306.03258 (2023-06)
LipVoicer: Generating Speech from Silent Videos Guided by Lip Reading

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

Diffusion probabilistic models (DPMs) and their extensions have emerged as competitive generative models yet confront challenges of efficient sampling. We propose a new bilateral denoising diffusion model (BDDM) that parameterizes both the forward and reverse processes with a schedule network and a score network, which can train with a novel bilateral modeling objective. We show that the new surrogate objective can achieve a lower bound of the log marginal likelihood tighter than a conventional surrogate. We also find that BDDM allows inheriting pre-trained score network parameters from any DPMs and consequently enables speedy and stable learning of the schedule network and optimization of a noise schedule for sampling. Our experiments demonstrate that BDDMs can generate high-fidelity audio samples with as few as three sampling steps. Moreover, compared to other state-of-the-art diffusion-based neural vocoders, BDDMs produce comparable or higher quality samples indistinguishable from human speech, notably with only seven sampling steps (143x faster than WaveGrad and 28.6x faster than DiffWave). We release our code at https://github.com/tencent-ailab/bddm.

For agents

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

get_harvested_code_for_paper("2203.13508")
get_code_for_paper("2203.13508")
have("2203.13508")

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

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

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

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

Connect an agent — have() is free.