Asher Cohen
Back to posts

Understanding Algorithms Through Layers and Metaphors

Exploring how algorithms work by thinking of them as layered machines, from intent to mathematical operations, using metaphors to grasp complex concepts

Think of algorithms as layered machines, each layer turning ideas into action.

At the top is intent: the goal you want to achieve, like predicting the next letter in a name.

Next comes logic: the rules you follow to reach that goal. For example, "look at the previous letters and guess what comes next."

Then comes process: the step-by-step actions the computer takes—looping through letters, checking guesses, and repeating.

After that, everything turns into numbers. Computers can't understand letters or words, only numeric representations. Each character or word becomes a vector—a list of numbers—and patterns become relationships between those numbers.

At the bottom is math. All the loops and logic collapse into operations on numbers: addition, multiplication, exponentials, and derivatives. This is where change happens.

Metaphors for Understanding

Think of it like:

Knobs on a sound mixer: each knob affects the output slightly. Training is turning the knobs in the right direction.

Standing on a mountain in fog: derivatives tell you which way is downhill. Step by step, you reach the lowest point.

Tasting soup: small adjustments improve the flavor. Math tells you which ingredient to tweak and by how much.

The Core Principle

The core of machine learning is simple: represent things as numbers, measure how wrong you are, figure out which numbers caused the error, adjust them slightly, and repeat.

I struggle with the math behind certain algorithms, but thinking about them in pure words and metaphors has always helped me grasp how they work.