Part VI — Seminars · Chapter 16

Towards agent explainability

~45 min read6 interactive widgets

In this chapter

  1. The story of a research question
  2. Artificial intelligence and the paradox of understanding
  3. What is explainability? Two families of enquiry
  4. What do we want XAI for?
  5. How XAI should be: the state of the art and the “Focus!” truth
  6. Agents, interventions and causality
  7. Agent XAI today: theory, practice, and the cynical triangle
  8. How to check if an explanation is good
  9. Explaining an agent: Q-learning
  10. Intention Policy Graphs
  11. Intentions and telic XAI
  12. IPGs in practice: Overcooked, rationality and debugging
  13. Reliability: advantages and limitations
  14. A Ladder of Intentions
  15. Two processes, and future research
  16. Check your understanding
Editor’s note

This chapter is the guest seminar S3 — Towards Agent Explainability, held by doctoral student Víctor Giménez Ábalos (directed by Javier Vázquez Salceda and Sergio Álvarez Napagao, April 2026). It closes the course by turning the lens back on the course itself: everything built so far — BDI agents, RL agents, platforms — must be explainable. The seminar is a research talk, not a lecture: it moves from the general XAI landscape (SHAP, user studies) to a concrete proposal — Intention Policy Graphs and a Ladder of Intentions — for explaining agents by attributing intentions. Where Chapter 13 programmed intentions into agents, this chapter asks what it means to read them back out.

1. The story of a research question

The seminar opens with the evolution of its own title across the years of a PhD: Humility → Epiphany → Frustration → Intervention → Incompleteness. The arc is the research process itself: first humility before a huge field, then the epiphany of a promising idea, then the frustration of its limits, then an intervention — a concrete method — and finally the honest acknowledgment of incompleteness. The presentation is guided by four pillars as a guide to XAI: getting started (context, current XAI, why we should care), interventions & agents, intentions, and reliability.

Read the title trajectory as the seminar’s methodology statement: the speaker is not claiming to have solved explainability, but to have made a sound, bounded contribution — and the chapter will end, accordingly, with future research lines rather than conclusions.

2. Artificial intelligence and the paradox of understanding

The seminar sets the stage with a deflationary definition of the field’s name:

Hence the provocative formulation: the goal of Artificial Intelligence is to be incomprehensible. The paradox is exactly the tension XAI lives in: as systems get better at their tasks, they are perceived as more intelligent — and the less intelligible they become. Chapter 7’s intelligence discussion comes back with a twist: here the perceived intelligence is inversely correlated with understandability, which is why explainability must be engineered, not assumed.

3. What is explainability? Two families of enquiry

Explainability sits at the intersection of many notions: causality, decisions, autonomy, inquiry, communication, human-computer interaction, justification. The seminar’s key move is to locate explainability in the interstice between two families of enquiry:

The two families have deep historical roots: the Aristotelian tradition explains by function, intention, teleology (why something exists, what it is for); the Galilean tradition explains by cause, strict origin, mechanism (how something came to be). The Copernican revolution — roughly, the transition from teleological to mechanistic explanation — is what modern science is built on. XAI inherits both: a user may want a mechanistic answer (“which features drove this output?”) or a teleological one (“what was the agent trying to do?”). Both are legitimate; they answer different questions.

SCIENTIFIC INQUIRY SOCIAL ENQUIRY causality · decisions mechanistic: how did this happen? communication · HCI justificatory: why accept this? Galilean: cause, mechanism Aristotelian: function, intention THE INTERSTICE explainability = causality + decisions + autonomy + inquiry + communication + HCI + justification the Copernican revolution moved science from teleology to mechanism — XAI needs both families.
Plate 16.1 — Explainability in the interstice between two families of enquiry: scientific inquiry (Galilean, mechanistic) and social enquiry (Aristotelian, teleological). XAI answers questions from both.

4. What do we want XAI for?

The seminar surveys the reasons for XAI, following [Adadi et al.]. Three clusters of goals:

