Contrastive Retrospection: honing in on critical steps for rapid learning and generalization in RL
Chen Sun, Wannan Yang, Thomas Jiralerspong, Dane Malenfant, Benjamin Alsbury-Nealy, Yoshua Bengio, Blake A. Richards
Abstract
In real life, success is often contingent upon multiple critical steps that are distant in time from each other and from the final reward. These critical steps are challenging to identify with traditional reinforcement learning (RL) methods that rely on the Bellman equation for credit assignment. Here, we present a new RL algorithm that uses offline contrastive learning to hone in on these critical steps. This algorithm, which we call Contrastive Retrospection (ConSpec), can be added to any existing RL algorithm. ConSpec learns a set of prototypes for the critical steps in a task by a novel contrastive loss and delivers an intrinsic reward when the current state matches one of the prototypes. The prototypes in ConSpec provide two key benefits for credit assignment: (i) They enable rapid identification of all the critical steps. (ii) They do so in a readily interpretable manner, enabling out-of-distribution generalization when sensory features are altered. Distinct from other contemporary RL approaches to credit assignment, ConSpec takes advantage of the fact that it is easier to retrospectively identify the small set of steps that success is contingent upon (and ignoring other states) than it is to prospectively predict reward at every taken step. ConSpec greatly improves learning in a diverse set of RL tasks. The code is available at the link: https://github.com/sunchipsster1/ConSpec .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 28dc4b3c-3e34-439b-8785-0edf1e38c1faCited by top-tier papers3
- SAMULE: Self-Learning Agents Enhanced by Multi-level ReflectionYubin Ge, Salvatore Romeo, Jason Cai, Monica Sunkara et al.EMNLP 2025
- Action abstractions for amortized samplingOussama Boussif, Léna Néhale Ezzine, Joseph D. Viviano, Michal Koziarski et al.ICLR 2025
- CoPE: A Framework for Optimizing Coordination between Planning and Execution in LLM-based AgentsHuanxi Liu, Kun Hu, Qiang Wang, Yuanzhao Zhai et al.ICML 2026
Builds on7
- Decision Transformer: Reinforcement Learning via Sequence ModelingLili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee et al.NeurIPS 2021 · 2,557 citations
- Leveraging Procedural Generation to Benchmark Reinforcement LearningKarl Cobbe, Christopher Hesse, Jacob Hilton, John SchulmanICML 2020 · 685 citations
- Contrastive Learning as Goal-Conditioned Reinforcement LearningBenjamin Eysenbach, Tianjun Zhang, Sergey Levine, Ruslan SalakhutdinovNeurIPS 2022 · 331 citations
- Learning to Reach Goals via Iterated Supervised LearningDibya Ghosh, Abhishek Gupta, Ashwin Reddy, Justin Fu et al.ICLR 2021 · 222 citations
- What can I do here? A Theory of Affordances in Reinforcement LearningKhimya Khetarpal, Zafarali Ahmed, Gheorghe Comanici, David Abel et al.ICML 2020 · 60 citations
Related papers
- Robust Task Representations for Offline Meta-Reinforcement Learning via Contrastive LearningHaoqi Yuan, Zongqing LuICML 2022 · 53 citations
- ProtoX: Explaining a Reinforcement Learning Agent via PrototypingRonilo J. Ragodos, Tong Wang, Qihang Lin, Xun ZhouNeurIPS 2022 · 13 citations
- Stabilizing Contrastive RL: Techniques for Robotic Goal Reaching from Offline DataChongyi Zheng, Benjamin Eysenbach, Homer Rich Walke, Patrick Yin et al.ICLR 2024 · 16 citations
- Improving Zero-Shot Generalization in Offline Reinforcement Learning using Generalized Similarity FunctionsBogdan Mazoure, Ilya Kostrikov, Ofir Nachum, Jonathan TompsonNeurIPS 2022 · 29 citations
- ContraDiff: Planning Towards High Return States via Contrastive LearningYixiang Shan, Zhengbang Zhu, Ting Long, Qifan Liang et al.ICLR 2025
