108 lines
3.4 KiB
Markdown
108 lines
3.4 KiB
Markdown
---
|
|
license: apache-2.0
|
|
library_name: transformers
|
|
pipeline_tag: text-generation
|
|
base_model: Qwen/Qwen3-8B
|
|
datasets:
|
|
- haiyewon/Strudel-Synth
|
|
language:
|
|
- en
|
|
tags:
|
|
- music
|
|
- midi
|
|
- strudel
|
|
- symbolic-music
|
|
- music-decompilation
|
|
- code-generation
|
|
- qwen3
|
|
---
|
|
|
|
# Decomposer
|
|
|
|
**Decomposer** decompiles symbolic music (MIDI) into executable **Strudel** programs.
|
|
This model is the **8B** model from the paper *Decomposer: Learning to Decompile Symbolic Music to Programs*, post-trained from **Qwen3-8B**.
|
|
|
|
- 📄 **Paper:** [arXiv:2607.01849](https://arxiv.org/abs/2607.01849)
|
|
- 🌐 **Project page:** [yewon-kim.com/decomposer](https://yewon-kim.com/decomposer)
|
|
- 🎹 **Live demo:** [haiyewon/decomposer-demo](https://huggingface.co/spaces/haiyewon/decomposer-demo)
|
|
- 💻 **Code:** [github.com/elianakim/Decomposer](https://github.com/elianakim/Decomposer)
|
|
- 🤗 **Dataset:** [haiyewon/Strudel-Synth](https://huggingface.co/datasets/haiyewon/Strudel-Synth)
|
|
|
|
## Model Description
|
|
|
|
- **Base model:** [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B)
|
|
- **Model size:** 8.2B
|
|
- **Type:** Causal Language Model
|
|
- **Precision:** bfloat16
|
|
|
|
## Quick Start
|
|
|
|
Clone our [GitHub code repo](https://github.com/elianakim/Decomposer), run through the setup steps, and try:
|
|
|
|
```bash
|
|
git clone https://github.com/elianakim/Decomposer.git
|
|
cd Decomposer
|
|
uv sync
|
|
|
|
uv run generate_transformers.py \
|
|
--model haiyewon/Decomposer-Qwen3-8B \
|
|
--midi_path path/to/input.mid \
|
|
--n_outputs 5
|
|
```
|
|
|
|
The repo and inference scripts provide a more complete usage guide.
|
|
<!-- , including the
|
|
MIDI→text preprocessing (`MidiToText`) and the decompilation prompt -->
|
|
|
|
|
|
## Model Details
|
|
### Input Format
|
|
|
|
MIDI is serialized as instrument-wise note events. Onsets are given in
|
|
[**cycle coordinates**](https://strudel.cc/understand/cycles) instead of seconds:
|
|
|
|
```
|
|
[BPM=120 Meter=4]
|
|
[acoustic_grand_piano] C4@0.00 E4@0.25 G4@0.50 C5@1.00
|
|
[drum] bass_drum@0.00 closed_hi_hat@0.25 closed_hi_hat@0.50 snare@0.75
|
|
```
|
|
|
|
- **Header** `[BPM=… Meter=…]` — tempo/meter; if absent, [madmom](https://github.com/CPJKU/madmom) is used to estimate them.
|
|
- **Events** — one line per instrument, `pitch@cycle_onset` tokens; melodic pitches as note
|
|
names (`C4`, `F#3`), drums as GM drum names (`bass_drum`, `closed_hi_hat`).
|
|
|
|
|
|
### Training Data
|
|
|
|
**[Strudel-Synth](https://huggingface.co/datasets/haiyewon/Strudel-Synth)** is a synthetic corpus of **21,174 (MIDI, Strudel) pairs**
|
|
(20,152 train / 1,022 test) built by distilling Strudel programs from Claude-Opus-4.6
|
|
and rendering each to MIDI with the Strudel runtime. Its ~20K training split is divided
|
|
into two disjoint ~10K halves, one per stage:
|
|
|
|
- **SFT** uses the first half as paired (MIDI, Strudel) examples.
|
|
- **RL** uses the second half (MIDI only), plus short-fragment (<30 s) [LMD](https://colinraffel.com/projects/lmd/) MIDI.
|
|
|
|
### Inference Hyperparameters
|
|
|
|
Recommended settings matching the paper evaluation:
|
|
|
|
| Setting | Value |
|
|
|---|---|
|
|
| `temperature` | 1.0 |
|
|
| `max_new_tokens` | 4096 |
|
|
| `enable_thinking` | `false` |
|
|
|
|
|
|
## Citation
|
|
|
|
If you find our model useful, please cite our research as
|
|
|
|
```bibtex
|
|
@article{kim2026decomposer,
|
|
title = {Decomposer: Learning to Decompile Symbolic Music to Programs},
|
|
author = {Kim, Yewon and Gandhi, Apurva and Chung, David and Neubig, Graham and Donahue, Chris},
|
|
journal = {arXiv preprint arXiv:2607.01849},
|
|
year = {2026}
|
|
}
|
|
```
|