Each cluster demands a different kind of explanation: a legal justification, a debugging report, or a lesson. One size does not fit all — and the choice of audience determines what “good” means.

5. How XAI should be: the state of the art and the “Focus!” truth

In the mainstream literature, “interpretability über alles” dominates: feature relevance methods and user studies are the currency of the field [Lipton; Montavon et al.; Winnikof et al.]. The state of the art in XAI for non-agent systems is well stocked:

But how should XAI actually be? The seminar’s answer, attributed to [Arias-Duart, 2022]: “Focus!” Explanations should be:

The four adjectives are a quiet critique: much of the field optimises elaborate techniques and user-study scores while forgetting that an explanation nobody can act on is not an explanation. The “less spoken truth” is that feature-relevance maps, however technically sound, often fail the short/context/understandable test.

6. Agents, interventions and causality

The seminar then asks what is special about explaining agents. The bridge is the classical trio of problems:

  1. correlation does not imply causation;
  2. then what is causation?
  3. what can causation be used for?

The answer to the second question is J. Pearl’s Ladder of Causation: association → intervention → counterfactuals. The key formal distinction is between conditioning and intervening:

P(X|A) ≠ P(X|do(A))

Observing that A happened is not the same as making A happen. Relevance of agency: agents are precisely the entities that perform autonomous interventions — they have freedom of exploration, and the quality of the knowledge they gather depends on how they intervene. This is what makes agent XAI different from static-model XAI: an agent’s behaviour is the product of its interventions in a world it changes, so explaining it requires causal (not merely correlational) vocabulary — Chapter 4’s autonomy, now from the epistemic side.

PEARL’S LADDER OF CAUSATION — why agency matters for XAI 3. COUNTERFACTUALS 2. INTERVENTION 1. ASSOCIATION would X have been different if A had not happened? what happens if I make A happen? seeing A, what do I expect of X? climb climb P(X|A) ≠ P(X|do(A)) observing ≠ intervening agents perform autonomous interventions: freedom of exploration, quality of knowledge — causal, not correlational, vocabulary.
Plate 16.2 — Pearl’s Ladder of Causation and the agent connection. Association (seeing), intervention (making happen), counterfactuals (what-if): P(X|A) ≠ P(X|do(A)), and agents are the entities that intervene.

7. Agent XAI today: theory, practice, and the cynical triangle

How does “theory” look today? Two families of approaches coexist:

And how does practice look today? At most, rule-based explanations of the form: “I do ‘up’ when I am between x=[1,3] and y=[-2,3] and there is no screw at x,y=(1,4)”. Functional, but far from the intentional vocabulary the course has been building.

Why is it like it is today? The seminar offers a (cynical) triangle of incentives:

The result: regulation asks for things that are doable, academia produces things that are impressive but often unusable, and industry uses whatever passes the bar. The seminar’s intervention — the rest of the chapter — tries to break this triangle by grounding explanations in the agent’s actual behaviour.

8. How to check if an explanation is good

How to check whether agent XAI is good? The standard answer is user studies — but the seminar interrogates them:

It is unending work: middle-guys made tons of papers with cherrypicking; users can be deceived or wrong; formal guarantees are not always possible. Two additional currents complicate the picture: LLMs are great! (a user, probably) — large language models as explanation providers; and the question of metrics for reliability — can we measure whether an explanation is truthful, not just liked? This is the gap the seminar’s own work attacks: truthfulness as a measurable property of the explanation relative to the explained policy.

9. Explaining an agent: Q-learning

To make the problem concrete, the seminar picks a minimal architecture: Q-learning.

Then comes the gutpunch: now you know Q-learning. You can ‘ask’ XAI about this model’s particular decision, study how Q is created, or why this action was taken then. You can measure XAI across 20 metrics, and run 50 user studies in 30 use-cases. What about the 300 other, equally valid architectures? And… what about people that don’t work on AI? Explaining one architecture in depth does not scale: the field needs methods that work for any architecture — including humans — and that produce explanations non-experts can use.

