AS
All projects

03 / Machine-learning foundations

Aloygrad

Period
Jan 2026
Status
Experiment
Role
Engineer

Project overview

Minimal reverse-mode autodiff engine written from first principles to understand how gradients and neural networks really work.

Minimal reverse-mode automatic differentiation engine built to understand differentiable programming and neural networks from first principles, giving engineers full control over how gradients work.

The challenge

Automatic differentiation is often learned through mature frameworks that conceal the graph traversal and gradient propagation doing the real work.

The approach

Aloygrad rebuilds reverse-mode automatic differentiation from first principles so every operation, dependency, and gradient update remains visible.

01

How it works

01

Compose

Build an expression from differentiable values.

02

Record

Capture operations and dependencies in a graph.

03

Traverse

Order the graph from output back to inputs.

04

Differentiate

Apply local derivatives and accumulate gradients.

02

Key decisions

01

Prioritize understanding

The implementation stays intentionally small enough to trace instead of competing with production tensor libraries.

02

Represent the computation graph

Values retain their dependencies so backpropagation can walk the graph in the correct order.

03

Build from scalar operations

Small mathematical primitives make the chain rule and gradient accumulation concrete.

Technologies

Python / Calculus / Linear Algebra

Next projectPori