SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2512.23278 · ICLR · 2025

Flow2GAN: Hybrid Flow Matching and GAN with Multi-Resolution Network for Few-step High-Fidelity Audio Generation

Han Zhu, Zengwei Yao, Liyong Guo, Wei Kang, Lingxuan Ye

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 0 have no contract verdict; 4 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2512.23278.json · badge: /api/ran/2512.23278.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
k2-fsa/Flow2GAN canonical (classifier label)
classifier basis: census
4 ran · 3 no recorded run
FunctionStatusWhere it lives
find_checkpoints Ran
ran; our contract draft was wrong, not the code
k2-fsa/Flow2GAN/flow2gan/checkpoint.py
code served (permissive licence) · get_code("87c9b24deaf27799")
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 list, ndim 1, dtype family float; 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 tempfile
import os
from pathlib import Path

# Create a temporary directory with some checkpoint files
temp_dir = tempfile.mkdtemp()

# Create some dummy checkpoint files for testing
checkpoint_files = [
    "checkpoint-1.pt",
    "checkpoint-20.pt",
    "checkpoint-300.pt",
    "checkpoint-4000.pt"
]

for checkpoint_file in checkpoint_files:
    filepath = os.path.join(temp_dir, checkpoint_file)
    with open(filepath, 'w') as f:
        f.write("dummy checkpoint")

# Define arguments for the function
ARGS = {
    "out_dir": Path(temp_dir),
    "iteration": 0
}
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 list, ndim 1, dtype family float — a list 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_class_name Ran
ran; our contract draft was wrong, not the code
k2-fsa/Flow2GAN/flow2gan/diagnostics.py
code served (permissive licence) · get_code("b865558252e1566a")
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 str. 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

# Test with a basic nn.Module
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Test with Balancer module
class Balancer(nn.Module):
    def __init__(self):
        super().__init__()
        self.min_positive = 0.1
        self.max_positive = 0.9
        self.min_abs = 0.01
        self.max_abs = 0.99
    
    def forward(self, x):
        return x

# Test with ActivationBalancer module
class ActivationBalancer(nn.Module):
    def __init__(self):
        super().__init__()
        self.min_positive = 0.2
        self.max_positive = 0.8
        self.min_abs = 0.05
        self.max_abs = 0.95
    
    def forward(self, x):
        return x

# Test with AbsValuePenalizer module
class AbsValuePenalizer(nn.Module):
    def __init__(self):
        super().__init__()
        self.limit = 1.5
    
    def forward(self, x):
        return x

torch.manual_seed(0)

# Create instances to test with
simple_module = SimpleModule()
balancer_module = Balancer()
activation_balancer_module = ActivationBalancer()
abs_value_penalizer_module = AbsValuePenalizer()

ARGS = {
    'module': simple_module
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_tensor_stats Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
k2-fsa/Flow2GAN/flow2gan/diagnostics.py
code served (permissive licence) · get_code("d6c6ed911b29d8a6")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'x': torch.randn(2, 4, 3, 5),  # 4D tensor with distinct dimensions
    'dim': 1,  # dimension to keep
    'stats_type': 'rms'  # one of the valid stats types
}
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
pad_seq_collate_fn Ran
ran; our contract draft was wrong, not the code
k2-fsa/Flow2GAN/flow2gan/dataset.py
code served (permissive licence) · get_code("9abe9ae91c9c41f1")
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 logging
import torch
from torch.nn.utils.rnn import pad_sequence

torch.manual_seed(0)

# Construct sample data as a list of tuples: (audio_array, silence_flag, filename)
# Each audio is a list/array of samples
data = [
    ([1.0, 2.0, 3.0], False, "audio1.wav"),
    ([4.0, 5.0], False, "audio2.wav"),
    ([6.0, 7.0, 8.0, 9.0], True, "audio3.wav"),
]

ARGS = {
    "data": data,
    "filter_silence": True,
}
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
attach_diagnostics Not yet run
unverified (harvested, no recorded run)
k2-fsa/Flow2GAN/flow2gan/diagnostics.py
code served (permissive licence) · get_code("82343477d60d2f6e")
How it ran

no invocation recorded.

average_checkpoints Not yet run
unverified (harvested, no recorded run)
k2-fsa/Flow2GAN/flow2gan/checkpoint.py
code served (permissive licence) · get_code("74b622eae4c5ab2f")
How it ran

no invocation recorded.

weight_norm Not yet run
unverified (harvested, no recorded run)
k2-fsa/Flow2GAN/flow2gan/models/discriminators.py
code served (permissive licence) · get_code("353e388680850619")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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
find_checkpoints 2 other papers
2 dated earlier
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision
2506.14434 (2025-06)
Unifying Streaming and Non-streaming Zipformer-based ASR
get_class_name 2 other papers
2 dated earlier
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision
2506.14434 (2025-06)
Unifying Streaming and Non-streaming Zipformer-based ASR
attach_diagnostics 1 other paper
1 dated earlier
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision
average_checkpoints 1 other paper
1 dated earlier
2506.14434 (2025-06)
Unifying Streaming and Non-streaming Zipformer-based ASR
get_tensor_stats 1 other paper
1 dated earlier
2506.14434 (2025-06)
Unifying Streaming and Non-streaming Zipformer-based ASR

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-23.

Repositories linked to this paper

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

Abstract

Existing dominant methods for audio generation include Generative Adversarial Networks (GANs) and diffusion-based methods like Flow Matching. GANs suffer from slow convergence during training, while diffusion methods require multistep inference that introduces considerable computational overhead. In this work, we introduce Flow2GAN, a two-stage framework that combines Flow Matching training for learning generative capabilities with GAN fine-tuning for efficient few-step inference. Specifically, given audio's unique properties, we first improve Flow Matching for audio modeling through: 1) reformulating the objective as endpoint estimation, avoiding velocity estimation difficulties when involving empty regions; 2) applying spectral energy-based loss scaling to emphasize perceptually salient quieter regions. Building on these Flow Matching adaptations, we demonstrate that a further stage of lightweight GAN fine-tuning enables us to obtain fewstep (e.g., 1/2/4 steps) generators that produce high-quality audio. In addition, we develop a multi-branch network architecture that processes Fourier coefficients at different time-frequency resolutions, which improves the modeling capabilities compared to prior single-resolution designs. Experimental results indicate that our Flow2GAN delivers high-fidelity audio generation from Mel-spectrograms or discrete audio tokens, achieving highly favorable quality-efficiency trade-offs compared to existing state-of-the-art GAN-based and Flow Matching-based methods. Online demo samples are available at https://flow2gan.github.io, and the source code is released at https://github.com/k2-fsa/Flow2GAN.

For agents

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

get_harvested_code_for_paper("2512.23278")
get_code_for_paper("2512.23278")
have("2512.23278")

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

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

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

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

Connect an agent — have() is free.