10. Intention Policy Graphs

The seminar’s intervention builds on policy graphs:

The original Hayes explanations are three algorithms, each answering one question:

  1. What will you do when you are in state X? → “If I am in state X, I will perform action A” (or with probabilities: “… action A with probability pA, … or action B with probability pB”);
  2. When do you perform action X? → “I will perform action A in states S1, S2, … or Sn”;
  3. Why did you not perform action X in state Y? → “In state S, I would choose action A1. However, I would rather choose A2 if, instead, predicate p1 had value v1, … and pn had value vn”.

These are the basic explainable units: single-action statements, action-location statements, and counterfactual conditions. The IPG extends the graph’s edges so that intentions can be read out of them — the topic of the next section.

s1 s2 s3 s4 P(s′|a,s) P(s′|a,s) P(a|s) P(a|s) self-loop 1. what will you do in state X? · 2. when do you perform action X? · 3. why did you not perform action X in state Y? states (discrete) · actions · edges P(s′|a,s), P(a|s) — purely model agnostic [Hayes et al.; Climent et al.; Gimenez-Abalos et al.].
Plate 16.3 — A policy graph: discrete states and actions with transition and action probabilities on the edges. Hayes’ three explanation algorithms answer three questions about the policy the graph represents.

11. Intentions and telic XAI

Before adding intentions to graphs, the seminar asks whether it is safe: ALARM: INTENTIONS! Is it ‘safe’ to say a code has an intention? When is it ‘safe’? Will people misunderstand and think machines are conscious?

The philosophical grounding is telic XAI: artificial things can be characterised in terms of functions, goals, adaptation [Malle et al.; Saxe et al.; Simon]. The classic example:

Why did you fill the pot with water?
• I filled the pot with water because it was empty, and because the hob was free, and because there is no fire alarm going on.
• I filled the pot with water because I need boiling water, I intend to boil pasta, I am cooking pasta carbonara.

The first answer is mechanistic (Galilean): a conjunction of enabling conditions. The second is teleological (Aristotelian): an intention chain — boiling water serves cooking pasta, which serves eating carbonara. Both are true; they answer different questions. The seminar asks: are we OK to say a DL model has intentions? ‘Why that policy?’

How it looks for IPGs: teleology. Given a policy graph, the IPG supports teleological readings:

Intentions formalised. The procedure is explicit:

  1. attributing a desire d;
  2. suppose the agent ‘believes’ PPG(s′|a,s);
  3. suppose the agent acts PPG(a|s) — if the agent ‘desires’ d, then it will ‘act’ with the intention of achieving it: (existing) desires condition action choice;
  4. compute Id(s) = P(d|s);
  5. cut off ‘low’ (below threshold) Id to avoid attributing unfeasible or unlikely intentions.

The result is a probabilistic, testable notion of intention: an intention is not asserted but attributed with a degree, and the attribution is anchored to the graph’s empirical probabilities — not to any claim about consciousness. Safety is engineered by the threshold: only intentions that the behaviour actually supports are attributed.

FORMALISING INTENTIONS — attribution with a degree, anchored to empirical probabilities 1. DESIRE d 2. BELIEFS 3. ACTION 4. I_d(s) hypothesise P(s′|a,s) P(a|s) = P(d|s) 5. CUT OFF low I_d below threshold avoid attributing unfeasible or unlikely intentions threshold example (Overcooked): desire to SERVE SOUP = 0.625 · INTERACT expected to increase intention by 0.05 plan: INTERACT → DOWN → RIGHT → DOWN → INTERACT — intentions are read out of the graph, not asserted. safety: probabilistic attribution with threshold — no claim about consciousness [Malle et al.; Saxe et al.; Simon].
Plate 16.4 — The intention attribution procedure. Hypothesise a desire, read beliefs and action probabilities from the graph, compute Id(s) = P(d|s), and cut off low values below a threshold: intentions are attributed with a degree, anchored to empirical behaviour.

