Routed Continual Learning
Organizations: FAIR at Meta
Abstract
Agents deployed at scale repeatedly encounter related problems, and it is natural to let them learn from each other's experience rather than starting over each time. Unfortunately, there is no single way to retain that experience that works well across settings, and no way to know in advance which future problems a given experience will help with. A global history preserves every detail but becomes expensive and mixes together experience that may not belong together; compressing that history into one fixed representation limits the cost but can throw away valuable details. We introduce Routed Continual Learning (Routed CL), an architecture that decides how to partition and retain experience. Past trajectories are grouped into clusters, each of which maintains state using one memory system from a fixed library. Before each run, an LLM-based router either reuses an existing cluster or creates a new one, basing its decision on the problem statement, memory system descriptions, and cluster summaries. We also introduce Context Memory Adapter, which mediates between the memory system and the agentic loop. We evaluate the architecture on a heterogeneous stream that interleaves 301 instances from the six CL-Bench tasks with 97 banking instances from -Bench. Across four language models and five matched rollouts, Routed Continual Learning raises normalized reward over a single global in-context learning (ICL) history by 15-30% of the maximum attainable normalized reward, achieves higher mean normalized reward than ICL-only clustering, and reduces estimated API cost by 65-72% relative to Global ICL. These results support approaching continual learning as a routing problem that chooses both a learning mechanism and a state cluster rather than committing to one representation globally.
Figures & tables
| Model | Stateless ICL | Global ICL | Routed ICL | Routed CL | Ground-truth assignment |
|---|---|---|---|---|---|
| Gemini 3.7 Flash | 0.211 | 0.213 | 0.284 | ||
| GPT-5.6 Sol | 0.130 | 0.168 | 0.387 | 0.464 | 0.478 |
| Opus 4.7 | 0.060 | 0.092 | 0.209 | 0.243 | 0.312 |
| Opus 5 | 0.178 | 0.169 | 0.340 | 0.401 | 0.408 |
| Memory system | Retained state and observation structure |
|---|---|
| Retained trajectories | |
| In-context Learning (ICL) | Ordered visible trajectories |
| Distilled reasoning memory | |
| ReasoningBank (RB) | Strategies induced from self-judged successful and failed trajectories |
| Structured numerical state | |
| Hierarchical Regression (HR) | Repeated keyed scalar outcomes |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Instances | Instance objective | Reusable cross-instance information |
|---|---|---|---|
| Codebase Adaptation | 19 | Resolve repository issues under a command budget | Repository structure, test workflows, and contributor conventions |
| Cohort Studies | 20 | Estimate event-free curves for 36 population cohorts | Population structure across partially observed and differently sampled studies |
| Database Exploration | 40 | Answer database questions using limited SQL queries | Schema, joins, encodings, and migration-induced changes |
| Exploitable Poker | 120 | Maximize profit over independent poker hands | Opponent behavior and changes in strategy |
| Sales Prediction | 12 | Forecast five years of product–location demand | Shared growth, product and location effects, and forecast calibration |
| Blind Spectrum Monitoring | 90 | Infer long-run transmitter occupancy from noisy scans | Persistent transmitters observed intermittently across scans |
| Model | Global ICL | Routed ICL | Routed CL | Ground-truth assignment |
|---|---|---|---|---|
| Gemini 3.7 Flash | 0.019 | 0.229 | 0.265 | 0.313 |
| GPT-5.6 Sol | 0.043 | 0.307 | 0.381 | 0.401 |
| Opus 4.7 | 0.028 | 0.159 | 0.207 | 0.273 |
| Opus 5 | 0.193 | 0.265 | 0.270 |
| Model | Routed CL Routed ICL Mean | Positive rollouts |
|---|---|---|
| Gemini 3.7 Flash | 0.002 | 4/5 |
| GPT-5.6 Sol | 0.076 | 5/5 |
| Opus 4.7 | 0.034 | 4/5 |
| Opus 5 | 0.061 | 5/5 |
| Model | Stateless ICL | Global ICL | Routed ICL | Routed CL | Ground-truth assignment |
|---|---|---|---|---|---|
| Gemini 3.7 Flash | $39.59 | $200.14 | $91.31 | $61.08 | $59.20 |
| GPT-5.6 Sol | $89.24 | $456.22 | $170.40 | $125.99 | $117.08 |
| Opus 4.7 | $128.86 | $708.78 | $212.37 | $222.72 | $212.04 |
| Opus 5 | $161.77 | $914.36 | $424.54 | $316.61 | $265.10 |
| Model | Condition | Fresh input | Cache-read input | Cache-write input | Output | Usage total |
|---|---|---|---|---|---|---|
| Gemini 3.7 Flash | Stateless ICL | 34.1 | 91.1 | 0.0 | 0.7 | 127.2 |
| Global ICL | 237.4 | 192.8 | 0.0 | 0.7 | 432.2 | |
| Routed ICL | 101.1 | 137.3 | 0.0 | 0.6 | 239.7 | |
| Routed CL | 58.8 | 105.5 | 0.0 | 0.9 | 166.7 | |
| GT assignment | 57.7 | 101.3 | 0.0 | 0.9 | 161.2 | |
| GPT-5.6 Sol | Stateless ICL | 10.2 | 79.0 | 0.0 | 0.8 | 90.1 |
| Source task | Ground truth | Gemini 3.7 Flash | GPT-5.6 Sol | Opus 4.7 | Opus 5 |
|---|---|---|---|---|---|
| (a) Memory-system assignment | |||||
| Code | ICL | RB 4, ICL 1 | ICL 5 | RB 3, ICL 2 | ICL 4 , RB 1 |
| Cohort | HDE | HDE 5 | HDE 5 | HDE 4 , RB 1 | HDE 5 |
| Database | ICL | ICL 5 | ICL 5 | ICL 3 , RB 2 | ICL 5 |
| Poker | ICL | ICL 5 | ICL 5 | ICL 5 | ICL 5 |
| Sales | HR | ICL 4, RB 1 | HR 5 | HR 4 , ICL 1 | HR 5 |
Continual Learning for LLM Agents
Continual learning for LLM agents studies how agents adapt from experience while retaining skills and knowledge across tasks.
See all 202 papers