Model reference · open weights

MERT-30s

Available as managed deployment Licence fee Embeddings m-a-p Embeddings 1 variants 530 dl/mo

MERT-30s is an open-weight embedding model from m-a-p. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released bym-a-p
TypeEmbedding models
TaskEmbeddings
Parameters (lead)632M
Runs withtransformers
Released2026-09-09
Popularity530 downloads / month
LicenceCommercial licence needed

About

What MERT-30s is

· · · ·            

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.

Read the full model card

🚀 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

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys mert-30s for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (mert-30s below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/embeddings \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mert-30s","input":"text to embed"}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

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