12. IPGs in practice: Overcooked, rationality and debugging

The evaluation domain is Overcooked (the cooperative cooking game), where the agent’s desire is delivering soup. The questions the IPG answers empirically:

Rationality & XAI. The IPG also supports normative readings: between best performance and random performance (0 reward), behaviour that neither pursues a desire nor matches the environment’s affordances is irrational — and irrationality is where debugging begins.

Debugging & XAI. Locating irrational behaviour means:

Explainability and debugging merge: a faithful explanation of an agent’s intentions is also a diagnosis of its failures — Chapter 13’s “explainability = rationality” idea, applied.

13. Reliability: advantages and limitations

The seminar closes the IPG part with an honest balance sheet. Advantages:

Limitations:

The limitations are the honest boundaries of the intervention — and they motivate the final, more ambitious framework: the Ladder of Intentions.

14. A Ladder of Intentions

The final framework is a unifying model of behaviour explanation. Why is a unifying model important? Because otherwise every question multiplies:

The Ladder of Intentions is a holistic, universal taxonomy of behaviour, intention-centric, spanning praxia vs gnosia (acting vs knowing) and declarative vs imperative knowledge. It applies to BDI, RL, LLM-agents, custom code… and it decouples how to make interpretable XAI from truthful & feasible XAI.

Key idea. The ladder answers recursively: Why π? Reasons(π). Then… why Reason(π)? Reasons(Reason(π)). And so on… The agent can be ‘summarised’ into π; splitting it to see its causes makes it more understandable.

The levels, reification, robustness. Splitting into levels separates statements (S) from code (I) using them:

Folk-psychology grounding. The ladder’s rungs map onto ordinary explanation:

Why go right? Because [there is a wall on top] and [it’s the best action] — Belief.
Why is it the best? Because [] [I am exploring random actions] — Desire.
Why are you exploring random actions? Because [I have an estimator of when it’s better to exploit my knowledge vs explore] [and I use it to decide to explore now] — IPG is here.
Why do you use a value to decide to explore or exploit? Because [that’s the intent of my creator] — the top of the ladder.

Ladder learning. Learning a statement si implies learning something about si-1, ii-2. Statements can be given a priori, or learnt by experiencing the lower level; an agent could be designed to climb the ladder.

The 3 kinds of questions. The ladder organises XAI questions by their target rung:

Level 2 formalisation (general S2). The general idea is to establish an action preference / deliberation mechanism over action preference; the bottom can reduce to the top. From easiest (least informative) to hardest (most expressive):

LADDER OF INTENTIONS — statements (S) above code (I); questions target different rungs S2 — STATEMENTS: consequences, utility, reification of lower levels I2 / IPG — policy graph: actions, percepts, P(s′|a,s), P(a|s) S1 / I1 — beliefs and desires: folk-psychology rungs s2 = Consequence of [i0] in [s1] is [s1] · confidence in transitions, preferences the graph is the empirical substrate: frequentism ↔ epistemic soundness belief: wall on top · desire: exploring random actions · intent of my creator INTENTIONAL WEAKLY EPISTEMIC STRONGLY EPISTEMIC I to I · climbs up I_i to S_i+1 S to S, I lower decouples interpretable XAI from truthful & feasible XAI — applies to BDI, RL, LLM-agents, custom code.
Plate 16.5 — The Ladder of Intentions. Statements (S) sit above the code (I) that realises them; the IPG is the empirical substrate; the three kinds of XAI questions target different rungs — intentional, weakly epistemic, strongly epistemic.

15. Two processes, and future research

The seminar concludes by separating two roles in the XAI supply chain:

The two processes are the division of labour behind the ladder: Process 2 specifies what explanations should satisfy; Process 1 builds formalisations that can satisfy them, with reliability benchmarks. The deck’s closing slide lists future research lines: IIPGs (adding interventions); Deep IPGs (from Overcooked to Chess); Pgeon 2.0 (bringing XAI to industry via a good repository); truthfulness & benchmarking reliability; mind the gap (from technical to law and back); Red XAI (explainability = rationality); empowerment and higher-order empowerment; level formalisations; ladder extensions; the climbable ladder; the XAI inversion (AI for X, not X for AI); the XAg inversion (explain AI as agents).

And, in the speaker’s group: virtuous agents for modelling waste-water management and policy impact; curiosity-driven agents and transfer learning; LLM-based explanations (are they good? not generally — are there good use cases?); abduction-driven agents; IPG applications to LLMs, humans, and complex use-cases; empowerment research; evaluating LLMs critically (do they really reason or plan?); benchmarking XAI; and two Horizon projects on Agentic AI with focus on XAI.

Key idea

Explainability lives in the interstice between scientific inquiry (Galilean, mechanistic) and social enquiry (Aristotelian, teleological): P(X|A) ≠ P(X|do(A)), and agents — autonomous interveners — need causal, intentional vocabulary. The seminar’s intervention: Intention Policy Graphs, purely model-agnostic graphs of states, actions and probabilities, from which intentions are attributed with a degree (Id(s) = P(d|s), thresholded); and the Ladder of Intentions, a unifying taxonomy separating statements from code, with three kinds of questions (intentional, weakly/strongly epistemic). For the exams: XAI for agents is about truthfulness — an explanation must be faithful to the policy it explains, measurable, and attributable without claims of consciousness.

Check your understanding

What is the paradox of AI understanding stated at the beginning of the seminar?

Artificial = things synthesised by humans, characterisable in terms of functions and goals; intelligence = hard to define. Things that are hard to understand appear more intelligent, and understanding how something works makes its intelligence appear to vanish. Hence: the goal of AI is to be incomprehensible — the tension XAI lives in.

What are the two families of enquiry in which explainability sits?

Scientific inquiry (causality, decisions, autonomy; mechanistic — how did this happen?) and social enquiry (communication, HCI, justification; teleological — why accept this?). They map onto the Aristotelian tradition (function, intention, teleology) and the Galilean tradition (cause, strict origin, mechanism), separated by the Copernican revolution. XAI needs both.

What do we want XAI for, following Adadi et al.?

For humans & law (the most prevalent: accountability), for machines & humans (bias control; the model learns from it), and for machines & humans (others learn from the model). Each cluster demands a different kind of explanation.

What is the state of the art in XAI for non-agent systems, and what is the 'Focus!' truth?

SHAP (Shapley-value feature attribution), coefficients for linear models, 'counterfactuals' (closest similar instance of another class), saliency/attention maps. The 'less spoken truth' [Arias-Duart, 2022]: explanations should be short, true, given in context, and understandable — feature-relevance maps often fail that test.

Why is causality central to agent XAI? State Pearl's ladder and the key formula.

Correlation does not imply causation; Pearl's Ladder of Causation orders association, intervention, counterfactuals; the key distinction is P(X|A) ≠ P(X|do(A)) — observing is not intervening. Agents are precisely autonomous interveners (freedom of exploration, quality of knowledge), so explaining them requires causal vocabulary.

Describe the cynical triangle of XAI incentives.

The European commission must make XAI laws (wants general, system-agnostic, doable definitions); academia must research more XAI techniques (hard to implement, model-dependent, advanced definitions — which justifies papers); industry must justify projects to capitalistic stakeholders (anything that fulfils the demands works — SHAP/LIME works, who cares about correlation/causation?).

What are the problems with user studies as the gold standard for XAI evaluation?

Who makes the study, with whom, which users and background; which model and method are explained, in what context; which metrics, how much noise. Users can be deceived or wrong; formal guarantees are not always possible; cherrypicking is common; LLMs as explanation providers complicate the picture. The seminar calls for metrics for reliability — truthfulness as a measurable property.

Describe Q-learning in the seminar's minimal example, and the 'gutpunch'.

