You are on page 1of 76

Introduction to

Artificial Intelligence
CS171, Winter 2017
Introduction to Artificial Intelligence
Prof. Eric Mjolsness

Introduction
• Slides credits: Alex Ihler, Rick Lathrop, Rina Dechter, Max Welling,
Russell & Norvig, and others
Syllabus review here!
Today’s class

• What is Artificial Intelligence?


• A brief History
• Intelligent agents
• State of the art

• Reading assignment for Thursday: R&N Chapters 1&2.

• Reading assignment for next Tuesday: R&N Chapter 3


A.I. in Science Fiction
• Karel Capek 1921
– “Rossum’s Universal Robots” (workers)

• Isaac Asimov’s robot stories 1950-1990


– “I, Robot” 1950
– opposed the “Frankenstein complex”
– 3 laws of robotics, as an ethical system
– first use of “robotics”
– “Bicentennial Man” 1976

• Arthur C Clark’s 2001: A Space Odyssey (1969)


– spacecraft AI “HAL” can:
• speak easily with the crew
• see and understand the emotions of the crew
• navigate the ship automatically
• diagnose on-board problems
• make life-and-death decisions
• display emotions
• run amok, fear death, etc.

• William Gibson’s Neuromancer

• Many others
AI in movies

Hollywood travesty of “I, Robot”


What is AI?

?
=
Acting humanly: Turing Test

• Turing (1950) "Computing machinery and intelligence":


• "Can machines think?" --> "Can machines behave intelligently?"
• Operational test for intelligent behavior: the Imitation Game

• Suggested major components of AI:


– Natural language
– Knowledge representation
– Automated reasoning
– Machine learning
– (vision, robotics) for full test

Can you think of a theoretical system that could beat the Turing test
yet you wouldn’t find very intelligent?
What is AI?

• Turing test (1950)


• Requires:
– Natural language
– Knowledge representation
– automated reasoning
– machine learning
– (vision, robotics.) for full test
• Thinking humanly:
– Introspection, the general problem solver (Newell and Simon 1961)
– Cognitive sciences
– Neuroscience
• Thinking rationally:
– Logic
– Probability and utility
– Problems: how to represent and reason in a domain
• Acting rationally:
– Agents: Perceive and act
What is AI?

Views of AI fall into four categories:

Thinking humanly Thinking rationally

• Acting humanly Acting rationally

The textbook advocates "acting rationally“


• List of AI-topics
Different Types of Artificial Intelligence
• Modeling how human beings actually think
– cognitive models of human reasoning

• Modeling how human beings actually act


– models of human behavior (what they do, not how they think)

• Modeling how ideal agents “should think”


– models of “rational” thought (formal logic)
– note: humans are often not rational!

• Modeling how ideal agents “should act”


– rational actions but not necessarily formal rational reasoning
– i.e., more of a black-box/engineering approach

• R&N book focus on the last definition


– success is judged by how well the agent perform
-- methods are inspired by cognitive & neuroscience (how people think).
What is Artificial Intelligence

• Thought processes
– “The exciting new effort to make computers think .. Machines with minds, in
the full and literal sense” (Haugeland, 1985)
• Behavior
– “The study of how to make computers do things at which, at the moment,
people are better.” (Rich, and Knight, 1991)

The automation of activities that we associate


with human thinking, activities such as
decision-making, problem solving, learning…
(Bellman)
What is Artificial Intelligence
(John McCarthy , Basic Questions)

• What is artificial intelligence?


• It is the science and engineering of making intelligent machines, especially
intelligent computer programs. It is related to the similar task of using
computers to understand human intelligence, but AI does not have to confine
itself to methods that are biologically observable.

• Yes, but what is intelligence?


• Intelligence is the computational part of the ability to achieve goals in the
world. Varying kinds and degrees of intelligence occur in people, many animals
and some machines.

• Isn't there a solid definition of intelligence that doesn't depend on relating it


to human intelligence?
• Not yet. The problem is that we cannot yet characterize in general what kinds
of computational procedures we want to call intelligent. We understand some
of the mechanisms of intelligence and not others.

• More in: http://www-formal.stanford.edu/jmc/whatisai/node1.html


