Model reference · open weights

MERT-30s

Embeddings m-a-p Embeddings 1 build Non-commercial 530 dl/mo

MERT-30s is an open-weight embedding model from m-a-p. MERT-v2-30s (FP32) weighs 1.3 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • MERT-30s is a bidirectional music encoder developed by m-a-p that extracts general-purpose music representations from 30-second audio excerpts.
  • The model contains 632 million parameters and is designed for feature extraction tasks, with a companion version available for processing full songs.
  • It is distributed under the CC BY-NC 4.0 license.

Summary of the m-a-p/MERT-v2-30s model card, 2026-10-01

What it is

Released bym-a-p
Released2026-09-09
Parameters632M
VRAM1.3 GB for the weights

What it runs on

Memory and cards for MERT-v2-30s (FP32)

1.3 GBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What m-a-p says about MERT-30s

Read the model card

· · · ·            

MERT-v2-30s is a bidirectional music encoder pretrained on 30-second excerpts. Extract general-purpose music representations at the frame or recording level. Load with standard Hugging Face Transformers, using the familiar MERT workflow.

For complete recordings, use MERT-v2-FullSong, which continues pretraining on full songs.

MERT-v2-30s uses the bidirectional backbone in (B); MERT-v2-FullSong continues through the full-song branch in (C). The causal branch is used for YuE2 tokenization.

🚀 Quick start

Install the matching PyTorch packages:

python -m pip install torch==2.6.0 torchaudio==2.6.0 transformers==4.53.2 huggingface-hub safetensors soundfile
import soundfile as sf
import torch
import torchaudio.functional as AF
from transformers import AutoFeatureExtractor, AutoModel

repo = "m-a-p/MERT-v2-30s"
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = AutoFeatureExtractor.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval().to(device)

audio, sr = sf.read("music.wav", dtype="float32", always_2d=True)
audio = audio[:30 * sr].mean(axis=1)  # First 30 seconds, mixed to mono.
waveform = AF.resample(torch.from_numpy(audio), sr, processor.sampling_rate)
inputs = processor(
    waveform.numpy(), sampling_rate=processor.sampling_rate, return_tensors="pt",
).to(device)

with torch.inference_mode():
    output = model(**inputs, output_hidden_states=True)

frames = output.last_hidden_state         # [batch, frames, 1024], 25 Hz
layers = output.hidden_states             # 24 tensors, one per block
mask = output.feature_attention_mask[..., None]
embedding = (frames * mask).sum(1) / mask.sum(1).clamp_min(1)  # [batch, 1024]

hidden_states[0] is block 1; hidden_states[23] is block 24. For full songs, switch to MERT-v2-FullSong and remove the audio slice.

📊 MARBLE

Reported frozen-encoder results on MARBLE. All scores are multiplied by 100; higher is better. Bold marks the best displayed value in each column, including ties.

Baseline scores and parameter counts are reproduced from Tables III and V of PupuJEPA; the baselines were not rerun for this release. Evaluation protocols may differ across sources.

General music understanding. MTT = MagnaTagATune; key = GiantSteps refined key accuracy; genre and beat = GTZAN; valence and arousal = EmoMusic. ROC = ROC-AUC; AP = average precision.

ModelParamsMTT ROCMTT APKey acc.Genre acc.Beat F1Valence R²Arousal R²
MERT-Large330M90.637.964.177.686.856.776.1
Dasheng-1.2B1.2B91.540.458.081.487.757.475.0
MuQ310M90.538.563.283.890.158.376.4
MusicFM330M90.938.363.084.190.257.274.4
AudioMAE++307M91.239.561.780.390.059.075.7
MATPAC++307M90.638.263.781.490.157.874.7
A-JEPA307M91.039.265.083.890.057.474.8
PupuJEPA-Large307M91.740.866.186.991.062.576.8
PupuJEPA-Huge632M91.339.764.885.990.562.078.5
MERT-v2-30s632M91.9141.2966.9791.7290.5963.2380.01
MERT-v2-FullSong632M91.7441.2067.0590.6990.5763.5278.14

MTG-Jamendo tagging. Mood denotes mood/theme tags.

ModelParamsInstrument ROCInstrument APMood ROCMood APGenre ROCGenre APTop-50 ROCTop-50 AP
MERT-Large330M75.518.875.313.586.118.082.629.1
Dasheng-1.2B1.2B75.019.076.115.585.518.882.429.6
MuQ310M74.819.173.713.285.419.183.030.2
MusicFM330M74.618.574.914.185.319.481.929.7
AudioMAE++307M77.119.975.614.086.318.983.131.1
MATPAC++307M77.219.775.114.185.719.682.530.2
A-JEPA307M76.619.374.614.385.519.282.529.6
PupuJEPA-Large307M78.421.276.215.386.120.182.830.5
PupuJEPA-Huge632M77.620.575.914.785.920.183.130.7
MERT-v2-30s632M80.2722.8979.4416.6888.0121.2284.1832.17
MERT-v2-FullSong632M80.2723.5178.7415.7487.9820.6684.1331.62

Supplemental: Chords1217 frame accuracy is 78.48 for MERT-v2-30s and 77.79 for MERT-v2-FullSong.

HF reproduction verified: Both models reproduce all ten MARBLE tasks with the fixed evaluation settings. Scores and best settings.

🎛️ Layer guide

Recommended probe settings with the encoder frozen. L1 = hidden_states[0]; All-layer MLP uses all 24 layers.

Task / datasetMERT-v2-30s layerProbe LRMERT-v2-FullSong layerProbe LR
Genre · GTZANL235e-3L245e-4
Beat · GTZANL211e-3L231e-3
Key · GiantStepsL41e-3L231e-3
Emotion · EmoMusicAll-layer MLP5e-5L245e-4
Chords · Chords1217All-layer MLP1e-4All-layer MLP5e-4
Tagging · MagnaTagATuneL221e-3L231e-3
Instrument · MTG-JamendoL141e-3L121e-3
Mood/theme · MTG-JamendoL161e-3L131e-3
Genre · MTG-JamendoL191e-3L161e-3
Top-50 · MTG-JamendoL131e-3L221e-3

📚 Citation

Technical report coming soon. For now, please cite [MERT (ICLR 2024)](https://proceedings.iclr.cc/paper_files/paper/2024/hash/33

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms