INSPIRATION Students often memorize formulas without seeing the mechanism. We wanted a lesson where the diagram acts out the math while a song explains it, and where you have to predict the result before it's shown.

WHAT IT DOES learn-by-song teaches AI/ML concepts as a music video drawn by code. Two lessons are built: Perceptrons ("Zee Above Zero") and Activation functions ("Bend the Line"). The video pauses mid-lesson and asks a predict-then-watch question. After the lesson, a quiz with a different mix of questions each play: AI-generated from a curated fact sheet, generated by code with computed answers, and curated. Missed questions link back to the scene that taught them.

HOW WE BUILT IT Scenes are canvas templates rendered as a pure function of time, synced to the song through line timings stored as data. A FastAPI backend calls open models on Groq for quiz generation, with a strict schema, validation (one correct option, numbers must come from the fact sheet) and repair retries, and falls back to code-generated and curated questions. Songs were generated with Google Lyria from our AI-drafted, hand-edited lyrics, and line timings came from Whisper. Everything is labeled honestly: quiz generation is live; songs, lyrics and timings are produced ahead of time.

CHALLENGES Free-tier GPU and API limits, sung lyrics that don't always match the written ones (so the chorus shows formulas), and keeping AI-written quiz arithmetic correct. We fixed the last one by computing answers in code and validating model output.

ACCOMPLISHMENTS Two complete lessons, a quiz pipeline that checks its own arithmetic, a text-overlap checker and a contact-sheet tool for reviewing every scene.

WHAT WE LEARNED Curated facts plus validation beat free-form generation for education, and AI coding tools need their claims verified.

WHAT'S NEXT More topics through reusable templates, on-demand lyrics over a synthesized beat, and an LLM "explain my mistake" step, and we can automate the whole thing with api keys .

Built With

Share this project:

Updates

Submission history