CopilotCoding

CopilotCoding / GSM

Public

GSM — Geometric State Machine. A new type of AI architecture. No attention. No KV cache. No quadratic scaling. Just a fixed point in R^4096 being continuously deformed by a learned algebra of transformations. Trains fast, runs faster, sounds like Bach.

19
2
100% credibility
Found May 26, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Python
AI Summary

GSM (Geometric State Machine) is an AI system that learns to compose music by understanding patterns in existing MIDI files. Unlike traditional music AI that stores every note it has seen (which requires more memory for longer pieces), GSM works like a geometric sculptor—each note it learns reshapes a single, fixed point in a high-dimensional space. This means it can generate music of any length using the same amount of memory and compute. The project includes tools to process your music collection, train the AI to learn your preferred style, and generate new compositions. It was demonstrated training on 228 Bach pieces, producing convincing baroque piano music after about an hour on a consumer graphics card.

How It Works

1
🎹 You have a collection of MIDI music files

Maybe you've been composing for years, or you just love a particular artist's style and want to explore what an AI can create in that spirit.

2
🔧 You set up the tools to prepare your music

The system converts your MIDI files into a format the AI can understand and learn from, organizing everything so it's ready for training.

3
🧠 Your AI learns the patterns in your music

You train the model on your collection, and it discovers the underlying structure—what makes a melody feel right, how harmonies flow, the essence of the style.

4
You can watch your AI improve over time
📊
Watch training progress

Visualize loss curves, speed, and memory usage to understand how learning is going

Test the AI's speed

Run benchmarks to see how quickly the AI can generate music, proving it works efficiently

5
You ask the AI to compose new music

You provide a starting melody or let it begin fresh, set how creative or conservative you want the output to be, and watch as it generates original music in your chosen style.

🎵 You have original music to listen to and share

The AI produces MIDI files you can open in any music software, listen to in your browser, or share with others—authentic compositions inspired by what it learned.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is GSM?

GSM (Geometric State Machine) is a neural network architecture for sequence modeling that ditches the standard attention mechanism entirely. Instead of caching tokens or growing memory with sequence length, it maintains a single fixed-size vector in high-dimensional space that gets continuously reshaped by each input token. Think of it as a point on a geometric manifold being pushed around by learned transformation operators.

Built in Python with PyTorch, GSM trains on MIDI data to generate baroque piano music. The pipeline handles tokenization with MidiTok, packs large datasets into memory-mapped binaries for fast loading, and includes a benchmark suite that empirically proves the O(1) per-token property. Training produces checkpoints, loss curves, and MIDI output you can open in any DAW or drag into midi.city to listen.

Why is it gaining traction?

The architectural pitch is compelling: no quadratic attention means inference cost stays flat regardless of how long your context is. Token 1 and token 100,000 cost exactly the same to process. The README shows impressive numbers -- 29,000 tokens/second on consumer hardware, 32M parameters fitting in 6GB VRAM, and a 32M model outperforming a 6M model trained for the same duration.

The "sounds like Bach" claim backed by listener confirmation is a concrete, verifiable result. For developers frustrated by transformer memory costs or anyone building long-context applications, this is worth evaluating.

Who should use this?

Researchers exploring alternative sequence models and developers building music generation tools will find this most useful. If you're working on MIDI data and want O(1) inference for deployment on constrained hardware, it's worth a look. Anyone wanting to reproduce the results should have a GPU and some MIDI files ready.

Verdict

This is an interesting proof-of-concept from a single developer with 19 stars and no external validation. The architecture has genuine novelty and the results on small datasets are promising. However, with a 1.0% credibility score and no independent benchmarks, treat this as exploratory research, not production-ready tooling. Start with the sanity check script, run the benchmark suite on your hardware, and decide based on what you observe rather than the README claims.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.