easier | harder | |
---|---|---|
accessible | <-> | inaccessible |
deterministic | <-> | nondeterministic |
episodic | <-> | nonepisodic |
static | <-> | dynamic |
discrete | <-> | continuous |
An agent program is a function from percepts to actions.
The architecture is the hardware upon which the program runs. This architecture may be physical, or may be virtual as in the case of software agents (softbots) which live in a world of software.
The basic agent program:
function SKELETON-AGENT(percept) returns action
static: memory, the agent's memory of the world
memory <- UPDATE-MEMORY(memory, percept)
action <- CHOOSE-BEST-ACTION(memory)
memory <- UPDATE-MEMORY(memory, action)
return action
Key questions are:
We can analyze limited AI systems as intelligent agents. Usually the performance metric is decomposed into several "goals".
The PAGE analysis is an example of the general engineering design strategy of "divide and conquer": the problem of analyzing an AI system is divided into four easier subproblems.
It's also an example of "requirements analysis": start solving a problem by analyzing what is available as input, and what is desired as output.
Example: a satellite image analysis system
percepts | pixels of varying intensity and wavelength |
---|---|
actions | move the camera change the filter print an object name, e.g. "T82 tank" |
goals | true-to-reality identification of all objects present |
environment | images from a satellite camera with various types of distortion |
function TABLE-DRIVEN-AGENT(percept) returns action
static: percepts, a sequence, initially empty
static: table, a table, indexed by percept sequences,
initially fully specified
percepts <- APPEND(percept, percepts)
action <- LOOKUP(percepts, table)
return action
The disadvantages of this architecture are (1) excessive size and (2) lack of adaptiveness.
Consider the satellite agent. We can simplify here, so that previous percepts are not relevant.
Other questions:
Let's imagine giving the agent more complicated internals:
Consider the following architecture for an intelligent agent:
function REFLEX-AGENT(percept) returns action
static: state, a description of the current world state
static: rules, a set of condition-action rules
state <- UPDATE-STATE(state, percept)
rule <- RULE-MATCH(state, rules)
action <- RULE-ACTION(rule)
state <- UPDATE-STATE(state, action)
return action
There are three phases inside the loop here:
The key advantage of this architecture is that the UPDATE-STATE function identifies "equivalence classes" of percepts: many different percepts correspond to the same environmental situation, from the point of view of what the agent should do.
It is not rational for an agent to pay attention to EVERY aspect of the environment.
The table of rules can be much smaller than the lookup table above.
With reflex agents, the goal is implicit in the condition-action rules. With goal-based agents, we make the goal explicit. This allows us to
Consider the following architecture for an intelligent agent:
function GOAL-BASED-AGENT(percept, goal) returns
action
static: s, an action sequence, initially empty
static: state, a description of the current world state
state <- UPDATE-STATE(state, percept)
if s is empty then
s <- SEARCH(state, goal)
action <- RECOMMENDATION(s, state)
s <- REMAINDER(s)
return action
The heart of the goal based agent is the search function.
It returns a path from the current state to the goal--a plan.
The agent then returns the first action in the plan.
A simple enhancement would allow the agent to have multiple goals.
Sometimes agents will have multiple conflicting goals. In this case, a utility function is more appropriate.
A utility function assigns a number proportional to the "happiness" of the agent to each state.
An ideal agent will attempt to maximize the expected value of the utility function, so it must know the probability of each of the possible outcomes of an action in a given state. Consider the following architecture for an intelligent agent:
function UTILITY-BASED-AGENT(percept, utility-fn) returns
action
static: s, an action sequence, initially empty
static: state, a description of the current world state
state <- UPDATE-STATE(state, percept)
if s is empty then
s <- SEARCH(state, utility-fn)
action <- RECOMMENDATION(s, state)
s <- REMAINDER(s)
return action
The SEARCH function differs from that of a goal-based agent in that it attempts to find the optimal, reachable state in terms of the expected value of the utility function.
With the reflex architecture, if the table of rules prescribes the wrong action, and the agent discovers this and changes the table, it has automatically generalized from its specific experience.
Generalization is a key phenomenon in learning. Generalization always requires previous "background" knowledge to direct it.
All complex intelligent agents will have a lot of background knowledge preprogrammed, because they do not have the time to receive enough experience and feedback from the environment to allow them to learn to behave correctly starting from scratch.
In linguistics this is called the "poverty of stimulus" argument. If you calculate how many sentences a young child hears before it starts to speak correct English, the number is too few to allow it to "guess" the grammar of English. Therefore the baby must have a so-called universal natural language grammar preprogrammed into it by its genes. This argument is controversial, but there is scientific agreement that background knowledge of some sort (often very hidden and implicit) is necessary for learning in humans and AI systems.