Artificial Intelligence
UNIT-1
Agenda
What
is AI?
History AI
?
of AI Today
AI Ethics & Safety
Science of AI
Physics: Where did the physical universe come from?
And what laws guide its dynamics?
Biology: How did biological life evolve?
And how do living organisms function?
AI: What is the nature of intelligent thought?
What is intelligence?
Ability to perceive and act in the world
Planning: take decisions Learning and
Adaptation: recommend movies,
learn traffic patterns
Understanding: text, speech, visual scene
Dictionary.com: capacity for learning,
reasoning, understanding, and similar
forms of mental activity
Reasoning: proving theorems, medical diagnosis
Intelligence vs. humans
Are humans intelligent?
Are humans always intelligent?
Can non-human behavior be intelligent?
replicating human behavior early hallmark of
intelligence
What is artificial intelligence?
thought
vs.
behavior
human-like vs. rational
computers do things at
which, at the moment,
people are better” (Rich &
Knight 1991)
“[automation of] activities
that we associate with
human thinking, activities
such as decision making,
problem solving, learning…”
(Bellman 1978)
“The study of mental
faculties through the use of
computational models”
(Charniak& McDertmott
1985)
science that is concerned
with the automation of
intelligent behavior” (Luger &
Stubblefield 1993)
“The study of how to make “The branch of computer
What is artificial intelligence?
thought
vs.
behavior
human-like vs. rational
Systems that think
like humans
Systems that think
rationally
Systems that act like Systems that act
humans rationally
The Goal of AI
Think like a
human?
Act like a
human?
Think
rationally?
Act
rationally?
“Have machines solve problems that are challenging for humans.”
Narrow AI
How can we achieve this? Create an agent that can:
We call such a machine an intelligent agent.
•An intelligent
agent that can
solve a specific
problem.
E.g., drive a car or
play chess.
•A hypothetical
intelligent agent
which can
understand or
learn any
intellectual task
thathumanbeings
can.
•A hypothetical
intelligent agent
possessing
intelligence
surpassing that of
the brightest and
most gifted human
minds.
Artificial General
Intelligence (AGI)
[Wikipedia: AGI] [Wikipedia:
Superintelligence]
Artificial
Superintelligence
Cognitive Sciences
Moral
Philosophy
Note: The brain does
not work like artificial
neural networks from
machine learning!
The brain as an
information processing
machine.
•Requires scientific
theories of how the
brain works.
How to understand
cognition as a
computational process?
•Introspection: try to
think about how we
think.
•Predict the behavior
of human subjects.
•Image the brain,
examine neurological
data
Think like a
human?
Act like a
human?
Think
rationally?
Act
rationally?
AI consciousness
•What does it mean
that a machine is
conscient/sentient?
•How can we tell?
•What do we do then?
Thinking Humanly
•
•
•
•
Cognitive Science
–
The goal of aeronautical enggis not to fool pigeons in flying!
Do we want a machine that beats humans in chess or a machine
that thinks like humans while beating humans in chess?
–
Thinking like humans important in Cognitive Science applications
–
–
Intelligent tutoring
Expressing emotions in interfaces… HCI
Very hard to understand how humans think
• Post-factorationalizations,irrationality of human thinking
Deep Blue supposedly DOESN’T think like humans..
Alan Turing (1950)
“Computing
machinery and
Natural language processing
Knowledge representation
Automated reasoning
Machine learning
intelligence”
•
•
•
Alan Turing rejects the question “Can machines think?”
The Turing Test tries to define what acting like a human means.
•What capabilities would a computer need to have to pass the Turing Test?
These arestillthe coreAI areas.
Turing predicted that by the year 2000, machines would be able to fool 30%
of human judges for five minutes.
ChatGPT (2023) is probably doing a least that!
•
•
•
•
Think like a
human?
Act like a
human?
Think
rationally?
Act
rationally?
Needs to decide if she
talks to a human or an
AI system.
Turing Test: Criticism
What are some potential problems with the
Turing Test?
•Some human behavior is not intelligent.
•Some intelligent behavior may not be
human.
•Human observers may be easy to fool.
Imitate intelligence without intelligence.
E.g., the early chatbots ELIZA (1964)
simulates a conversation using pattern
matching.
Is passing the Turing test a good scientific goal?
•Engineering perspective: Imitating a
human is not a good way to solve practical
problems.
•We can create useful intelligent agents
•
without trying to imitate humans.
•
•
Alotdependson expectations.
Anthropomorphic fallacy: humans tend to
humanize things.
Chinese Room Argument
Thought experiment by John
Searle (1980): Imitate
intelligence using rules.
Acting Humanly: Turing’s Test
• If the human cannot tell whether the responses
from the other side of a wall are coming from a
human or computer, then the computer is
intelligent.
Think like a
human?
Act like a
human?
Think
rationally?
Act
rationally?
•Thinking Rationality: Draw sensible conclusions from facts, logic
and data.
•Logic: A chain of argument that always yield correct conclusions.
E.g., “Socrates is a man; all men are mortal; therefore, Socrates is mortal.”
•Logic-based approach to AI: Describe a problem in formal logic
notation and apply general deduction procedures to solve it.
Issues:
•
•
•
Describing real-world problems and knowledge using logic notation is
hard.
Computational complexity of finding the solution.
defined by simple logic rules.
Much intelligent or “rational” behavior in an uncertain world cannot be
Should it rather be
𝑠𝑡𝑢𝑑𝑦 ℎ𝑎𝑟𝑑 𝐴𝑁𝐷 𝑏𝑒 𝑙𝑢𝑐𝑘𝑦 𝐴𝑁𝐷 …֜𝐴 𝑖𝑛 𝑚𝑦 𝐴𝐼 𝑐𝑜𝑢𝑟𝑠𝑒
Example: What about the logical implication
𝑠𝑡𝑢𝑑𝑦 ℎ𝑎𝑟𝑑 ֜𝐴 𝑖𝑛 𝑚𝑦 𝐴𝐼 𝑐𝑜𝑢𝑟𝑠𝑒
Thinking Rationally: laws of thought
Aristotle: what are correct arguments /
thought processes?
Problems:
Not all intelligent behavior is mediated by logical
deliberation (reflexes)
What is the purpose of thinking?
Acting rational means to try to
achieve the “best” outcome.
•
•
•
Best means that we need to do optimization.
The desirability of outcomes can be measured by the economic concept
of utility. If there is uncertainty about achieving outcomes, then we
need to maximizing the expected utility.
Bounded rationality: In practice, expected utility optimization is subject
to the agent’s knowledge and computational constraints. The agent
needs to do the best with its knowledge and resources.
Optimization has several advantages:
•
•
•
•
Generality: optimization is not limited to logical rules.
Practicality: can be adapted to many real-world problems.
Well established: existing solvers and methods for simulation and
experimentation.
Avoids philosophy and psychology in favor of a clearly defined objective.
Think like a
human?
Act like a
human?
Think
rationally?
Act
rationally?
Acting rationally
•
•
•
Rational behavior: doing the right thing
Need not always be deliberative
Aristotle (Nicomacheanethics)
–
–
Reflexive
Everyart andevery inquiry, and similarlyevery action
and every pursuit is thought to aim at some good.
Acting → Thinking?
•Weak AI Hypothesis vs. Strong AI hypothesis
–
–
Weak Hyp: machines could act as if they are
intelligent
Strong Hyp: machines that act intelligent have to
think intelligently too
The History of AI
https : / / qbi. uq. e du. a u/ bra in/ inte llig e nt- m a chine s / his tory - a rtif icia l- inte llig e nce
Source: https://qbi.uq.edu.au/brain/intelligent-machines/history-artificial-intelligence + additions
Deep Learning Revolution
(learning layered artificial neural
networks) starts fueled by NVIDIA
GPUs. enables leaps in image
processing and speech recognition.
Second AI
Winter
Transformer
architecture
and large
language
models LLMs
1989: Universal
approximation
theorem for
artificial neural
networks
Generative AI
models:
•
•
•
DALL-E
ChatGPT, Bard
…
2010
2017
2022
2015
1987-
1993
1974-1980
First AI Winter
1989
Now Google
The State of the Art in Artificial
Intelligence
Overview of current AI capabilities and
progress
Based on Stanford’s AI100 initiative
Focus on technological, societal, and
application-level advances
AI100: One Hundred Year Study on AI
Led by Stanford University
Long-term assessment of AI progress and impact
Publishes expert reports and the AI Index at aiindex.org
Key Findings from AI100 (2016)
Rapid growth in AI applications
Impact areas: transport, healthcare, elder care
Need for ethical and democratic AI deployment
Highlights from 2018 and 2019 reports
compared to year 2000 baselines:
Growth in AI Research Publications
20-fold increase in AI papers (2010–2019)
Machine Learning dominates research output
Computer Vision and NLP follow
Public Sentiment and Ethics
70% AI news coverage is neutral
Positive sentiment rising rapidly
Key concerns: privacy and algorithmic bias
Education and Talent Growth
AI course enrollments growing rapidly
Most popular CS specialization worldwide
Strong industry demand for AI skills
Diversity in AI
80% male, 20% female professors
Similar trends in academia and industry
Highlights need for inclusivity
Conferences and Industry Expansion
NeurIPS attendance increased by 800%
AI startups in the U.S. increased 20-fold
Rapid commercialization of AI
Globalization of AI Research
China leads in paper volume
U.S. leads in citation impact
India among fastest-growing AI hiring nations
Vision and Language Advances
ImageNet accuracy surpasses human performance
NLP benchmarks exceed human-level scores
Major leap in perception and understanding
Human-Level Performance
Benchmarks
AI matches/exceeds humans in games and vision
Medical diagnosis performance comparable to experts
Shows task-specific intelligence
Domain Key Achievements Notable Examples / Systems
Robotic Vehicles
Autonomous driving and drone
deliveries; safe long-distance navigation
without human control.
DARPA Grand Challenge (2005), Waymo (10M
miles, 2018), Rwanda medical drones,
quadcopter mapping and formation.
Legged Locomotion
Dynamic, animal-like movement and
balance; humanoid robots performing
complex acrobatics.
BigDog (Raibert et al., 2008), Atlas (Ackerman &
Guizzo, 2016).
Autonomous
Planning &
Scheduling
Automated control, logistics, and
navigation in space and defense.
NASA Remote Agent (2000), EUROPA toolkit,
SEXTANT (2017), DART (1991), Uber/Google
Maps routing.
Machine Translation
Multilingual translation across 100+
languages; near-human performance in
some cases.
Google Translate, Wu et al. (2016b) neural MT.
Speech Recognition &
Assistants
Human-level speech transcription;
interactive voice-controlled systems.
Microsoft Conversational System (2017), Skype
Translator, Google Duplex, Siri, Alexa, Cortana.
Recommender
Systems
Personalized suggestions using user
data, metadata, and deep learning;
advanced spam filtering.
Amazon, Netflix, YouTube, Spotify, Facebook,
Gmail spam filters.
Game Playing
AI systems surpass human champions
across classic and modern strategy
games.
Deep Blue (1997), AlphaGo (2017), AlphaZero
(2018), Dota 2, StarCraft II, Poker AIs.
Image Understanding
Object detection and image captioning
beyond human-level benchmarks, but
still error-prone.
ImageNet challenge, Vinyals et al. (2017b) image
captioning systems.
Medicine
AI equals or surpasses experts in
diagnosis via medical imaging; aiding
clinical decision-making.
LYNA (breast cancer detection), AI for
Alzheimer’s, cancer, ophthalmic, and skin
diseases.
Climate Science
ML models detect and analyze extreme
weather; climate impact studies using
exascale computing.
Gordon Bell Prize model (2018), Rolnick et al.
catalog (2019).
What can AI do today? Some examples...
Types of AI
Based on
Capabilities
Based on
Functionalities
Type of AI Description Examples / Applications Key Characteristics
Narrow AI
(Weak AI)
Designed and trained to perform
a specific task or a narrow range
of tasks. These systems are highly
efficient at targeted functions but
lack the ability to generalize tasks
beyond their defined scope. They
do not possess understanding or
awareness.
- Voice assistants like Siri or
Alexa that understand specific
commands.
- Facial recognition software
used in security systems.
- Recommendation engines
used by Netflix or Amazon.
- Task-specific and
specialized.
- Lacks generalization
ability.
- No consciousness or self-
awareness.
General AI
(Strong AI)
Refers to AI systems with human-
like intelligence and cognitive
abilities to perform various tasks.
These systems can understand,
learn, and apply knowledge
across multiple domains like
humans. Still a theoretical
concept.
- Robots that can learn new
skills and adapt to unforeseen
challenges in real time.
- AI systems capable of
autonomously diagnosing and
solving complex medical
issues.
- Capable of reasoning and
learning across varied tasks.
- Possesses self-awareness
and consciousness
(theoretically).
- Not yet achieved in
practice.
Superintellige
nce (Super AI)
An advanced form of AI that
surpasses human intelligence in
creativity, problem-solving, and
emotional understanding. It could
have emotions, desires, and
beliefs of its own, capable of
making independent decisions.
- Speculative future AI that
could revolutionize science,
industries, and decision-
making.
- Could innovate
autonomously and outperform
human intelligence in every
field.
- Surpasses human
intelligence.
- Has independent
reasoning and emotional
understanding.
- Raises ethical and control
concerns.
Types of AI
Types of AI
Intelligent Agents
Machines that act rationally.
Outline
What is an
intelligent
agent?
Rationality
PEAS
(Performance
measure,
Environment,
Actuators,
Sensors)
Environment
types
Agent types
What is an Agent?
An agent is anything that can be viewed as perceiving its environment
through sensors and acting upon that environment through actuators.
•Control theory: A closed-loop control system (= feedback control system)
isa set of mechanical or electronic devices that automatically regulate a
process variable to a desired state or set point without human interaction.
The agent is called a controller.
•Softbot: Agent is a software program that runs on a host device.
Agents
Human agent:
eyes, ears, and other organs for sensors
hands,legs,mouth,andotherbodyparts for
actuators
Robotic agent:
cameras and laser range finders for sensors
various motors for actuators
3
Examples of Agents
•
• Softbots
Physically grounded agents
–
–
–
–
Expert Systems
IBM Watson
Intelligent buildings
Autonomous spacecraft
Intelligent Agents
•
•
Have sensors,effectors
Implement mapping from percept
sequence to actions
Environment Agent
actions
percepts
•Performance Measure
Components of an Intelligent Agent
Intelligent agents act
rationally in their
environment.
They need to
•
•
Optional
• Learn from experience to
improve performance.
Communicate with the
environment using
percepts and actions.
Represent knowledge,
reason and plan to achieve
a desired outcome. Agent interacting with the environment
[Artificial Intelligence: A Modern Approach, Editions 1-3]
Developer
Rational Agents
An agent should strive to do the right thing, based
on what it can perceive and the actions it can
perform. The right action is the one that will cause
the agent to be most successful.
Performance measure: An objective criterion for
success of an agent's behavior.
E.g., performance measure of a vacuum-cleaner
agent could be amount of dirt cleaned up, amount of
time taken, amount of electricity consumed, amount
of noise generated, etc.
Ideal Rational Agent
Rationality vsomniscience?
Acting in order to obtain valuable information
“For each possible percept sequence, does
whatever action is expected to maximize its
performance measure on the basis of evidence
perceived so far and built-in knowledge.''
What is artificial intelligence (agent view)
Robotic agent:
An agent is anything that can be viewed as perceiving
its environment through sensors and acting upon that
environment through actuators
Human agent:
–
–
–
–
eyes, ears, and other organs for sensors
cameras andlaser range finders for sensors
various motors for actuators
hands,legs,mouth,andotherbodyparts for actuators
Agent Function and Agent Program
The agent function maps from the set of all possible percept sequences 𝑃𝑃∗
to the
set of actions 𝐴𝐴 formulated as an abstract mathematical function.
𝑓𝑓 ∶ 𝑃𝑃∗
→ 𝐴𝐴
The agent program is a concrete implementation of this function for a given
physical system.
Agent = architecture (hardware) + agent program (implementation of 𝑓𝑓)
• Sensors
• Memory
• Computational power
𝒂𝒂 = 𝒇𝒇(𝒑𝒑)
𝒂𝒂
𝒑𝒑
Example:
Vacuum-cleaner World
• Percepts:
Location and status,
e.g., [A, Dirty]
• Actions:
Left, Right, Suck, NoOp
Implemented agent program:
function Vacuum-Agent( [location, status] )
returns an action 𝑎𝑎
if status = Dirty then return Suck
else if location = A then
return Right
else if location = B then
return Left
Agent function: 𝑓𝑓 ∶ 𝑃𝑃∗ → 𝐴𝐴
Percept Sequence Action
[A, Clean] Right
[A, Dirty] Suck
…
[A, Clean], [B, Clean] Left
…
[A, Clean], [B, Clean], [A, Dirty] Suck
…
Most recent
Percept 𝑝𝑝
Problem: This table can become infinitively large!
Rational Agents: What is Good Behavior?
Foundation from normative moral theory and economics:
• Consequentialism: Evaluate actions by their consequences.
• Utilitarianism: Maximize happiness and well-being.
Definition of a rational agent:
“For each possible percept sequence, a rational agent should select an
action that maximizes its expected performance measure, given the
evidence provided by the percept sequence and the agent’s built-in
knowledge.”
• Performance measure: An objective criterion for success of an agent's
behavior (often called utility function or reward function).
• Expectation: Outcome averaged over all possible situations that may
arise.
Rule: Pick the action that maximize the expected utility
𝑎𝑎 = argmax𝑎𝑎∈A 𝐸𝐸 𝑈𝑈 𝑎𝑎)
Rational Agents
This means:
• Rationality is an ideal – it implies that no one can build a better agent
• Rationality ≠ Omniscience – rational agents can make mistakes if percepts and
knowledge do not suffice to make a good decision
• Rationality ≠ Perfection – rational agents maximize expected outcomes not actual
outcomes
• It is rational to explore and learn – I.e., use percepts to supplement prior knowledge
and become autonomous
• Rationality is often bounded by available memory, computational power, available
sensors, etc.
Rule: Pick the action that maximize the expected utility
𝑎𝑎 = argmax𝑎𝑎∈A 𝐸𝐸 𝑈𝑈 𝑎𝑎)
Example: Performance
Measure for the
Vacuum-cleaner World
• Percepts:
Location and status,
e.g., [A, Dirty]
• Actions:
Left, Right, Suck, NoOp
Agent function:
Percept Sequence Action
[A, Clean] Right
[A, Dirty] Suck
…
[A, Clean], [B, Clean] Left
…
Implemented agent program:
function Vacuum-Agent( [location, status] )
returns an action
if status = Dirty then return Suck
else if location = A then return Right
else if location = B then return Left
What could be a performance measure?
Is this agent program rational?
Problem Specification: PEAS Performance
measure
Performance
measure
Environment Actuators Sensors
Defines utility
and what is
rational
Components and
rules of how actions
affect the
environment.
Defines
available
actions
Defines
percepts
Example: Automated Taxi Driver
Performance
measure
• Safe
• fast
• legal
• comfortable
trip
• maximize
profits
Environment
• Roads
• other traffic
• pedestrians
• customers
Actuators
• Steering
wheel
• accelerator
• brake
• signal
• horn
Sensors
• Cameras
• sonar
• speedometer
• GPS
• Odometer
• engine
sensors
• keyboard
Example: Spam Filter
Performance
measure
• Accuracy:
Minimizing
false
positives,
false
negatives
Environment
• A user’s email
account
• email server
Actuators
• Mark as spam
• delete
• etc.
Sensors
• Incoming
messages
• other
information
about user’s
account
The Environment
• We typically consider everything
outside the agent function (the
agent’s brain) as the agent’s
environment.
• This means that the sensors and
actuators are part of the
environment.
• The agent function receives
already preprocessed percepts
and acts by issuing high-level
instructions to the actuators.
Examples:
Environment Types
Fully observable: The agent's sensors
give it access to the complete state of
the environment. The agent can “see”
the whole environment.
vs.
Partially observable: The agent cannot see all
aspects of the environment. E.g., it can’t see
through walls
Deterministic: Changes in the environment
is completely determined by the current
state of the environment and the agent’s
action.
vs.
Stochastic: Changes cannot be determined from
the current state and the action (there is some
randomness).
Strategic: The environment is stochastic and
adversarial. It chooses actions strategically to
harm the agent. E.g., a game where the other
player is modeled as part of the environment.
Known: The agent knows the rules of the
environment and can predict the
outcome of actions.
vs. Unknown: The agent cannot predict the outcome
of actions.
Environment Types (cont.)
Static: The environment is not changing
while agent is deliberating.
Semidynamic: the environment is static,
but the agent's performance score
depends on how fast it acts.
vs.
Dynamic: The environment is changing while
the agent is deliberating.
Discrete: The environment provides a fixed
number of distinct percepts, actions, and
environment states. Time can also evolve in a
discrete or continuous fashion.
vs.
Continuous: Percepts, actions, state variables or
time are continuous leading to an infinite state,
percept or action space.
Episodic: Episode = a self-contained
sequence of actions. Short episodes for a
task that the agent performs repeatedly.
What the agent does in one episode does
not affect future episodes.
vs.
Sequential: Tasks are long, and actions taken
now affect the outcomes later. The agent must
consider the long-term consequences of its
actions.
Single agent: A single agent operating in an
environment.
vs. Multi-agent: Agent cooperate or compete in the
same environment.
Examples of Different Environments
Observable
Deterministic
Episodic?
Static
Discrete
Single agent
* Can be models as a single agent problem with the other agent(s) in the environment.
** A single game would be sequential environment. Multiple games could be also
modeled as an episodic sequence of independent games.
Fully Partially Partially
Determ. game
Mechanics
+ Strategic*
Stochastic
+Strategic
Stochastic
Sequential** Sequential** Sequential
Semidynamic Dynamic
Static
Discrete Discrete Continuous
Multi* Multi* Multi*
Partially
Deterministic
Episodic
Static
Discrete
Single
Vacuum cleaner
world
Chess with
a clock
Scrabble Taxi driving
Designing a Rational Agent
Remember the definition of a
rational agent:
“For each possible percept sequence, a
rational agent should select an action
that maximizes its expected
performance measure, given the
evidence provided by the percept
sequence and the agent’s built-in
knowledge.”
𝑓𝑓
action
Percept to the
agent function
Action from the
agent function
to execute
𝑎𝑎 = 𝑓𝑓(𝑝𝑝)
Hardware + an
event loop
• Read the
sensors
• Ask agent
function
for action
• Execute
action
Agent Function
• Represents the
“brain”
• Assess performance
measure
• Remember percept
sequence
• Built-in knowledge
Important:
Everything
outside the agent
function
represents the
environment.
This includes the
physical robot, its
sensors and its
actuators, and
event loop!
Hierarchy of Agent Types
Utility-based agents
Goal-based agents
Model-based reflex agents
Simple reflex agents
Simple Reflex Agent
• Uses only built-in knowledge in the form of rules that select action only based
on the current percept. This is typically very fast!
• The agent does not know about the performance measure! But well-designed
rules can lead to good performance.
• The agent needs no memory and ignores all past percepts.
𝑎𝑎 = 𝑓𝑓(𝑝𝑝)
The interaction is a sequence: 𝑝𝑝0, 𝑎𝑎0, 𝑝𝑝1, 𝑎𝑎1, 𝑝𝑝2, 𝑎𝑎2, … 𝑝𝑝𝑡𝑡, 𝑎𝑎𝑡𝑡, …
Example: A simple vacuum cleaner that uses rules based on its current sensor input.
Model-based Reflex Agent
• Maintains a state variable to keep track of aspects of the environment that
cannot be currently observed. I.e., it has memory.
• It knows how the environment evolves over time and what its actions do
(implemented as the transition function) to keep its state up-to-date.
• There is now more information for the rules to make better decisions.
The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1, 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, 𝑝𝑝3, … , 𝑝𝑝𝑡𝑡, 𝑠𝑠𝑡𝑡, 𝑎𝑎𝑡𝑡, …
Example: A vacuum cleaner that remembers were it has already cleaned.
𝑎𝑎 = 𝑓𝑓(𝑝𝑝, 𝑠𝑠)
𝑠𝑠
𝑠𝑠′
= 𝑇𝑇(𝑠𝑠, 𝑎𝑎)
𝑝𝑝
State Representation
States help keep track of the environment and the agent in it. This is often referred to
as the system state.
The representation can be:
• Atomic: Just a label for a black box. E.g., A, B
• Factored: A set of attribute values called fluents (because they model what can change).
E.g., [location = left, status = clean, temperature = 75 deg. F]
Variables describing
the system state are
called “fluents”
The set of all possible states is called the state space 𝑺𝑺. This set is typically very large!
Models a snapshot of
the current situation
Note: We often construct atomic labels from factored state representations. E.g.: If the
agent’s state is the location x = 7 and y = 3, then the atomic state label could be the
string “(7, 3)”. With the atomic representation, we can only compare if two labels are
the same. With the factored state representation, we have more information. E.g., we
can calculate the distance between the coordinates in two states.
Transition Function
• How the environment changes when actions are performed is modeled as a discrete dynamical
system.
• Example of a state diagram
for the Vacuum cleaner world.
• States change because of
a. System dynamics of the environment (the environment evolves by itself).
b. The actions of the agent.
• Both types of changes are represented by the transition function written as
𝑇𝑇: 𝑆𝑆 × 𝐴𝐴 → 𝑆𝑆 or 𝑠𝑠𝑠 = 𝑇𝑇(𝑠𝑠, 𝑎𝑎) 𝑆𝑆 … set of states
𝐴𝐴 … set of available actions
𝑎𝑎 ∈ 𝐴𝐴 … an action
𝑠𝑠 ∈ 𝑆𝑆 … current state
𝑠𝑠′
∈ 𝑆𝑆 … next state
Models how the
situation changes
State Action/
Transition
Transition model
Old-school vs. Smart Thermostat
Old-school thermostat
Percepts States
Transitions
Smart thermostat
Percepts States
Transitions
Old-school vs. Smart Thermostat: Solution
Set target
temperature
Many sensors, internet
connectivity, memory.
Change
temperature
when you
are too
cold/warm.
Old-school thermostat Smart thermostat
Setting
Contacts
Setting: Cool,
off, heat
Contact:
Open, closed
The agent uses
no states (only
reacts to the
current
percepts)
Sensors
• Temp: deg. F
• Someone walking by
• Someone changes temp.
Internet
• Outside temp.
• Weather report
• Energy curtailment
• Day & time
• …
Factored description
• Estimated time to
cool the house
• Someone home?
• How long till
someone is
coming home?
• Schedule
• ….
Bi-metal
spring
Percepts State
Transitions
No transitions (has no states)
Percepts State
Transitions
Many: E.g., Person walks by -> someone is home.
Temperature changes -> estimated cool time changes
Fluents
model
current
situation
Actions
or
changes
in the
environ
ment
change
the state
Goal-based Agent
• The agent has the task of reaching a defined goal state, and then it is done.
• The agent needs to choose actions to move towards the goal. Subtypes:
• Greedy or heuristic goal-seeking agent: Choose the next action to move towards the goal.
• Planning agent: Use search algorithms to plan a sequence of actions that leads to the goal.
• Performance measure: the cost to reach the goal.
𝑎𝑎 = argmin𝑎𝑎0∈A �
𝑡𝑡=0
𝑇𝑇
𝑐𝑐𝑡𝑡 � 𝑠𝑠𝑇𝑇∈ 𝑆𝑆𝑔𝑔𝑔𝑔𝑎𝑎𝑔𝑔
Sum of the cost
of a planed sequence of
actions that leads to a
goal state
The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1, 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, … , 𝑠𝑠𝑔𝑔𝑔𝑔𝑎𝑎𝑔𝑔
Example: Solving a puzzle. What action gets me closer to the solution?
cost
Plan or
heuristic
Utility-based Agent
• The agent uses a utility function to evaluate the desirability of each possible
states. This is typically expressed as the reward of being in a state 𝑅𝑅(𝑠𝑠).
• Choose actions to stay in desirable states.
• Performance measure: The discounted sum of expected utility over time.
𝑎𝑎 = arg𝑚𝑚𝑎𝑎𝑚𝑚𝑎𝑎0∈A 𝐸𝐸 �
𝑡𝑡=0
∞
𝛾𝛾𝑡𝑡
𝑟𝑟𝑡𝑡 �𝑎𝑎0
Implements rational
behavior: Utility is
the expected future
discounted reward
Techniques: Markov decision
processes, reinforcement learning
reward
The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1. 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, …
Example: An autonomous Mars rover prefers states where its battery is not critically low.
Agents that Learn
The learning element modifies the agent program (reflex-based, goal-
based, or utility-based) to improve its performance.
How is the agent
currently performing?
Updates how the
performance element
chooses actions.
Generate actions for
exploration
Examples
Smart Thermostat: What Type of Agent is it?
Change
temperature
when you are
too
cold/warm
Smart thermostat
Percepts
Sensors
• Temp: deg. F
• Someone walking by
• Someone changes
temp.
Internet
• Outside temp.
• Weather report
• Energy curtailment
• Day & time
• …
States
Factored states
• Estimated
time to cool
the house
• Someone
home?
• How long till
someone is
coming
home?
• Schedule
• ….
Example: Modern Vacuum Robot
Features are:
• Control via App
• Cleaning Modes
• Navigation
• Mapping
• Boundary blockers
Source: https://www.techhive.com/article/3269782/best-robot-
vacuum-cleaners.html
PEAS Description of a
Modern Robot Vacuum
Performance
measure
Environment Actuators Sensors
PEAS Description of a
Modern Robot Vacuum: Solution
Performance
measure
• Time to clean
95%
• Does it get
stuck?
Environment
• Rooms
• Obstacles
• Dirt
• People/pets
• …
Actuators
• Wheels
• Brushes
• Blower
• Sound
• Communicate
to server/app
Sensors
• Bumper
• Cameras/dirt
sensor
• Laser
• Motor sensor
(overheating)
• Cliff detection
• Home base
locator
What Type of Intelligent Agent is a
Modern Robot Vacuum?
Utility-based agents
Goal-based agents
Model-based reflex agents
Simple reflex agents
Does it collect utility over
time? How would the utility for
each state be defined?
Does it actively try to reach
a goal state?
Does it store state information?
How would states be defined
(atomic/factored)?
Does it use simple rules based
only on the current percepts?
Is
it
learning?
Check what applies
Example: Large Language Models
PEAS Description of ChatGPT
Performance
measure
Environment Actuators Sensors
What Type of Intelligent Agent is
ChatGPT?
Utility-based agents
Goal-based agents
Model-based reflex agents
Simple reflex agents
Does it collect utility over
time? How would the utility for
each state be defined?
Does it actively try to reach
a goal state?
Does it store state information?
How would the state be defined
(atomic/factored)?
Does it use simple rules based
on the current percepts?
Is
it
learning?
Answer the following questions:
• Does ChatGPT pass the Touring test?
• Is ChatGPT a rational agent? Why?
Check what applies
We will talk about knowledge-based agents later.
Intelligent Systems a
Sets of Agents:
Self-driving Car
Utility-based agents
Goal-based agents
Model-based reflex agents
Simple reflex agents
Make sure the passenger has a pleasant drive
(not too much sudden breaking = utility)
Plan the route to the destination.
Remember where every other car is and
calculate where they will be in the next few
seconds.
React to unforeseen issues like a child
running in front of the car quickly.
It
should
learn!
High-level
planning
Low-level
planning

