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

A small, 125M-parameter Transformer model running on iPhones can now autocomplete live piano performances in MIDI, generating continuations in real time with latency low enough for practical use. Commenters explore its musical quality and limitations—especially around rhythm, structure, and accompaniment—while suggesting extensions like multi-part backing tracks, richer control over musical attributes, and use as a jamming partner or plugin. The project also prompts broader reflections on AI’s role in creativity, from its potential to accelerate musical exploration to concerns that such tools might dilute the value of traditional practice and improvisation.

Overall reception & perceived potential

  • Many commenters found the app “magic,” inspiring, and unusually musical compared to other AI music tools.
  • Several plan to hook it up to synths or DAWs for fun, ideation, or live performance.
  • Some see it as a great “HN-style” project where the learning journey and implementation details are as interesting as the deliverable.

Musical quality and behavior

  • Listeners note decent local coherence but weaknesses in rhythm, form, and longer-term structure; suggestions include bar/measure tokens and higher-level planning.
  • Some find the AI continuation of well-known pieces (e.g., Für Elise) disconcerting; others find it refreshing and creatively expansive.
  • One commenter compares results unfavorably to Markov models and argues that more convincing music needs better structure-aware pipelines or datasets.
  • There is discussion that relationships between pitches may matter more than absolute pitches, suggesting interval-based representations.

Requested features and use cases

  • Strong interest in:
    • Real-time accompaniment (3–4 part, baroque or jazz style) from a played melody or chord progression.
    • A “jamming partner” that reacts like another musician.
    • MIDI-out instead of (or in addition to) on-device audio, including to player pianos.
    • Web MIDI, VST / Max for Live versions, and alternate drum patterns.
    • Input via microphone (whistling, acoustic piano).

Technical design, data, and performance

  • The model is ~125M parameters and runs on-device at high note rates; biggest speed gain came from a more compact note representation with compound events.
  • Additional note attributes (velocity, duration, pedal, tempo, program changes) could be modeled as fields on NOTE events or separate CONTROL events, though data consistency is a concern.
  • Pretraining used a few hundred thousand MIDI files (~300M note events); DPO used ~700 preference examples and trained quickly.
  • Inference optimizations mostly rely on Core ML; further speed improvements and planning strategies (multiple continuations, automatic selection, chain-of-thought–like planning) are on the roadmap.

Comparisons to prior work & musical practice

  • Commenters reference earlier systems (Songsmith, Magenta Realtime, Continuator, Anticipatory Music Transformer) and suggest distillation and representation ideas from them.
  • Historical context: classical training often involved “autocomplete”-style pattern continuation and high-level improvisation from notation alone.

Philosophical and critical perspectives

  • One line of discussion worries that AI accompaniment undermines the joy and discipline of learning harmony, technique, and improvisation.
  • Others argue tools like this don’t prevent serious study; they’re toys or creative aids, especially now that generation is cheap and “taste” and curation become central.
  • Broader concerns appear about cultural bifurcation between people who deeply practice skills and those who rely heavily on AI, though others dismiss this as overblown.