0% found this document useful (0 votes)
57 views

Class 4 Software

The document discusses the differences between generative AI and human understanding in content generation, focusing on the roles of probabilities and understanding. It outlines how generative AI models, like GPT, rely on statistical probabilities to generate text, while humans use reasoning and contextual understanding. The implications of these differences are explored, highlighting the efficiency of AI in training and processing data compared to the nuanced understanding humans possess.

Uploaded by

204118568
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)
57 views

Class 4 Software

The document discusses the differences between generative AI and human understanding in content generation, focusing on the roles of probabilities and understanding. It outlines how generative AI models, like GPT, rely on statistical probabilities to generate text, while humans use reasoning and contextual understanding. The implications of these differences are explored, highlighting the efficiency of AI in training and processing data compared to the nuanced understanding humans possess.

Uploaded by

204118568
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/ 45

MSBA7033 — Generative Artificial Intelligence

Class 4:
The Software of Generative
AI — Probabilities vs.
Understanding

Dr. Dawei “David” Wang


Email: [email protected]

Prompt: organisational chart, pyramid, corporate ladder of artificial intelligence | Tool: Adobe Firefly
Class Agenda

1. Probabilities (or machine understanding)


2. Understanding (or human understanding)

3. Implications

4. Human vs. AI

2
PROBABILITIES
HOW ARTIFICIAL INTELLIGENCE GENERATES CONTENTS

Probabilities Understanding Implications Human vs. AI

3
We Learned the Format of Data for Generative AI Models
Generative AI models are typically trained in the prompt-response (e.g. text-to-text) format

User input AI output

Prompt Response
(Question / instruction) (Answer as text)

Large-language models
Write a review for The gen-AI class
the generative AI by Prof. Dawei
Gen-AI
class offered by Wang is one of the
Professor Dawei best classes I’ve
Wang in the taken. It helped me
University of Hong to gain insights
Kong. into gen-AI.

4
We Learned that Data Are Fed into Generative AI Models
For the model to learn, we feed the prompt-response training data into the model

But how does the model


actually learn the rules?

5
Let’s Look at Large-Language Models
Specifically, let’s look at a large-language model we are all familiar with: the GPT models

GPT stands for

Generative Pre-trained Transformer


Step 0: Convert words into numbers

Step 1: Train the transformer model

Step 2: Fine-tune generative model

Step 3: Train reinforcement model

6
Step 0: Train The Embedding Model
First step is to convert or preprocess the words into standardised numbers

Embeddings are like unique DNAs for each word. We code texts into numeric forms to facilitate
training. OpenAI offers its embedding models in its API, such as the text-embedding-3-large.

Data A cat is sitting on the mat.

Text A Cat Is Sitting On The Mat .

3,072 unique 3,072 unique 3,072 unique 3,072 unique 3,072 unique 3,072 unique 3,072 unique 3,072 unique
Token
numbers numbers numbers numbers numbers numbers numbers numbers

7
Step 1-A: Train The Transformer Model — Words
Transformer models learn association between words

We will randomly mask words in a sentence and ask the transformer model to predict the missing
word in the sentence. This is called masked language modeling.

1 A Cat Is Sitting On The ??? .

2 A Cat Is ??? On The Mat .

The model will start to learn associations


3 A ??? Is Sitting On The Mat .
between words (or strings of numbers), and
4 A Cat code associations
??? Sittingas probabilities.
On The Mat .

5 ??? Cat Is Sitting On The Mat .

… … … … … … … … …

8
Step 1-B: Train The Transformer Model — Higher-Level
Transformer models learn association between words, phrases, sentences and paragraphs

We stack multiple layers of transformers models. Layers will refine the representation of the input
text, allowing the model to capture increasingly abstract and complex patterns.

Encoder Decoder

Transformer model 1 Transformer model A

Transformer model 2 Transformer model B


The model will start to learn higher-level
Transformer model 3 Transformer model C
associations between texts, and optimise
Layers Transformer model 4 Transformer model D
their probabilities in deeper layers.
Transformer model 5 Transformer model E

Transformer model 6 Transformer model F

… …

9
Step 2: Train The Generative Model
After the transformer model is PRE-TRAINED, we fine-tune using prompt-response pairs

By fine-tuning the model on prompt-response pairs and exposing it to various inquiries and
responses, the model learns to generate responses that are relevant to the given context.

Prompt Response
(Question / instruction) (Answer as text)

Write a review for the The model will start to fine-tune the The gen-AI class by
generative AI class probabilities so Gen-AI
that it can guess the Prof. Dawei Wang is
offered by Professor response based on the prompt. one of the best classes
Dawei Wang in the I’ve taken. It helped me
University of Hong to gain insights into
Kong. gen-AI.

10
Conditional Probabilities
Patterns in training data are ultimately coded as probabilities in the GPT model

Large-language model
Training data
Apples are red.
GPT
Bananas are yellow.
model
Oranges are orange.

