In this article
Before you start
This page assumes you know what an AI agent is, and have met prompts and fixed-rule agents.
Why interviewers ask this
If you cannot say what makes an agent learn, you cannot explain why one agent gets better with use and another repeats the same mistake. Agent design questions often reach this point once the loop and the tools are drawn: what changes between run one and run fifty, and who decides it is better?
A weak answer says "the agent has memory" or "it learns from data." A strong answer names the feedback loop: something measures outcomes against a standard, something uses that measurement to change behavior, and something keeps trying new things. A Staff-level answer adds that for a large language model (LLM) agent the weights usually stay fixed, so the learning lives in stored text or code, and then names the cost: exploration makes some runs worse on purpose. The agentic AI interview questions page shows where this fits among neighboring questions.
Learning agents from first principles
- Performance element
- The performance element is the part of an agent that selects actions from what the agent perceives. In earlier textbook chapters it was treated as the whole agent. In a learning agent it is one part, and the other parts exist to improve it.
- Critic
- The critic is the part of a learning agent that compares the agent's behavior with a performance standard that sits outside the agent and sends the result to the learning element as feedback, so the agent knows how well it is doing.
- Learning element
- The learning element is the part of a learning agent that takes the critic's feedback and modifies the performance element, so that the agent chooses better actions the next time it faces a similar situation.
- Problem generator
- The problem generator is the part of a learning agent that proposes exploratory actions, which may be worse in the short run, so that the agent gains new experience it can learn from.
In plain words
Picture a chess student with a coach. The coach scores each game against a fixed standard, and the student changes how they play. Sometimes the student tries a new opening, because only new games teach new things.
The analogy breaks in one place: in an agent the standard is written down and sits outside the learner, so the learner cannot quietly lower it.
A percept is one input the agent receives from its environment, such as a sensor reading or a tool result. In one precise sentence, a learning agent is an agent whose percepts feed back into its own action rules, according to lecture notes reproducing the Russell and Norvig model, which say percepts are used "for improving future performance." Russell and Norvig describe four basic agent designs (simple reflex, model-based reflex, goal-based, utility-based) and then show how any of them becomes a learning agent; the intelligent agents page covers the designs. A goal-based agent plans toward a target but does not, by itself, improve its own planner. That is the gap learning fills.
Step 1: The performance element acts
The performance element chooses an action from the current percepts. It is the box earlier chapters called the whole agent. The lecture notes describe it as the agent function considered previously: percepts to actions.
Input: percepts. Output: an action. In a language-model agent this is the model plus its prompt and tools, which together decide the next step. In a taxi example from the lecture notes it is the part that drives the road the agent already knows. On its own it never changes. You now know what is being improved; the next step is how the agent finds out whether it did well.
Step 2: The critic scores the outcome
The critic tells the agent how well it is doing. According to the lecture notes, it compares behavior with an objective performance standard that is outside the agent. That placement matters. If the agent could edit its own standard, it could pass every test by lowering the bar.
Input: what happened. Output: feedback, such as a score, a pass or fail, or a trip time. The same idea appears in reinforcement learning, where reward computation lives in the environment because, in the Sutton and Barto slides, the agent "cannot change it arbitrarily." The critic is therefore not the learner. It is the judge.
Step 3: The learning element changes the performance element
The learning element turns feedback into a change. It takes the critic's verdict and modifies the performance element so that next time the choice is better.
Input: feedback and the current behavior. Output: a modified performance element. Reinforcement learning is the classic version: an agent tries to maximize the total reward it receives while interacting with an uncertain environment, per the publisher description of Sutton and Barto (MIT Press, 1998). Q-learning is one common method: it keeps a table of estimated values for each situation-action pair and updates it from reward.
LLM agents often learn without touching weights. Reflexion converts binary or scalar feedback into a written summary that is added as context for the next attempt. Voyager stores executable code as a growing skill library and uses a language model through black-box queries, which the authors say avoids fine-tuning. Mapping Reflexion's evaluator onto the critic is our analogy; neither paper uses these terms. You now have the loop: act, judge, change.
Step 4: The problem generator proposes new things to try
The problem generator makes the agent try things it would not choose on its own. The lecture notes say it is responsible for generating new experience and that this requires exploration, meaning actions that are sometimes suboptimal. In their taxi example the performance element drives the known road, and the generator says to try another road for a change, because it may be quicker. In the textbook figure the learning element also sends learning goals to the problem generator.
Input: the current best behavior. Output: a deliberate detour. Without this part the agent only ever sees outcomes of what it already believes is best, so a better route it has never tried stays unknown. Voyager's automatic curriculum, which its authors say maximizes exploration, plays a similar role; that mapping is again our analogy. The worked example below puts numbers on this part.
Step-by-step description
- The performance element acts in the environment.
- The critic scores against the outside standard.
- The learning element rewrites the actor.
- The problem generator adds new tries.
- The performance element selects actions in the environment.
- The critic compares behavior with a performance standard outside the agent.
- The learning element uses the feedback to modify the performance element.
- The problem generator proposes exploratory actions that give the agent new experience.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
A taxi has two routes, A and B. All numbers are illustrative. Route A takes 30 minutes and route B takes 24 every time. The taxi believes, correctly, that A takes 30 and, wrongly, that B takes 35. After each trip the learning element moves its estimate for the route driven halfway toward the observed time (a learning rate of 0.5). The taxi drives the route with the lower estimate, except that every fifth trip the problem generator picks the other route.1
Without the generator, the taxi drives A all ten trips: 300 minutes in total. With it, trips 1 to 4 use A, trip 5 is a detour onto B (24 minutes), and the estimate for B falls from 35 to 29.5, below A's 30. Trips 6 to 9 then use B, and the estimate drops to 26.75 and on to 24.34 by trip 9. Trip 10 is another detour, back to A at 30 minutes. The total is 270 minutes.1 A driver who knew the best route from the start would spend 240.1
| Quantity | Value (illustrative) |
|---|---|
| Total time, greedy taxi, 10 trips | 300 minutes |
| Total time, taxi with problem generator | 270 minutes |
| Total time, hindsight best | 240 minutes |
| Minutes lost to hindsight, greedy / with generator | 60 / 30 |
| Estimate for route B after trip 5 | 29.5 minutes |
| Estimate for route B after trip 9 | 24.34 minutes |
| Cost of the detour on trip 10 | 6 minutes |
The greedy taxi never learns anything, because every trip confirms what it already believed. The lesson is in the shape, not the figures: a small, deliberate loss early bought a lasting gain.
Text description of the diagram
- The taxi drives A all ten trips: 300 minutes in total.
- The taxi with a problem generator spends 270 minutes.
- A driver who knew the best route from the start spends 240 minutes.
Trade-offs and edge cases
Exploration trades present performance for future knowledge. The detour on trip 10 above is pure cost if the world has not changed, and pure gain if route times drift. How often to explore depends on how fast the environment changes and how costly a bad trip is.
How the agent learns also differs by design.
Text description of the diagram
- Reinforcement learning updates policy or value estimates from reward.
- Reflexion adds written reflections to the next attempt's context.
- Voyager stores executable code skills in a library and leaves the model unchanged.
Edge cases follow from the loop:
- A wrong critic teaches the wrong lesson. The Sutton and Barto slides say a goal should specify "what we want to achieve, not how." A score that rewards a proxy gets optimized as a proxy. Whether a critic measures the right thing is a design judgment, not something the loop checks for you.
- Gains are task-specific. Reflexion reports 91% pass@1 on the HumanEval coding benchmark against 80% for generative pre-trained transformer (GPT)-4, per its abstract (v4, October 2023). That is one benchmark in the paper's own metric, not a general result.
- Memory grows. Stored reflections and skills add context, and long contexts degrade; see context rot and why agents fail on long tasks.
- Exploration can be unsafe. A detour in a real system can cost money or harm users, so some designs put a person in the loop; see human in the loop AI agents.
Reported practice differs on terminology: some authors reserve "learning" for weight updates, while the sources above also treat reflections and skill libraries as learning. Say which you mean.
How to answer it in an interview
What is a learning agent, and how would you build one on top of a language model?
A learning agent uses feedback to improve how it acts. I describe four parts: a performance element that picks actions, a critic that scores outcomes against a standard outside the agent, a learning element that uses that score to change the performance element, and a problem generator that proposes new things to try. With a language model, the weights usually stay fixed, so I store written reflections or reusable skills. The trade-off is that exploring costs some short-term performance.
The spoken structure: define it in one sentence, name the four parts in order, say what changes in an LLM agent, then give the cost of exploring.
Common mistakes
- "A learning agent means the model gets retrained." (wrong) Reflexion and Voyager improve through reflections and a skill library while the model stays unchanged. (right) "The learning can live in memory, code or a policy, not only in weights."
- "Any agent with memory is a learning agent." (wrong) Memory alone changes nothing. (right) "It is a learning agent when feedback modifies how it chooses actions."
- "The critic is the learning element." (wrong) The critic judges; the learning element changes behavior. (right) "The critic scores against an external standard and the learning element acts on the score."
- "Exploring is a bug, so I always pick the best-known action." (wrong) A greedy agent cannot discover a better option. (right) "I explore on purpose, and I budget what that costs."
Follow-up questions
What are the four components of a learning agent?
The performance element selects actions, the critic judges outcomes against an outside standard, the learning element uses the judgment to modify the performance element, and the problem generator suggests exploratory actions. The lecture notes give these roles.
How is a learning agent different from a goal-based agent?
A goal-based agent chooses actions by asking which one reaches its target, using a fixed method. A learning agent adds a loop that changes that method from experience. A learning agent can have a goal-based performance element inside it.
Does a learning agent have to retrain the model?
No. Reflexion adds text reflections to the next attempt's context, and Voyager stores code skills while querying a fixed model. Weight updates are one option, as in classic reinforcement learning, and not a requirement.
What is the exploration versus exploitation trade-off?
Exploiting means taking the best-known action; exploring means trying something else to learn more. In the taxi example, the detour on trip 5 cost nothing and paid off, while the detour on trip 10 cost 6 minutes of illustrative time.
How do you tell whether an agent is really learning?
Compare runs before and after the feedback on the same tasks, with the standard held fixed, and check that the gain survives new tasks. The page on evaluating agents covers trajectories and reliability, and the AI agent system design guide shows where the loop sits in a full design.
- A learning agent turns feedback into changes in its own action choices.
- Four parts: performance element, critic, learning element, problem generator.
- The critic's standard sits outside the agent, so the agent cannot lower it.
- Without a problem generator, the agent never finds options it has not tried.
- LLM agents often learn through memory or skills while the weights stay fixed.
Sources
- Artificial Intelligence, Topic 6: Agents that Learn (lecture notes after Russell and Norvig) — University of Western Australia, CSSE (undated notes after the 2003 edition; read 2026-10-26), 1 Jan 2003
- Reinforcement Learning: An Introduction, slides on the agent-environment interface — Bryn Mawr College CS380, spring 2011, after Sutton and Barto, 1 Jan 2011
- Reinforcement Learning: An Introduction (publisher description) — MIT Press via Google Books (read 2026-10-26), 1 Jan 1998
- Reflexion: Language Agents with Verbal Reinforcement Learning (arXiv 2303.11366v4) — arXiv (Shinn, Cassano, Berman, Gopinath, Narasimhan, Yao), 10 Oct 2023
- Voyager: An Open-Ended Embodied Agent with Large Language Models (arXiv 2305.16291) — arXiv (Wang et al.), 25 May 2023