Tech

What are AI model hallucinations? – VeryComputer

A few days ago, when reviewing the news of GPT-4, I mentioned hallucinations as one of the main problems of artificial intelligence models. The chosen term is, indeed, quite explanatory, but even so, I think it is interesting to delve a little into it to understand what it consists of, why it means that we should never take the outputs of artificial intelligence as something 100% reliable. and definitively, the reasons why they occur and what measures are being taken to try to mitigate them. So, let’s start at the beginning.

What are hallucinations?

In the context of artificial intelligence, hallucinations refer to abnormal behavior in which a model generates false information or perceptions, without there being an external source of stimulus that justifies its existence. We have talked, on more than one occasion, about the tendency of some generative tools (not only text, but also images and many other fields) to provide invented/inconsistent information. From the horror faces of DALL-E 2 to Miguel Hernández’s invented poems, but also the misinterpretations of the data received by sensors can be considered hallucinations.

Hallucinations are a problem in any system based on artificial intelligence that must infer an answer, of whatever type, from the interpretation of its input data based on its learning process. However, their importance varies substantially depending on the context. Because, of course, it is not the same for a text-generating AI to invent a poem and attribute it to a real author, or to give an erroneous definition of a word, to the expert system responsible for autonomous driving of a vehicle. misinterpret the information from your sensors and cause an accident.

The arrival of artificial intelligence in critical applications has therefore focused on a problem that was previously identified, but that has become more important than eversince fields such as security, medicine and the like cannot risk trusting artificial intelligence if there is a risk that hallucinations cause incorrect answers without these being able to be inferred, at least in principle, based on the data with which the model has been fed.

What are AI model hallucinations?

Why are they produced?

There are several reasons why an artificial intelligence model can hallucinate, which are usually different depending on whether we are talking about supervised learning models and unsupervised learning models. We already explained this in the article on the fundamentals of artificial intelligencebut let’s remember it in an abbreviated way.

  • supervised learning: the model is trained on labeled data along with the expected output. The goal of the model is to learn how to map input data to its corresponding expected outputs, in order to predict the output for new input data. For a simple example, we feed the model with a dataset of photos of cats and dogs, labeling each one with the type of pet shown in it. The goal is for the model to learn to distinguish between cats and dogs to identify them in the images we provide when they are ready for action.
  • Unsupervised learning: in this case, as you probably already imagined, the model is trained with unlabeled data. This type of training is used when what we want is for the model to be able to find hidden patterns and structures in the data by itself. For example, if you are analyzing social media data to identify groups of users with similar interests using unsupervised learning, the model will look for hidden patterns in the data that suggest certain users have similar interests, without being given any specific labels. .

Hallucinations in models with supervised learning

The main cause of hallucinations in a supervised learning model is the overfitting (overfitting), which occurs when the model overfits the training data and loses the ability to generalize to new data. Going back to the example of the cat and dog photos, if the model fits the training images too much, it may memorize them instead of learning useful patterns that it can apply to new images. As a result, the model may correctly classify training images, but fail on new images that it hasn’t seen before.

Hallucinations in models with unsupervised learning

In this case, the most cited cause for the model to “hallucinate” is the lack of sufficient information in the input-learning data. If the model does not have enough information to fully understand the patterns in the data, it can generate incorrect information.

The presence of noise is also especially important in unsupervised learning models, that is, information that is not useful, but that can lead the model to detect false patterns that it will later use when processing the input data.

Other common causes in both types of learning

There are some problems that can occur in both cases (although some of them may be more common in one type of learning than in another). These are the most common:

  • insufficient training: based on its function and its complexity, a model may need a huge data set for its training to be sufficient. Otherwise, you may not be able to get all the information you need to correctly identify the patterns.
  • Skewed datasets: The data sets used in training should be as diverse as possible. Imagine, for example, a model that has to analyze photographs by identifying faces. If the AI ​​responsible for this function has only been trained using photos of people of one race-ethnicity, it is very likely that it will make mistakes when processing images with people of other races.
  • Model complexity: If the model is too complex, it can learn to recognize patterns that are not important or do not have a direct correspondence with reality, which can lead to the generation of false information.
  • Algorithm design flaws: If there are errors in the model code, this can also cause hallucinations. These errors can be due to typos, logic errors, or problems with the way the data is processed.

What are AI model hallucinations?

How can they be avoided?

At this point, you will already be fully aware that we are talking about a very complex problem and that, therefore, it does not have a simple solution. However, yes, there are good practices and techniques that can substantially reduce the risk of a model experiencing hallucinations.

The first thing is, of course, to start with a large and well-edited dataset. To this end, we must take into account that it must be as representative and diverse as possible, minimize the volume of noise as much as possible and, of course, not use the same data for the training and validation processes. The latter is what is known as naive cross validation, and the result of it is that we will obtain results that can be much better than those that we would obtain from using a different data set. Consequence? We will think that the model works better than it actually does.

Another good practice is regularization, which imposes restrictions on the complexity of the model, with which we can avoid problems such as overfitting. There are several regularization techniques, such as LASSO (Least Absolute Shrinkage and Selection Operator), Rigde (also known as contracted regression), and dropout regularization, among others. In all cases, the aim is to reduce complexity and prevent the model from memorizing the training data, instead of being able to generalize from said process.

A very interesting approach is the use of generative adversarial models (GAN, and probably familiar from NVIDIA’s GauGAN2) to generate dummy data that can be used to train the neural network to be more resistant to hallucinations. During training, the generator network and the discriminator network are trained against each other. The source network tries to create data that fools the discriminator network, while the discriminator network tries to distinguish between the data created by the source network and the actual data. Over time, the generator network learns to generate more realistic data and the discriminator network becomes more effective in detecting generated data.

What are AI model hallucinations?

Another approach to reduce hallucinations in artificial intelligence is the use of explainability techniques. These techniques allow us to understand how the neural network makes decisions and which characteristics of the input data are most important for its learning process. By better understanding how the model works, it is possible to identify the causes of hallucinations and take steps to correct them.

In addition, they are developing specific techniques to reduce hallucinations in critical applications for safety, such as autonomous driving. In this context, it is essential that the neural network be able to accurately detect objects and situations in the environment to make safe decisions. To achieve this, reinforcement learning techniques are being used that allow the neural network to learn iteratively from the feedback it receives from the environment.

These are just some of the methods and best practices to avoid, or at least mitigate as far as possible, hallucinations from AI models. However, and although advances are made in this sense on a regular basis, and there are also generative artificial intelligences, such as the new Bing, which always document their responses with the sources, which is an excellent measure to mitigate hallucinations, We must remember that these can occur at any time. and, consequently, we must always act with certain reservations before the departures of the same.

This does not mean, of course, that we should rule out the use of artificial intelligence, far from it. Model makers give priority to finding solutions to this problem, and in many cases the result is reliable. The important thing is, yes, not to trust us.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *