
Francesco Conti : 12 November 2025 22:03
Artificial intelligence isn’t about magic, it’s about learning! This article aims to demystify the esotericism surrounding artificial intelligence (AI) by providing a comprehensive answer to the question , “How do machines learn?” Indeed, the ” magic ” behind AI’s functioning lies in the learning phase. Artificial intelligence applications use vast amounts of data, from which patterns are identified to make data-driven decisions.
There are several approaches to learning, including supervised , unsupervised , and reinforcement learning. These methods differ in their objectives and problems to solve, as well as in the type of data available: labeled examples, unlabeled examples, or through direct interaction with an environment, respectively.
In this article, we’ll explore these three methods and try to understand how they work! We’ll also provide an overview of modern learning mechanisms, such as active learning and reinforcement learning from human feedback !
Supervised learning is one of the most popular approaches in machine learning. Methods based on this approach rely on a training phase using data, in which each example is associated with a corresponding response, or label . The primary goal of a machine learning (ML) model in this context is to learn the relationship between data features and labels in order to make accurate predictions on new inputs. The main tasks that can be solved through supervised learning are:
To gain a clearer understanding, let’s consider a classification example in which we want to train a model to predict whether a customer in an online store belongs to a “high-end” or “low-end” segment in order to target luxury product advertising. To this end, we collect data on customers’ income and average monthly spending. Each training example is assigned a label that evaluates whether the customer has responded to high-end ads in the past, associating a value of 1 (yellow square) and 0 (green triangle). In this example:
Once the rule has been learned, the model is used in a phase called inference , to classify new customers and understand whether to advertise luxury products. In this phase, the model

Beyond this trivial example, supervised learning is currently successfully used for problems of:
In unsupervised learning, we have no labels or correct answers associated with the training data. The primary goal of this approach is to discover hidden patterns or structures in the data without any external guidance. The main tasks associated with unsupervised learning are:
Returning to the store example, in this case we might have collected information about income and spending history, but without recording information about responses to previous advertisements for luxury products. In this case, we only have the features and not the labels, but we might still be interested in profiling customers to assess whether there are groups that might prove more responsive. From the figure, we can see that users are grouped into two clusters. Unsupervised learning, therefore, can still be used to extract insights from data and establish a rule for taking actions, such as targeted advertising, which in this case will be directed toward the cluster with the highest income and average spending.

Among the most significant applications of unsupervised learning:
Reinforcement Learning (RL) is a branch of artificial intelligence in which agents learn to make decisions through direct interaction with an environment. Unlike previous approaches, RL is based on a trial-and-error learning process. Agents explore the environment and receive positive or negative rewards based on their actions. The agent’s goal is to learn an optimal strategy to maximize the cumulative amount of reinforcements obtained over the long term. Through continuous iterations, the agent updates its action policy to make more intelligent decisions in the specific context.
RL finds application in a wide range of tasks, including controlling autonomous robots, resource management, strategic games, and action planning. For example, in robot control, the agent learns to perform actions that maximize the achievement of a specific goal, such as walking or manipulating objects. In strategic games, RL can be used to train agents capable of making tactical and strategic decisions to win complex games such as chess or video games.
The approaches described are the fundamental ingredients of machine learning and are necessary for understanding how functional blocks of entire AI systems function. However, some learning techniques benefit from hybrid or multi-stage training.
One example is unsupervised pretraining for computer vision tasks. In particular, when available labeled data is limited, pretraining with an unsupervised task allows a model to learn meaningful image representations from unlabeled data.
These learned features can be transferred to specific tasks, improving performance and reducing the need for labeled data. This type of learning is called transfer learning : a model is pre-trained on a task or domain and is then used as a starting point for tackling a new task.
Approaches of this type are used to address the lack (or excessive cost) of properly labeled data. Below, we’ll discuss other methods that achieve the same goal!
Other learning approaches that are very popular in recent applications:
In this article, we explored how machines learn; the techniques illustrated represent an important framework for formalizing AI problems. Even complex systems such as image recognition and language models rely on these functional building blocks. Future articles will explore how machine learning and deep learning extract insights from data to solve various tasks.