The agent acts by argmax_a Q(s,a); Q is learnt from states, actions and rewards; you cannot learn Q while only exploiting — you must explore (multiple modes: exploring/exploiting; when exploring, pick actions randomly) or you converge to local minima. The gutpunch: after explaining this one architecture across 20 metrics and 50 user studies, what about the 300 other equally valid architectures, and people who do not work on AI?

What is a policy graph, and what are Hayes' three explanation algorithms?

A graph over discrete states and actions with edges P(s′|a,s) and P(a|s), purely model agnostic. Hayes' three algorithms answer: (1) what will you do when you are in state X? ('I will perform action A', possibly with probabilities); (2) when do you perform action X? ('I will perform action A in states S1...Sn'); (3) why did you not perform action X in state Y? (counterfactual: 'I would rather choose A2 if predicate p1 had value v1...').

What is the IPG, and how does it add intentions to policy graphs?

The Intention Policy Graph [Gimenez-Abalos et al.] extends policy graphs (states, actions, P(s′|a,s), P(a|s)) so intentions can be read out teleologically: what does it intend (Desire to SERVE SOUP: 0.625), why would it interact (intention expected to increase by 0.05), how would it fulfil its desire (a plan over the graph). It is purely model agnostic and grounded in observed frequencies (frequentism ↔ epistemic soundness).

Give the five-step formalisation of intentions and the safety mechanism.

(1) Attributing a desire d; (2) suppose the agent 'believes' P_PG(s′|a,s); (3) suppose the agent acts P_PG(a|s) — desires condition action choice; (4) compute I_d(s) = P(d|s); (5) cut off 'low' I_d below a threshold to avoid attributing unfeasible or unlikely intentions. Safety: probabilistic attribution anchored to behaviour, no claim about consciousness.

How are intentions used for rationality analysis and debugging?

Between best performance and random performance (0 reward), irrational behaviour is located: agents not doing any desire; desires not matching agent behaviour; affordances vs rationality; locating irrational contexts (e.g. unseen plates). Explainability merges with debugging: faithful explanations are also diagnoses.

What are the advantages and limitations of IPGs?

Advantages: simple & intuitive; multiple applications; public repository; applicable to any architecture including humans; frequentism is epistemically sound. Limitations: finding desires is hard; continuous/complex domains with sparsity vs efficiency; no desire prioritisation, values, virtues; no answers about actions never done (interventionism); no higher-order causes; ignores transparent model information; ignores why the agent believes P(s′|a,s).

What is the Ladder of Intentions and what does it decouple?

A holistic, universal taxonomy of behaviour, intention-centric, spanning praxia vs gnosia and declarative vs imperative; applies to BDI, RL, LLM-agents, custom code. It splits behaviour into levels separating statements (S) from code (I) using them (statement reification: s2 = Consequence of [i0] in [s1] is [s1]), and it decouples how to make interpretable XAI from truthful & feasible XAI. Key idea: why π? Reasons(π); why Reasons(π)? … recursively.

What are the 3 kinds of XAI questions in the ladder?

Intentional (I to I): goal oriented, climbs up, concise but not comprehensive ('Why up? Because I am going to the pot'). Weakly epistemic (I_i to S_i+1): declarative relevance supporting a way of acting, bounded rationality ('In this state, the pot is above me'); how S came to be remains unclear. Strongly epistemic (S to S, I lower): learning explanations ('I have experienced that going up decreases my distance to the pot'); aggregates tons of data, often unfeasible.

Describe the two processes in the XAI supply chain.

Process 1 (agent expert, technical XAI): deeply understands the architecture, conceives mechanisms to model the agent in the formalisations S demanded by Process 2, provides reliability benchmarks, unconcerned with use-cases. Process 2 (sociologist): studies desiderata from explanations, demands intermediate formalisations and the 3 queries, builds explanations from S (even before an architecture implements it), runs user studies, unconcerned with the substrate of agency.