0% found this document useful (0 votes)
37 views5 pages

Understanding Generative Models in AI

Uploaded by

Raja Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

Understanding Generative Models in AI

Uploaded by

Raja Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Generative AI for Beginners: Part 5 – Understand Generative Models

This blog is part of the series Generative AI for Beginners [TODO link], where we are learning basics
of Generative AI, one simple step at a time.

To make it easy to grasp, I have divided the entire series in small chunks:

1. Part 1 – Introduction to AI
2. Part 2 - Understanding Machine Learning
3. Part 3 - The Role of Data in AI OR Deep Learning
4. Part 4 – Introduction to Generative AI [current blog]
5. Part 5 - Large Language Models (LLMs)
6. Part 6 - Prompt Engineering
7. Part 7 - Ethical Considerations in Generative AI
8. Part 8 - Future Trends in Generative AI

This is the 5th blog in this series where we will understand generative AI models and how they
work.

Let’s start!

Machine Learning Models


In previous blog, we briefly touched upon Generative Models. Before going in-depth on generative
models, let’s first understand Machine Learning Models.

Machine learning models are basically the algorithms that are used to achieve certain tasks. These
algorithms usages mathematical concepts like calculus, probability, statistics, etc. and requires huge
amount of data for training.

Over time, various machine learning models have been introduced. These models are designed for
different tasks. On a high level, we can categorize the machine learning models into 2 parts:

1. Discriminative models
2. Generative models

A high-level understanding of Discriminative Models and Generative Models


Discriminative models, as name suggests are used to discriminate (classify) different kinds of data.

While, generative models, as name indicates, are used to generate new data.

A generative model can generate new images of animals, even animals that does not exists (by using
creativity),

While a discriminative model can identify an animal. It can tell if it’s a dog or a cat or some other
animal.

Let’s go little deep into these models!


Discriminative Model
Discriminative models are a type of machine learning model that:

• DO NOT generate new data


• are mainly used for tasks like classification, regression, anomaly detection, voice and picture
recognition etc.
• Usages supervised learning approach – requires labelled data

Most common discriminative models are:

• Logistic regression
• Support vector machines (SVMs)
• Decision trees

Generative models
Generative models are a type of machine learning model that:

• learns the underlying set of data and generates new data the closely mimics the original data
• are mainly used to create new content, such as images, text, or even music.
• Usages unsupervised learning approach

Most common generative models are:

• Generative Adversarial Networks (GANs)


• Variational Autoencoders (VAEs),
• Transformer-based Language Models
• Limited Boltzmann Machines (RBMs)
• Bayesian network
• Autoregressive model

From a mathematical perspective:

On a data X and a target Y:

Discriminative models estimate the conditional probability p(Y | X).

Generative models estimate the joint probability p(X, Y), or just p(X) if there are no labels.

In a generative model there are samples in the data that is input variables X but it lacks the output
variable Y and we use the only input variables to train the generative model.

It recognizes patterns from the input variables to generate an output that is unknown and based on
the training data only.

Generative Adversarial Networks (GANs)


Variational Autoencoders (VAEs)

Transformer-based Language Models


Transformer-based language models are:

• a type of large language model


• that uses the transformer architecture
• to learn contextual relationships between words in a sentence or paragraph

Note: The Transformer architecture is a type of neural network architecture that has
proven highly effective in various Natural Language Processing (NLP) tasks.

How does Transformer-based Language Models work?


Transformer-based Language Models consist of an encoder and a decoder, and they learn
context and meaning by tracking relationships between words and concepts.

These models are pre-trained on large text corpora, learning patterns and structures that represent
the grammar, syntax, and semantics of a language.

Once trained, transformer-based models can be fine-tuned for various NLP tasks, including text
generation, where they generate coherent and contextually relevant text based on a given input or
prompt.

Use of Transformer-based Language Models


Transformer-based Language Models are mainly used for various natural language
processing (NLP) tasks, such as language representation, multimodal models, and text
generation.

Examples of Transformer-based language models


An example of Transformer-based language models is GPT, which is used in ChatGPT.

Another popular example is Google's Bidirectional Encoder Representations from


Transformers (BERT).

Note for me:

Transformer-based Language Models being a specific type of Large Language Model that is
often employed for generative tasks in natural language processing.
Who are building Generative AI Models
Building a generative model is not just about the concepts, research, and algorithms, but also about
the cost. Even if you are able to build a generative model with the help of a team of great
researchers, scientists and engineers, the generative models need to be trained on massive data to
understand patterns and underlying structures.

Sometimes these models, for example GPT (generative AI model behind ChatGPT) is trained using
almost entire internet. One of the few other factors that incurs huge cost are –research, hardware,
computational power etc. So, apart from knowledge and talent, building generative models also
requires lots of money. Because of this, so far most of generative models has only been built by big
organizations.

