The main approach behind the technologies referred to as AI nowadays is ML. ML enables a computer to learn from examples for the purpose of solving tasks on similar data that it has not seen before. Although the foundations of ML date back to the 1960s, high computational and data demands relegated it to more of a side curiosity in the field of computer science for several decades.
The meeting of ML and NLP has given rise to language models.
Often, yet not always, when we talk about AI, we were really talking about methods from ML.
One application of unsupervised ML is to solve a clustering task. In a clustering task, the ML algorithm analyzes the data and tries to identify groups of similar samples.
An important point about the loss function is that it explicitly defines what we are training the model to do. The entire aim of the training is to modify the model in order to minimize the loss. This is what we mean by learning.
Deep learning is a subset of ML involving one specific technique: neural networks.