Russell Norvig Chapter 02: Intelligent Agents
Metadata
Title: Intelligent Agents
Number: 2
Exercises: https://aimacode.github.io/aima-exercises/agents-exercises/
Related Notes: Task Environments; The Structure of Agents
Coverage
2.1 Agents and Environments
2.2 Good Behaviour: The Concept of Rationality
2.3 The Nature of Environments
2.4 The Structure of Agents
Key Quotes and Definitions
An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators.
We use the term percept to refer to the content an agent’s sensors are perceiving. An agent’s percept sequence is the complete history of everything the agent has ever perceived.
In general, an agent’s choice of action at any given instant can depend on its built-in knowledge and on the entire percept sequence observed to date, but not on anything it hasn’t perceived.
p. 54
A 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.
p. 58
Agents and Environments
An agent is defined in the key quotes section above. Some example agents:
A human agent might have eyes, ears etc as sensors, and hands, vocal tract etc for actuators.
A robotic agent may have cameras for sensors and motors for actuators
A software agent may receive file inputs, network packets, or human input as sensory inputs, and acts by writing files, sending packets, making sounds, displaying information.
The environment could be anything, in practice it is that part of the universe whose state we care about when designing the agent. The part that affects what the agent perceives and is affected by the agent’s actions.
By specifying the agent’s choice of action for every possible percept sequence, we have said more or less everything there is to say about the agent. Mathematically, we say that an agent’s behaviour is described by the agent function that maps any given percept sequence to an action.
We can imagine tabulating the agent function that describes a given agent. That table may be infinite unless we bound the lenght of percept sequence we’re interested in. We could observe an agent and record its responses in such a table too.
Such a table is an external characterization, contrasted by the internal characterization of an agent program. These should be kept distinct:
The agent function is an abstract mathematical description; the agent program is a concrete implementation running within some physical system.
p. 55
RN present a simple example. Imagine a world with two squares which may be clean or dirty, and a vacuum cleaner. The cleaner may move square, suck or do nothing. We could imagine a function that says, “if the current square is dirty suck, otherwise change square”.
This could be plotted on a table:
percept sequence | action |
---|---|
—————- | —— |
[A, clean] | Right |
[A, dirty] | Suck |
[A, clean], [A, clean] | Right |
[A, clean], [A, dirty] | Suck |
And so on…
The obvious question then is, how do we best fill this table? What would make an agent correct, good, bad, intelligent, stupid?
Good Behaviour and Rationality
Good Behaviour
Unlike in philosophy where we find rich notions of doing “the right thing”, AI has stuck to a broadly consequentialist approach. When an agent is put in an environment, it generates a sequence of actions according to the percepts it receives. These actions causes the environment to go through a sequence of states. If the sequence is desirable, the agent has performed well. The notion of desirability is captured in a performance measure that evaluates any given sequence of environment states.
Unlike humans, machines do not have desires or preferences of their own that impact the performance measure. The performance measure comes from their designer. The machine may or may not have an explicit representation of the performance measure available to it.
It can be very hard to formulate a performance measure correctly. EG we might look to maximize the amount of dirt cleaned by the vacuum cleaner. But then it could just clean and dump the same dirt over and over.
As a general rule, it is better to design performance measures according to what one actually wants to be achieved in the environment, rather than according to how one thinks the agent should behave.
p. 57
Rationality
What is rational at a given time depends on:
The performance measure that defines success
The agent’s prior knowledge of the environment
The actions that the agent can perform
The agent’s percept sequence
leading to the definition of the rational agent in the key quotes above.
Take the vacuum example. Is the function mentioned rational? Possibly if the environment is known, within the limits of the vacuum’s actions, and if the performance measure is defined as one point awarded for each clean square at each time step over, say 1000 timesteps.
But what if the performance measure includes a penalty for each unneccessary movement. When the floor is clean the vacuum oscillates between the squares looking for dirt. Then the agent might be better to stop and check periodically whether the squares are still clean.
Note that agents are not omniscient - rationality maximizes expected performance not actual performance. However doing actions in order to modify future percepts - ie information gathering - is an important part of rationality. Exploration is a form of such information gathering.
Their definition also requires that an agent learn as much as possible from what it perceives. As the agent gains experience its initial configuration may be modified and augmented.
To the extent that an agent relies on prior knowledge of its designer rather than its own percepts and learnign process, we say that the agent lacks autonomy. A rational agent should be autonomous. Practically we seldom require complete autonomy from the start. Just as evolution provides animals with enough built-in reflexes to survive long enough to learn, it would be reasonable to provide an AI agent with some initial knowledge and the ability to learn. After sufficient experience, the agent can be come effectively independent of its prior knowledge.
Elsewhere RN discuss the example of a calculator. A calculator can be seen to respond to sensory input in terms of user input, and provide answers to questions. Is it AI? If not what’s missing? This sense of learning, and independence from its designer, seem to be lacking in thinking about the calculator as an AI application.
The Nature of Environments
The chapter presents in detail an introduction to understanding environments. This lengthy discussion has been split to a separate note on Task Environments.
The Structure of Agents
The chapter presents in detail an introduction to how the insides of an agent work. This has been split to a separate note on The Structure of Agents.
Next -> Russell Norvig Chapter 03: Solving Problems by Searching