YuE2-3B Instrumental KTO LoRA (experimental)
A 70 MB LoRA adapter for YuE2-3B that makes instrumental generation actually instrumental. With the official model, a "no vocals" prompt still produces singing, humming or chanting in roughly half of the songs in our tests; with this adapter the semantic stage is steered away from vocal content while the score, the NAR and the VAE stay the official ones.
中文摘要:给 YuE2-3B 用的 70 MB LoRA,目标是让"纯音乐"真的没有人声。原模型即使在 prompt 里写了 no vocals,我们测试中仍有约一半的曲子出现演唱、哼唱或吟唱;打开这个 adapter 后,在评测集配对盲听里人声率从 56% 降到 0%(95% 区间 0–16%)。它只在语义 token 生成阶段生效,乐谱规划、NAR、VAE 仍用官方权重;关闭时输出与官方模型逐位一致。只限非商业使用(CC BY-NC 4.0)。
| Base model | m-a-p/YuE2-3B @ 8f24312f187763b9854adeec87e437e2b03bbff1, VAE m-a-p/YuE2-Vae @ 152733a19ad43aa67e367f9b5503ef8075bb5126 |
| Adapter | rank 16, alpha 32, on the AR experts only: q/k/v/o_proj, gate/up/down_proj of all 28 layers (17.4 M params, FP32) |
| Active in | the semantic-token stage only (score planning, NAR and VAE use the base weights) |
| Training | KTO (β = 10, lr 2e-4, 4 epochs, 72 updates) on 147 of YuE2's own instrumental generations, labelled clean / vocal |
| File | adapter.safetensors, sha256 27643e2bc397a84eb6549eeddea3e704632b10ad02b248e951d0510ad39a829e |
| License | CC BY-NC 4.0 (adapted from YuE2-3B weights, CC BY-NC 4.0); yue2_instrumental_lora.py Apache 2.0 |
Listen
Same prompt, same planned score, same seed — the only difference is whether the adapter is on:
| Prompt (abridged) | Official YuE2 | + this adapter |
|---|---|---|
| synthwave racing, retro analog synths, gated reverb drums | ||
| driving cello ostinato in 6/8, hammered dulcimer, stealth |
More, generated with the adapter on (prompts in samples/samples.json):
| Style | Audio |
|---|---|
| dark synthwave noir, boss fight | |
| post-apocalyptic desolate ambient, title screen | |
| massive war orchestra, open-field battle | |
| cello ostinato and dulcimer, victory |
Samples are AAC 192 kbps; the model outputs 48 kHz stereo.
Results
Blind listening (the main result). The evaluation set has 24 game/film-BGM prompts that were never used in training, rendered twice with identical scores and seeds: adapter off and on (40 pairs). Tracks were drawn at random without showing their source; the listener only answered "is there any human voice (singing, humming, chant, speech, vocal samples)?".
| heard | voice | no voice | can't tell | voice rate | 95% CI (Wilson) | |
|---|---|---|---|---|---|---|
| Official YuE2 (adapter off) | 20 | 10 | 8 | 2 | 56% | 34–75% |
| With adapter | 20 | 0 | 20 | 0 | 0% | 0–16% |
Fisher exact test p ≈ 0.0002. Of the 12 pairs where both versions were heard, the 6 discordant pairs all went "official: voice → adapter: no voice" (exact McNemar p = 0.031). Disclosure: one adapter track was first answered "voice" and changed to "no voice" after the listener had looked up its source; counting the original answer gives 1/20 = 5% (CI 1–24%, p ≈ 0.0015). One official track was changed (no voice → voice) while still blind.
Vocal detector (a logistic regression on AudioSet voice classes from AST plus a Demucs vocal-stem share, fitted to 62 human labels, leave-one-out accuracy ≈ 90%):
| songs | flagged vocal | |
|---|---|---|
| Official YuE2, evaluation prompts | 40 | 65% |
| With adapter, evaluation prompts | 40 | 10% |
| With adapter, 6 further single-style batches (142 songs) | 142 | p ≤ 0.33 for 127 (89%), p > 0.5 for 5 (4%) |
On the evaluation pairs the adapter lowered the detector's vocal probability on 39 of 40 songs; no song went from clean to vocal.
Is a better prompt enough? A common alternative is classifier-free guidance against a "vocals, singing, choir, humming, ..." negative prompt. On the same 40 evaluation pairs (same scores, same seeds, CFG 1.5), it barely moves the result:
| flagged vocal (p > 0.5) | clean (p ≤ 0.33) | mean p_vocal | median wall time | |
|---|---|---|---|---|
| Official YuE2 | 26/40 | 8 | 0.68 | 50 s |
| Vocal-negative CFG 1.5 | 25/40 | 12 | 0.58 | 56 s |
| This adapter | 4/40 | 33 | 0.30 | 49 s |
Negative CFG turned 6 songs clean but 5 others vocal (McNemar p = 1); the adapter turned 22 clean and none vocal (p ≈ 5 × 10⁻⁷), and costs no extra compute.
Audio quality (AudioBox Aesthetics, same 40 pairs, mean adapter − official): content enjoyment +0.01, production quality +0.02, content usefulness +0.04, production complexity −0.28 (5.35 → 5.07). The arrangements tend to be slightly simpler — plausibly part of what removing the vocal layer means, but worth knowing.
Off is off. With the adapter not loaded (or use_adapter(None)), the pipeline is bit-identical to YuE2Pipeline; this and the stage isolation are covered by test_standalone_cpu.py. The Usage section below was run end to end on a fresh machine (upstream from GitHub, files from this repo).
Usage
git clone https://github.com/multimodal-art-projection/YuE && git -C YuE checkout 1647252d68b70cbead046ffd3f7caf036dde47ee
pip install ./YuE
huggingface-cli download stevensu/YuE2-3B-instrumental-kto-lora --local-dir yue2-instrumental-kto
cd yue2-instrumental-kto
python yue2_instrumental_lora.py --yue-repo ../YuE \
--style "cinematic orchestra, heroic brass, driving strings, open world exploration, 110 BPM, D minor" \
--out song.flac
# A/B against the official model with the same seed: --adapter none
The CLI follows the flow the adapter was evaluated with: YuE2 plans a score from section tags, the official instrumental skill moves the vocal line to the instrument track, and the score is rendered with the adapter on during the semantic stage. In Python:
from yue2_instrumental_lora import InstrumentalPipeline, MODEL_REVISION, VAE_REVISION
pipe = InstrumentalPipeline.from_pretrained("m-a-p/YuE2-3B", revision=MODEL_REVISION, vae_revision=VAE_REVISION)
pipe.use_adapter("adapter.safetensors")
song = pipe(style=..., lyrics=..., abc=..., cot="full", seed=...) # same arguments as YuE2Pipeline
Requirements: backend="torch" (or "torch-eager") and quantization="none"; the vLLM backend and FP8 are not supported. The deltas are added to the AR weights when the semantic stage starts and the original tensors are put back when it ends, so YuE2's CUDA-graph AR runs unchanged.
Training
- 296 instrumental songs were generated by YuE2-3B itself from 48 game/film-BGM prompts (24 style families × 2 scenes, 2 plan variants, several seeds per score).
- Each song was labelled clean / vocal by the detector above; songs in the uncertain zone were dropped. 147 songs (desirable = clean, undesirable = vocal) remained.
- KTO on the AR experts with the adapter-off model as the reference policy, mean log-probability over the semantic tokens and the end token; 72 updates on one NVIDIA L40S.
No third-party audio, lyrics or recordings were used — only YuE2's own outputs and the author's listening labels. Prompts describe instrumentation, tempo, key and mood, never a film, composer or melody.
Limitations
- Small evaluation: one listener (the author), 20 songs per arm; game/film-style English prompts only. Other genres, Chinese prompts and lyric-free "vocal-like" instruments are not measured.
- Not a guarantee: the detector still flags about 4–10% of adapter outputs as vocal. In our runs the flagged prompts often asked for "ceremonial" / ritual-like moods; such words seem to invite chant.
- Simpler arrangements: production complexity drops by about 0.3 (AudioBox scale 1–10).
- Unrelated to the adapter: YuE2's score planner sometimes hits its length limit (0–33% of prompts per batch on the first attempt in our runs; nearly all succeed with another seed) and very slow prompts are occasionally cut at the end; retry with another seed.
- Only the instrumental use case: do not load it for songs with lyrics.
License and attribution
The adapter weights are adapted material of YuE2-3B and are shared under CC BY-NC 4.0: non-commercial use only, with attribution. Based on YuE2 by the YuE2 authors (m-a-p); the base weights' license and additional creator permission are in the YuE repository. Music you generate is governed by YuE2's terms for outputs. Changes made: a rank-16 LoRA on the AR experts trained with KTO as described above. This adapter is not an official YuE2 release.
Model tree for stevensu/YuE2-3B-instrumental-kto-lora
Base model
m-a-p/YuE2-3B