Fun-ASR-Nano is an 800M-parameter end-to-end speech recognition model developed by Alibaba DAMO Academy's FunAudioLLM team. It achieves state-of-the-art performance on Chinese,…
Fun-ASR-Nano
This model was published in HF papers on 2025-09-15 and contributed to Hugging Face Transformers on 2026-09-08.
Fun-ASR-Nano
Overview
Fun-ASR-Nano is an 800M-parameter end-to-end speech recognition model developed by Alibaba DAMO Academy's FunAudioLLM team. It achieves state-of-the-art performance on Chinese, English, and Japanese ASR benchmarks while being significantly smaller than comparable models.
The model was proposed in Fun-ASR: An Industrial-Grade Speech Recognition System.
Architecture
Fun-ASR-Nano consists of three components:
Audio Encoder (SenseVoiceEncoderSmall): A 70-layer SANM (Self-Attention with FSMN Memory) encoder that combines multi-head self-attention with Feedforward Sequential Memory Networks for efficient speech feature extraction.
Audio Adaptor: A 2-layer Transformer that projects encoder outputs (512-dim) to the LLM dimension (1024-dim).
Language Model (Qwen3-0.6B): A 28-layer causal language model that generates transcription text autoregressively.
Key Features
- Chinese, English, and Japanese, including 7 Chinese dialects and 26 regional accents
- Hotword customization for domain-specific vocabulary
- Native punctuation output (no separate punctuation model needed)
Usage
Single inference
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor
model_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, device_map="auto")
audio_url = "https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/en.mp3"
inputs = processor.apply_transcription_request(audio=audio_url).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=200)
generated_ids = generated_ids[:, inputs.input_ids.shape[1]:]
print(processor.decode(generated_ids, skip_special_tokens=True)[0])
Batch inference
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor
model_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, device_map="auto")
audio_urls = [
"https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/zh.mp3",
"https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/en.mp3",
]
languages = ["zh", "en"]
inputs = processor.apply_transcription_request(audio=audio_urls, language=languages).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=200)
generated_ids = generated_ids[:, inputs.input_ids.shape[1]:]
print(processor.decode(generated_ids, skip_special_tokens=True))
Custom prompts and hotwords
Pass contextual information with prompt and hotwords with keywords; the checkpoint chat template builds the full
transcription instruction. language accepts Chinese, English, and Japanese as full names or ISO codes.
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor
model_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, device_map="auto")
audio_url = "https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/en.mp3"
inputs = processor.apply_transcription_request(
audio=audio_url,
prompt="A tribal story involving a chieftain and a boy.",
keywords=["tribal chieftain", "fifty pieces of gold"],
).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=200)
generated_ids = generated_ids[:, inputs.input_ids.shape[1]:]
print(processor.decode(generated_ids, skip_special_tokens=True)[0])
Training
Pass the target transcripts to apply_transcription_request with transcription, and the returned labels are used to compute the loss.
from datasets import Audio, load_dataset
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor
model_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"
NUM_SAMPLES = 2
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, device_map="auto")
model.train()
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.cast_column("audio", Audio(sampling_rate=processor.feature_extractor.sampling_rate))
speech_samples = [el["array"] for el in ds["audio"][:NUM_SAMPLES]]
text_samples = ds["text"][:NUM_SAMPLES]
inputs = processor.apply_transcription_request(speech_samples, language="en", transcription=text_samples)
inputs.to(model.device, dtype=model.dtype)
loss = model(**inputs).loss
print("Loss:", loss.item())
loss.backward()
Inference with torch.compile
import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, CompileConfig
model_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, device_map="auto")
audio_url = "https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/en.mp3"
inputs = processor.apply_transcription_request(audio=audio_url).to(model.device)
with torch.inference_mode():
generated_ids = model.generate(
**inputs,
max_new_tokens=200,
compile_config=CompileConfig(),
)
generated_ids = generated_ids[:, inputs.input_ids.shape[1]:]
print(processor.decode(generated_ids, skip_special_tokens=True)[0])
FunAsrNanoConfig
[[autodoc]] FunAsrNanoConfig
FunAsrNanoEncoderConfig
[[autodoc]] FunAsrNanoEncoderConfig
FunAsrNanoAdaptorConfig
[[autodoc]] FunAsrNanoAdaptorConfig
FunAsrNanoFeatureExtractor
[[autodoc]] FunAsrNanoFeatureExtractor - call
FunAsrNanoProcessor
[[autodoc]] FunAsrNanoProcessor - call - apply_transcription_request
FunAsrNanoEncoder
[[autodoc]] FunAsrNanoEncoder - forward
FunAsrNanoModel
[[autodoc]] FunAsrNanoModel - forward
FunAsrNanoForConditionalGeneration
[[autodoc]] FunAsrNanoForConditionalGeneration - forward
Source and license
Source: Transformers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.