How Model-Based Agents Track Their World

UPI Study › Courses › Introduction to Artificial Intelligence › Free lessons › Lesson 2.6 Free with a free account

How Model-Based Agents Track Their World

Introduction to Artificial Intelligence · Chapter 2: Intelligence, Cognition, and Agent DesignSection 2.6 · lesson 14 of 6910 min · free with a free account

← Reactive Agents: Condition-Action ResponsesNext lesson: Agents That Plan Toward Objectives →

Earn 3 college credits for Introduction to Artificial IntelligenceRecommended for credit by NCCRS · Computer Science 373 · self-paced · one payment, lifetime access

In this lesson

How model-based agents keep an internal state of a partly hidden world.

  • Explain why partially observable environments require an internal state
  • Distinguish the transition model from the sensor model
  • Apply the predict, observe, correct cycle to update an agent's state
  • Track a set of possible states from a sequence of actions and percepts

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,501 words). Read along, or search it.

Opening Scene

A Car in Your Blind Spot

You're driving, and a car passes you on the left. For a few seconds it slides into your blind spot, and no mirror shows it. You don't decide the car has vanished. You keep a picture in your head: it's still there, a little farther along than where you last saw it. That picture comes from what you saw earlier, and what you know about how cars move. So how can an agent keep track of what it can't see?

Partial Observability

Acting on What Cannot Be Seen

Real environments rarely show everything at once. A camera points one way, walls block the view, and some facts, like what's behind a closed door, can't be sensed at all. When an agent can't observe every relevant part of its world at every moment, the environment is partially observable. An agent that acts on the current percept alone treats anything it can't sense right now, as if it doesn't exist. With empty-looking mirrors, it changes lanes. A model-based agent acts on the percept plus a stored picture of the world. It waits, because it knows a car was just there.

Internal State

The Agent's Best Description of Now

That stored picture is the internal state: the information an agent keeps about the world between percepts. It's the agent's best current description of what the world is like now, including the parts it can't see. For a robot vacuum, it can hold four kinds of things. Things seen earlier, like a chair spotted in the hallway. Its own actions, like which rooms are already cleaned. Changes that happen on their own, like a pet that has wandered into another room. And the agent's own condition: I'm in the kitchen, with 40 percent charge.

Two Cautions

A Best Guess Holding Only What Matters

Two cautions apply to every internal state. First, it's a best guess, not a fact. The agent never sees the whole world, so its picture can be wrong, and a good design lets it be corrected. Second, it holds only what decisions need. A vacuum robot has no reason to store the color of the sofa. A small, focused state is easier to keep accurate.

Agent Structure

Where the State Sits Inside the Agent

Here's where the state sits inside the agent. At each time step, a percept arrives from the environment. The update step combines it with the previous state, the last action, and the agent's models of the world. The result is the current state. If-then rules then choose an action from that state, not from the raw percept. And the new state and the action are remembered for the next update.

Two Models

Transition Model and Sensor Model

To update its state, the agent needs knowledge of how its world behaves: models. A model-based agent keeps two. The transition model answers: how does the world change? Given the world now, and what the agent does, it says what the world will be like next. It covers changes the agent causes, like turning the wheel to move left, and changes that happen on their own, like a passing car that keeps moving ahead. The sensor model answers: how does the world show up in my percepts? It says what the sensors will report, including blind spots, and how reliable the readings are.

Model Sources

Written, Learned, or Both

Models can be written by designers, learned from data, or built from both. Either way, they're simplifications, so they're never perfect. In realistic settings they often include uncertainty, like: the robot usually moves about one meter. Probability tools for that come in later chapters.

Quick Check

A Drone Climbing in Thin Air

Quick check. A drone's software assumes each climb command raises it two meters. In thin mountain air, it really rises only one and a half. Its altitude estimate keeps drifting upward from the truth. Which part of the drone's knowledge is wrong? Pause, and decide. The transition model. It describes how the world changes after an action, and it says each climb adds two meters. That's what's off. The sensor model is tempting, because the estimate is wrong. But nothing here is misread. The prediction itself is too big, so the state drifts. A sensor model error looks different, like sun glare being mistaken for an obstacle. Good percepts, such as an altimeter reading, can correct the drift.

Update Cycle

Predict, Observe, Correct, Act

The state isn't built once. It's updated at every time step, with a simple rhythm: predict, then correct. Predict: apply the transition model to the previous state and the last action. That gives what the world should be like now, even before the agent looks. Observe: a new percept arrives. Correct: compare it with the prediction, using the sensor model. Keep what fits the percept, and drop or revise what doesn't. Act: the rules choose an action from the corrected state. And that action feeds the next prediction.

When Things Disagree

Four Prediction and Percept Situations

Predictions and percepts don't always agree. If they agree, the models are working, so keep the state, with more confidence. If the percept shows something unexpected, the world changed, or the model missed something. Trust a reliable percept for what it covers, and revise the state. If there's no useful percept, because the view is blocked, rely on the prediction, and accept that doubt grows with time. And if the percept fits none of the possibilities, the model or the sensor is probably wrong. Widen or reset the state, then investigate.

State Forms

Best Guess, Possibility Set, or Probabilities

The state itself can be written down in different ways. A single best guess, like: I'm in cell C. Simple and fast, but it can't express doubt. A set of possibilities, like: I'm in B, C or D. That shows doubt, without numbers. Or probabilities, like: sixty percent C, forty percent D. That handles noisy sensors best, but needs probability tools from later lessons.

