Skip to content
ModelListedExternal
Browse files

HAFM

HAFM: Hierarchical Autoregressive Foundation Model for Music Accompaniment Generation > Authors: Jian Zhu, Jianwei Cui, Shihao Chen, Yubang Zhang, Yunlong Xue, Cheng Luo, Jun Sun.

KindOtherVersionCkpt bestCgrade

Model source

Kind
Other
File size
1.58–505 MB
Version
vCkpt best
Updated
Oct 11, 2026
Source
Hugging Face

Source description

HAFM

HAFM: Hierarchical Autoregressive Foundation Model for Music Accompaniment Generation

Authors: Jian Zhu, Jianwei Cui, Shihao Chen, Yubang Zhang, Yunlong Xue, Cheng Luo, Jun Sun.

This repo contains the code and data of Hierarchical Autoregressive Foundation Model.

1. Abstract

We present HAFM, a system that generates instrumental music audio to accompany input vocals. Given isolated singing voice, HAFM produces a coherent instrumental accompaniment that can be directly mixed with the input to create complete music. We propose three key innovations over prior work: (1) a dual-rate codec tokenization scheme using HuBERT semantic tokens at 50,Hz for vocals and EnCodec acoustic tokens at 75,Hz for instrumentals, enabling time-aligned yet rate-independent modeling; (2) a three-stage hierarchical autoregressive architecture (semantic $\rightarrow$ coarse acoustic $\rightarrow$ fine acoustic) with interleaved multi-codebook prediction and classifier-free guidance; and (3) modern Transformer design choices including QK-norm, GEGLU activations, RMSNorm, and T5-style relative position bias for improved training stability and sequence generalization. Experiments on MUSDB18 demonstrate that HAFM achieves a Fr'{e}chet Audio Distance (FAD) of 2.08 on isolated vocal inputs, outperforming retrieval baselines and matching prior state-of-the-art systems with fewer parameters. The source code is available at https://github.com/HackerHyper/HAFM.

2. ARCH

ARCH

3. infer

python infer_simple.py \
  --vocal_path  vocal.wav \
  --output_path output.wav \
  --config      configs/ar.yaml

If you have any problems, contact me via [email protected].

Sources

1 source
Hugging FacePrimaryVersion 1653c3c7bffdc9b4b2d57d8b6e4f5bb3002a64fe
huggingface.co/zhuqijian/HAFM/tree/1653c3c7bffdc9b4b2d57d8b6e4f5bb3002a64fe

Verified Oct 11

Download files

Model artifacts

4 artifacts

ar_coarse/ckpt_best.pt

pt · 487 MB · SHA-256 584ba739758b…3cca · Hugging Face

Download file

ar_fine/ckpt_best.pt

pt · 505 MB · SHA-256 20f58ed265c0…a72f · Hugging Face

Download file

ar_semantic/ckpt_best.pt

pt · 442 MB · SHA-256 672e4d212023…4f8d · Hugging Face

Download file

hubert_kmeans_500.pt

pt · 1.58 MB · SHA-256 1f42c8beac95…b638 · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: apache-2.0 pipeline_tag: audio-to-audio --- # HAFM HAFM: Hierarchical Autoregressive Foundation Model for Music Accompaniment Generation > **Authors:** Jian Zhu, Jianwei Cui, Shihao Chen, Yubang Zhang, Yunlong Xue, Cheng Luo, Jun Sun. This repo contains the code and data of [Hierarchical Autoregressive Foundation Model](https://arxiv.org/abs/2604.09054). ## 1. Abstract We present HAFM, a system that generates instrumental music audio to accompany input vocals. Given isolated singing voice, HAFM produces a coherent instrumental accompaniment that can be directly mixed with the input to create complete music. We propose three key innovations over prior work: (1) a dual-rate codec tokenization scheme using HuBERT semantic tokens at 50\,Hz for vocals and EnCodec acoustic tokens at 75\,Hz for instrumentals, enabling time-aligned yet rate-independent modeling; (2) a three-stage hierarchical autoregressive architecture (semantic $\rightarrow$ coarse acoustic $\rightarrow$ fine acoustic) with interleaved multi-codebook prediction and classifier-free guidance; and (3) modern Transformer design choices including QK-norm, GEGLU activations, RMSNorm, and T5-style relative position bias for improved training stability and sequence generalization. Experiments on MUSDB18 demonstrate that HAFM achieves a Fr\'{e}chet Audio Distance (FAD) of 2.08 on isolated vocal inputs, outperforming retrieval baselines and matching prior state-of-the-art systems with fewer parameters. The source code is available at https://github.com/HackerHyper/HAFM. ## 2. ARCH ![ARCH](https://cdn-uploads.huggingface.co/production/uploads/66f8c8d6b7f71a554aae373f/qvNKpyJ0m44qSmRB5i6PG.jpeg) ## 3. infer ```bash python infer_simple.py \ --vocal_path vocal.wav \ --output_path output.wav \ --config configs/ar.yaml ``` If you have any problems, contact me via [email protected].

Source context: 0 downloads · 0 likes · Pipeline audio-to-audio · Repo zhuqijian/HAFM