SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.15166 · NeurIPS · 2021

PortaSpeech: Portable and High-Quality Generative Text-to-Speech

Yi Ren, Zhou Zhao, Jinglin Liu

arXiv · PDF · Open in the Atlas

Code that ran

12 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2109.15166.json · badge: /api/ran/2109.15166.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
natspeech/natspeech canonical (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
keonlee9420/PortaSpeech community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Embedding Ran
ran; our contract draft was wrong, not the code · constructed an object; no result was computed
natspeech/natspeech/modules/commons/layers.py
code served (permissive licence) · get_code("a025408166aaff26")
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 an instance of its own class, Embedding: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    "num_embeddings": 10,
    "embedding_dim": 4,
    "padding_idx": None,
}
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 Embedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Embedding 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
convert_pad_shape Ran
ran, honoured the contract we drafted
keonlee9420/PortaSpeech/model/blocks.py
pointer only (licence: MIT); the stored copy get_code serves, from isletennos/mmvc_trainer, is pointer only (licence: NONE) · get_code("59ae0708b1e8d94b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from isletennos/mmvc_trainer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fused_add_tanh_sigmoid_multiply Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
keonlee9420/PortaSpeech/model/blocks.py
pointer only (licence: MIT); the stored copy get_code serves, from isletennos/mmvc_trainer, is pointer only (licence: NONE) · get_code("b38f9c28c5117398")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from isletennos/mmvc_trainer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fused_add_tanh_sigmoid_multiply Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
natspeech/natspeech/modules/commons/wavenet.py
code served (permissive licence) · get_code("03f2c896fd1d86dc")
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, 3) 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)

# Analyze the function:
# - input_a: tensor, indexed as [:, :n_channels_int, :] and [:, n_channels_int:, :]
#   so it needs shape (batch, 2*n_channels_int, seq_len)
# - input_b: same shape as input_a
# - n_channels: indexable with [0], should be a list/tuple with at least 1 element

batch_size = 2
n_channels_int = 4
seq_len = 3

# Create input tensors
# Shape: (batch_size, 2*n_channels_int, seq_len)
input_a = torch.randn(batch_size, 2 * n_channels_int, seq_len)
input_b = torch.randn(batch_size, 2 * n_channels_int, seq_len)

# n_channels should be indexable and have n_channels[0] as an integer
n_channels = [n_channels_int]

