SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.00874 · 2022

HTS-AT: A Hierarchical Token-Semantic Audio Transformer for Sound Classification and Detection

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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, 2 violated it and 3 have no contract verdict; 4 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/2202.00874.json · badge: /api/ran/2202.00874.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
retrocirce/hts-audio-transformer canonical (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
retrocirce/hts-audio-transformer/model/layers.py
pointer only (licence: MIT); the stored copy get_code serves, from fudan-zvg/SeaFormer, is pointer only (licence: NONE) · get_code("3ac6b7d76e8e3584")
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 fudan-zvg/SeaFormer, 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.

fl_mapping Ran
ran on a synthesized input
retrocirce/hts-audio-transformer/fl_evaluate.py
code served (permissive licence) · get_code("1c48abb3bcfeac5b")
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 ndarray, ndim 2, dtype family float, shape (2, 10) 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 numpy as np

# Analyze the function to understand parameter requirements:
# - heatmap: iterable of arrays, each with values compared to thresholds
# - f_map: list of arrays containing indices that are checked for membership

# Create small test data
# heatmap should be a list/array of detection scores
# Each element in heatmap is compared against thresholds (10 thresholds, so expecting values in [0,1])
heatmap = [
    np.array([0.3, 0.15, 0.25, 0.1, 0.5, 0.2, 0.19, 0.52, 0.4, 0.13]),
    np.array([0.28, 0.19, 0.21, 0.22, 0.49, 0.19, 0.17, 0.5, 0.38, 0.12])
]

# f_map is a list of arrays, each containing indices
# These are used to check membership: "if dd in ff_map"
# So each element should be an array/list of integers
f_map = [
    np.array([0, 2, 4]),
    np.array([1, 3, 5]),
    np.array([2, 4, 6]),
    np.array([3, 5, 7]),
    np.array([4, 6, 8]),
    np.array([5, 7, 9]),
    np.array([0, 3, 6]),
    np.array([1, 4, 7]),
    np.array([2, 5, 8]),
    np.array([3, 6, 9])
]

ARGS = {
    "heatmap": heatmap,
    "f_map": f_map
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 10) — shape (2, 10) 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
float32_to_int16 Ran
ran, violated the contract we drafted
retrocirce/hts-audio-transformer/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from DragonLiu1995/multimodal-llm-for-audio-gen, is pointer only (licence: NOASSERTION) · get_code("42b7821640dcfbcf")
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 DragonLiu1995/multimodal-llm-for-audio-gen, and GitHub could not classify the licence of that repository (NOASSERTION). 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_mix_lambda Ran
ran on a synthesized input
retrocirce/hts-audio-transformer/utils.py
code served (permissive licence) · get_code("38d1a2922b5e7686")
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 ndarray, ndim 1, dtype family float, shape (2,) 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 numpy as np

# Analyze the function:
# - mixup_alpha: float, used as parameter to np.random.beta()
# - batch_size: int, used in range() to determine how many lambdas to generate

ARGS = {
    "mixup_alpha": 1.0,
    "batch_size": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
int16_to_float32 Ran
ran, violated the contract we drafted
retrocirce/hts-audio-transformer/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from DragonLiu1995/multimodal-llm-for-audio-gen, is pointer only (licence: NOASSERTION) · get_code("47bbdd629908bce3")
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 DragonLiu1995/multimodal-llm-for-audio-gen, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

scratch_optim Ran
ran on a synthesized input
retrocirce/hts-audio-transformer/fl_evaluate.py
code served (permissive licence) · get_code("70f55f7a5aa863e1")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Create sample predictions array
preds = np.array([0.5, 1.5, 2.3, 0.8, 1.2])

# Define threshold parameters
threshold = 1.0
sec_threshold = 0.5

# Define mode parameter
mode = 2

# Construct ARGS dictionary
ARGS = {
    "preds": preds,
    "threshold": threshold,
    "sec_threshold": sec_threshold,
    "mode": mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
retrocirce/hts-audio-transformer/model/layers.py
code served (permissive licence) · get_code("02566da69866c48c")
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, shape (2, 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
import math

torch.manual_seed(0)

# Create a small tensor to be filled with truncated normal values
tensor = torch.empty(2, 4)

# Define arguments for trunc_normal_
ARGS = {
    'tensor': tensor,
    'mean': 0.0,
    'std': 1.0,
    'a': -2.0,
    'b': 2.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family float, shape (2, 4) — shape (2, 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
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
retrocirce/hts-audio-transformer/model/htsat.py
code served (permissive licence) · get_code("f9fd6241d935f07b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (12, 4, 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 a tensor with shape (B, H, W, C)
# B = 2 (batch size)
# H = 8 (height, must be divisible by window_size)
# W = 12 (width, must be divisible by window_size)
# C = 4 (channels)
# window_size = 4

B = 2
H = 8
W = 12
C = 4
window_size = 4

x = torch.randn(B, H, W, C)

ARGS = {
    'x': x,
    'window_size': window_size
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 (12, 4, 4, 4) — shape (12, 4, 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
window_reverse Ran
ran; our contract draft was wrong, not the code
retrocirce/hts-audio-transformer/model/htsat.py
code served (permissive licence) · get_code("fb32094c6dbece71")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 8, 12, 6) 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)

# Define parameters
# We need windows of shape (num_windows*B, window_size, window_size, C)
# where num_windows = (H // window_size) * (W // window_size)

B = 2
H = 8
W = 12
window_size = 4
C = 6

# Calculate num_windows
num_windows_h = H // window_size  # 8 // 4 = 2
num_windows_w = W // window_size  # 12 // 4 = 3
num_windows = num_windows_h * num_windows_w  # 2 * 3 = 6

# Total number of windows across batch
total_windows = num_windows * B  # 6 * 2 = 12

# Create windows tensor
windows = torch.randn(total_windows, window_size, window_size, C)

ARGS = {
    'windows': windows,
    'window_size': window_size,
    'H': H,
    'W': W
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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, 8, 12, 6) — shape (2, 8, 12, 6) 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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 3 the same month, 6 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
window_reverse 227 other papers
30 dated earlier, 2 the same month, 193 later, 2 same year, order not determinable · 34 only as an assembly brick
1608.03983 (2016-08)
SGDR: Stochastic Gradient Descent with Warm Restarts
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 224 more not named here
drop_path 224 other papers
23 dated earlier, 2 the same month, 196 later, 2 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
window_partition 223 other papers
28 dated earlier, 2 the same month, 191 later, 2 same year, order not determinable · 32 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 220 more not named here
trunc_normal_ 160 other papers
20 dated earlier, 139 later, 1 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
int16_to_float32 4 other papers
1 dated earlier, 3 later
2112.07891 (2021-12)
Zero-shot Audio Source Separation through Query-based Learning from Weakly-labeled Data
2308.05734 (2023-08)
AudioLDM 2: Learning Holistic Audio Generation with Self-supervised Pretraining
2402.04825 (2024-02)
Fast Timing-Conditioned Latent Audio Diffusion
and 1 more not named here
float32_to_int16 3 other papers
1 dated earlier, 2 later
2112.07891 (2021-12)
Zero-shot Audio Source Separation through Query-based Learning from Weakly-labeled Data
2402.04825 (2024-02)
Fast Timing-Conditioned Latent Audio Diffusion
2411.05679 (2024-11)
Tell What You Hear From What You See -Video to Audio Generation Through Text
get_mix_lambda 1 other paper
1 dated earlier
2112.07891 (2021-12)
Zero-shot Audio Source Separation through Query-based Learning from Weakly-labeled Data

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

Audio classification is an important task of mapping audio samples into their corresponding labels. Recently, the transformer model with self-attention mechanisms has been adopted in this field. However, existing audio transformers require large GPU memories and long training time, meanwhile relying on pretrained vision models to achieve high performance, which limits the model's scalability in audio tasks. To combat these problems, we introduce HTS-AT: an audio transformer with a hierarchical structure to reduce the model size and training time. It is further combined with a token-semantic module to map final outputs into class featuremaps, thus enabling the model for the audio event detection (i.e. localization in time). We evaluate HTS-AT on three datasets of audio classification where it achieves new state-of-the-art (SOTA) results on AudioSet and ESC-50, and equals the SOTA on Speech Command V2. It also achieves better performance in event localization than the previous CNN-based models. Moreover, HTS-AT requires only 35% model parameters and 15% training time of the previous audio transformer. These results demonstrate the high performance and high efficiency of HTS-AT.

For agents

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

get_harvested_code_for_paper("2202.00874")
get_code_for_paper("2202.00874")
have("2202.00874")

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

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

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

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

Connect an agent — have() is free.