Skip to content
Tech News
← Back to articles

Show HN: I trained a 125M model to autocomplete piano on-device

read original more articles
Why This Matters

This breakthrough demonstrates the potential for on-device AI models to perform real-time music autocompletion, making advanced musical tools more accessible and private for consumers. It highlights significant progress in optimizing AI for mobile devices, paving the way for more personalized and portable creative applications in the tech industry.

Key Takeaways

TL;DR: I trained a 125M-parameter transformer to autocomplete piano performances in real time (~108 notes/sec on an iPhone 15). The biggest improvements came from finding the right MIDI representation, cleaning the training data aggressively, and adding DPO post-training.

Almost a year ago, I started tinkering with an idea: connect my MIDI piano to my phone, play something, and have AI autocomplete the song for me. Think GitHub Copilot, but for piano.

It turned out to be a deeper rabbit hole than I expected. Fourteen experiments later, it is finally at a point where I am happy enough with it to write about.

Your browser does not support the video tag. Potato-quality video because the good phone was busy running the MIDI model.

The app, RollTab, is available for free here if you have a MIDI keyboard and an iPhone/iPad.

A few sound samples

Each audio starts with a short prompt, followed by the model's continuation.

Pokémon, Pallet Town (8-note prompt)

Your browser does not support the audio tag.

Final Fantasy VI, Terra's Theme (16-note prompt)

... continue reading