Conditional Probability of Next Word


Given the word "Apples", what is the probability that the next word is “are"?
P(are | Apples) = 1, because in our corpus, every occurrence of "Apples" is followed by “are".
Conditional Probability of Word Sequence
Given the word sequence "Bananas are", what is the probability that the next word is “yellow"?
P(yellow | Bananas are) = 1, because in the training data, every "Bananas are" is followed by "yellow".

11
CONDITIONAL PROBABILITIES

Almost all the processes used in training generative


AI models are about calculating how likely some
element can appear given other ones.
P( … | … ) = 0.??

12
An Important Implication

Given that generative AI is based on probabilities, its responses would represent


the most likely outcome based on the training data. In an aggregated level, the
AI would then only represent the average intelligence (or to be precise, past intelligence).

This is called:
AUTOREGRESSIVENESS

13
UNDERSTANDING
HOW HUMAN INTELLIGENCE GENERATES CONTENTS

Probabilities Understanding Implications Human vs. AI

14
Let’s Look at How Human Generate Text
Let’s use the same example to learn how humans conduct this fill-in-the-gap exercise

Text A cat is sitting on the ____.

15
Asking Humans to Fill in The Gap
Humans do not fill in the gap ____ by drawing from a database of probabilities, instead we ask
what’s the relationship between the cat and the word to be filled.

Humans will ask: What’s the meaning?

Text A cat is sitting on the ____.

Machines will ask: What’s the probability?

16
Human’s Thought Process
When we attempt to fill in the blank (or generate), we think through the problem first

Thought process

1 What is a cat? Cats are domestic animals

2 Where do cats live? They probably like to live indoors

3 Where do cats like to sit? They like to sit on cozy places

4 Why is the cat sitting there? The cat is probably lazing around

17
Humans Generate Using Understanding
When we attempt to fill in the blank (or generate), we use understanding and reasons

Option Generated content Reasoning Answer

1 A cat is sitting on the grass. Do cats like to go outside? Sometimes

2 A cat is sitting on the beach. Do cats like beaches and sea? No

3 A cat is sitting on the mat. Do cats like indoor places? Yes

4 A cat is sitting on the tree. Do cats like to climb trees? Sometimes

18
Human Understanding Is Based on Explanations
Humans understand because we know the reasons and explanations between relationships

Cat is sitting on mat because the mat is inside the house.

C
A B
Cat is sitting on the mat.

Cat Mat
D
Cat is sitting on the mat because the mat is soft and comfortable.

19
A Comparison: Machines Generate Using Probabilities
When machines attempt to fill in the blank (or generate), they optimize and maximize

Option Generated content Conditional Probabilities Rank

1 A cat is sitting on the grass. P( grass | … ) = 0.3 3

2 A cat is sitting on the beach. P( beach | … ) = 0.2 4

3 A cat is sitting on the mat. P( mat | … ) = 0.9 1

4 A cat is sitting on the tree. P( tree | … ) = 0.4 2

20
But Machines Can Generate Explanations Too?
But machines can also tell us the reasons by drawing on probabilities learned from its data

Cat is sitting on mat because the mat is related to house.

P( … | … ) = 0.7 C P( … | … ) = 0.6

HOWEVER,Catthisis is completely dependent on


A B
sitting on the mat.
whether your training data contains those
P( … | … ) = 0.9
explanatorial relationships!
Cat Mat
P( … | … ) = 0.8
D P( … | … ) = 0.5

Cat is sitting on the mat because the mat related to comfort.

21
Where Does Our Reasoning Come from?
It comes from our past experiences, education, family, friends, etc.

Psychology is the study of the human mind and behaviors

Social psychology Our social environment How our friends or family affect what we generate?

Cognitive psychology Our logic and reasoning How our intelligence affect what we generate?

Personality psychology Our traits and personality How our personality affect what we generate?

Evolutionary psychology Our ancestors and evolution How our instincts affect what we generate?

Biological psychology Our hormones and emotions How our emotions affect what we generate?

22
IMPLICATIONS
PROBABILITIES VS UNDERSTANDING

Probabilities Understanding Implications Human vs. AI

23
Probability Is Faster to Develop
It is much faster to train a large-language model than to teach a person how to write

How long it takes to train a person vs. machine from the ground up

Machine: A few months

A few months is enough to crawl the data and train the models

Human: More than 16 years

A lot of time is taken to nurture and educate the human person

24
Probability Is More Predictable (Note: but not as predictable as rule-based models)
Generative AI is more predictable; A human can grow up to become a genius or a criminal

A comparison on the level of intelligence or creativity

Autoregressive nature of generative AI model makes it have less variance or more predictable:

Machine:

Looking at human in general, you find geniuses like Herbert Simon and people who are less capable:

Human:

Capability

25
Overall… Probability Is Efficient
It is much faster to train a large-language model than to teach a person how to write

Large Language Models (LLMs) Human Learning

Can process information from large Learning through a slow, complex,


