Artificially Intelligent Systems

Artificial Intelligence (AI) is something everyone has heard of, though it can still be challenging to define. (What is intelligence, for that matter?)
Our thoughts quickly turn to social media, where many are aware that AI is used—and perhaps suspect that we are somehow being manipulated in one way or another.
Simultaneously, we also have the popular cultural depiction of AI in films like The Terminator, Blade Runner and Star Wars. Here, AI is represented as a robot or a computer system with human-like intelligence—capable of thinking and acting independently to match, and perhaps exceed, our own mental abilities.
Does Instagram and TikTok's algorithms have anything to do with C3PO or Skynet? Realistically speaking, what exactly is artificial intelligence anyway?

Systems that achieve a goal based on data

Artificial intelligence is simply an umbrella term. The same way apples and pears are both fruits, two different computer programs can both be considered as examples of artificial intelligence, even if they do widely different things and are based on different underlying techniques.
Here are two definitions. The first definition asks: What do AI systems actually do and affect? While the second asks: Can machines think like us?
Norway's national strategy for artificial intelligence has the following definition: “AI systems act in the physical or digital dimension by perceiving their environment, processing and interpreting information and deciding the best action(s) to take to achieve the given goal. Some AI systems can adapt their behaviour by analysing how the environment is affected by their previous actions”.
UNESCO’s 2019 definition aligns with early understandings of AI where the emphasis was on imitating human behaviour, and mimicking human cognition: AI was defined as “machines capable of IMITATING human intelligence, including such features as perception, learning, reasoning, problem-solving, language interaction, and even producing creative work”.
When you hear about artificial intelligence relating to technology and data, quite often it is more specifically machine learning or deep learning that is being referenced. Machine/deep learning are subcategories of artificial intelligence, and encompass systems that can learn from data.

What is machine learning?

You have learned what algorithms are, and we have written that some algorithms are referred to as “smart”; they are used to train and run machine learning models. Let's see what this actually means.
Algorithms underpin every computer program. Machine learning algorithms also rely on precise, step‑by‑step instructions for how to train and run a model, where the model (i.e. a structured set of parameters or weights) is the result of that training.
Even though we call it “artificial intelligence”, there is no reflection, improvisation, or self-awareness involved.
Instead, it is about using methods and tools from mathematics and statistics to create machine learning algorithms or models that can change and adapt to circumstances and available data.
First, we must determine the specific task the model is to solve—such as filtering out spam, playing chess, or predicting car sales in the coming months. The machine learning algorithm is then given specific data to work with—data used to “train” the model for the specific task.
Often, a human has to decide which parts or characteristics of the data are important; this person is usually an expert in the area where the model is being built (for example, a radiologist for medical images, or an office worker for spam).
At the start, the model may not be able to tell the difference between legitimate email and spam. But after seeing many examples, and getting feedback on whether it sorted them correctly, it ‘learns’ to spot the differences more accurately and improves at its task over time.
You can see how machine learning is problem-specific. A model can be trained to navigate a self-driving car in traffic, suggest the best route, review documentation for a loan application or automatically fill in fields on an invoice where it finds the necessary data.
Each model is made to be as good as it can possibly be at its specific task — but it can't suddenly stop and decide to do something entirely different.
Deep learning is a way of doing machine learning using large “neural networks” with many layers that can automatically find useful patterns in complex data, such as images, sound, or long texts. Instead of a human carefully deciding which features of the data matter, a deep learning model can often discover these on its own by training on huge amounts of examples.
The algorithms used to train today’s major generative AI models (such as GPT-style text models, image generators, many voice models) are almost all deep learning methods—specifically large neural networks (e.g., transformers) trained on very large datasets using gradient descent and related techniques.
In simple terms, machine learning often relies more on humans to define what to look for, while deep learning can learn many of those details itself—but usually needs far more data and computing power.
The Hollywood version of AI that resembles human intelligence is indeed something many people envision. This is called artificial general intelligence (AGI). But it is a vision that, for now, is far from achievable, and something entirely different from machine learning.

Example

Alien or Mamma Mia?

