0% found this document useful (0 votes)
15 views42 pages

Generative Ai and Large Language Models (LLMS) : Unit - 7

This document provides an overview of Generative AI and Large Language Models (LLMs), detailing their definitions, historical context, and applications across various fields. It contrasts Generative AI with traditional machine learning, introduces key models like GANs and VAEs, and explains the architecture and functioning of transformers. Additionally, it includes examples of popular generative AI tools and concludes with a quiz to reinforce learning objectives.

Uploaded by

devakis935
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)
15 views42 pages

Generative Ai and Large Language Models (LLMS) : Unit - 7

This document provides an overview of Generative AI and Large Language Models (LLMs), detailing their definitions, historical context, and applications across various fields. It contrasts Generative AI with traditional machine learning, introduces key models like GANs and VAEs, and explains the architecture and functioning of transformers. Additionally, it includes examples of popular generative AI tools and concludes with a quiz to reinforce learning objectives.

Uploaded by

devakis935
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
You are on page 1/ 42

Unit - 7

Generative AI and
Large Language
Models (LLMs)
Chapters for Discussion

Chapter - 1 Generative AI

Chapter - 2 Large Language Models (LLMs)


Chapter
Generative AI
1
DISCLAIMER
The content is curated from online/offline resources and
used for educational purpose only.
Learning Objectives
• What is Generative AI? (differentiate from traditional AI)
• A brief history of Generative AI models
• How advancements in computer technology have
impacted Generative AI
• Examples of Generative AI applications in various fields
• Introduction to Large Language Models (LLMs):
strengths, weaknesses, and limitations GOAL
• Different types of Generative AI models (e.g., Generative
Adversarial Networks (GANs), Variational Autoencoders
(VAEs))

Source : www.freepik.com/
‘Video games are in for quite a trip’: How
generative AI could radically reshape gaming
Source: CNN, 23. October 2023

SAP prepares to add Joule


generative AI copilot across its apps
Source: CIO, 26. September 2023

How generative AI could add trillions to


the global economy
Source: World Economic Forum, 14. July 2023
What is Generative AI?

• Generative AI is a branch of artificial


intelligence that focuses on creating models
capable of generating original content
autonomously, mimicking human creativity.

• These models learn patterns and structures


from existing data and then use that knowledge
to generate new and unique outputs.

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:

• Text generation tools include GPT, Jasper, AI-Writer and Lex.


• Image generation tools include Dall-E 2, Midjourney and Stable Diffusion.
• Music generation tools include Amper, Dadabots and MuseNet.
• Code generation tools include CodeStarter, Codex, GitHub Copilot and Tabnine.
• Voice synthesis tools include Descript, Listnr and Podcast.ai.
• AI chip design tool companies include Synopsys, Cadence, Google and Nvidia.
Generative AI Vs Machine Learning
Generative AI Machine learning
Enables a machine to solve problems by simulating Enables a machine to train on past data and learn
human intelligence and supporting complex human from new data with some level of autonomy.
interactions.
Aims to create a system that can perform complex Aims to learn from data to continuously enhance and
tasks and interactions with a level of autonomy. improve model accuracy.
Has a broad range of potential applications and a wide Has a broad range of potential applications but a
assortment of capabilities within that range. relatively narrow assortment of capabilities within that
range.
Mimics human decision-making. Uses algorithms to learn and operate predictive
models, assisting in human decision-making.
Works with all types of data including structured, semi- Typically only uses structured and semi-structured
structured and unstructured. data.
Uses logic and decision-making to learn, reason, Uses statistical models to learn, but can only adjust or
adjust and self-correct over time. self-correct with user feedback or new data.
Examples of large language models
Launch Year Number of Number of Languages Open
Model Developer Parameters Covered Source
+95 natural languages
GPT-3 OpenAI 2020 175 billion No
+ 12 code languages
104 languages in multilingual
BERT Google 2018 340 million Yes
model
46 natural languages
BLOOM BigScience 2022 176 billion Yes
13 code languages
NeMo LLM NVIDIA 2022 530 billion English only Yes

