Intelligent Agents

Agents

\text{Agent} = \text{Architecture} + \text{Program}

Agent: Anything that can perceive its environment through sensors and acting upon the environment through actuators.11. This is a very broad definition that encompasses simple thermostats and complex self-driving cars.

Example: Agent Types

Terms

Percept: The agent’s perceptual inputs

Percept Sequence: The complete history of everything the agent has perceived

Agent Function: Maps any given percept sequence to an action [f: P^* \to A]22. P^* represents the set of all possible percept sequences.

Performance Measure: Objective criterion for success of an agent’s behavior

Rationality

An agent should “do the right thing” based on what it can perceive and currently do.

Example: Robovac

Which performance measure is better for a robovac?

  1. +1 score for every dirt cleaned within a time unit, or
  2. +1 score for each clean square per time unit

The former measure would reward a robovac that sucks \to dumps \to sucks just to farm points!

Rational Agent

For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure.

Aside: On Omniscience, Learning, and Autonomy

Rationality isn’t omniscience; there is a difference between expected and actual performance. Agents are autonomous if their behavior is determined by experience (they can learn and adapt).

Environmental Properties

PEAS

Performance, Environment, Actuators, Sensors44. Structuring the problem via PEAS prevents feature creep when designing an AI system.

Note — Specifying the task environment is always the first step in designing an agent.

Example: Applying PEAS to an Automated Taxi
Performance Measure Environment Actuators Sensors
safe, fast, legal, comfortably trip, maximize profits roads, other traffic, pedestrians, customers steering, accelerator, brake, signal, horn, display camera, sonar, speedometer, GPS, odometer, engine sensors, keyboard, accelerator

Properties of Task Environments

(Parenthesized text is what the real-world environment tends to be)

Agent = Architecture + Program

Agent Program v.s. Agent Function

Input
Agent Program Takes current percept as input (nothing is available from the environment)
Agent Function Takes the entire percept history (has memory of all percepts)

Table-Driven Agent

Construct a table that contains the appropriate action for every possible percept sequence.

Why? — Drawbacks: Huge table, long time to construct, no autonomy, takes too long to learn.66. For a game like chess, the table would have more entries than atoms in the universe.

Five Basic Agent Types

(Arranged in order of increasing generality)

1. Simple Reflex Agents

Simply maps “what the world is like now” \to “what action should I do now”.

function SIMPLE-REFLEX-AGENT(percept) returns action
    static: rules // A set of condition-action rules
    state \leftarrow INTERPRET-INPUT(percept)
    rule \leftarrow RULE-MATCH(state, rules)
    action \leftarrow RULE-ACTION[rule]
    return action

2. Model-based Reflex Agents

Maintains internal state to track parts of the world it can’t see now. Uses State, How the world evolves, and What actions do to understand the world.

function REFLEX-AGENT-WITH-STATE(percept) returns action
    static: state, rules, action
    state \leftarrow UPDATE-STATE(state, action, percept)
    rule \leftarrow RULE-MATCH(state, rules)
    action \leftarrow RULE-ACTION[rule]
    return action

3. Goal-based Agents

Maps “What the world is like now” \to “what it will be like if I do action A” \to “what action should I do now” based on pursuing a specific goal.

4. Utility-based Agents

Maps states onto a degree of happiness (utility function) to handle multiple or conflicting goals (e.g., speed vs. safety).

5. Learning Agents

Agents that can operate in initially unknown environments and become more competent.77. Learning agents aren’t really a 5th separate category; you can have a learning utility-based agent, a learning reflex agent, etc. They have four components:

  1. Performance Element: The “agent” part that chooses actions.
  2. Learning Element: Responsible for making improvements.
  3. Critic: Evaluates how well the agent is doing against a fixed performance standard.
  4. Problem Generator: Suggests actions that will lead to new, informative experiences (exploration).

  1. This is a very broad definition that encompasses simple thermostats and complex self-driving cars.↩︎

  2. P^* represents the set of all possible percept sequences.↩︎

  3. Designing the right performance measure is notoriously difficult—this is known as the “alignment problem” in modern AI safety.↩︎

  4. Structuring the problem via PEAS prevents feature creep when designing an AI system.↩︎

  5. Episodic environments are much easier to solve because the agent doesn’t need to think ahead.↩︎

  6. For a game like chess, the table would have more entries than atoms in the universe.↩︎

  7. Learning agents aren’t really a 5th separate category; you can have a learning utility-based agent, a learning reflex agent, etc.↩︎