Instructions to use JumperV/Diapason with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use JumperV/Diapason with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "JumperV/Diapason") - Notebooks
- Google Colab
- Kaggle
Diapason
Diapason is a LoRA adapter for Qwen/Qwen3-4B-Instruct-2507 that answers questions about opera (forms, genres, voice types, vocal technique, composers and works) and Western music theory (intervals, chords, scales and modes, keys, Roman numerals, chromatic harmony, meter).
Results
| Test | Base model | Diapason | Change (points) |
|---|---|---|---|
| MusicTheoryBench: knowledge (269 Qs, chance 25%) | 59.1% | 58.7% | -0.4 |
| MusicTheoryBench: reasoning (98 Qs, chance 25%) | 33.7% | 34.7% | +1.0 |
| MusicTheoryBench: all (367 Qs) | 52.3% | 52.3% | +0.0 |
| Theory drills: exact answer (held out) | 15.1% | 89.4% | +74.3 |
| Opera / theory questions: score (held out) | 44.4% | 43.8% | -0.6 |
| Opera / theory questions: fully correct | 29.2% | 17.2% | -12.0 |
| Opera / theory questions: wrong | 40.4% | 29.6% | -10.8 |
- MusicTheoryBench (m-a-p/MusicTheoryBench) was not used for training. Each model reasons in its own words, then "Answer:" is appended and the next letter is read (this matches the letter the model stated ~97% of the time). General music-theory knowledge is unchanged from the base model.
- Theory drills (179 held-out exercises: intervals, chords, chord identification, scales, key signatures, Roman numerals, Neapolitan and augmented sixth chords, transposition, meter) are scored exactly by code. The base model scores 15.1% when asked to show its working and 20.1% when asked to answer first.
- Opera / theory questions (250 held out) are graded 0/1/2 against reference answers by Gemma-4 12B. The adapter answers more concisely; its overall score is about the same as the base model's.
Training data
- ~6,319 question–answer pairs generated by Gemma-4 12B (Apache-2.0) from two CC BY-SA 4.0 sources:
- 116 chapters of Open Music Theory, Version 2 by Mark Gotham, Kyle Gullings, Chelsey Hamm, Bryn Hughes, Brian Jarvis, Megan Lavengood and John Peterson (ed. Erin K. Maher), licensed CC BY-SA 4.0;
- 736 English Wikipedia articles on opera and music theory, © their contributors, licensed CC BY-SA 4.0. The adapter was trained on machine-written questions and answers derived from these texts; it does not reproduce them and is not endorsed by their authors.
- 1,980 music-theory drills generated and checked by a small Python theory engine (exact answers with worked explanations).
- No personal or private data was used.
Training procedure
QLoRA (4-bit NF4 base, bf16 compute), LoRA r=16, alpha=32, dropout 0.05 on q/k/v/o/gate/up/down projections; 2 epochs, learning rate 2e-4 with cosine schedule, effective batch size 16, max length 768, loss on answers only. Trained with TRL + PEFT on a single RTX 3060 12 GB.
Usage
Use the system prompt below (Diapason was trained with it) and, for calculations, ask for step-by-step working. The results above were measured with the NF4 4-bit setup shown here.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
BASE = "Qwen/Qwen3-4B-Instruct-2507"
tok = AutoTokenizer.from_pretrained(BASE)
# NF4 4-bit, the setup Diapason was trained with (about 3-4 GB of VRAM).
# Note: plain BitsAndBytesConfig(load_in_4bit=True) defaults to FP4, which gives noticeably worse answers.
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16)
model = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(model, "JumperV/Diapason")
SYSTEM = "You are a knowledgeable tutor in opera and music theory. Answer clearly and accurately."
STEPS = '\n\nWork it out briefly step by step, then give the final answer on the last line as "Answer: ...".'
def ask(question, calculation=False):
msgs = [{"role": "system", "content": SYSTEM},
{"role": "user", "content": question + (STEPS if calculation else "")}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt",
return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=400, do_sample=False)
return tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(ask("Spell the German augmented sixth chord in C minor.", calculation=True))
print(ask("What is a leitmotif, and which composer is most associated with it?"))
Tips:
- Always include the system prompt; without it answers are noticeably worse.
- With the step-by-step instruction it writes short working and ends with
Answer: ...; read that line. - Full bf16 (
dtype="auto", about 9 GB of VRAM) also works; all reported results used NF4.
Limitations
- Small model: it can state wrong facts confidently, especially about less famous works and people.
- Training answers were machine-written from Wikipedia and Open Music Theory and may carry the teacher model's errors.
- It tends to show its working even when asked for only a letter or a single word.
- About 1 in 10 calculation drills is still wrong, usually a slip inside otherwise correct working (for example a wrong semitone count for an interval).
- Note spelling uses ♯/♭; double sharps are written ♯♯.
- Downloads last month
- 26
Model tree for JumperV/Diapason
Base model
Qwen/Qwen3-4B-Instruct-2507