You follow algorithms all the time without calling them that. A recipe for masala chai is one. So are the directions to a friend’s house, and the steps for withdrawing cash from an ATM. Each is a list of clear steps that, if you follow them in order, gets you to a result.
Computers work the same way. Every app on your phone, every search, and every AI tool is built from algorithms. This guide explains what an algorithm is, how the algorithms behind AI are different from ordinary ones, and why “the algorithm” and “the AI model” are not the same thing. No maths or coding background needed.
What is an algorithm?
An algorithm is a finite list of clear, step-by-step instructions for solving a problem or doing a task.
Three things make something an algorithm:
- Clear steps. Each step says exactly what to do. “Add a bit of sugar” is vague; “add one teaspoon of sugar” is clear.
- An order. The steps run in a set sequence, and some steps can repeat or depend on a choice (“if the water is boiling, add the tea leaves”).
- An end. It finishes and gives a result. A list of steps that runs forever with no answer isn’t a useful algorithm.
The word itself is old. It comes from the name of Muhammad ibn Musa al-Khwarizmi, a Persian mathematician who worked in Baghdad in the 9th century. His book on calculating with the Hindu-Arabic numerals (the 0 to 9 we use today) was translated into Latin, and his name, written as Algoritmi, slowly turned into the word “algorithm”. The same scholar’s work on equations gave us the word “algebra”.
Algorithms in everyday computing
Long before AI, computers were running algorithms that people wrote by hand:
- Sorting. Your contacts list is sorted A to Z by a sorting algorithm.
- Searching. Finding one name among thousands quickly uses a search algorithm.
- Route finding. A maps app uses algorithms that find the shortest path between two points on a road network.
- Calculations. Your bank app adds interest using a fixed formula, step by step.
In all of these, a programmer decided every rule. The computer follows them perfectly, but it never invents a rule of its own. If the rules are wrong, the result is wrong.
So what is an algorithm in AI?
AI uses algorithms too, but often in a surprising way. Instead of a programmer writing the rules for the task, a programmer writes an algorithm for learning the rules from examples. This is called a learning algorithm, or a machine learning algorithm.
Take spam filtering. The old way was to write rules by hand: if the email contains “lottery winner”, move it to spam. Spammers quickly learned to write “l0ttery w1nner” instead, and someone had to write a new rule.
The machine learning way is different. You collect thousands of emails that people have already marked spam or not spam. Then a learning algorithm studies them and works out, by itself, which patterns tend to mean spam. Nobody writes the rule “lottery means spam”. The algorithm finds that pattern, and many subtler ones, from the examples.
So in AI there are usually two different things at work:
- The learning algorithm: the recipe for how to learn. It is written by people.
- The model: what comes out after the learning algorithm has studied the data. It is the learned pattern, stored as numbers.
Algorithm vs model: the difference that confuses everyone
People often say “the AI algorithm decided…”. Usually they mean the model. Here is an everyday way to keep the two apart.
Think of a study method: read the chapter, answer the practice questions, check your answers, go back over the ones you got wrong. That method is the algorithm. Two students can follow the very same method and end up knowing different things, because they studied different books.
What ends up in a student’s head after studying is the model. Feed the same learning algorithm different data and you get a different model. That’s why two spam filters can use the same algorithm and still behave differently: they learned from different emails.
| Learning algorithm | Model | |
|---|---|---|
| What it is | The steps for learning from data | The result of that learning |
| Who makes it | People write it | It is produced by training |
| Looks like | Code | Numbers (often millions or billions of them) |
| Everyday comparison | A study method | What a student learned |
Large language models like the ones behind ChatGPT, Claude and Gemini follow this pattern too. A learning algorithm is run over huge amounts of text during training, and the result is a model made of billions of learned numbers. Our guide to what a large language model is explains that training process step by step.
Common AI algorithms you may hear about
You don’t need to know these to use AI, but the names come up a lot. In plain words:
- Linear regression draws the best straight line through data, for example to estimate a house price from its size.
- Decision tree learns a flowchart of yes/no questions, such as “Is the income above X? Is the loan amount below Y?”.
- k-means clustering sorts items into groups that look alike, without being told what the groups are.
- Gradient descent is the step-by-step method most neural networks use to improve. It nudges the model’s numbers a little at a time so its mistakes get smaller.
- Backpropagation works out how much each number inside a neural network contributed to a mistake, so gradient descent knows which way to nudge it.
Many of these are decades old. What changed in recent years is mostly the amount of data, the speed of computers, and the size of the models these algorithms can train.
What about “the algorithm” on social media?
When people say “the YouTube algorithm” or “the Instagram algorithm”, they usually mean the whole recommendation system: the software that decides what to show you next. It is not one algorithm. It is many algorithms and trained models working together, using signals such as what you watched, liked, skipped or searched for.
It is fair to call it “the algorithm” in conversation. Just remember that much of its behaviour was learned from data, not written as a rule by a person, which is why even its makers can’t always say exactly why one video was shown instead of another.
Common misconceptions
“An algorithm is something only computers have.” No. A recipe, a knitting pattern and long division are all algorithms. Computers just follow them very fast.
“The algorithm and the AI are the same thing.” In AI, the learning algorithm builds the model, and the model gives the answers. They are related, but different.
“Algorithms are always neutral.” An algorithm follows its steps exactly, but a learning algorithm learns from data, and data can carry unfair patterns from the real world. That is called AI bias, and it is the next letter in this series.
“AI algorithms are too complex for normal people to understand.” The maths can get deep, but the idea is simple: show examples, measure mistakes, adjust, repeat.
Key takeaways
- An algorithm is a finite list of clear, ordered steps that solves a problem.
- Traditional software runs algorithms whose rules were written by people.
- In AI, a learning algorithm finds the rules itself by studying examples.
- The model is what the learning algorithm produces: learned patterns stored as numbers.
- Same algorithm + different data = different model.
Frequently asked questions
What is an algorithm in simple words?
An algorithm is a set of step-by-step instructions for doing a task, like a recipe. A computer follows it exactly to turn an input into a result.
What is the difference between an algorithm and AI?
An algorithm is any list of steps, and most software uses algorithms without any AI. AI is a field that builds systems for tasks that usually need human intelligence. Many AI systems are built by running a learning algorithm over data to produce a model.
Is ChatGPT an algorithm?
Not exactly. ChatGPT is an app built on large language models. Those models were created by learning algorithms, and algorithms run them, but the model itself is a huge set of learned numbers rather than a list of hand-written steps.
Who invented algorithms?
People have used step-by-step methods for thousands of years, for example in Babylonian and Greek mathematics. The word “algorithm” comes from al-Khwarizmi, the 9th-century mathematician whose name was written in Latin as Algoritmi.
Do I need to learn algorithms to use AI?
No. You can use AI tools without knowing any algorithms. If you want to build AI systems, learning the basics of how a few common ones work is very helpful.
Comments