Inspiration

I'm legally blind, and most math tutoring tools assume a fast connection and a big model running in the cloud. I wanted to build something different for the Mobile AI track: a Socratic algebra tutor built for Arm-powered phones and tablets, running entirely on-device, working offline, and never sending a student's work anywhere. Aristotle grew out of that constraint — and out of a belief that AI-assisted learning shouldn't require sacrificing privacy or speed.

It's also explicitly not a homework shortcut. Aristotle is named after the philosopher who pioneered formal logic — the question of whether a conclusion follows from its premises. Instead of generating answers, it verifies whether a student's own reasoning step is valid, and asks questions rather than revealing solutions.

What it does

Aristotle is a browser-based algebra tutoring Progressive Web App, purpose-built for the Mobile AI track. Instead of just handing over the answer, it walks students through balancing equations step by step, checking each move against the rules of algebra and giving Socratic-style feedback when a step doesn't hold up. It installs like a native app on Arm-powered phones and tablets, runs fully offline once loaded, and does all of its inference on-device — no server round-trip, no student data leaving the device.

How I built it

The engine combines two systems: a rule-based Socratic layer that handles equation parsing, operation detection, and prompt generation, and a small ONNX neural network (4→8→1) that validates whether an algebraic balancing step was applied correctly. The model takes four features — operation type, the delta applied to each side of the equation, and the difference between those deltas — and outputs a validity score. It's tiny (~1KB) and runs directly in the browser via onnxruntime-web.

A lot of the real engineering happened in the surrounding logic, not the model itself:

  • A gatekeeping layer decides what actually gets sent to the model, so it isn't force-fed arbitrary input.
  • A sideMove() helper independently extracts the delta from each side of an equation, so the two sides can't get mismatched.
  • A bare-equation arithmetic evaluator handles simple cases without invoking the model at all.
  • The UI distinguishes "not a balancing step" (neutral, gray) from "wrong balancing step" (red), so students aren't misled by a false error.

Along the way I settled on a rule that shaped a lot of my decisions: retrain the model when you change what features it sees; add a guardrail when you change what reaches the model. That distinction kept the model small and the logic auditable.

Challenges I ran into

  • Offline caching bug: the PWA's service worker wasn't reliably caching assets for true offline use — tracked down and fixed.
  • Mismatched deltas: an early version could compute inconsistent deltas across the two sides of an equation, producing confusing feedback. Fixed with the sideMove() helper.
  • False negatives on non-balancing steps: the UI originally flagged anything that wasn't a valid balancing move as an error, even when it wasn't meant to be one. Now it's rendered as neutral.
  • Installability: getting the PWA to a clean install state took several rounds of fixing manifest and service worker issues, now at zero Chrome DevTools warnings.
  • Hidden state dependency: evaluateProofStep() took a step parameter but silently ignored it, relying instead on a lastValidatedStep property set by an earlier call. Any code path that skipped that ordering would fail silently instead of throwing an error. Fixed by making the function read directly from its parameter, removing the hidden coupling.

Accomplishments that I'm proud of

Getting a genuinely useful tutoring experience out of a ~1KB model — and proving it on real Arm hardware. I tested Aristotle on a Samsung Galaxy phone: cold-start inference ran in roughly 30–70ms, and steady-state inference settled to 4–5ms, fully local with no network dependency after load. On a held-out test set of 400 samples, the validator hit 100% accuracy, precision, recall, and F1. Aristotle shows that on-device inference doesn't need to mean a stripped-down experience — the intelligence lives as much in the surrounding guardrails and UI logic as in the model itself.

What I learned

That efficiency isn't only about model size — it's about being deliberate at every layer of the pipeline about what reaches the model, what doesn't, and why.

What's next for Aristotle

Expanding beyond linear equation balancing to more algebra topics, and continuing to refine the on-device inference pipeline for speed and accuracy on low-power devices.

Built With

Share this project:

Updates

Submission history