Scalability,
datasets at scale and recognize patterns lengthy process. Cannot handle broad
expertise
from diverse fields. knowledge, must expertise in one area.

Can be developed or trained in weeks to Takes years of education and practice to


Speed of
months, depending on the develop a high standard of writing and
training
computational resources available. understanding.

Resources Requires computational resources and Requires money, time, personal effort,
needed energy for development and training. and societal educational structures.

26
Understanding Is More Precise
Humans can easily tell the causality of a relationship

Correlational relationship
A A is related to B
B

Causal relationship
A A leads to B
B

27
Understanding vs. Probability in Precision
Asking AI to generate a horse-riding astronaut is easy but what about astronaut-riding horse?
Prompt: “A horse riding an astronaut” Prompt: “A horse riding on the back of astronaut”

Another problem of auto-regressiveness:


not only are outputs average-looking, they
are also dependent on historical data.

28
Understanding Is Explainable
Human understanding is less of a “black-box” than machine-learning models

Mediating relationship

Causal relationship
A A leads to B
B
29
Understanding vs. Probability in Explanation
It is almost impossible to know for sure how machines generated those outputs

Generative AI model

Input = Output

BLACK BOX

30
Overall… Understanding Is Flexible
Statistical generalizability of machines vs. conceptual flexibility of human understanding

Probabilities Understanding
Machines Humans

Good at generalizing from training data to Can apply knowledge to entirely novel
similar situations based on statistical situations using understanding and
patterns. reasons.

Limited by training data Limited by education and intelligence

E.g., can invent extraordinary stories in


E.g., can invent good stories that seem
entirely new genres by combining
familiar but are limited by its training data.
knowledge.

31
HUMAN VS. AI
INTERACTIVE CREATIVITY TASKS

Probabilities Understanding Implications Human vs. AI

32
Intelligence

Logical Reasoning Ability


! : Strong Logical Reasoning Ability
(Existing Literature)
# : Weak Logical Reasoning Ability

IQ

! : ❓❓❓ Divergent Thinking Convergent Thinking ! : ❓❓❓


# : ❓❓❓
Creativity # : ❓❓❓
(Our Research) (Our Research)

33
Our Data
Type Sample / Model Originality Collection / Model Year Size

Olsen et al. 2021 Around the world 2020


$
An eclectic sample of Bao et al. 2024 HIT (Harbin, China) 2022 8,572
humans
HKUBS undergrads Hong Kong, China 2024

Claude-3-Haiku 2023

Claude-3-Opus Anthropic (USA) 2024

Claude-3.5-Sonnet 2024

# Ernie-4.0-8k Baidu (China) 2024


Eight large-language 182,003
models GPT-3.5-Turbo 2022

GPT-4.0-Turbo OpenAI (USA) 2023

GPT-4o 2024

Llama-2-70b Meta (USA) 2024

37
Comparing Creativity

38
Word Cloud
Average humans and machines Top-percentile humans and machines

39
Creative Geniuses

40
Demographic Groups

41
Temperature
Most likely answer Most random answer

Randomness or creativity parameter


42
Hallucination

43
Intelligence

Logical Reasoning Ability


! : Strong Logical Reasoning Ability
(Existing Literature)
# : Weak Logical Reasoning Ability

IQ

# :Not surpassing humans Divergent Thinking Convergent Thinking ! : ❓❓❓


$ :Can augment humans
Creativity # : ❓❓❓
(Our Research) (Our Research)

44
Creativity Comparison

Divergent Convergent
Thinking ! Thinking

Generating multiple diverse answers or solutions. Generating singular effective answers or solutions.
Breaking norms and overcoming fixed thinking patterns. Finding connections between things or events.
Quick and flexible flow of ideas. Deep extension of thought.
Viewing problems from different perspectives. Exploring new perspectives on existing relationships.

45
Intelligence

Logical Reasoning Ability


! : Strong Logical Reasoning Ability
(Existing Literature)
# : Weak Logical Reasoning Ability

IQ

# : Not surpassing humans Divergent Thinking Convergent Thinking # :Already surpassed humans
$ : Can augment humans
Creativity $ :Can replace humans
(Our Research) (Our Research)

49
Human-Machine Collaboration Case •
“Jiao Zi”

“Jiao Zi” Director


Personal Information: Yang Yu, born in 1980, from Sichuan, China.
Educational Background: Sichuan University Huaxi College of
Pharmacy.

Personal Career:
2002: Began working on animated short films.
2008: The short film "Hit a Big Watermelon" won a special award at
the Berlin Film Festival.
2013: The short film "The Boss's Woman" won international gold
awards and other prizes.
2014: Raised only 50 million RMB to begin production on "Ne Zha."

50
Human-Machine Collaboration Case • “Ne Zha”

Small Big
production success
(people + machine) (film rating + box office)
Budget: RMB 40 m Box office: (5.036 billion RMB)

51 Source: Baidu

You might also like