AI artificial intelligence introduction.pdf

  • 1.
  • 2.
    Agenda What is AI? History AI ? ofAI Today AI Ethics & Safety
  • 3.
    Science of AI Physics:Where did the physical universe come from? And what laws guide its dynamics? Biology: How did biological life evolve? And how do living organisms function? AI: What is the nature of intelligent thought?
  • 4.
    What is intelligence? Abilityto perceive and act in the world Planning: take decisions Learning and Adaptation: recommend movies, learn traffic patterns Understanding: text, speech, visual scene Dictionary.com: capacity for learning, reasoning, understanding, and similar forms of mental activity Reasoning: proving theorems, medical diagnosis
  • 5.
    Intelligence vs. humans Arehumans intelligent? Are humans always intelligent? Can non-human behavior be intelligent? replicating human behavior early hallmark of intelligence
  • 6.
    What is artificialintelligence? thought vs. behavior human-like vs. rational computers do things at which, at the moment, people are better” (Rich & Knight 1991) “[automation of] activities that we associate with human thinking, activities such as decision making, problem solving, learning…” (Bellman 1978) “The study of mental faculties through the use of computational models” (Charniak& McDertmott 1985) science that is concerned with the automation of intelligent behavior” (Luger & Stubblefield 1993) “The study of how to make “The branch of computer
  • 7.
    What is artificialintelligence? thought vs. behavior human-like vs. rational Systems that think like humans Systems that think rationally Systems that act like Systems that act humans rationally
  • 8.
    The Goal ofAI Think like a human? Act like a human? Think rationally? Act rationally? “Have machines solve problems that are challenging for humans.” Narrow AI How can we achieve this? Create an agent that can: We call such a machine an intelligent agent. •An intelligent agent that can solve a specific problem. E.g., drive a car or play chess. •A hypothetical intelligent agent which can understand or learn any intellectual task thathumanbeings can. •A hypothetical intelligent agent possessing intelligence surpassing that of the brightest and most gifted human minds. Artificial General Intelligence (AGI) [Wikipedia: AGI] [Wikipedia: Superintelligence] Artificial Superintelligence
  • 9.
    Cognitive Sciences Moral Philosophy Note: Thebrain does not work like artificial neural networks from machine learning! The brain as an information processing machine. •Requires scientific theories of how the brain works. How to understand cognition as a computational process? •Introspection: try to think about how we think. •Predict the behavior of human subjects. •Image the brain, examine neurological data Think like a human? Act like a human? Think rationally? Act rationally? AI consciousness •What does it mean that a machine is conscient/sentient? •How can we tell? •What do we do then?
  • 10.
    Thinking Humanly • • • • Cognitive Science – Thegoal of aeronautical enggis not to fool pigeons in flying! Do we want a machine that beats humans in chess or a machine that thinks like humans while beating humans in chess? – Thinking like humans important in Cognitive Science applications – – Intelligent tutoring Expressing emotions in interfaces… HCI Very hard to understand how humans think • Post-factorationalizations,irrationality of human thinking Deep Blue supposedly DOESN’T think like humans..
  • 11.
    Alan Turing (1950) “Computing machineryand Natural language processing Knowledge representation Automated reasoning Machine learning intelligence” • • • Alan Turing rejects the question “Can machines think?” The Turing Test tries to define what acting like a human means. •What capabilities would a computer need to have to pass the Turing Test? These arestillthe coreAI areas. Turing predicted that by the year 2000, machines would be able to fool 30% of human judges for five minutes. ChatGPT (2023) is probably doing a least that! • • • • Think like a human? Act like a human? Think rationally? Act rationally? Needs to decide if she talks to a human or an AI system.
  • 12.
    Turing Test: Criticism Whatare some potential problems with the Turing Test? •Some human behavior is not intelligent. •Some intelligent behavior may not be human. •Human observers may be easy to fool. Imitate intelligence without intelligence. E.g., the early chatbots ELIZA (1964) simulates a conversation using pattern matching. Is passing the Turing test a good scientific goal? •Engineering perspective: Imitating a human is not a good way to solve practical problems. •We can create useful intelligent agents • without trying to imitate humans. • • Alotdependson expectations. Anthropomorphic fallacy: humans tend to humanize things. Chinese Room Argument Thought experiment by John Searle (1980): Imitate intelligence using rules.
  • 13.
    Acting Humanly: Turing’sTest • If the human cannot tell whether the responses from the other side of a wall are coming from a human or computer, then the computer is intelligent.
  • 14.
    Think like a human? Actlike a human? Think rationally? Act rationally? •Thinking Rationality: Draw sensible conclusions from facts, logic and data. •Logic: A chain of argument that always yield correct conclusions. E.g., “Socrates is a man; all men are mortal; therefore, Socrates is mortal.” •Logic-based approach to AI: Describe a problem in formal logic notation and apply general deduction procedures to solve it. Issues: • • • Describing real-world problems and knowledge using logic notation is hard. Computational complexity of finding the solution. defined by simple logic rules. Much intelligent or “rational” behavior in an uncertain world cannot be Should it rather be 𝑠𝑡𝑢𝑑𝑦 ℎ𝑎𝑟𝑑 𝐴𝑁𝐷 𝑏𝑒 𝑙𝑢𝑐𝑘𝑦 𝐴𝑁𝐷 …֜𝐴 𝑖𝑛 𝑚𝑦 𝐴𝐼 𝑐𝑜𝑢𝑟𝑠𝑒 Example: What about the logical implication 𝑠𝑡𝑢𝑑𝑦 ℎ𝑎𝑟𝑑 ֜𝐴 𝑖𝑛 𝑚𝑦 𝐴𝐼 𝑐𝑜𝑢𝑟𝑠𝑒
  • 15.
    Thinking Rationally: lawsof thought Aristotle: what are correct arguments / thought processes? Problems: Not all intelligent behavior is mediated by logical deliberation (reflexes) What is the purpose of thinking?
  • 16.
    Acting rational meansto try to achieve the “best” outcome. • • • Best means that we need to do optimization. The desirability of outcomes can be measured by the economic concept of utility. If there is uncertainty about achieving outcomes, then we need to maximizing the expected utility. Bounded rationality: In practice, expected utility optimization is subject to the agent’s knowledge and computational constraints. The agent needs to do the best with its knowledge and resources. Optimization has several advantages: • • • • Generality: optimization is not limited to logical rules. Practicality: can be adapted to many real-world problems. Well established: existing solvers and methods for simulation and experimentation. Avoids philosophy and psychology in favor of a clearly defined objective. Think like a human? Act like a human? Think rationally? Act rationally?
  • 17.
    Acting rationally • • • Rational behavior:doing the right thing Need not always be deliberative Aristotle (Nicomacheanethics) – – Reflexive Everyart andevery inquiry, and similarlyevery action and every pursuit is thought to aim at some good.
  • 18.
    Acting → Thinking? •WeakAI Hypothesis vs. Strong AI hypothesis – – Weak Hyp: machines could act as if they are intelligent Strong Hyp: machines that act intelligent have to think intelligently too
  • 19.
  • 20.
    https : // qbi. uq. e du. a u/ bra in/ inte llig e nt- m a chine s / his tory - a rtif icia l- inte llig e nce Source: https://qbi.uq.edu.au/brain/intelligent-machines/history-artificial-intelligence + additions Deep Learning Revolution (learning layered artificial neural networks) starts fueled by NVIDIA GPUs. enables leaps in image processing and speech recognition. Second AI Winter Transformer architecture and large language models LLMs 1989: Universal approximation theorem for artificial neural networks Generative AI models: • • • DALL-E ChatGPT, Bard … 2010 2017 2022 2015 1987- 1993 1974-1980 First AI Winter 1989 Now Google
  • 21.
    The State ofthe Art in Artificial Intelligence Overview of current AI capabilities and progress Based on Stanford’s AI100 initiative Focus on technological, societal, and application-level advances
  • 22.
    AI100: One HundredYear Study on AI Led by Stanford University Long-term assessment of AI progress and impact Publishes expert reports and the AI Index at aiindex.org Key Findings from AI100 (2016) Rapid growth in AI applications Impact areas: transport, healthcare, elder care Need for ethical and democratic AI deployment
  • 23.
    Highlights from 2018and 2019 reports compared to year 2000 baselines: Growth in AI Research Publications 20-fold increase in AI papers (2010–2019) Machine Learning dominates research output Computer Vision and NLP follow Public Sentiment and Ethics 70% AI news coverage is neutral Positive sentiment rising rapidly Key concerns: privacy and algorithmic bias Education and Talent Growth AI course enrollments growing rapidly Most popular CS specialization worldwide Strong industry demand for AI skills Diversity in AI 80% male, 20% female professors Similar trends in academia and industry Highlights need for inclusivity Conferences and Industry Expansion NeurIPS attendance increased by 800% AI startups in the U.S. increased 20-fold Rapid commercialization of AI Globalization of AI Research China leads in paper volume U.S. leads in citation impact India among fastest-growing AI hiring nations Vision and Language Advances ImageNet accuracy surpasses human performance NLP benchmarks exceed human-level scores Major leap in perception and understanding Human-Level Performance Benchmarks AI matches/exceeds humans in games and vision Medical diagnosis performance comparable to experts Shows task-specific intelligence
  • 24.
    Domain Key AchievementsNotable Examples / Systems Robotic Vehicles Autonomous driving and drone deliveries; safe long-distance navigation without human control. DARPA Grand Challenge (2005), Waymo (10M miles, 2018), Rwanda medical drones, quadcopter mapping and formation. Legged Locomotion Dynamic, animal-like movement and balance; humanoid robots performing complex acrobatics. BigDog (Raibert et al., 2008), Atlas (Ackerman & Guizzo, 2016). Autonomous Planning & Scheduling Automated control, logistics, and navigation in space and defense. NASA Remote Agent (2000), EUROPA toolkit, SEXTANT (2017), DART (1991), Uber/Google Maps routing. Machine Translation Multilingual translation across 100+ languages; near-human performance in some cases. Google Translate, Wu et al. (2016b) neural MT. Speech Recognition & Assistants Human-level speech transcription; interactive voice-controlled systems. Microsoft Conversational System (2017), Skype Translator, Google Duplex, Siri, Alexa, Cortana. Recommender Systems Personalized suggestions using user data, metadata, and deep learning; advanced spam filtering. Amazon, Netflix, YouTube, Spotify, Facebook, Gmail spam filters. Game Playing AI systems surpass human champions across classic and modern strategy games. Deep Blue (1997), AlphaGo (2017), AlphaZero (2018), Dota 2, StarCraft II, Poker AIs. Image Understanding Object detection and image captioning beyond human-level benchmarks, but still error-prone. ImageNet challenge, Vinyals et al. (2017b) image captioning systems. Medicine AI equals or surpasses experts in diagnosis via medical imaging; aiding clinical decision-making. LYNA (breast cancer detection), AI for Alzheimer’s, cancer, ophthalmic, and skin diseases. Climate Science ML models detect and analyze extreme weather; climate impact studies using exascale computing. Gordon Bell Prize model (2018), Rolnick et al. catalog (2019). What can AI do today? Some examples...
  • 25.
    Types of AI Basedon Capabilities Based on Functionalities
  • 26.
    Type of AIDescription Examples / Applications Key Characteristics Narrow AI (Weak AI) Designed and trained to perform a specific task or a narrow range of tasks. These systems are highly efficient at targeted functions but lack the ability to generalize tasks beyond their defined scope. They do not possess understanding or awareness. - Voice assistants like Siri or Alexa that understand specific commands. - Facial recognition software used in security systems. - Recommendation engines used by Netflix or Amazon. - Task-specific and specialized. - Lacks generalization ability. - No consciousness or self- awareness. General AI (Strong AI) Refers to AI systems with human- like intelligence and cognitive abilities to perform various tasks. These systems can understand, learn, and apply knowledge across multiple domains like humans. Still a theoretical concept. - Robots that can learn new skills and adapt to unforeseen challenges in real time. - AI systems capable of autonomously diagnosing and solving complex medical issues. - Capable of reasoning and learning across varied tasks. - Possesses self-awareness and consciousness (theoretically). - Not yet achieved in practice. Superintellige nce (Super AI) An advanced form of AI that surpasses human intelligence in creativity, problem-solving, and emotional understanding. It could have emotions, desires, and beliefs of its own, capable of making independent decisions. - Speculative future AI that could revolutionize science, industries, and decision- making. - Could innovate autonomously and outperform human intelligence in every field. - Surpasses human intelligence. - Has independent reasoning and emotional understanding. - Raises ethical and control concerns. Types of AI
  • 27.
  • 28.
  • 29.
  • 30.
    What is anAgent? An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. •Control theory: A closed-loop control system (= feedback control system) isa set of mechanical or electronic devices that automatically regulate a process variable to a desired state or set point without human interaction. The agent is called a controller. •Softbot: Agent is a software program that runs on a host device.
  • 31.
    Agents Human agent: eyes, ears,and other organs for sensors hands,legs,mouth,andotherbodyparts for actuators Robotic agent: cameras and laser range finders for sensors various motors for actuators 3
  • 32.
    Examples of Agents • •Softbots Physically grounded agents – – – – Expert Systems IBM Watson Intelligent buildings Autonomous spacecraft
  • 33.
    Intelligent Agents • • Have sensors,effectors Implementmapping from percept sequence to actions Environment Agent actions percepts •Performance Measure
  • 34.
    Components of anIntelligent Agent Intelligent agents act rationally in their environment. They need to • • Optional • Learn from experience to improve performance. Communicate with the environment using percepts and actions. Represent knowledge, reason and plan to achieve a desired outcome. Agent interacting with the environment [Artificial Intelligence: A Modern Approach, Editions 1-3] Developer
  • 35.
    Rational Agents An agentshould strive to do the right thing, based on what it can perceive and the actions it can perform. The right action is the one that will cause the agent to be most successful. Performance measure: An objective criterion for success of an agent's behavior. E.g., performance measure of a vacuum-cleaner agent could be amount of dirt cleaned up, amount of time taken, amount of electricity consumed, amount of noise generated, etc.
  • 36.
    Ideal Rational Agent Rationalityvsomniscience? Acting in order to obtain valuable information “For each possible percept sequence, does whatever action is expected to maximize its performance measure on the basis of evidence perceived so far and built-in knowledge.''
  • 37.
    What is artificialintelligence (agent view) Robotic agent: An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators Human agent: – – – – eyes, ears, and other organs for sensors cameras andlaser range finders for sensors various motors for actuators hands,legs,mouth,andotherbodyparts for actuators
  • 38.
    Agent Function andAgent Program The agent function maps from the set of all possible percept sequences 𝑃𝑃∗ to the set of actions 𝐴𝐴 formulated as an abstract mathematical function. 𝑓𝑓 ∶ 𝑃𝑃∗ → 𝐴𝐴 The agent program is a concrete implementation of this function for a given physical system. Agent = architecture (hardware) + agent program (implementation of 𝑓𝑓) • Sensors • Memory • Computational power 𝒂𝒂 = 𝒇𝒇(𝒑𝒑) 𝒂𝒂 𝒑𝒑
  • 39.
    Example: Vacuum-cleaner World • Percepts: Locationand status, e.g., [A, Dirty] • Actions: Left, Right, Suck, NoOp Implemented agent program: function Vacuum-Agent( [location, status] ) returns an action 𝑎𝑎 if status = Dirty then return Suck else if location = A then return Right else if location = B then return Left Agent function: 𝑓𝑓 ∶ 𝑃𝑃∗ → 𝐴𝐴 Percept Sequence Action [A, Clean] Right [A, Dirty] Suck … [A, Clean], [B, Clean] Left … [A, Clean], [B, Clean], [A, Dirty] Suck … Most recent Percept 𝑝𝑝 Problem: This table can become infinitively large!
  • 40.
    Rational Agents: Whatis Good Behavior? Foundation from normative moral theory and economics: • Consequentialism: Evaluate actions by their consequences. • Utilitarianism: Maximize happiness and well-being. Definition of a rational agent: “For each possible percept sequence, a rational agent should select an action that maximizes its expected performance measure, given the evidence provided by the percept sequence and the agent’s built-in knowledge.” • Performance measure: An objective criterion for success of an agent's behavior (often called utility function or reward function). • Expectation: Outcome averaged over all possible situations that may arise. Rule: Pick the action that maximize the expected utility 𝑎𝑎 = argmax𝑎𝑎∈A 𝐸𝐸 𝑈𝑈 𝑎𝑎)
  • 41.
    Rational Agents This means: •Rationality is an ideal – it implies that no one can build a better agent • Rationality ≠ Omniscience – rational agents can make mistakes if percepts and knowledge do not suffice to make a good decision • Rationality ≠ Perfection – rational agents maximize expected outcomes not actual outcomes • It is rational to explore and learn – I.e., use percepts to supplement prior knowledge and become autonomous • Rationality is often bounded by available memory, computational power, available sensors, etc. Rule: Pick the action that maximize the expected utility 𝑎𝑎 = argmax𝑎𝑎∈A 𝐸𝐸 𝑈𝑈 𝑎𝑎)
  • 42.
    Example: Performance Measure forthe Vacuum-cleaner World • Percepts: Location and status, e.g., [A, Dirty] • Actions: Left, Right, Suck, NoOp Agent function: Percept Sequence Action [A, Clean] Right [A, Dirty] Suck … [A, Clean], [B, Clean] Left … Implemented agent program: function Vacuum-Agent( [location, status] ) returns an action if status = Dirty then return Suck else if location = A then return Right else if location = B then return Left What could be a performance measure? Is this agent program rational?
  • 43.
    Problem Specification: PEASPerformance measure Performance measure Environment Actuators Sensors Defines utility and what is rational Components and rules of how actions affect the environment. Defines available actions Defines percepts
  • 44.
    Example: Automated TaxiDriver Performance measure • Safe • fast • legal • comfortable trip • maximize profits Environment • Roads • other traffic • pedestrians • customers Actuators • Steering wheel • accelerator • brake • signal • horn Sensors • Cameras • sonar • speedometer • GPS • Odometer • engine sensors • keyboard
  • 45.
    Example: Spam Filter Performance measure •Accuracy: Minimizing false positives, false negatives Environment • A user’s email account • email server Actuators • Mark as spam • delete • etc. Sensors • Incoming messages • other information about user’s account
  • 46.
    The Environment • Wetypically consider everything outside the agent function (the agent’s brain) as the agent’s environment. • This means that the sensors and actuators are part of the environment. • The agent function receives already preprocessed percepts and acts by issuing high-level instructions to the actuators. Examples:
  • 47.
    Environment Types Fully observable:The agent's sensors give it access to the complete state of the environment. The agent can “see” the whole environment. vs. Partially observable: The agent cannot see all aspects of the environment. E.g., it can’t see through walls Deterministic: Changes in the environment is completely determined by the current state of the environment and the agent’s action. vs. Stochastic: Changes cannot be determined from the current state and the action (there is some randomness). Strategic: The environment is stochastic and adversarial. It chooses actions strategically to harm the agent. E.g., a game where the other player is modeled as part of the environment. Known: The agent knows the rules of the environment and can predict the outcome of actions. vs. Unknown: The agent cannot predict the outcome of actions.
  • 48.
    Environment Types (cont.) Static:The environment is not changing while agent is deliberating. Semidynamic: the environment is static, but the agent's performance score depends on how fast it acts. vs. Dynamic: The environment is changing while the agent is deliberating. Discrete: The environment provides a fixed number of distinct percepts, actions, and environment states. Time can also evolve in a discrete or continuous fashion. vs. Continuous: Percepts, actions, state variables or time are continuous leading to an infinite state, percept or action space. Episodic: Episode = a self-contained sequence of actions. Short episodes for a task that the agent performs repeatedly. What the agent does in one episode does not affect future episodes. vs. Sequential: Tasks are long, and actions taken now affect the outcomes later. The agent must consider the long-term consequences of its actions. Single agent: A single agent operating in an environment. vs. Multi-agent: Agent cooperate or compete in the same environment.
  • 49.
    Examples of DifferentEnvironments Observable Deterministic Episodic? Static Discrete Single agent * Can be models as a single agent problem with the other agent(s) in the environment. ** A single game would be sequential environment. Multiple games could be also modeled as an episodic sequence of independent games. Fully Partially Partially Determ. game Mechanics + Strategic* Stochastic +Strategic Stochastic Sequential** Sequential** Sequential Semidynamic Dynamic Static Discrete Discrete Continuous Multi* Multi* Multi* Partially Deterministic Episodic Static Discrete Single Vacuum cleaner world Chess with a clock Scrabble Taxi driving
  • 50.
    Designing a RationalAgent Remember the definition of a rational agent: “For each possible percept sequence, a rational agent should select an action that maximizes its expected performance measure, given the evidence provided by the percept sequence and the agent’s built-in knowledge.” 𝑓𝑓 action Percept to the agent function Action from the agent function to execute 𝑎𝑎 = 𝑓𝑓(𝑝𝑝) Hardware + an event loop • Read the sensors • Ask agent function for action • Execute action Agent Function • Represents the “brain” • Assess performance measure • Remember percept sequence • Built-in knowledge Important: Everything outside the agent function represents the environment. This includes the physical robot, its sensors and its actuators, and event loop!
  • 51.
    Hierarchy of AgentTypes Utility-based agents Goal-based agents Model-based reflex agents Simple reflex agents
  • 52.
    Simple Reflex Agent •Uses only built-in knowledge in the form of rules that select action only based on the current percept. This is typically very fast! • The agent does not know about the performance measure! But well-designed rules can lead to good performance. • The agent needs no memory and ignores all past percepts. 𝑎𝑎 = 𝑓𝑓(𝑝𝑝) The interaction is a sequence: 𝑝𝑝0, 𝑎𝑎0, 𝑝𝑝1, 𝑎𝑎1, 𝑝𝑝2, 𝑎𝑎2, … 𝑝𝑝𝑡𝑡, 𝑎𝑎𝑡𝑡, … Example: A simple vacuum cleaner that uses rules based on its current sensor input.
  • 53.
    Model-based Reflex Agent •Maintains a state variable to keep track of aspects of the environment that cannot be currently observed. I.e., it has memory. • It knows how the environment evolves over time and what its actions do (implemented as the transition function) to keep its state up-to-date. • There is now more information for the rules to make better decisions. The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1, 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, 𝑝𝑝3, … , 𝑝𝑝𝑡𝑡, 𝑠𝑠𝑡𝑡, 𝑎𝑎𝑡𝑡, … Example: A vacuum cleaner that remembers were it has already cleaned. 𝑎𝑎 = 𝑓𝑓(𝑝𝑝, 𝑠𝑠) 𝑠𝑠 𝑠𝑠′ = 𝑇𝑇(𝑠𝑠, 𝑎𝑎) 𝑝𝑝
  • 54.
    State Representation States helpkeep track of the environment and the agent in it. This is often referred to as the system state. The representation can be: • Atomic: Just a label for a black box. E.g., A, B • Factored: A set of attribute values called fluents (because they model what can change). E.g., [location = left, status = clean, temperature = 75 deg. F] Variables describing the system state are called “fluents” The set of all possible states is called the state space 𝑺𝑺. This set is typically very large! Models a snapshot of the current situation Note: We often construct atomic labels from factored state representations. E.g.: If the agent’s state is the location x = 7 and y = 3, then the atomic state label could be the string “(7, 3)”. With the atomic representation, we can only compare if two labels are the same. With the factored state representation, we have more information. E.g., we can calculate the distance between the coordinates in two states.
  • 55.
    Transition Function • Howthe environment changes when actions are performed is modeled as a discrete dynamical system. • Example of a state diagram for the Vacuum cleaner world. • States change because of a. System dynamics of the environment (the environment evolves by itself). b. The actions of the agent. • Both types of changes are represented by the transition function written as 𝑇𝑇: 𝑆𝑆 × 𝐴𝐴 → 𝑆𝑆 or 𝑠𝑠𝑠 = 𝑇𝑇(𝑠𝑠, 𝑎𝑎) 𝑆𝑆 … set of states 𝐴𝐴 … set of available actions 𝑎𝑎 ∈ 𝐴𝐴 … an action 𝑠𝑠 ∈ 𝑆𝑆 … current state 𝑠𝑠′ ∈ 𝑆𝑆 … next state Models how the situation changes State Action/ Transition Transition model
  • 56.
    Old-school vs. SmartThermostat Old-school thermostat Percepts States Transitions Smart thermostat Percepts States Transitions
  • 57.
    Old-school vs. SmartThermostat: Solution Set target temperature Many sensors, internet connectivity, memory. Change temperature when you are too cold/warm. Old-school thermostat Smart thermostat Setting Contacts Setting: Cool, off, heat Contact: Open, closed The agent uses no states (only reacts to the current percepts) Sensors • Temp: deg. F • Someone walking by • Someone changes temp. Internet • Outside temp. • Weather report • Energy curtailment • Day & time • … Factored description • Estimated time to cool the house • Someone home? • How long till someone is coming home? • Schedule • …. Bi-metal spring Percepts State Transitions No transitions (has no states) Percepts State Transitions Many: E.g., Person walks by -> someone is home. Temperature changes -> estimated cool time changes Fluents model current situation Actions or changes in the environ ment change the state
  • 58.
    Goal-based Agent • Theagent has the task of reaching a defined goal state, and then it is done. • The agent needs to choose actions to move towards the goal. Subtypes: • Greedy or heuristic goal-seeking agent: Choose the next action to move towards the goal. • Planning agent: Use search algorithms to plan a sequence of actions that leads to the goal. • Performance measure: the cost to reach the goal. 𝑎𝑎 = argmin𝑎𝑎0∈A � 𝑡𝑡=0 𝑇𝑇 𝑐𝑐𝑡𝑡 � 𝑠𝑠𝑇𝑇∈ 𝑆𝑆𝑔𝑔𝑔𝑔𝑎𝑎𝑔𝑔 Sum of the cost of a planed sequence of actions that leads to a goal state The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1, 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, … , 𝑠𝑠𝑔𝑔𝑔𝑔𝑎𝑎𝑔𝑔 Example: Solving a puzzle. What action gets me closer to the solution? cost Plan or heuristic
  • 59.
    Utility-based Agent • Theagent uses a utility function to evaluate the desirability of each possible states. This is typically expressed as the reward of being in a state 𝑅𝑅(𝑠𝑠). • Choose actions to stay in desirable states. • Performance measure: The discounted sum of expected utility over time. 𝑎𝑎 = arg𝑚𝑚𝑎𝑎𝑚𝑚𝑎𝑎0∈A 𝐸𝐸 � 𝑡𝑡=0 ∞ 𝛾𝛾𝑡𝑡 𝑟𝑟𝑡𝑡 �𝑎𝑎0 Implements rational behavior: Utility is the expected future discounted reward Techniques: Markov decision processes, reinforcement learning reward The interaction is a sequence: 𝑝𝑝0, 𝑠𝑠0, 𝑎𝑎0, 𝑝𝑝1, 𝑠𝑠1, 𝑎𝑎1. 𝑝𝑝2, 𝑠𝑠2, 𝑎𝑎2, … Example: An autonomous Mars rover prefers states where its battery is not critically low.
  • 60.
    Agents that Learn Thelearning element modifies the agent program (reflex-based, goal- based, or utility-based) to improve its performance. How is the agent currently performing? Updates how the performance element chooses actions. Generate actions for exploration
  • 61.
  • 62.
    Smart Thermostat: WhatType of Agent is it? Change temperature when you are too cold/warm Smart thermostat Percepts Sensors • Temp: deg. F • Someone walking by • Someone changes temp. Internet • Outside temp. • Weather report • Energy curtailment • Day & time • … States Factored states • Estimated time to cool the house • Someone home? • How long till someone is coming home? • Schedule • ….
  • 63.
    Example: Modern VacuumRobot Features are: • Control via App • Cleaning Modes • Navigation • Mapping • Boundary blockers Source: https://www.techhive.com/article/3269782/best-robot- vacuum-cleaners.html
  • 64.
    PEAS Description ofa Modern Robot Vacuum Performance measure Environment Actuators Sensors
  • 65.
    PEAS Description ofa Modern Robot Vacuum: Solution Performance measure • Time to clean 95% • Does it get stuck? Environment • Rooms • Obstacles • Dirt • People/pets • … Actuators • Wheels • Brushes • Blower • Sound • Communicate to server/app Sensors • Bumper • Cameras/dirt sensor • Laser • Motor sensor (overheating) • Cliff detection • Home base locator
  • 66.
    What Type ofIntelligent Agent is a Modern Robot Vacuum? Utility-based agents Goal-based agents Model-based reflex agents Simple reflex agents Does it collect utility over time? How would the utility for each state be defined? Does it actively try to reach a goal state? Does it store state information? How would states be defined (atomic/factored)? Does it use simple rules based only on the current percepts? Is it learning? Check what applies
  • 67.
  • 68.
    PEAS Description ofChatGPT Performance measure Environment Actuators Sensors
  • 69.
    What Type ofIntelligent Agent is ChatGPT? Utility-based agents Goal-based agents Model-based reflex agents Simple reflex agents Does it collect utility over time? How would the utility for each state be defined? Does it actively try to reach a goal state? Does it store state information? How would the state be defined (atomic/factored)? Does it use simple rules based on the current percepts? Is it learning? Answer the following questions: • Does ChatGPT pass the Touring test? • Is ChatGPT a rational agent? Why? Check what applies We will talk about knowledge-based agents later.
  • 70.
    Intelligent Systems a Setsof Agents: Self-driving Car Utility-based agents Goal-based agents Model-based reflex agents Simple reflex agents Make sure the passenger has a pleasant drive (not too much sudden breaking = utility) Plan the route to the destination. Remember where every other car is and calculate where they will be in the next few seconds. React to unforeseen issues like a child running in front of the car quickly. It should learn! High-level planning Low-level planning