An Introduction
to GenerativeAI
Dr. Rupak Chakraborty
Assistant Professor, Dept. of Computer Science and Artificial Intelligence
Techno India University, West Bengal
2.
Contents
What is GenAI?
Types of Gen AI
Power of Gen AI
Applications
How Gen AI works?
RAG: What, Why and How?
Conclusion
3.
Overview of GenerativeAI
Generative AI creates new content, like text or images,
based on patterns in data.
“AI can not only boost our analytic and decision-
making abilities but also heighten creativity”
— Harvard Business Review
4.
Types of GenerativeAI
LLM- LLMs are large AI models with a vast number of parameters, trained on
massive datasets, enabling them to handle complex language tasks. Ex-GPT-4,
Gemini, Claude AI, DeepSeek AI etc.
SLM- SLMs are smaller AI models with fewer parameters, making them faster and
more efficient than LLMs. Ex-Phi-3-mini, Llama 3.1 8B etc.
RAG- It enhances these models by pulling in external information for more accurate
results.
Large Language
Models (LLM)
Short Language
Model(SLM)
Retrieval Augmented
System (RAG)-LLM
5.
Power of GenerativeAI
-> Generative AI is revolutionizing communication, work,
and innovation.
->With tools like ChatGPT, Gemini, and ClaudeAI reaching
millions of users, its impact is undeniable.
->Its widespread use on GitHub shows its transformative
power. Already reshaping industries, its influence will only
expand.
6.
Applications of GenAI
Text Generation
Text Generation involves using
machine learning models to generate
new text based on patterns learned
from existing text data. The models
used for text generation can be Markov
Chains, Recurrent Neural Networks
(RNNs), and more recently,
Transformers (Bert, Roberta), which
have revolutionized the field due to
their extended attention span.
Application: ChatGPT
7.
Applications of GenAI
Image Generation
Image Generation is a process of using
deep learning algorithms such as
VAEs, GANs(create new data
instances), and more recently Stable
Diffusion, to create new images that
are visually similar to real-world
images. Image Generation can be
used for data augmentation to improve
the performance of machine learning
models, as well as in creating art,
generating product images, and more.
Application: MidJourney and DALL-E
8.
Applications of GenAI
Video and Speech Generation
Video Generation involves deep learning
methods such as GANs and Video Diffusion
to generate new videos by predicting frames
based on previous frames. Video Generation
can be used in various fields, such as
entertainment, sports analysis, and
autonomous driving. Video Generation can
be often seen in use with Speech
Generation. The models used for speech
generation can be powered by
Transformers. Speech Generation can be
used in text-to-speech conversion, virtual
assistants, and voice cloning.
Application:DeepBrain and Synthesia
9.
When you hear“AI,” think “statistical pattern-matching”
● Oracle describes AI this way:
AI has become a catchall term for
applications that perform complex tasks
that once required human input, such as
communicating with customers online or
playing chess.
The term is often used interchangeably
with … machine learning (ML) and deep
learning.
The data is “tokenized” (= made
into “chunks” of words, punctuation
marks, pixels, etc.) during this
process - remember this for later
10.
How Generative AIworks
The system generates text or images using its previously built model of the
statistical distributions of tokens (= “chunks” of words, punctuation marks,
pixels, etc.) created from its very large training dataset.
Chat
Doc
Image
11.
How Generative AIworks contd..
We can ask it
questions - but a
very specific type
of question known
as prompts,
following this
structure:
“Here’s a fragment of text.
Tell me how this fragment might <continue on in
this language, or suggest a particular image>.
According to your model of the statistics of
<human language, or human-handled images>,
what <words, or pixels> are likely to come next?”
12.
How Generative AIworks contd..
n tokens in 1 token out
The prompts are converted into tokens (= “chunks” of words, punctuation marks,
pixels, etc.), then the system analyzes what is likely to come next, based on the
tokens in its own dataset (as many as 570 GB to 45 TB in GPT-4!).
It then generates a tokenized output.
Vector of
probabilities from
own
tokens
13.
How Generative AIworks contd..
With each output, it keeps re-analyzing the probabilities to decide next tokens.
n tokens in 1 token out
She went to the store
and
shopped
Vector of
probabilities from
own
tokens
14.
HERE’S THE REALLYCOOL PART!!!
Transformers (the “T in “GPT”) know how to direct attention to specific parts
of the input to guide their selection of the output - such as verb tenses, objects.
n tokens in 1 token out
She went to the store and shopped
Vector of
probabilities from
own
tokens
15.
How Generative AIworks contd..
The system can give you different answers to the same inputs:
n tokens in 1 token out
She went to the store
and
bought
Vector of
probabilities from
own
tokens
16.
How Generative AIworks contd..
The system can give you different answers to the same inputs:
n tokens in 1 token out
She went to the store
and
clocked in
Vector of
probabilities from
own
tokens
17.
How Generative AIworks contd..
The system can give you different answers to the same inputs:
n tokens in 1 token out
She went to the store
and
danced
Vector of
probabilities from
own
tokens
huh?
18.
How Generative AIworks contd..
n tokens in 1 token out
“Hallucinations” - when the output doesn’t seem to make sense - are why it is
important not to accept everything it outputs at face value.
She went to the store and
danced
Vector of
probabilities from
own
tokens
huh?
19.
Examples of publiclyavailable Generative AI tools
Crowdsourced list of
available AI tools:
bit.ly/4nhBtp9
20.
What is Retrieval-AugmentedGeneration (RAG)?
RAG is the process of optimizing the output of a large language model, so it
references an authoritative knowledge base outside of its training data
sources before generating a response.
RAG extends the already powerful capabilities of LLMs to specific domains or
an organization's internal knowledge base, all without the need to retrain the
model.
It is a cost-effective approach to improving LLM output so it remains relevant,
accurate, and useful in various contexts.
21.
Why RAG?
Known challengesof LLM-
• Presenting false information when it does not have the answer.
• Presenting out-of-date or generic information when the user
expects a specific, current response.
• Creating a response from non-authoritative sources.
• Creating inaccurate responses due to terminology confusion,
wherein different training sources use the same terminology to
talk about different things.
22.
How RAG work?
•Create external data.
Create
• Retrieve relevant information
Retrieve
• Augment the LLM prompt.
Augment
• Update external data
Update
RAG agent frameworks
Someof the famous agentic RAG frameworks are
• DB GPT,
• Quadrant Rag Eval,
• MetaGPT,
• Ragapp,
• GPT RAG by Azure,
• IBM Granite,
• Langflow,
• AgentGPT
25.
Conclusion
Generative AI hasa diverse range of applications that go beyond text, video,
image, speech generation, and data augmentation.
It can be used for music generation, game development, healthcare, and more.
In healthcare, generative AI can help generate synthetic medical data to train
machine learning models, develop new drug candidates, and design clinical trials.
It's an exciting time to dive into Generative AI in its early stages, those who gain
the necessary skills and knowledge have the opportunity to shape its future.