A typical example of how machine learning is used, is the recommendations you get from various streaming services. Here, machine learning models are used to suggest content based on what you like to watch or listen to.
Suppose you love science fiction but can’t stand frivolous romantic comedies. If you put on The Terminator one evening, and Blade Runner the next, the recommendation model of the streaming service can recognise a pattern and subsequently suggest that you put on, say, Alien or The Matrix—instead of filling your homepage with Mamma Mia and My Big Fat Greek Wedding, which you're not interested in.
In this example, the recommendation model’s goal is to provide the best possible suggestions for content tailored to each user's preferences, habits, and tastes. The better the model is designed, and the more data it has to work with describing your and other users' habits and patterns of action, the better it can become at giving you suggestions you actually like.
The overarching goal of such a system is to maximise the chances of keeping you glued to the screen—and subsequently, continuing to pay your subscription. But this system also brings benefits for you, as it makes it easier for you to find content you actually like.

Large Language Models (LLMs) and Generative AI (GenAI)

LLMs are one of the most prominent recent developments in deep learning. They are trained on enormous collections of text and learn statistical patterns about how language is structured.
During training, a neural network repeatedly tries to predict missing or subsequent tokens (chunks of text which could be a word, part of a word, or sometimes something longer like a sentence!). It then compares its predictions with the training data, and adjusts its internal parameters to reduce the difference.
After many such adjustments, an LLM can generate new text that follows patterns learned from its training data, rather than simply retrieving or copying the original text. LLMs are one type of generative AI; other generative models use related deep-learning techniques to generate images, audio, video, and other forms of content.

How the models are trained

There are many different types of machine learning algorithms, but it's common to group them into three categories: supervised learning, unsupervised learning, and reinforcement learning.
The simplest of these is supervised learning, so we'll look at that first.

Supervised learning

When training the machine learning model, we use what we call training data. If, for example, we're talking about a model to filter out spam email, the training data can consist of tens of thousands, perhaps millions of examples of emails—both legitimate and spam—that the model should learn to distinguish between.
In supervised learning, the algorithm is given a dataset that contains both the data (input) and information about what each data represents (output). In a spam filter, for example, it has labelled examples that say which emails are spam and which are not, and the model learns a rule that links new input (real emails) to the correct output (spam or not spam).
Another example: Imagine we’re training an image recognition model to tell elephants from giraffes. As training data, we give it lots of labelled images showing these two animals, where each image is marked as either ‘elephant’ or ‘giraffe‘.
This labelled data enables us to train the model. We can create a program that evaluates which answers are correct, and provide the model with instant feedback, adjusting its internal parameters to improve its accuracy as it learns to spot the difference.
Once the training is complete, test data—data the model hasn't seen before—is used to see how accurate the model has actually become.
Here we will use completely new and previously unseen pictures of elephants and giraffes, that were not part of the training dataset. Thus, when we test the model with a new dataset, we will be able to tell if it has learned what it should have, and if it works as desired.
When the model is later put into production—that is, taken into real use, in this case an image recognition tool—it is possible to set it up so that it continues learning from the new user supplied data to develop further.
However, this process needs to be monitored to ensure that the model is actually improving and not learning the wrong things.
Training data goes in, through algorithms, and out we get a model based on the training data
Test data goes in, and then the model gives us an answer about what is what, based on the model

Unsupervised learning

In unsupervised learning, the algorithm looks for structures and patterns in the data on its own. Unlike supervised learning, no information about what the data means (output) is given during training. Instead, we want the model itself to recognise grey animals with trunks and strange yellow animals with long necks as different animals, and group them separately.

Reinforcement learning

Here the algorithm is not instructed on how to solve its task, but instead receives rewards and punishments for good and bad results. A typical example is a machine that is only given a goal—say, to win at chess—but is not told which pieces are the most valuable or what is considered a smart move. It then attempts to achieve this goal through trial and error.
With machine learning as a tool, we can solve problems in new and different ways, including things that we humans are not capable of on our own. This opens up many exciting possibilities. However, the algorithms are at the mercy of the data they have to work with.
Enough data—and good enough data—are therefore prerequisites for succeeding with machine learning.
Data is increasingly in abundance, and it comes from all kinds of sources. This is partly as a result of the Internet of Things (IoT), which is the next thing we will look at. Later, we will also revisit artificial intelligence and machine learning, in chapter 5.