Agents
• An agent is anything that can be viewed as
perceiving its environment through sensors and
acting upon that environment through actuators

• Human agent:
– Sensors: eyes, ears, …
– Actuators: hands, legs, mouth…

• Robotic agent
– Sensors: cameras, range finders, …
– Actuators: motors
Acting rationally: rational agent

• Rational behavior: Doing that was is expected to maximize


one’s “utility function” in this world.

• An agent is an entity that perceives and acts.


• A rational agent acts rationally.

• This course is about designing rational agents

• Abstractly, an agent is a function from percept histories to actions:


[f: P* --> A]

• For any given class of environments and tasks, we seek the agent (or class
of agents) with the best performance

• Caveat: computational limitations make perfect rationality unachievable


=> design best program for given machine resources
Academic Disciplines important to AI.
• Philosophy Logic, methods of reasoning, mind as physical
system, foundations of learning, language,
rationality.

• Mathematics Formal representation and proof, algorithms,


computation, (un)decidability, (in)tractability,
probability.

• Economics utility, decision theory, rational economic agents

• Neuroscience neurons as information processing units.

• Psychology/ how do people behave, perceive, process Cognitive Science


information, represent knowledge.

• Computer building fast computers


engineering

• Control theory design systems that maximize an objective


function over time

• Linguistics knowledge representation, grammar


History of AI
• McCulloch and Pitts (1943)
– Neural networks that learn
• Minsky (1951)
– Built a neural net computer
• Darmouth conference (1956):
– McCarthy, Minsky, Newell, Simon met,
– Logic theorist (LT)- proves a theorem in Principia Mathematica-Russel.
– The name “Artficial Intelligence” was coined.
• 1952-1969
– GPS- Newell and Simon
– Geometry theorem prover - Gelernter (1959)
– Samuel Checkers that learns (1952)
– McCarthy - Lisp (1958), Advice Taker, Robinson’s resolution
– Microworlds: Integration, block-worlds.
– 1962- the perceptron convergence theorem (Rosenblatt)
History, continued

• 1966-1974 a dose of reality


– Problems with computation
– Minsky & Papert “Perceptrons” book
• 1969-1979 Knowledge-based systems
– Weak vs. strong methods
– Expert systems:
• Dendral:Inferring molecular structures
• Mycin: diagnosing blood infections
• Prospector: recomending exploratory drilling (Duda).
– Roger Shank: no syntax only semantics
• 1980-1988: AI becomes an industry
– R1: Mcdermott, 1982, order configurations of computer systems
– 1981: Fifth generation
– AI WInter
• 1986-present: return to neural networks
• Recent events:
– AI Spring
– AI becomes a science: HMMs, planning, belief networks
– deep neural networks
– mathematics everywhere in AI (learning, vision, …)
– commercial success in major companies
– next: AI/ML in “real” science?
The Birthplace of
“Artificial Intelligence”, 1956

• Darmouth workshop, 1956: historical meeting of the precieved founders of AI met: John McCarthy,
Marvin Minsky, Alan Newell, and Herbert Simon.

• A Proposal for the Dartmouth Summer Research Project on Artificial Intelligence. J. McCarthy, M. L.
Minsky, N. Rochester, and C.E. Shannon. August 31, 1955. "We propose that a 2 month, 10 man study
of artificial intelligence be carried out during the summer of 1956 at Dartmouth College in Hanover,
New Hampshire. The study is to proceed on the basis of the conjecture that every aspect of learning or
any other feature of intelligence can in principle be so precisely described that a machine can be made
to simulate it." And this marks the debut of the term "artificial intelligence.“

• 50 anniversery of Darmouth workshop


State of the art

• AlphaGo def. Lee Sedol in Go, March 2016


• Involved in LIGO gravitational wave search (successful in 2015)

• control of autonomous boats and flying drones


• Autonomous highway vehicles near/at commercial stage
• autonomous science observations on Mars rovers ~2010

• commercial speech recognition and synthesis by machine learning


• NASA's on-board autonomous planning program controlled the scheduling of
operations for a spacecraft (Remote Agent/DS1) ~2001
• Deep Blue defeated the reigning world chess champion Garry Kasparov in 1997
• Proved a mathematical conjecture (Robbins conjecture) unsolved for decades

