arXiv:2610.34533cs.SDOct 2026

Manuscript Offprint

arXiv:2610.34533

STFT Frontend Mismatch in Pretrained Audio Spectrogram Transformers: Analysis and Adaptation

Julia Wilkins, Wei-Ching Lin, Abinaya Kumar, Shabnam Ghaffarzadegan, Juan Pablo Bellow

Julia Wilkins 1^{1}, Wei-Ching Lin 2^{2}, Abinaya Kumar 2^{2}, Shabnam Ghaffarzadegan 2^{2}, Juan Pablo Bello 1^{1}

1^{1} New York University, USA

2^{2} Bosch Research, USA

Abstract—Pretrained audio spectrogram transformers are widely used as backbones of machine listening systems for sound event classification. However, they are typically trained using spectrograms with a fixed Short-Time Fourier Transform (STFT) configuration, implicitly binding the model to the time-frequency resolution seen during pretraining. In practice, adapting these systems to new domains or computational constraints often requires different STFT frontend parameters. In this work, we conduct a controlled study of the sensitivity of the foundational Audio Spectrogram Transformer to variations in STFT window and hop size, showing that audio classification performance degrades substantially as frontend parameters deviate from pretraining settings. As a mitigation strategy, we introduce a lightweight conditioning mechanism using FiLM that enables a pretrained model to adapt to variable input configurations using limited additional training data. Our method generalizes well to unseen STFT configurations, improving model robustness without sacrificing performance in the original setting.

Index Terms—Audio Spectrogram Transformers, Short-Time Fourier Transform, FiLM, Pretrained Model Adaptation, Audio Classification

1. INTRODUCTION

Pretrained transformer-based models have become foundational to many machine listening systems, with the Audio Spectrogram Transformer (AST) [1] and its variants [2]–[5] emerging as widely adopted backbones in the audio domain due to strong performance on audio classification benchmarks [6], [7] and ability to capture long-range temporal structure [8]. AST operates on log-Mel spectrograms as input, computed via the Short-Time Fourier Transform (STFT) [9], [10]. STFT parameters, such as window and hop length, control the time-frequency resolution of the resulting spectrogram for a given sampling rate [10]. This comes with fundamental tradeoffs: longer windows improve frequency resolution but reduce temporal precision and vice-versa; shorter hops improve temporal precision but increase computational costs. AST, like most pretrained machine listening models, is trained with a fixed STFT configuration, implicitly tying the model to the time-frequency resolution seen during pretraining.

In practice, when pretrained AST models are applied to new downstream tasks and datasets, the STFT hyperparameters are typically inherited from the pretraining pipeline rather than treated as a deliberate design decision. Yet audio datasets vary considerably in their acoustic characteristics: some tasks demand fine temporal resolution to capture transient sounds or rapid transitions [11]−[13][11]-[13], such as phoneme boundaries [14][14], [15][15] or species call onsets [16]−[18][16]-[18], while computational constraints in low-latency or resource-limited settings may necessitate coarser representations [19][19], [20][20]. When these demands conflict with the pretrained frontend configuration, the result is what we refer to in this study as an STFT frontend mismatch: a systematic discrepancy between the time-frequency resolution assumed by the model and what the downstream dataset or task requires.

This mismatch is typically treated as an input shape incompatibility and addressed with superficial workarounds. Common approaches include cropping, padding, repeating, or interpolating the input spectrogram to match the pretrained model's expected dimensions, which can distort the time-frequency structure or discard information [4], [21]. Alternatively, one could fine-tune or fully retrain the model on a new STFT configuration, but beyond the substantial data and compute requirements (e.g., AST was trained on 2 million 10s clips for 600 hours on 4 GPUs [1], [4]), this simply shifts the constraint to a different fixed configuration and does not ensure robustness to other unseen resolutions.

Prior work has been done to improve the flexibility of AST to changes in spectrogram patch size [22] and audio input length or temporal resolution [23]. The former uses variable patch sizes to proportionally adjust patch embedding weights during training [22]. The latter introduces a sequence packing method with masked self-attention to allow AST to handle variable-length inputs and temporally compressed resolutions [23]. While promising, these approaches still require re-training or fine-tuning a significant portion of the original AST due to underlying architecture changes. Further, neither approach directly investigates AST's inflexibility to changes in both window and hop length simultaneously. Other similarly motivated works propose a module for learning the optimal temporal resolution of a spectrogram for classification tasks [13], or designing CNN layers that generalize across sampling rates for source separation [24]; the prior focuses on resolution selection during model training rather than pretrained model adaptation and the latter on sampling rate invariance alone. We address these limitations via the following contributions in this work:

• We present a systematic analysis of the sensitivity of pretrained AST to STFT frontend mismatch within a controlled study, showing substantial audio classification performance degradation as window and hop length deviate from pretraining settings.

• We propose a lightweight FiLM-based conditioning mechanism that enables pretrained AST to adapt to variable STFT window and hop lengths with minimal additional training.

• We show that our adaptation approach improves audio classification performance across unseen frontend settings while maintaining strong performance in the original configuration.

• We conduct a data efficiency study and show that substantial performance improvements can be achieved with as few as 1,000 additional training samples with our method.

For the scope of this work, we analyze the original AST model [1] as a widely adopted backbone for audio classification tasks. We use AudioSet [7] as an in-domain dataset to limit additional domain shift effects. We use STFT window and hop length as the axes of frontend variation, controlling for the sampling rate and other STFT hyperparameters to reduce confounding factors.

References (34)