ARGS = {
    "input_a": input_a,
    "input_b": input_b,
    "n_channels": n_channels,
}
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, 3) — shape (2, 4, 3) 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_padding Ran
ran, honoured the contract we drafted
keonlee9420/PortaSpeech/hifigan/models.py
pointer only (licence: MIT); the stored copy get_code serves, from isletennos/mmvc_trainer, is pointer only (licence: NONE) · get_code("a26f85d7c72ef39a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from isletennos/mmvc_trainer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_sinusoid_encoding_table Ran
ran, honoured the contract we drafted
keonlee9420/PortaSpeech/model/linguistic_encoder.py
pointer only (licence: MIT); the stored copy get_code serves, from Matthewdowney18/Transformer_Dialogue, is pointer only (licence: NONE) · get_code("0f8f22937463d3c5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Matthewdowney18/Transformer_Dialogue, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

pad_input Ran
ran on a synthesized input
keonlee9420/PortaSpeech/model/postnet.py
code served (permissive licence) · get_code("ee17504855eec917")
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. 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

torch.manual_seed(0)

# Construct tensors for the function
batch_size = 2
dim = 4
max_time = 5
n_sqz = 2

# x: [batch_size, dim, max_time]
x = torch.randn(batch_size, dim, max_time)

# x_mask: [batch_size, 1, max_time]
x_mask = torch.ones(batch_size, 1, max_time)

# g: [batch_size, dim, max_time]
g = torch.randn(batch_size, dim, max_time)

ARGS = {
    "x": x,
    "x_mask": x_mask,
    "g": g,
    "n_sqz": n_sqz
}
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 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: none by the harness; any seed is in the setup block
read_lexicon Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from KevinMIN95/StyleSpeech
pointer only · get_code("2b5c06c1ba593c3c")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sequence_mask Ran
ran; our contract draft was wrong, not the code
natspeech/natspeech/modules/commons/rel_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from guozixunnicolas/fundamentalmusicembedding, is pointer only (licence: NONE) · get_code("88bf809d1bc9db4c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from guozixunnicolas/fundamentalmusicembedding, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

shift_1d Ran
ran on a synthesized input
natspeech/natspeech/modules/commons/rel_transformer.py
code served (permissive licence) · get_code("2173110241f356ce")
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, 3) 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.functional as F

torch.manual_seed(0)

# Create a small 3D tensor for testing
# Shape: (batch=2, channels=4, length=3)
x = torch.randn(2, 4, 3)

ARGS = {
    "x": x
}
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, 3) — shape (2, 4, 3) 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
squeeze Ran
ran on a synthesized input
keonlee9420/PortaSpeech/model/postnet.py
code served (permissive licence) · get_code("3feb059fe1daeee2")
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. 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

torch.manual_seed(0)

# Construct small tensors with distinct dimensions
batch_size = 2
dim_x = 4
dim_g = 3
max_time = 6
n_sqz = 2

# x: [batch_size, dim, max_time]
x = torch.randn(batch_size, dim_x, max_time)

# x_mask: [batch_size, 1, max_time]
x_mask = torch.ones(batch_size, 1, max_time)

# g: [batch_size, dim, max_time]
g = torch.randn(batch_size, dim_g, max_time)

# n_sqz: squeeze factor
n_sqz_val = 2

ARGS = {
    "x": x,
    "x_mask": x_mask,
    "g": g,
    "n_sqz": n_sqz_val
}
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 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: none by the harness; any seed is in the setup block
unsqueeze Ran
ran on a synthesized input
keonlee9420/PortaSpeech/model/postnet.py
code served (permissive licence) · get_code("c058572344c8f736")
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. 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

torch.manual_seed(0)

# Construct arguments for unsqueeze function
# x: (batch, channels, time) tensor
# The function expects c_x to be divisible by n_sqz
b, c_x, t_x = 2, 4, 3
x = torch.randn(b, c_x, t_x)

# x_mask: optional mask tensor with shape (batch, 1, time)
x_mask = torch.ones(b, 1, t_x)

# g: optional conditioning tensor with same shape requirements as x
# c_g should be divisible by n_sqz
c_g = 4
g = torch.randn(b, c_g, t_x)

# n_sqz: number to squeeze by (must divide c_x and c_g)
n_sqz = 2

# pad_size: amount to pad/remove from the end
pad_size = 0

ARGS = {
    "x": x,
    "x_mask": x_mask,
    "g": g,
    "n_sqz": n_sqz,
    "pad_size": pad_size,
}
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 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: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 9 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 9 later) and 3 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
get_padding 53 other papers
8 dated earlier, 44 later, 1 undated · 4 only as an assembly brick
1910.10838 (2019-10)
Zero-Shot Multi-Speaker Text-To-Speech with State-of-the-art Neural Speaker Embeddings
2006.04558 (2020-06)
FastSpeech 2: Fast and High-Quality End-to-End Text to Speech
2006.06873 (2020-06)
FastPitch: Parallel Text-to-speech with Pitch Prediction
and 50 more not named here
Embedding 18 other papers
4 dated earlier, 14 later · 3 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1905.12790 (2019-05)
A Generalized Framework of Sequence Generation with Application to Undirected Sequence Models
1911.02116 (2019-11)
Unsupervised Cross-lingual Representation Learning at Scale
and 15 more not named here
convert_pad_shape 12 other papers
1 dated earlier, 1 the same month, 10 later
2106.06103 (2021-06)
Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
2109.13821 (2021-09)
Diffusion-Based Voice Conversion with Fast Maximum Likelihood Sampling Scheme
2204.11792 (2022-04)
SyntaSpeech: Syntax-Aware Generative Adversarial Text-to-Speech
and 9 more not named here
get_sinusoid_encoding_table 12 other papers
10 dated earlier, 2 later · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.02481 (2019-10)
Learn to Explain Efficiently via Neural Logic Inductive Learning
and 9 more not named here
read_lexicon 11 other papers
10 dated earlier, 1 later
1905.09263 (2019-05)
FastSpeech: Fast, Robust and Controllable Text to Speech
2006.04558 (2020-06)
FastSpeech 2: Fast and High-Quality End-to-End Text to Speech
2006.06873 (2020-06)
FastPitch: Parallel Text-to-speech with Pitch Prediction
and 8 more not named here
sequence_mask 7 other papers
2 dated earlier, 5 later
2006.04558 (2020-06)
FastSpeech 2: Fast and High-Quality End-to-End Text to Speech
2106.06103 (2021-06)
Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
2204.11792 (2022-04)
SyntaSpeech: Syntax-Aware Generative Adversarial Text-to-Speech
and 4 more not named here
fused_add_tanh_sigmoid_multiply 6 other papers
5 dated earlier, 1 later · 1 only as an assembly brick
1803.09017 (2018-03)
Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis
1811.00002 (2018-11)
WaveGlow: A Flow-based Generative Network for Speech Synthesis
2006.04598 (2020-06)
WaveNODE: A Continuous Normalizing Flow for Speech Synthesis
and 3 more not named here
fused_add_tanh_sigmoid_multiply 1 other paper
1 later
2205.07211 (2022-05)
GenerSpeech: Towards Style Transfer for Generalizable Out-Of-Domain Text-to-Speech
shift_1d 1 other paper
1 later
2204.11792 (2022-04)
SyntaSpeech: Syntax-Aware Generative Adversarial Text-to-Speech

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