OpenAI, the organization who developed ChatGPT and DALL-E has billions of funding from several
sources. BERT (Bidirectional Encoder Representations from Transformers) is built by Google.
DeepMind, known for several generative models such as AlphaCode, is now a subsidiary of Alphabet,
the parent company of Google. Make-A-Video, an AI-powered video generator, which can create
videos from text or image prompts, is developed by Meta.

[Link]

But it’s not just talent. When you’re asking a model to train using nearly the entire internet

Additional Content
[Link]

[Link]

set of data instances X and a set of labels Y:

Discriminative models estimate the conditional probability P(Y∣X=x) on

Watch "GAN Generative Adversarial Network Explained | Generative Modelling | Training of GAN
Deep Learning" on YouTube

[Link]
Check the images

Watch "What Are GANs? | Generative Adversarial Networks Explained | Deep Learning With Python
| Edureka" on YouTube

[Link]

Use texts and save

Watch "Generative AI for beginners| What is generative AI | What is generative AI for dummies" on
YouTube

[Link]

check texts

Common questions

Powered by AI

Transformer-based language models enhance NLP tasks by using the transformer neural network architecture to learn contextual relationships between words in a sentence. They are pre-trained on large text corpora, learning patterns that reflect language grammar, syntax, and semantics. Once trained, these models can be fine-tuned for tasks such as text generation, language representation, and multimodal models. Prominent examples of these models include GPT, used in ChatGPT, and Google's BERT .

Discriminative models estimate the conditional probability p(Y | X), focusing on modeling the decision boundary between different classes. In contrast, generative models estimate the joint probability p(X, Y), or just p(X) if there are no labels, learning the overall distribution of the data to generate new samples that mimic the original data .

Transformer-based language models contribute to advancements in automated text generation by capturing complex language patterns and context through their sophisticated attention mechanisms. They can produce coherent, contextually relevant text that closely adheres to natural language norms, making them valuable for applications like chatbots and content creation. However, challenges include the high computational cost of training, the need for large datasets, potential biases inherited from training data, and issues related to maintaining consistency and relevance in longer text outputs .

Unsupervised learning in generative models involves training algorithms on data with no explicit labels, allowing the model to discover patterns and structures independently. This approach is crucial for generative tasks as it enables the creation of new content by learning the data distribution without predefined outcomes. The model identifies relationships and hierarchical structures within the input data, which it uses to generate new samples that resemble the training data .

Deep learning has significantly influenced the development and capabilities of generative models by providing the computational frameworks necessary for handling large and complex datasets. It enables generative models to learn intricate patterns and features within data, enhancing their ability to create realistic and diverse outputs. Techniques such as convolutional neural networks in GANs and transformer architectures in language models have expanded the scope and functionality of generative AI, allowing for sophisticated applications across various domains, such as realistic image synthesis and coherent text generation .

Discriminative models are primarily used for tasks like classification, regression, and anomaly detection, utilizing a supervised learning approach that requires labeled data. They do not generate new data but focus on analyzing existing data to make predictions. Generative models, however, are used to create new content such as images, text, or music by learning the underlying data structure through an unsupervised approach. They often work with data that lacks output labels and can generate new samples mimicking the original data distribution .

The transformer architecture is uniquely effective for language tasks due to its ability to handle sequence data flexibly, capturing long-range dependencies in text through self-attention mechanisms. Unlike traditional recurrent neural networks, transformers do not require sequential processing, enabling significant parallelization and reducing training times. They excel in learning contextual relationships, making them highly effective for tasks like text generation and language comprehension .

The development of generative AI models is primarily undertaken by large organizations due to the substantial costs associated with research, harnessing massive computational power, and accessing extensive datasets for training. Training models like GPT involve processing nearly the entire internet, which requires significant investment in hardware and talent. Companies like OpenAI, Google, and Meta invest heavily in building these models, leveraging financial resources and specialized expertise that are beyond the reach of smaller entities .

Generative models are applied in a variety of domains, including image and video generation, music composition, and text creation. They impact content creation industries by enabling automated production of creative content, reducing the time and effort required from human creators. For instance, tools like DALL-E can generate artistic images from textual descriptions, while applications like Make-A-Video create video content from scripts. Additionally, transformer-based models like GPT facilitate automated writing and editing, enhancing efficiency in media and entertainment sectors .

Generative Adversarial Networks (GANs) differ from other generative models by employing a dual-model system consisting of a generator and a discriminator. This adversarial setup drives the generator to produce more realistic data by competing against the discriminator, which evaluates the authenticity of the generated samples. A unique aspect of GANs' training process is this adversarial dynamic, where the generator continuously improves its outputs to deceive the discriminator, leading to more refined and realistic generated data .

You might also like