Reading 2: How AI Agents "Think"

From simple reflexes to genuine learning — and everything in between.

Not All AI Thinks the Same Way

In Reading 1, we established that AI agents sense their environment and take actions in response. But that description covers an enormous range of systems. A thermostat and a chess-playing program are both agents — but the way they decide what to do could not be more different. To understand AI clearly, we need to distinguish between the different levels at which an agent can operate.

Think of it as a spectrum. At one end: an agent that simply reacts. In the middle: an agent that plans. At the other end: an agent that learns. Most real AI systems sit somewhere along this spectrum, and many combine elements from more than one level. Let us look at each.

Level 1: Reflex Behavior

The simplest kind of agent behavior is a reflex action: a fixed, predetermined response to a particular input. The agent does not plan. It does not weigh options. It simply maps inputs to outputs according to a set of rules that were written in advance.

A thermostat is the classic example. If the temperature drops below the set point, turn on the heat. If it rises above the set point, turn it off. There is no reasoning happening — just a direct connection between a sensed condition and a fixed response.

The earliest spam filters worked the same way. A list of rules was written in advance: if the subject line contains "FREE MONEY" or the body contains more than three exclamation points in a row, route the message to spam. The filter did not think about whether the message was really spam. It just applied the rules.

Reflex agents are fast, reliable, and easy to understand. They are also brittle: they can only handle situations that were anticipated when the rules were written. The moment a spammer learns the rules, they can write messages that evade them. The moment the environment changes in an unexpected way, a reflex agent has no way to adapt.

This brittleness is not a flaw to be fixed — it is a fundamental property of rule-based systems. It is also why more sophisticated approaches to AI exist.

Level 2: Goal-Directed Behavior

A more capable agent does not just react to the current state of the world. It has a goal — a desired end state — and it deliberates about how to reach it. This is goal-directed behavior, and it requires something that reflex behavior does not: the ability to think ahead.

A chess-playing program is the canonical example. At any given moment, there are many legal moves available. A reflex agent might just pick the move that captures the most valuable piece right now. A goal-directed agent considers the consequences of each move, and the consequences of the opponent's likely responses, and so on several moves into the future — selecting the move that best advances the goal of winning.

GPS navigation is goal-directed in a similar way. The destination is the goal. The system does not just take the first available road. It considers possible routes, estimates travel times, and selects the path most likely to reach the destination efficiently. If you miss a turn, it does not give up — it recalculates toward the same goal from the new position.

Goal-directed behavior is significantly more powerful than reflex behavior, but it has a cost: it requires knowing what the goal is, having a model of the environment to reason about, and having enough computational resources to search through possible courses of action. In Topic 6b, we will look carefully at how that search process works.

Level 3: Learning Behavior

The most powerful category of agent behavior is one where the agent's responses improve over time through experience. This is learning behavior, and it is what most people today mean when they talk about modern AI.

A learning agent is not given a complete set of rules in advance. Instead, it is given a way to improve — and it develops its own rules through exposure to data, feedback, or experience. The rules it ends up with may be ones that no human would have thought to write. They may be so complex that no human could fully read them. But they work, because they were shaped by encountering the actual problem many times over.

A modern spam filter does not use a fixed word list. It was trained on millions of emails — some labeled "spam," some labeled "not spam" — and learned patterns from that data that it now applies to new messages. It continues to improve as users mark messages and provide new examples. The rules it uses are not written anywhere a human could read; they are embedded in the structure of a statistical model.

Learning behavior is the foundation of most of what makes modern AI impressive and most of what makes it ethically complicated. We will spend all of Week 7 on the specific techniques that make learning possible. For now, the key distinction to hold on to is this: a learning agent changes based on experience. A reflex agent and a goal-directed agent do not.

Two Kinds of Knowledge

Whether an agent is reflex, goal-directed, or learning, it operates on some kind of knowledge. And it turns out that knowledge comes in two fundamentally different flavors, with a distinction that is worth naming carefully.

Procedural knowledge is knowledge of how to do something. It is the kind of knowledge that lives in muscle memory and practiced skill. A skilled typist knows how to type without being able to describe every finger movement. An experienced driver knows how to parallel park without being able to write an instruction manual. You probably know how to ride a bike — but could you explain to someone, in words only, exactly how to balance?

Declarative knowledge is knowledge of what is true about the world. It is the kind of knowledge that can be written down, looked up, or stated as a fact. Paris is the capital of France. Water boils at 100 degrees Celsius at sea level. The school year ends in June. These are declarative facts — propositions that are either true or false, and that can be stored, retrieved, and reasoned about explicitly.

As a teacher, you use both kinds constantly. You know how to manage a classroom (procedural) and you know the content you are teaching (declarative). What is interesting is that these two kinds of knowledge are acquired differently, stored differently, and used differently — and that turns out to be true for AI systems as well.

The earliest AI systems focused heavily on declarative knowledge: give the computer a large store of facts and rules, and let it reason from them. This approach, sometimes called "expert systems" or "knowledge-based AI," had real successes in the 1970s and 1980s. It also had a fundamental limitation: the world is too complex to fully describe in explicit rules. The procedural knowledge that humans use for perception, language, and physical interaction is notoriously difficult to make declarative. How do you describe, in rules, how to recognize a face? How do you write down the rules for understanding a sentence?

Modern machine learning approaches the problem differently: rather than trying to describe knowledge explicitly, they try to learn it from examples. This shift — from declarative rule-following to learned procedural skill — is one of the most important transitions in the history of the field.

Two Ways to Do AI Research

Before we leave this reading, it is worth naming one more distinction that shapes how AI research is done. The field is pursued along two quite different tracks, and understanding the difference helps make sense of why AI systems are built the way they are.

The first is the engineering track. Researchers on this track are trying to build systems that work — systems that perform well on a specific task. They are performance-oriented: what matters is whether the spam filter catches spam, whether the navigation system finds a good route, whether the medical imaging system identifies the right diagnosis. How it does those things is a means to an end.

The second is the theoretical track. Researchers on this track are trying to understand intelligence itself — human, animal, or machine. They are simulation-oriented: what matters is whether the system sheds light on how intelligence actually works, not whether it performs well on a commercial task.

These two tracks often work together and borrow from each other. But they lead to different priorities. An engineering-track spam filter might use a technique that works brilliantly but that no one fully understands. A theoretical-track researcher might build a system that performs worse on email but teaches us something important about how categorization works.

Most of the AI systems you encounter in your daily life — and most of the AI systems your students will use — come from the engineering track. That does not make them less interesting. But it does mean that "it works" and "we understand how it works" are not the same thing, and the gap between those two things is often where the ethical complications live.

What Comes Next

In Reading 3, we turn to one of the most famous thought experiments in the history of AI: the Turing Test. We will look at what it proposed, why it seemed like a good idea, and what a 1960s program called ELIZA revealed about the limits of using human-like behavior as a measure of intelligence. That story is over sixty years old — and it has never been more relevant.