Audio-R1
Collection
RL post-training of audio-language models with self-supervised tasks as verifiable rewards β’ 4 items β’ Updated
How to use NearAndDear98/Audio-R1-AF-Next-Think with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("nvidia/audio-flamingo-next-think-hf")
model = PeftModel.from_pretrained(base_model, "NearAndDear98/Audio-R1-AF-Next-Think")LoRA adapter for nvidia/audio-flamingo-next-think-hf trained with Audio-R1, an RL post-training framework that uses audio self-supervised tasks as a source of verifiable rewards.
| Hyperparameter | Value |
|---|---|
| Method | GRPO, 1 epoch, LoRA |
| Reward | accuracy (1.0 if the chosen letter is correct) + format (0.2) |
| Format reward | non-empty <think> (the model answers without an <answer> tag) |
| Optimizer / LR schedule | AdamW, cosine |
| Learning rate / warmup ratio | 5e-6 / 0.03 |
| Rollouts per prompt | 8 |
| Sampling temperature / top-p | 0.8 / 0.9 |
| KL coefficient Ξ² | 0.04 |
| Clip Ξ΅ | 0.2 |
| Per-device batch Γ grad. accumulation | 8 Γ 4 |
| GPUs | 4 |
| LoRA rank / Ξ± / dropout | 8 / 32 / 0.05 |
| LoRA targets | all linear layers; audio encoder frozen |
| Precision / seed | bf16 / 42 |
import librosa, torch
from peft import PeftModel
from transformers import AutoProcessor, MusicFlamingoForConditionalGeneration
base = "nvidia/audio-flamingo-next-think-hf"
processor = AutoProcessor.from_pretrained(base)
model = MusicFlamingoForConditionalGeneration.from_pretrained(base, dtype=torch.float32, device_map="auto")
model = PeftModel.from_pretrained(model, "NearAndDear98/Audio-R1-AF-Next-Think").eval()
SYSTEM = (
"Your response MUST contain two parts in this exact order: "
"1. Your reasoning enclosed within <think> </think> tags. "
"2. The final answer β a single letter for the correct option β enclosed "
"within <answer> </answer> tags."
)
question = "<sound>\nQuestion ...\n(A) ...\n(B) ...\n(C) ...\n(D) ..." # one <sound> per audio
prompt = processor.apply_chat_template(
[{"role": "system", "content": SYSTEM}, {"role": "user", "content": question}],
tokenize=False, add_generation_prompt=True,
)
audios = [librosa.load("example.wav", sr=16000, mono=True)[0]]
inputs = processor(text=[prompt], audio=audios, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(processor.batch_decode(out[:, inputs["input_ids"].shape[-1]:], skip_special_tokens=True)[0])
The base model is released under the NVIDIA OneWay Noncommercial License; this adapter inherits those terms and is for non-commercial research use only.
@article{jeong2026audior1,
title = {Audio-R1: Audio Reasoning through Reinforcement Learning on Self-Supervised Tasks},
author = {Jeong, Jihoon and Ravanelli, Mirco and Wang, Zhepei and Subakan, Cem},
journal = {arXiv preprint arXiv:2610.34609},
year = {2026}
}
Base model
nvidia/audio-flamingo-next-think-hf