Generative Ai and Large Language Models (LLMS) : Unit - 7
Generative Ai and Large Language Models (LLMS) : Unit - 7
Generative AI and
Large Language
Models (LLMs)
Chapters for Discussion
Chapter - 1 Generative AI
Source : www.freepik.com/
‘Video games are in for quite a trip’: How
generative AI could radically reshape gaming
Source: CNN, 23. October 2023
Click here
Reference link
What are some examples of generative AI tools?
Generative AI tools exist for various modalities, such as text, imagery, music, code and voices.
Some popular AI content generators to explore include the following:
https://images.app.goo.gl/AXKZ1MktuwFZtRa68
Transformers
• Assign to each unique word a unique identifier, a number that will serve as a token to
represent that word.
• Note the location of every token relative to every other token.
• Using just token and location—determine the probability of it being adjacent to, or in the
vicinity of, every other word.
• Feed these probabilities into a neural network to build a map of relationships.
• Given any string of words as a prompt, use the neural network to predict the next word (just
like AutoCorrect).
• Based on feedback, adjust the internal parameters of the neural network to improve its
performance.
Transformers are language models
All the Transformer models mentioned above (GPT, BERT, BART, T5, etc.) have been trained
as language models.
https://towardsdatascience.com/transformers-141e32e69591
Transformers are big models
https://blog.tensorflow.org/2020/05/how-hugging-face-achieved-2x-performance-boost-question-answering.html?m=1
GAN(Generative Adversarial Network)
When training begins, the generator produces obviously fake data, and the discriminator
quickly learns to tell that it's fake:
GAN(Generative Adversarial Network)
As training progresses, the generator gets closer to producing output that can fool the
discriminator:
GAN(Generative Adversarial Network)
Finally, if generator training goes well, the discriminator gets worse at telling the
difference between real and fake. It starts to classify fake data as real, and its accuracy
decreases.
GAN(Generative Adversarial Network)
https://images.app.goo.gl/u8SWTAhsxdajpKDr5
Variational Autoencoders (VAEs)
https://towardsdatascience.com/understanding-variational-autoencoders-vaes-f70510919f73
What are Autoencoders?
https://images.app.goo.gl/J3QEhZUcrqm7YYpP8
•Autoencoders are a type of neural network architecture with an encoder and a decoder.
•The encoder compresses the input data into a lower-dimensional representation, capturing its
essential features.
•The decoder then attempts to reconstruct the original data from this compressed representation.
What is VAE?
• VAEs combine two types of neural networks, much like GANs. However, they combine two
distinct kinds of neural networks that operate differently.
• In the case of VAEs, one network finds better ways of encoding raw data into a latent space,
while the second -- the decoder -- finds better ways of transforming these latent representations
into new content.
• VAEs address the overfitting issue by introducing a probabilistic approach to the latent
representation.
• The encoder in a VAE not only generates a compressed representation (z) but also estimates
the probability distribution of z.
VAE Architecture
•Encoder: Takes the input data (x) and encodes it into two vectors:
•Mean (μ): Represents the center of the latent distribution.
•Standard Deviation (σ): Represents the spread of the latent distribution.
•Decoder: Takes a random noise vector (ε) and combines it with the mean (μ)
to sample a point from the latent space (z).
•This sampled point (z) is then used to reconstruct the original data (x').
RAG (Retrieval Augmented Generation)
Retrieval Augmented Generation (RAG) is an innovative method that harnesses the strengths of both
retrieval-based and generative systems. By retrieving relevant documents from a vast database and
subsequently utilizing a generative model to formulate a response, RAG proves to be a powerful tool
in LLM-based systems.
Retrieval Augmented Generation (RAG) is an architecture that augments the capabilities of a Large
Language Model (LLM) like ChatGPT by adding an information retrieval system that provides
grounding data.
RAG (Retrieval Augmented Generation)
https://images.app.goo.gl/8ibaKMn7G4urqQ3u8
How Does RAG Work?
•Step 3: Context Fusion - The retrieved documents are merged with the user input, creating
a richer context for the LLM.
•Step 4: Text Generation - Leveraging the enhanced context, the LLM generates a response
that is both informative and factually accurate.
Chapter
Large Language Models
2 (LLMs)
What is a LLM?
https://botpenguin.com/blogs/understanding-custom-llm-models
What is a LLM?
parallel.
Transformer models
• The specific kind of neural networks used for LLMs are called transformer models.
Transformer models are able to learn context — especially important for human language,
which is highly context-dependent.
https://huggingface.co/learn/nlp-course/chapter1/4
Lab Activity
Hands On
Lab 1
Source : www.freepik.com/
Let’s Start
Quiz
Answer: B
Example
Quiz
Answer: C
Example
Quiz
3. Generative Adversarial Networks (GANs) consist of two main
parts. What is the role of the generator?
Answer: A
Example
Quiz
Answer: B
Example
References
• https://towardsdatascience.com/data-science/home
• https://www.genaiuniversity.com/blog
• https://library-guides.ucl.ac.uk/referencing-plagiarism/acknowledging-AI
• https://lib.conestogac.on.ca/reference-list/ai
Thank You