Explaining Generative Artificial Intelligence Models (Generative A.I)

anitakivindyo
3 min readDec 16, 2022

--

This article explains what generative models are and how different their approach is, in solving machine learning problems.

Photo by DeepMind on Unsplash

One of the biggest advancements of Artificial Intelligence is its ability to create new things. Until recently, most of the Machine Learning models that powered A.I applications made use of discriminative models.

What are discriminative models ? you may ask, and how are they different from generative models?

A discriminative model is simply a conditional model, these models tend to answer the question ‘how can the model best classify some data’ or ‘how can the model best predict a value’

A generative model on the other hand describes how well data can be generated.

Let’s use an example to better understand this concept.

Say we have a task to detect whether a camera is pointed at a giraffe,( this is a binary Image Classification task) how to define ML problems

The most popular approach would be to train a model over a collection of images (some of which should be giraffes and others should not). The model should then find patterns in the training images and make a prediction of whether or not the camera is pointed to a giraffe or not. This is the discriminative approach.

A generative model on the other hand would learn from the input data (of giraffe images and no giraffe) and try to find whether an image labeled “giraffe” resembles data it has seen before more closely, than an image labeled “no giraffe”. This doesn’t stop there, generative models can go ahead and support another use-case. The patterns learned in a generative model can be used to generate new data which look similar to the data it has seen before. So new giraffe images.

In summary, discriminative models draw boundaries in the data space, while generative models try to ‘model’ how data is placed throughout the data space.

From a statistical point of view, a discriminative model is a model of conditional probability.

A generative model is a joint probability distribution.

We can now have a look at 3 popular types of Generative AI models and what they do.

  1. Generative Adversarial Networks (GANs)
  2. General autoregressive models
  3. Transformer-based models

Generative Adversarial Networks (GANs Networks)

***adversarial, means involving two people or sides that oppose each other***

This machine learning aproach involves putting two networks against each other to generate new content.

The training algorithm swaps back and forth between training a:

i) Generator network — this is produces new data

ii) Discriminator network — measures how close the generator network data represents the training data

AutoRegressive Models

These models are used to study systems that evolve over time, and assume the likelihood of some data occuring. However this prediction solely depends on historical data.

Such models are great at solving regressive problems like weather predictions and stock market predictions

Transformer based Models

These models are used to study data that occur in a sequential structure. Like the sequence of words in a sentence. So they are commonly used in modelling modern language in the field of Natural Language Processing (NLP) and modelling images Computer Vision (CN).

Generative AI algorithms can be classified as both unsupervised and semi-supervised machine learning algorithms. This alone makes them quite diverse and allows them to generate new data in the data space.

I mean, have you tried the lensa App everyone is using? yea, thats Generative A.I. cool right?

--

--

anitakivindyo

My personal blog aiming to explain concepts in Machine Learning, Artificial Intelligence and Data science