Non-autoregressive text-to-speech (NAR-TTS) models such as FastSpeech 2 [25] and Glow-TTS [8] can synthesize high-quality speech from the given text in parallel. After analyzing two kinds of generative NAR-TTS models (VAE and normalizing flow), we find that: VAE is good at capturing the long-range semantics features (e.g., prosody) even with small model size but suffers from blurry and unnatural results; and normalizing flow is good at reconstructing the frequency bin-wise details but performs poorly when the number of model parameters is limited. Inspired by these observations, to generate diverse speech with natural details and rich prosody using a lightweight architecture, we propose PortaSpeech, a portable and high-quality generative text-to-speech model. Specifically, 1) to model both the prosody and mel-spectrogram details accurately, we adopt a lightweight VAE with an enhanced prior followed by a flow-based post-net with strong conditional inputs as the main architecture. 2) To further compress the model size and memory footprint, we introduce the grouped parameter sharing mechanism to the affine coupling layers in the post-net. 3) To improve the expressiveness of synthesized speech and reduce the dependency on accurate fine-grained alignment between text and speech, we propose a linguistic encoder with mixture alignment combining hard word-level alignment and soft phoneme-level alignment, which explicitly extracts word-level semantic information. Experimental results show that PortaSpeech outperforms other TTS models in both voice quality and prosody modeling in terms of subjective and objective evaluation metrics, and shows only a slight performance degradation when reducing the model parameters to 6.7M (about 4x model size and 3x runtime memory compression ratio compared with FastSpeech 2). Our extensive ablation studies demonstrate that each design in PortaSpeech is effective 3 . * Equal contribution. † Corresponding author 3 Audio samples are available at https://portaspeech.github.io/. 35th Conference on Neural Information Processing Systems (NeurIPS 2021).

For agents

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

get_harvested_code_for_paper("2109.15166")
get_code_for_paper("2109.15166")
have("2109.15166")

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

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

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

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

Connect an agent — have() is free.