Turing NLG Microsoft 2020 17 billion English only Yes

OPT Meta 2022 175 billion English only Yes


LaMDA Google 2021 137 billion English only
Transformer

https://images.app.goo.gl/AXKZ1MktuwFZtRa68
Transformers

• In 2017 transformers were introduced: “Attention is all you need”.


• They are the next generation of Recurrent Neural Networks and Long Short-Term
Memory architectures and have several benefits:
• Parallel processing: Increases performance and scalability
• Bidirectionality: Allows understanding of ambiguous words and coreferences
• The original transformer architecture defines two main parts, an encoder and a decoder.
However, not all foundation models use both parts. BERT only uses encoders, GPT only
decoders.
How Transformer Works

• 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)

• A generative adversarial network (GAN) is a


deep learning architecture.
• Generative Adversarial Networks (GANs) are a
powerful class of neural networks that are used
for an unsupervised learning. GANs are made
up of two neural networks, a discriminator and a
generator.
• They use adversarial training to produce
artificial data that is identical to actual data.
https://images.app.goo.gl/oyKHyxeJ6Wo2EmL99
GAN(Generative Adversarial Network)

A generative adversarial network (GAN) has two parts:


•The generator learns to generate plausible data. The generated instances become
negative training examples for the discriminator.
•The discriminator learns to distinguish the generator's fake data from real data. The
discriminator penalizes the generator for producing implausible results.
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

•The VAE architecture consists of two main parts:

•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 1: User Input - The user submits a question or prompt.

•Step 2: Information Retrieval - RAG employs a retrieval system to locate relevant


external documents based on the user input.

•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?

• Large language models (LLM) are very large deep


learning models that are pre-trained on vast
amounts of data.
• The underlying transformer is a set of neural
networks that consist of an encoder and a decoder
with self-attention capabilities.
• The encoder and decoder extract meanings from
a sequence of text and understand the
relationships between words and phrases in it.

https://botpenguin.com/blogs/understanding-custom-llm-models
What is a LLM?

• Transformer LLMs are capable of


unsupervised training, although a
more precise explanation is that
transformers perform self-learning.

• Unlike earlier recurrent neural


networks (RNN) that sequentially
process inputs, transformers
process entire sequences in
https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/7707

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

• Try GPT using Python


Conclusion
• Generative AI encompasses technologies that create content like text,
images, audio, and synthetic data
• Generative AI operates through machine learning, specifically deep learning
using neural networks like CNNs (Convolutional Neural Networks) and
transformers.
• Generative AI focuses on creating new content, contrasting with machine
learning which analyzes data and makes predictions based on patterns.
• Tools like TensorFlow Probability, PyTorch GANs, OpenAI's GPT models,
and StyleGAN illustrate the capabilities of generative AI across various
applications.
• LLMs are AI programs trained on extensive datasets to understand and
generate human-like text. They include models like BERT, GPT, and others
known for their language processing abilities.

Source : www.freepik.com/
Let’s Start
Quiz

1. Which of the following is a primary function of Generative AI?

a) Classifying data into predefined categories


b) Generating new data based on existing patterns
c) Optimizing routes for delivery trucks
d) Detecting fraudulent activity in financial transactions

Answer: B
Example
Quiz

2. LLMs stand for:

a) Linear Logic Machines


b) Local Learning Models
c) Large Language Models
d) Limited Law Modules

Answer: C
Example
Quiz
3. Generative Adversarial Networks (GANs) consist of two main
parts. What is the role of the generator?

a) To create new data samples that resemble real data


b) To evaluate the quality of generated data compared to real data
c) To pre-process and clean real data for the training process
d) To store and manage the real data used for training

Answer: A
Example
Quiz

4. During GAN training, the discriminator:

a) Provides the generator with real data examples


b) Attempts to distinguish between real and generated data
c) Directly generates new data itself
d) Scores the creativity of the generated data

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy