Show HN: I trained a 125M model to autocomplete piano on-device(simedw.com)
577 points by simedw 54 days ago | 113 comments
tl;dr: A developer trained a 125M-parameter decoder-only transformer to autocomplete piano performances in real time (~108 notes/sec on iPhone 15), shipping it as an iOS app called RollTab. Key wins came from a compact note-based MIDI tokenization (pitch, delta, duration, velocity as a single token with summed embeddings), aggressive dataset cleaning over scaling, scheduled sampling between note fields, and DPO post-training using pairwise Gemini preference judgments—which lifted preference rates from ~25% to ~69% over the base model. The model was exported to Core ML with INT8 quantization and uses context rebuilding for long sessions.
HN Discussion:
  • ↑Historical context: autocomplete-style pattern generation mirrors classical composition training traditions
  • ↓Musicological critique of the AI's output quality, noting incorrect cadence choices
  • ↑Appreciation of the project's learning value and curiosity about training data details
  • ↓Concern that AI-generated notes undermine the joy and intuition of learning piano improvisation
  • •Interest in extending or comparing to related prior work and feature requests like accompaniment generation