Attribution and interpretation of visual decisions
Reinforcement learning (RL) agents learn through trial and error, yet the opacity of their visual decision-making limits critical deployment. Attribution techniques—such as integrated gradients and non-negative matrix factorization (NMF)—combined with diversified training environments allow researchers to diagnose agent biases and improve interpretability in robotics and autonomous systems.
The reinforcement learning (RL) has transformed the automation of complex tasks by allowing agents to learn through trial and error using a reward system. However, one of the major barriers to its deployment remains the lack of transparency: these neural networks often act as ‘black boxes’, especially when dealing with complex visual inputs.
In this article, based on published research from Distill, we explore how attribution techniques and environment diversity enable us to open the black box for analysing, diagnosing, and even correcting the behaviour of RL agents.
In computer vision applied to reinforcement learning, an agent observes an image (for example, a 64 × 64 pixel video game image) and must deduce an optimal action as well as an estimate of its chances of success (the value function).
The attribution (notably via the method of integrated gradients combined with dimensionality reduction through non-negative matrix factorization, or NMF) allows each model decision to be associated with the precise visual elements of the image that motivated it:
- Positive Signals (Good News): Identifying a reward (such as a golden coin in the game CoinRun) increases the agent’s success estimate.
- Negative signals (bad news): The detection of an obstacle (circular saw, enemy, pit) lowers this estimate and prompts the agent to trigger an avoidance maneuver.
Diagnostic of Failures and Hallucinations
Thanks to this real-time visual mapping, it becomes possible to understand precisely why a high-performing model might sometimes fail:
- Chess Analysis: The attribution reveals, for example, that a memoryless agent can collide with a circular saw simply because a moving enemy temporarily obscured it from the screen.
- Detection of hallucinations: Researchers observed sudden peaks in the value function when the agent mistook an element of the scenery for a room, or its own crouching silhouette for a trap.
The diversity hypothesis: the key to interpretability
A major discovery from these works lies in the importance of the variety of training data. By training agents on the game CoinRun, whose levels are procedurally generated, the researchers formulated the diversity hypothesis.
Human-interpretable characteristics only emerge in a neural network if the training environment is sufficiently diversified at this level of abstraction.
- Lack of diversity (overfitting): If an agent trains on a limited set of fixed levels (for example, 100 levels), it memorises visual shortcuts (such as the background colour or elapsed time) rather than understanding the game structure. Its internal representations then become unreadable.
- High diversity (generalisation): By training on tens of thousands of randomly generated levels, the agent is forced to learn general and reusable concepts (detecting platform edges, enemies, rewards), making its artificial brain noticeably more transparent.
Practical applications: from auditing to model editing
Understanding how a RL agent perceives its environment paves the way for practical applications in robotics, in the industry, or in autonomous systems:
(Note: The French text was translated into fluent, natural British English while preserving the original technical terminology and Markdown formatting as instructed.)
- Surgical Editing Validation: The researchers have shown that it is possible to manually modify certain weights in the network to make the agent ‘blind’ to a specific danger (such as circular saws) without affecting its other movement capabilities.
- Security and Debugging: Before deploying an agent in the real world, attribution allows you to verify that it bases its decisions on relevant and secure indicators, rather than biases in correlation present in the simulation.
Cet article est rédigé par Blaise Grenier, Journaliste reporter d'images et auteur. Découvrir le parcours de l'auteur et la charte éditoriale »