What Is an Algorithm? The Basic Building Block Behind All AI

“Algorithm” is one of those words that gets thrown around constantly in discussions of AI, social media, and technology in general — often as a vague stand-in for “the mysterious thing a computer does.” But an algorithm is actually a simple, well-defined concept, and it’s the foundational building block underneath every piece of software, not just AI. Understanding what an algorithm really is makes the rest of AI terminology much easier to parse.

What Is an Algorithm?

An algorithm is a precise, step-by-step set of instructions for solving a problem or completing a task. That’s it — there’s no inherent connection to computers or artificial intelligence in the basic definition. A recipe is an algorithm for making a dish. Directions for assembling furniture are an algorithm. Long division, the way you were taught it in school, is an algorithm for dividing numbers.

What makes something an algorithm rather than just a general idea is that it’s specific and unambiguous enough to actually follow, step by step, to a result. “Cook the chicken until it’s good” is not an algorithm. “Cook the chicken at 375°F for 25 minutes, or until its internal temperature reaches 165°F” is.

Algorithms in Computing

In computing, an algorithm is a sequence of instructions a computer follows to transform some input into some output. Every piece of software you’ve ever used — a search engine, a spreadsheet formula, a video game’s physics engine, a social media feed — is built out of algorithms. A sorting algorithm takes an unordered list and rearranges it in order. A pathfinding algorithm takes a map and finds the shortest route between two points. These are concrete, well-understood, and often decades old.

Traditional software algorithms are typically deterministic and explicitly written by a human programmer: if you give the same input, you get the same output, every time, because a person wrote out exactly what steps to follow for every scenario they anticipated.

How Is an AI Algorithm Different?

This is where things get more interesting, and where the popular use of “algorithm” starts to diverge from older definitions. Machine learning algorithms are still algorithms in the formal sense — precise, step-by-step procedures — but what they do is different. Rather than encoding explicit rules for solving a specific problem, a machine learning algorithm is a procedure for learning the rules from data (our article on machine learning covers this process in detail).

So a machine learning “algorithm” is really two things layered on top of each other: there’s the training algorithm (the specific mathematical procedure used to adjust the model’s internal values based on data — things like gradient descent or backpropagation), and there’s the resulting trained model itself, which then makes predictions on new inputs. When people casually say “the algorithm” recommended this video or flagged this post, they usually mean the trained model making decisions, not the underlying training procedure.

Why This Distinction Actually Matters

The confusion between “algorithm” as a transparent, human-written set of rules and “algorithm” as a trained model’s learned behavior is at the root of a lot of public misunderstanding about AI. When someone complains that “the algorithm” is biased or making a bad decision, they’re often picturing a programmer having explicitly coded in that behavior — like a line of code that says “show this user more of X.” In reality, a learned model’s behavior emerges from patterns in training data, which makes it both harder to predict and harder to directly fix than a traditional rule-based algorithm.

This is also why AI systems can be genuinely difficult to audit or explain (see our coverage of the “black box” problem in deep learning). A traditional algorithm’s logic can be read directly from its code. A trained model’s “logic” is distributed across millions or billions of numerical weights, which don’t map cleanly onto human-readable rules at all.

Common Types of Algorithms in AI

A few categories come up repeatedly in AI contexts:

  • Training algorithms: the mathematical procedures used to adjust a model’s weights during learning, such as gradient descent.
  • Classification algorithms: procedures that sort inputs into predefined categories, such as spam vs. not spam.
  • Ranking and recommendation algorithms: procedures that order items (search results, social media posts, product suggestions) by predicted relevance to a specific user.
  • Optimization algorithms: procedures that search for the best solution among many possibilities, used in everything from logistics routing to neural network training itself.

Algorithms Existed Long Before AI

It’s worth remembering that algorithms are a much older and broader concept than artificial intelligence. The word itself traces back to a 9th-century Persian mathematician, and formal algorithmic thinking underpins essentially all of modern computing, mathematics, and engineering — long before anyone was training neural networks. AI didn’t invent algorithms; it introduced a new category of algorithm (the learning-based kind) that behaves differently from the deterministic, explicitly-coded kind that came before it.

Why This Matters for Evaluating AI Tools

When an AI software vendor describes their product as using a “proprietary algorithm,” it’s worth asking (even just mentally) which kind of algorithm they mean. A rule-based system following explicit logic is predictable and auditable, but inflexible. A learned model is more adaptable and can handle messy, real-world inputs far better, but its behavior is harder to fully predict or explain, and it inherits whatever patterns and biases existed in its training data.

The Bottom Line

An algorithm, at its core, is simply a precise set of instructions for solving a problem — a concept far older and broader than artificial intelligence. What’s genuinely new about AI is a category of algorithm that learns its own rules from data rather than following rules a human wrote out explicitly. Keeping that distinction in mind is one of the most useful mental tools for understanding what AI software is actually doing, and why it sometimes behaves in ways that are hard to predict or explain.