Skip to main content
An Introduction
to Generative AI
Dr. Rupak Chakraborty
Assistant Professor, Dept. of Computer Science and Artificial Intelligence
Techno India University, West Bengal
Contents
What is Gen AI?
Types of Gen AI
Power of Gen AI
Applications
How Gen AI works?
RAG: What, Why and How?
Conclusion
Overview of Generative AI
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
Types of Generative AI
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
Power of Generative AI
-> 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.
Applications of Gen AI
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
Applications of Gen AI
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
Applications of Gen AI
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
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
How Generative AI works
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
How Generative AI works 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?”
How Generative AI works 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
How Generative AI works 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
HERE’S THE REALLY COOL 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
How Generative AI works 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
How Generative AI works 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
How Generative AI works 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?
How Generative AI works 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?
Examples of publicly available Generative AI tools
Crowdsourced list of
available AI tools:
bit.ly/4nhBtp9
What is Retrieval-Augmented Generation (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.
Why RAG?
Known challenges of 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.
How RAG work?
• Create external data.
Create
• Retrieve relevant information
Retrieve
• Augment the LLM prompt.
Augment
• Update external data
Update
How RAG work contd..
RAG agent frameworks
Some of the famous agentic RAG frameworks are
• DB GPT,
• Quadrant Rag Eval,
• MetaGPT,
• Ragapp,
• GPT RAG by Azure,
• IBM Granite,
• Langflow,
• AgentGPT
Conclusion
Generative AI has a 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.
Introduction to Gen AI and its Applications