• No hands across America (driving autonomously 98% of the time from Pittsburgh
to San Diego)
• During the 1991 Gulf War, US forces deployed an AI logistics planning and
scheduling program that involved up to 50,000 vehicles, cargo, and people

• Proverb solves crossword puzzles better than most humans


• Stanford vehicle in Darpa challenge completed autonomously a 132 mile desert
track in 6 hours 32 minutes.
Can we build hardware as complex as the brain?
• How complicated is our brain?
– a neuron, or nerve cell, is the basic information processing unit
– estimated to be on the order of 10 11 neurons in a human brain
– many more synapses (10 14) connecting these neurons
– cycle time: 10 -3 seconds (1 millisecond)

• How complex can we make computers?


– 109 or more transistors per CPU
– supercomputer: 102-7 CPUs x 10 11 bits of RAM
– cycle times: order of 10 - 8 seconds
– vastly less power-efficient, though!

• Conclusion
– YES: in the near future we can have computers with as many basic
processing elements as our brain, but with
• far fewer interconnections (wires or synapses) than the brain
• much faster updates than the brain
– but building hardware is very different from making a computer behave like
a brain!
A Neuron
Can Computers play Humans at Chess?
• Chess Playing is a classic AI problem
– well-defined problem
– very complex: difficult for humans to play well

3000
Garry Kasparov (current World Champion) Deep Blue

2550 Deep Thought


Points Ratings

2100 Ratings

1650

1200
1966 YES:
• Conclusion: 1971 1976
today’s 1981can1986
computers 1991
beat even 1997
the best human
2007: Can Computers Talk?
• This is known as “speech synthesis”
– translate text to phonetic form
• e.g., “fictitious” -> fik-tish-es
– use pronunciation rules to map phonemes to actual sound
• e.g., “tish” -> sequence of basic audio sounds

• Difficulties
– sounds made by this “lookup” approach sound unnatural
– sounds are not independent
• e.g., “act” and “action”
• modern systems (e.g., at AT&T) can handle this pretty well
– a harder problem is emphasis, emotion, etc
• humans understand what they are saying
• machines don’t: so they sound unnatural

• Conclusion: NO, for complete sentences, but YES for individual words
2007: Can Computers Recognize Speech?

• Speech Recognition:
– mapping sounds from a microphone into a list of words.
– Hard problem: noise, more than one person talking,
occlusion, speech variability,..
– Even if we recognize each word, we may not understand its meaning.

• Recognizing single words from a small vocabulary


• systems can do this with high accuracy (order of 99%)
• e.g., directory inquiries
– limited vocabulary (area codes, city names)
– computer tries to recognize you first, if unsuccessful hands you
over to a human operator
– saves millions of dollars a year for the phone companies
2007: Recognizing human speech (ctd.)

• Recognizing normal speech is much more difficult


– speech is continuous: where are the boundaries between words?
• e.g., “John’s car has a flat tire”
– large vocabularies
• can be many thousands of possible words
• we can use context to help figure out what someone said
– try telling a waiter in a restaurant:
“I would like some dream and sugar in my coffee”
– background noise, other speakers, accents, colds, etc
– on normal speech, modern systems are only about 60% accurate

• Conclusion: NO, normal speech is too complex to accurately recognize,


but YES for restricted problems
– (e.g., recent software for PC use by IBM, Dragon systems, etc)
2007: Can Computers Understand speech?

• Understanding is different to recognition:


– “Time flies like an arrow”
• assume the computer can recognize all the words
• but how could it understand it?
– 1. time passes quickly like an arrow?
– 2. command: time the flies the way an arrow times the flies
– 3. command: only time those flies which are like an arrow
– 4. “time-flies” are fond of arrows
• only 1. makes any sense, but how could a computer figure this
out?
– clearly humans use a lot of implicit commonsense
knowledge in communication

• Conclusion: NO, much of what we say is beyond the capabilities of a


computer to understand at present
Can Computers Learn and Adapt ?
• Learning and Adaptation
– consider a computer learning to drive on the freeway
– we could code lots of rules about what to do
– or we could let it drive and steer it back on course when it heads for
the embankment
• systems like this are under development (e.g., Daimler Benz)
• e.g., RALPH at CMU
– in mid 90’s it drove 98% of the way from Pittsburgh to San
Diego without any human assistance