Worked Example

Locating a Robot With a Bump Sensor

Now a worked case. A small robot sits in a straight corridor of four cells: A, B, C and D. It doesn't know which cell it started in. It has one action, Right, which moves it one cell. And one sensor: a bump sensor that reports bump when a move is blocked by the end wall. The transition model: Right moves A to B, B to C, and C to D. From D, the wall blocks it, so it stays in D. The sensor model: no bump for A, B or C. A bump only from D. The robot keeps its state as a set of possible cells. At the start, with no information, all four are possible. Move one. Each cell leads to the next, and D would bump. The sensor says no bump, so drop D's outcome. The state is B, C or D. Move two: no bump again. Now it's C or D. Move three: bump. Only the outcome from D bumps, so the state is just D.

What It Shows

Models Plus Percepts Reveal Position

Notice what happened. The bump sensor says nothing about cells A, B or C, yet the robot found its position. It came from combining both models with the sequence of percepts. An agent using only the current percept couldn't do this. Each no bump, taken alone, fits almost any cell. And an empty set is a warning. Suppose the robot believes it's in D, moves right, and gets no bump. No cell fits. Either the sensor failed, or the corridor model is wrong. So widen the state, and investigate.

Quick Check

Two Moves in a Five-Cell Corridor

Quick check. A longer corridor has five cells, A through E, with the wall after E. The robot doesn't know where it starts. It moves right twice, and gets no bump both times. What's its state now? Pause, and decide. C, D or E. After the first move, the robot can't be in A, so the state is B through E. After the second, it can't be in B either, so it's C, D or E. E is still possible, because a robot that started in C would be there now. Just E is tempting, but no bump never pins down the end. Only a bump would.

Bringing It Together

Tracking the Picture, Not Yet Planning

Back to the car in your blind spot. Your internal state holds the car. Your transition model says it keeps moving ahead. And your sensor model knows the blind spot gives no percept. So you predict where it is, and correct the moment it reappears in the mirror. Notice what the agent hasn't done: chosen a route, or aimed for a destination. It has only kept an accurate picture. Using that picture to reach goals is a different job: planning.

Key Takeaways

State, Models, and Predict-Correct

To sum up. Agents that see only part of their world keep an internal state, a best guess that includes what they can't see right now. The transition model says how the world changes. The sensor model says how the world shows up in percepts. At every step, the agent predicts with the transition model, and corrects with the new percept and the sensor model. Models plus a sequence of percepts can reveal facts no single percept shows. And when nothing fits, check the models and the sensors.

Reflection

A Simmering Pot in Another Room

Here's something to think about. A pot is simmering in the kitchen while you're in another room. What picture of it do you keep in your head? What do you know about pots, that updates it? And what percept, a smell or a sound, would make you change it?

About Introduction to Artificial Intelligence at UPI Study

Introduction to Artificial Intelligence (Computer Science 373) is a self-paced online course of 69 video lessons in 9 chapters, from intelligent agents and search to game strategy, neural networks, logic and reasoning, machine learning, language, robotics and AI ethics. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: AI vs Current Trends in CS and IT

Why take it here

Why students take Introduction to Artificial Intelligence with UPI Study

How machines search, reason and learnIntroduction to Artificial Intelligence covers how AI systems are built: intelligent agents, search and heuristics, game strategy, logic, neural networks, machine learning, language and perception, and the ethics of AI. It is a common upper-level course in computer science degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Introduction to Artificial Intelligence carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About How Model-Based Agents Track Their World

What is a model-based reflex agent?
A model-based agent acts on its current percept plus an internal state, a stored best guess about the world that includes parts it cannot sense right now. It keeps that state up to date using a transition model and a sensor model, then chooses actions with if-then rules applied to the state rather than the raw percept. A driver who keeps track of a car in the blind spot is acting this way.
What is the difference between a transition model and a sensor model?
A transition model describes how the world changes, both from the agent's actions and on its own, while a sensor model describes how the world shows up in the agent's percepts, including blind spots and how reliable readings are. If a drone assumes each climb command raises it two meters but it really rises one and a half, its transition model is wrong, and its altitude estimate drifts upward.
How does a model-based agent update its internal state?
It follows a predict-then-correct rhythm at every time step. First it predicts the current state by applying the transition model to the previous state and the last action. Then a new percept arrives, and the agent corrects its prediction by comparing it with that percept using the sensor model. Rules choose an action from the corrected state, and that action feeds the next prediction.
How can an agent find facts that no single percept shows?
By combining its models with a sequence of percepts. A robot in a four-cell corridor with only a bump sensor, starting from an unknown cell, moves right and gets no bump, so it rules out one possibility. Each further no-bump reading narrows the set, and a bump after the third move tells it that it must be in the last cell. If no cell fits, the models or sensors need checking.

About the Introduction to Artificial Intelligence course

How many college credits is Introduction to Artificial Intelligence?
Introduction to Artificial Intelligence (Computer Science 373) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Artificial Intelligence cost and what is included?
$250, paid once, with lifetime access: all 69 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Artificial Intelligence take?
It is self-paced with no deadlines. The 69 lessons total about 16 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Introduction to Artificial Intelligence.

69 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Introduction to Artificial Intelligence
3 credits · NCCRS
Enroll →