What is an AI Algorithm?

What makes the difference between a regular Algorithm and a Machine Learning Algorithm?

Alexandre Gonfalonieri
Apr 22 · 7 min read

The word algorithm has become very popular recently. It has transitioned from something only mathematicians used to something most marketing teams use to promote AI-powered solutions.

During my projects, I realized that some startups just use the word algorithm without really explaining how does the fact that they use algorithms make the project “AI”. I hope that this will article will help you understand the difference between “AI” algorithm and other algorithms.

What is an Algorithm?

Well, let’s start with an easy definition.

Algorithm: process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

Basically, the goal of an algorithm is to solve a specific problem, usually defined by someone as a sequence of steps.

For instance, a food recipe to make a cake- that’s an algorithm.

In other words, algorithms are shortcuts that help us give instructions to computers. An algorithm simply tells a computer what to do next with an “and,” “or,” or “not” statement. Obviously, like most things related to mathematics, it starts off pretty simple but becomes infinitely complex when expanded.

It’s important to point out that not all algorithms are related to AI or machine learning specifically.

Algorithms provide the instructions for almost any AI system you can think of.

It sounds great but actually traditional algorithms have an issue. Indeed, you have to tell to create a step by step process to reach your objective. Rather than follow only explicitly programmed instructions, some computer algorithms are designed to allow computers to learn on their own.

Machine learning

What is it?

Machine learning: set of algorithms that enable the software to update and “learn” from previous outcomes without the need for programmer intervention. It is fed with structured data in order to complete a task without being programmed how to do so.

Machine Learning is made up of a series of algorithms. Basically, AI (Machine Learning is a subset of AI) is designed to learn in the same way as a child. Thanks to a dataset, an AI can find patterns and builds assumptions based on those findings.

This is called model-based learning, and it allows AI to make better decisions than humans because it can take many more factors into account and analyze them in milliseconds.

An algorithm is like following a recipe. You follow a set of instructions: prepare the ingredients, heat the oven to 200c, and bake for 10 minutes. The output/result will be to have a great cake.

Now, let’s imagine your oven is too hot. Through Machine Learning, the system learns from the past that the oven gets too hot and so turns it down.

Machine Learning can be compared with an experienced cook (if you have a good dataset). It knows the recipe and has learned a lot from previous experiences. For instance, the system has found out that this ingredient worked well with this cake (based on data)and it would make recommendations/predictions. By using ML, you get something that goes beyond the sum of its parts.

As we have seen an algorithm is a mathematical technique. It is derived by statisticians and mathematicians for a particular task, for instance, prediction.

Algorithms in machine learning aren’t new. At the most basic level, machine learning programs are code. So, they’re code written in Python or Java or some programming language. However, Only when they were implemented in the form of a code, the algorithms’ utility increased since computers can handle high computation.

Many algorithms are existing for AI but they are often in my opinion of 3 classes:

You have of course subclasses on these 3 classes and you can even find hybrid approaches that try to include the power of both.

Difference between AI and “clever” algorithm

The difference between AI and a clever algorithm is how it is programmed.

As a user, we tend to focus only the moment inputs are collected and entered into a system to where outputs are produced as the results from a system.

However, what happens in the middle is what matters most: let’s call it the hidden step.

The hidden step is often untold, making it difficult to distinguish between AI and algorithms.

Some elements can help us classify a system using AI versus clever algorithms

  • Basic Algorithm

If a defined input leads to a defined output, then the system’s journey can be categorized as an algorithm. This program imitates the basic calculative ability behind formulaic decision-making.

  • Complex Algorithm

If a set of complex rules, calculations, or problem-solving operations can lead to a defined output then that system’s journey can be classified as a complex algorithm.

  • Machine Learning (AI)

In an AI system, outputs are not determined but designated based on complex mapping of data that is then multiplied with each output.

Machine Learning makes assumptions, reassesses the model and reevaluates the data, all without human intervention. This is a game changer. Basically, a human engineer does not need to code for each and every possible action/reaction. The ML system will find out all possible patterns at a speed and capability no human could attain.

Traditional Algorithm.
It takes some input and some logic in the form of code and gives you an output.

The traditional algorithm produces an output on the basis of steps described in the algorithm. Give the algorithm input and it produces output based on the rules and parameters you have hard-coded yourself.

Machine Learning Algorithm.
It takes an input and an output and gives you some logic which can then be used to work with new input to give you an output. That logic which is generated is what makes this ML.

ML algorithm predicts an output on the basis of learning through the input provided to it. This learning through input is called the Training process.

Give the algorithm data to learn from and it adjusts parameters to explain the data. Then you can use these set of parameters to explain/predict new data.

But not all ML algorithms are based on neural networks, algorithms that solve many business use-cases can be solved by regression or tree-based algorithms.

It’s all about the complexity…

These algorithms usually require lesser computation and lesser data to perform reasonably well on many problems which are perfect for some business issues. When you see the term AI used to define these algorithms, I believe, it does not make sense.

Most AI modifies its algorithm in some way. In other words, the same input needs not to yield the same output/response later. For instance, neural network modifies the “weights” of certain junctures in its pathways, based on the correctness of previous guesses/responses on input.

Neural Network: series of algorithms that endeavors to recognize underlying relationships in a set of data through a process that mimics the way the human brain operates.

When chained together, algorithms — like lines of code — become more robust. They’re combined to build AI systems like neural networks.

The machine learning algorithm behavior is determined by what it learned during its training step and then how it compares to what it’s seeing in real life — in production. This is very different from most common algorithms, and it requires companies to be able to assess model performance in ways that are unique to machine learning algorithms.

ML Vs Classical Algorithms

I have seen customers apply similar staging to both machine learning and classical algorithms projects, where you have some experimental development (PoC) then followed by full-scale production.

However, everything else is quite different. I’ll give some examples.

  • An ML solution is truly an AI if it is not programmed to perform a task, but is programmed to learn to perform the task
  • Traditional learning methodologies such as training a model-based on historic training data and evaluating the resulting model against incoming data are not feasible as the environment is always changing
  • Classical approaches have a more rigorous mathematical approach while machine learning algorithms are more data-intensive

In most cases, one of the fundamental differences is that machine learning can have a range of outcomes that are all valid but cannot necessarily be determined upfront.

In my experience, Machine Learning also requires a lot of time to work perfectly. For example, it’s possible for an ML Project running in production to display no errors at all, have completely good behavior from any kind of metric like CPU utilization but still be turning out bad predictions.

In summary, a traditional algorithm takes some input and some logic in the form of code and drums up the output. As opposed to this, a Machine Learning Algorithm takes an input and an output and gives some logic which can then be used to work with new input to give one an output. The logic generated is what makes it ML.

ML algorithm can learn from data while classical algorithms specify the exact rules to find the overall answer.


where the future is written

Alexandre Gonfalonieri

Written by

I write about AI | https://www.linkedin.com/in/agonfalonieri9/



where the future is written