– machine learning allows computers to learn to do things without


explicit programming

• Conclusion: YES, computers can learn and adapt, when presented with
information in the appropriate way
2007: Can Computers “see”?
• Recognition v. Understanding (like Speech)
– Recognition and Understanding of Objects in a scene
• look around this room
• you can effortlessly recognize objects
• human brain can map 2d visual image to 3d “map”

• Why is visual recognition a hard problem?

• Conclusion: mostly NO: computers can only “see” certain types of


objects under limited circumstances; but
• YES for certain constrained problems (e.g., stereo, navigation, face
recognition, …)
Can Computers plan and make decisions?
• Intelligence
– involves solving problems and making decisions and plans
– e.g., you want to visit your cousin in Boston
• you need to decide on dates, flights
• you need to get to the airport, etc
• involves a sequence of decisions, plans, and actions

• What makes planning hard?


– the world is not predictable:
• your flight is canceled or there’s a backup on the 405
– there is a potentially huge number of details
• do you consider all flights? all dates?
– no: commonsense constrains your solutions
– AI systems are successful in large-scale constrained planning problems

• Conclusion: YES, real-world planning and decision-making is now possible at


beyond-human skill levels.
– Gulf war 1991 logistics
– Shipping port loading and unloading
– Spacecraft planning and scheduling
• Remote Agent / DS1
AI Applications: Predicting the Stock Market

Value of
the Stock ?

time in days
• The Prediction Problem
– given the past, predict the future
– very difficult problem!
– we can use learning algorithms to learn a predictive model from historical
data
• prob(increase at day t+1 | values at day t, t-1,t-2....,t-k)
– such models are routinely used by banks and financial traders to manage
portfolios worth millions of dollars
AI-Applications: Machine Translation
• Language problems in international business
– e.g., at a meeting of Japanese, Korean, Vietnamese and Swedish investors, no
common language
– or: you are shipping your software manuals to 127 countries
– solution; hire translators to translate
– would be much cheaper if a machine could do this!

• How hard is automated translation


– very difficult!
– e.g., English to Russian
– “The spirit is willing but the flesh is weak” (English)
– “the vodka is good but the meat is rotten” (Russian)
– not only must the words be translated, but their meaning also!

• Nonetheless....
– commercial systems can do alot of the work very well (e.g.,restricted
vocabularies in software documentation)
– algorithms which combine dictionaries, grammar models, etc.
– see for example babelfish.altavista.com
Human-like capabilities:
which one is central for intelligence?
(Each has its partisans)

• Reasoning • Prediction
– Logic
– Common-sense reasoning
• Perception
– Probable reasoning • Analogy/Metaphor
• Language
• Knowledge
– Declarative
– Procedural
– Causal
Summary
• What is Artificial Intelligence?
– modeling humans thinking, acting, should think, should act.
• History of AI
• Intelligent agents
– We want to build agents that act rationally
– Tasks: performance, environment, actions, sensing
– Structure: Sensing/perception, action, decision-making, knowledge
• Real-World Applications of AI
– AI is alive and well in various “every day” applications
• many products, systems, have AI components
– Transformative potential
• Want to change the world? Create AI’s.
• Assigned Reading
– Chapters 1 and 2 in the text R&N
Human-like capabilities:
which one is central for intelligence?
(Each has its partisans)

• Reasoning • Prediction
– Logic
– Common-sense reasoning
• Perception
– Probable reasoning • Analogy/Metaphor
• Language
• Knowledge
– Declarative
– Procedural
– Causal
Agents (chapter 2)

• Agents and environments


• Rationality
• PEAS (Performance measure, Environment, Actuators, Sensors)
• Environment types
• Agent types
Agents

• 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; hands,
• legs, mouth, and other body parts for actuators

• Robotic agent: cameras and infrared range finders for sensors;


• various motors for actuators
Agents and environments

• The agent function maps from percept histories to actions:


[f: P*  A]

• The agent program runs on the physical architecture to


produce f

• agent = architecture + program


