HeadlinesBriefing favicon HeadlinesBriefing.com

On-Device Piano AI: 125M Model Autocompletes Music

Hacker News •
×

A developer trained a 125M-parameter transformer to autocomplete piano performances in real time, achieving approximately 108 notes per second on an iPhone 15. The system, called Roll Tab, works similarly to GitHub Copilot but for music—users play a few notes on a MIDI piano, and the model continues the performance entirely on-device.

The biggest improvements came from finding the right MIDI representation, aggressively cleaning training data, and adding DPO post-training. The final representation uses NOTE(pitch, delta_onset, duration, velocity) tokens, avoiding note-off drift and reducing transformer passes per note. Each note contains five categorical fields with separate embeddings and output heads, allowing efficient generation.

Training involved cross-entropy loss across multiple output heads, though music continuation lacks single correct answers. Data augmentation was crucial since live input differs from pristine MIDI files. The dataset included hundreds of thousands of cleaned MIDI files with deduplication and filtering.

The app is free for users with MIDI keyboards and iOS devices. Sample continuations include Pokémon, Final Fantasy VI, and Für Elise. Comments and questions about the model, training, Core ML, or failed approaches are welcomed.