Agents and environments

Compare: Standard Embedded System Structure

ADC microcontroller DAC


sensors actuators

ASIC FPGA
Vacuum World

• Percepts: location, contents


– e.g., [A, dirty]
• Actions: {left, right, vacuum,…}
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.
Rational agents

• Rational Agent: For each possible percept sequence, a rational


agent should select an action that is expected to maximize its
performance measure, given the evidence provided by the percept
sequence and whatever built-in knowledge the agent has.
What’s involved in Intelligence?
Intelligent agents

• Ability to interact with the real world


– to perceive, understand, and act
– e.g., speech recognition and understanding and synthesis
– e.g., image understanding
– e.g., ability to take actions, have an effect

• Knowledge Representation, Reasoning and Planning


– modeling the external world, given input
– solving new problems, planning and making decisions
– ability to deal with unexpected problems, uncertainties

• Learning and Adaptation


– we are continuously learning and adapting
– our internal models are always being “updated”
• e.g. a baby learning to categorize and recognize animals
Implementing agents

• Table look-ups
• Autonomy
– All actions are completely specified
– no need in sensing, no autonomy
– example: Monkey and the banana
• Structure of an agent
– agent = architecture + program
– Agent types
• medical diagnosis
• Satellite image analysis system
• part-picking robot
• Interactive English tutor
• cooking agent
• taxi driver
Agent architecture

Environment

Perception Decision Action

Knowledge
Agent types

• Example: Taxi driver


• Simple reflex
– If car-in-front-is-breaking then initiate-breaking
• Agents that keep track of the world
– If car-in-front-is-breaking and on fwy then initiate-breaking
– needs internal state
• goal-based
– If car-in-front-is-breaking and needs to get to hospital then go to adjacent
lane and plan
– search and planning
• utility-based
– If car-in-front-is-breaking and on fwy and needs to get to hospital alive then
search of a way to get to the hospital that will make your passengers happy.
– Needs utility function that map a state to a real function (am I happy?)
Agent functions and programs

• An agent is completely specified by the agent function mapping


percept sequences to actions
• One agent function (or a small equivalence class) is rational

• Aim: find a way to implement the rational agent function concisely


Table-lookup agent

• \input{algorithms/table-agent-algorithm}

• Drawbacks:
– Huge table
– Take a long time to build the table
– No autonomy
– Even with learning, need a long time to learn the table entries
Agent types

• Four basic types in order of increasing generality:

• Simple reflex agents


• Model-based reflex agents
• Goal-based agents
• Utility-based agents
Table Driven Agent.

table lookup
for entire history
Table Driven Agent. current state of decision process

Impractical

table lookup
for entire history
Simple reflex agents
Simple reflex agents

Subagent: C/A rule 1

Subagent: C/A rule 2

Subagent: C/A rule n


Simple reflex agents

Subagent: C/A rule 1

Subagent: C/A rule 2

Subagent: C/A rule n


Σ
Simple reflex agents

Fast but too simple


NO MEMORY
Fails if environment
is partially observable

example: vacuum cleaner world


Model-based reflex agents
Model the state of the world by:
description of
modeling how the world changes
current world state how its actions change the world

•This can work even with partial information


•It’s is unclear what to do
without a clear goal
Goal-based agents
Goal-based agents
Goals provide reason to prefer one action over the other.
We need to predict the future: we need to plan & search
Utility-based agents
Utility-based agents
Some solutions to goal states are better than others.
Which one is best is given by a utility function.
Which combination of goals is preferred?
Learning agents
Learning agents
How does an agent improve over time?
By monitoring it’s performance and suggesting
better modeling, new action rules, etc.
Evaluates
current
world
state

changes
action
rules “old agent”=
model world
and decide on
actions
suggests to be taken
explorations
Summary
• What is Artificial Intelligence?
– modeling humans’ thinking, acting, should think, should act.

• Intelligent agents
– We want to build agents that act rationally
– Maximize expected performance measure

• Task environment – PEAS


– Yield design constraints

• Real-World Applications of AI
– AI is integrated in a broad range of products & systems

• Reading
– Today: Ch. 1 & 2 in R&N
– For next week: Ch. 3 in R&N (search)

You might also like