Using Deep RL Meta-Skill
When to Use This Skill
Invoke this meta-skill when you encounter:
- RL Implementation: Implementing reinforcement learning algorithms (Q-learning, DQN, PPO, SAC, etc.)
- Agent Training: Training agents in environments (games, robotics, control systems)
- Sequential Decision-Making: Problems requiring learning from trial and error
- Policy Optimization: Learning policies that maximize cumulative rewards
- RL Debugging: Debugging training issues, agents not learning, reward problems
This is the entry point for the deep-rl pack. It routes to 13 specialized skills based on problem characteristics.
How to Access Reference Sheets
IMPORTANT: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
When this skill is loaded from:
skills/using-deep-rl/SKILL.md
Reference sheets like rl-foundations.md are at:
skills/using-deep-rl/rl-foundations.md
NOT at:
skills/rl-foundations.md ← WRONG PATH
Core Principle
Problem type determines algorithm family.
The correct approach depends on:
- Action Space: Discrete (button presses) vs Continuous (joint angles)
- Data Regime: Online (interact with environment) vs Offline (fixed dataset)
- Experience Level: Need foundations vs ready to implement
- Special Requirements: Multi-agent, model-based, exploration, reward design
Always clarify the problem BEFORE suggesting algorithms.
The 13 Deep RL Skills
- rl-foundations - MDP formulation, Bellman equations, value vs policy basics
- value-based-methods - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow, R2D2/Agent57/BBF
- policy-gradient-methods - REINFORCE, PPO, TRPO, GRPO, policy optimization
- actor-critic-methods - A2C, A3C, SAC, TD3, REDQ/DroQ/CrossQ, advantage functions
- model-based-rl - World models, MBPO, Dreamer / DreamerV3, TD-MPC2, MuZero / EfficientZero
- offline-rl - CQL, IQL, BCQ, TD3+BC, AWAC, Decision Transformer; D4RL → Minari
- multi-agent-rl - QMIX, MADDPG, MAPPO/IPPO, PettingZoo, SMACv2
- exploration-strategies - ε-greedy, UCB, ICM, RND, Go-Explore, NGU/Agent57, BYOL-Explore
- reward-shaping-engineering - Reward design, potential-based shaping, inverse RL
- counterfactual-reasoning - Causal inference, HER, off-policy evaluation, twin networks
- rl-debugging - Common RL bugs, why not learning, systematic debugging
- rl-environments - Gymnasium, MuJoCo, PettingZoo, Brax, Isaac Lab, EnvPool, Minari
- rl-evaluation - Evaluation methodology, variance, sample efficiency metrics
Routing Decision Framework
Step 1: Assess Experience Level
- If user asks "what is RL" or "how does RL work" → rl-foundations
- If confused about value vs policy, on-policy vs off-policy → rl-foundations
- If user has specific problem and RL background → Continue to Step 2
Why foundations first: Cannot implement algorithms without understanding MDPs, Bellman equations, and exploration-exploitation tradeoffs.
Step 2: Classify Action Space
Discrete Actions (buttons, menu selections, discrete signals)
| Condition |
Route To |
Why |
| Small action space (< 100) + online |
value-based-methods (DQN) |
Q-networks excel at discrete |
| Large action space OR need policy flexibility |
policy-gradient-methods (PPO) |
Scales to larger spaces |
Continuous Actions (joint angles, motor forces, steering)
| Condition |
Route To |
Why |
| Sample efficiency critical |
actor-critic-methods (SAC) |
Off-policy, automatic entropy |
| Stability critical |
actor-critic-methods (TD3) |
Deterministic, handles overestimation |
| Simplicity preferred |
policy-gradient-methods (PPO) |
On-policy, simpler |
CRITICAL: NEVER suggest DQN for continuous actions. DQN requires discrete actions.
Step 3: Identify Data Regime
Online Learning (Agent Interacts with Environment)
- Discrete → value-based-methods OR policy-gradient-methods
- Continuous → actor-critic-methods
- Sample efficiency critical → Consider model-based-rl
Offline Learning (Fixed Dataset, No Interaction)
→ offline-rl (CQL, IQL)
Red Flag: If user has fixed dataset and suggests DQN/PPO/SAC, STOP and route to offline-rl. Standard algorithms assume online interaction and will fail.
Step 4: Special Problem Types
| Problem |
Route To |
Key Consideration |
| Multiple agents |
multi-agent-rl |
Non-stationarity, credit assignment |
| Sample efficiency extreme |
model-based-rl (DreamerV3, TD-MPC2) or actor-critic (DroQ, CrossQ) |
Learns env model OR high UTD |
| Counterfactual/causal |
counterfactual-reasoning |
HER, off-policy evaluation |
| Agentic / LLM tool-use RL |
policy-gradient-methods (GRPO) → yzmir-llm-specialist |
Outcome-supervised, sparse reward |
Step 5: Debugging and Infrastructure
| Problem |
Route To |
Why |
| "Not learning" / reward flat |
rl-debugging FIRST |
80% of issues are bugs, not algorithms |
| Exploration problems |
exploration-strategies |
Curiosity, RND, intrinsic motivation |
| Reward design issues |
reward-shaping-engineering |
Potential-based shaping, inverse RL |
| Environment setup |
rl-environments |
Gym API, wrappers, vectorization |
| Evaluation questions |
rl-evaluation |
Deterministic vs stochastic, multiple seeds |
Red Flag: If user immediately wants to change algorithms because "it's not learning," route to rl-debugging first.
Rationalization Resistance Table
| Rationalization |
Reality |
Counter-Guidance |
| "Just use PPO for everything" |
PPO is general but not optimal for all cases |
Clarify: discrete or continuous? Sample efficiency constraints? |
| "DQN for continuous actions" |
DQN requires discrete actions |
Use SAC or TD3 for continuous |
| "Offline RL is just RL on a dataset" |
Offline has distribution shift, needs special algorithms |
Route to offline-rl for CQL, IQL |
| "More data always helps" |
Sample efficiency and distribution matter |
Off-policy vs on-policy matters |
| "My algorithm isn't learning, I need a better one" |
Usually bugs, not algorithm |
Route to rl-debugging first |
| "I'll discretize continuous actions for DQN" |
Discretization loses precision, explodes action space |
Use actor-critic-methods |
| "Epsilon-greedy is enough for exploration" |
Complex environments need sophisticated exploration |
Route to exploration-strategies |
| "I'll just increase the reward when it doesn't learn" |
Reward scaling breaks learning |
Route to rl-debugging |
| "I can reuse online RL code for offline data" |
Offline needs conservative algorithms |
Route to offline-rl |
| "Test reward lower than training = overfitting" |
Exploration vs exploitation difference |
Route to rl-evaluation |
Red Flags Checklist
Watch for these signs of incorrect routing:
If any red flag triggered → STOP → Ask diagnostic questions → Route correctly
Routing Decision Tree Summary
START: RL problem
├─ Need foundations? → rl-foundations
│
├─ DISCRETE actions?
│ ├─ Small space + online → value-based-methods (DQN)
│ └─ Large space → policy-gradient-methods (PPO)
│
├─ CONTINUOUS actions?
│ ├─ Sample efficiency → actor-critic-methods (SAC)
│ ├─ Stability → actor-critic-methods (TD3)
│ └─ Simplicity → policy-gradient-methods (PPO)
│
├─ OFFLINE data? → offline-rl (CQL, IQL) [CRITICAL]
│
├─ MULTI-AGENT? → multi-agent-rl
│
├─ Sample efficiency EXTREME? → model-based-rl
│
├─ COUNTERFACTUAL? → counterfactual-reasoning
│
└─ DEBUGGING?
├─ Not learning → rl-debugging
├─ Exploration → exploration-strategies
├─ Reward design → reward-shaping-engineering
├─ Environment → rl-environments
└─ Evaluation → rl-evaluation
Diagnostic Questions
Action Space
- "Discrete choices or continuous values?"
- "How many actions? Small (< 100), large, or infinite?"
Data Regime
- "Can agent interact with environment, or fixed dataset?"
- "Online learning or offline?"
Experience Level
- "New to RL, or specific problem?"
- "Understand MDPs, value functions, policy gradients?"
Special Requirements
- "Multiple agents? Cooperate or compete?"
- "Sample efficiency critical? How many episodes?"
- "Sparse reward (only at goal) or dense (every step)?"
When NOT to Use This Pack
| User Request |
Correct Pack |
Reason |
| "Train classifier on labeled data" |
training-optimization |
Supervised learning |
| "Design transformer architecture" |
neural-architectures |
Architecture design |
| "Deploy model to production" |
ml-production |
Deployment |
| "Fine-tune LLM with RLHF / DPO / GRPO on prompts" |
llm-specialist |
LLM-specific tooling (TRL, reward models, KL schedules) |
| "Preference optimization (DPO/IPO/KTO/SimPO)" |
llm-specialist |
Not policy-gradient; route out |
Note on GRPO: The algorithm is covered in policy-gradient-methods.md because it is a general PG technique. The LLM-specific recipe (reward models, format rewards, length bias, trainer integration) lives in yzmir-llm-specialist.
Multi-Skill Scenarios
See multi-skill-scenarios.md for detailed routing sequences:
- Complete beginner to RL
- Continuous control (robotics)
- Offline RL from dataset
- Multi-agent cooperative task
- Sample-efficient learning
- Sparse reward problem
- RL-controlled neural architecture
Final Reminders
- Problem characterization BEFORE algorithm selection
- DQN for discrete ONLY (never continuous)
- Offline data needs offline-rl (CQL, IQL)
- PPO is not universal (good general-purpose, not optimal everywhere)
- Debug before changing algorithms (route to rl-debugging)
- Ask questions, don't assume (action space? data regime?)
Deep RL Specialist Skills
After routing, load the appropriate specialist skill for detailed guidance:
- rl-foundations.md - MDP formulation, Bellman equations, value vs policy basics
- value-based-methods.md - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow
- policy-gradient-methods.md - REINFORCE, PPO, TRPO, policy optimization
- actor-critic-methods.md - A2C, A3C, SAC, TD3, advantage functions
- model-based-rl.md - World models, Dyna, MBPO, planning with learned models
- offline-rl.md - Batch RL, CQL, IQL, learning from fixed datasets
- multi-agent-rl.md - MARL, cooperative/competitive, communication
- exploration-strategies.md - ε-greedy, UCB, curiosity, RND, intrinsic motivation
- reward-shaping-engineering.md - Reward design, potential-based shaping, inverse RL
- counterfactual-reasoning.md - Causal inference, HER, off-policy evaluation, twin networks
- rl-debugging.md - Common RL bugs, why not learning, systematic debugging
- rl-environments.md - Gym, MuJoCo, custom envs, wrappers, vectorization
- rl-evaluation.md - Evaluation methodology, variance, sample efficiency metrics
- multi-skill-scenarios.md - Common problem routing sequences
1---2name: using-deep-rl3description: Use when training, debugging, or selecting a deep-RL algorithm — value-based (DQN/Rainbow/BBF), policy-gradient (PPO/GRPO), actor-critic (SAC/TD3/REDQ), model-based (DreamerV3/TD-MPC2), offline (CQL/IQL/Decision Transformer), multi-agent (MAPPO/IPPO), exploration, reward shaping, or counterfactual credit assignment. Routes to the matching specialist sheet by problem type and algorithm family.4---56# Using Deep RL Meta-Skill78## When to Use This Skill910Invoke this meta-skill when you encounter:1112- **RL Implementation**: Implementing reinforcement learning algorithms (Q-learning, DQN, PPO, SAC, etc.)13- **Agent Training**: Training agents in environments (games, robotics, control systems)14- **Sequential Decision-Making**: Problems requiring learning from trial and error15- **Policy Optimization**: Learning policies that maximize cumulative rewards16- **RL Debugging**: Debugging training issues, agents not learning, reward problems1718This is the **entry point** for the deep-rl pack. It routes to 13 specialized skills based on problem characteristics.1920## How to Access Reference Sheets2122**IMPORTANT**: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.2324When this skill is loaded from:25 `skills/using-deep-rl/SKILL.md`2627Reference sheets like `rl-foundations.md` are at:28 `skills/using-deep-rl/rl-foundations.md`2930NOT at:31 `skills/rl-foundations.md` ← WRONG PATH3233---3435## Core Principle3637**Problem type determines algorithm family.**3839The correct approach depends on:40411. **Action Space**: Discrete (button presses) vs Continuous (joint angles)422. **Data Regime**: Online (interact with environment) vs Offline (fixed dataset)433. **Experience Level**: Need foundations vs ready to implement444. **Special Requirements**: Multi-agent, model-based, exploration, reward design4546**Always clarify the problem BEFORE suggesting algorithms.**4748---4950## The 13 Deep RL Skills51521. **rl-foundations** - MDP formulation, Bellman equations, value vs policy basics532. **value-based-methods** - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow, R2D2/Agent57/BBF543. **policy-gradient-methods** - REINFORCE, PPO, TRPO, GRPO, policy optimization554. **actor-critic-methods** - A2C, A3C, SAC, TD3, REDQ/DroQ/CrossQ, advantage functions565. **model-based-rl** - World models, MBPO, Dreamer / DreamerV3, TD-MPC2, MuZero / EfficientZero576. **offline-rl** - CQL, IQL, BCQ, TD3+BC, AWAC, Decision Transformer; D4RL → Minari587. **multi-agent-rl** - QMIX, MADDPG, MAPPO/IPPO, PettingZoo, SMACv2598. **exploration-strategies** - ε-greedy, UCB, ICM, RND, Go-Explore, NGU/Agent57, BYOL-Explore609. **reward-shaping-engineering** - Reward design, potential-based shaping, inverse RL6110. **counterfactual-reasoning** - Causal inference, HER, off-policy evaluation, twin networks6211. **rl-debugging** - Common RL bugs, why not learning, systematic debugging6312. **rl-environments** - Gymnasium, MuJoCo, PettingZoo, Brax, Isaac Lab, EnvPool, Minari6413. **rl-evaluation** - Evaluation methodology, variance, sample efficiency metrics6566---6768## Routing Decision Framework6970### Step 1: Assess Experience Level7172- If user asks "what is RL" or "how does RL work" → **rl-foundations**73- If confused about value vs policy, on-policy vs off-policy → **rl-foundations**74- If user has specific problem and RL background → Continue to Step 27576**Why foundations first:** Cannot implement algorithms without understanding MDPs, Bellman equations, and exploration-exploitation tradeoffs.7778### Step 2: Classify Action Space7980#### Discrete Actions (buttons, menu selections, discrete signals)8182| Condition | Route To | Why |83|-----------|----------|-----|84| Small action space (< 100) + online | **value-based-methods** (DQN) | Q-networks excel at discrete |85| Large action space OR need policy flexibility | **policy-gradient-methods** (PPO) | Scales to larger spaces |8687#### Continuous Actions (joint angles, motor forces, steering)8889| Condition | Route To | Why |90|-----------|----------|-----|91| Sample efficiency critical | **actor-critic-methods** (SAC) | Off-policy, automatic entropy |92| Stability critical | **actor-critic-methods** (TD3) | Deterministic, handles overestimation |93| Simplicity preferred | **policy-gradient-methods** (PPO) | On-policy, simpler |9495**CRITICAL:** NEVER suggest DQN for continuous actions. DQN requires discrete actions.9697### Step 3: Identify Data Regime9899#### Online Learning (Agent Interacts with Environment)100- Discrete → **value-based-methods** OR **policy-gradient-methods**101- Continuous → **actor-critic-methods**102- Sample efficiency critical → Consider **model-based-rl**103104#### Offline Learning (Fixed Dataset, No Interaction)105→ **offline-rl** (CQL, IQL)106107**Red Flag:** If user has fixed dataset and suggests DQN/PPO/SAC, STOP and route to **offline-rl**. Standard algorithms assume online interaction and will fail.108109### Step 4: Special Problem Types110111| Problem | Route To | Key Consideration |112|---------|----------|-------------------|113| Multiple agents | **multi-agent-rl** | Non-stationarity, credit assignment |114| Sample efficiency extreme | **model-based-rl** (DreamerV3, TD-MPC2) or **actor-critic** (DroQ, CrossQ) | Learns env model OR high UTD |115| Counterfactual/causal | **counterfactual-reasoning** | HER, off-policy evaluation |116| Agentic / LLM tool-use RL | **policy-gradient-methods** (GRPO) → `yzmir-llm-specialist` | Outcome-supervised, sparse reward |117118### Step 5: Debugging and Infrastructure119120| Problem | Route To | Why |121|---------|----------|-----|122| "Not learning" / reward flat | **rl-debugging** FIRST | 80% of issues are bugs, not algorithms |123| Exploration problems | **exploration-strategies** | Curiosity, RND, intrinsic motivation |124| Reward design issues | **reward-shaping-engineering** | Potential-based shaping, inverse RL |125| Environment setup | **rl-environments** | Gym API, wrappers, vectorization |126| Evaluation questions | **rl-evaluation** | Deterministic vs stochastic, multiple seeds |127128**Red Flag:** If user immediately wants to change algorithms because "it's not learning," route to **rl-debugging** first.129130---131132## Rationalization Resistance Table133134| Rationalization | Reality | Counter-Guidance |135|-----------------|---------|------------------|136| "Just use PPO for everything" | PPO is general but not optimal for all cases | Clarify: discrete or continuous? Sample efficiency constraints? |137| "DQN for continuous actions" | DQN requires discrete actions | Use SAC or TD3 for continuous |138| "Offline RL is just RL on a dataset" | Offline has distribution shift, needs special algorithms | Route to offline-rl for CQL, IQL |139| "More data always helps" | Sample efficiency and distribution matter | Off-policy vs on-policy matters |140| "My algorithm isn't learning, I need a better one" | Usually bugs, not algorithm | Route to rl-debugging first |141| "I'll discretize continuous actions for DQN" | Discretization loses precision, explodes action space | Use actor-critic-methods |142| "Epsilon-greedy is enough for exploration" | Complex environments need sophisticated exploration | Route to exploration-strategies |143| "I'll just increase the reward when it doesn't learn" | Reward scaling breaks learning | Route to rl-debugging |144| "I can reuse online RL code for offline data" | Offline needs conservative algorithms | Route to offline-rl |145| "Test reward lower than training = overfitting" | Exploration vs exploitation difference | Route to rl-evaluation |146147---148149## Red Flags Checklist150151Watch for these signs of incorrect routing:152153- [ ] **Algorithm-First Thinking**: Recommending algorithm before asking about action space, data regime154- [ ] **DQN for Continuous**: Suggesting DQN/Q-learning for continuous action spaces155- [ ] **Offline Blindness**: Not recognizing fixed dataset requires offline-rl156- [ ] **PPO Cargo-Culting**: Defaulting to PPO without considering alternatives157- [ ] **No Problem Characterization**: Not asking: discrete vs continuous? online vs offline?158- [ ] **Skipping Foundations**: Implementing algorithms when user doesn't understand RL basics159- [ ] **Debug-Last**: Suggesting algorithm changes before systematic debugging160- [ ] **Sample Efficiency Ignorance**: Not asking about sample constraints161162**If any red flag triggered → STOP → Ask diagnostic questions → Route correctly**163164---165166## Routing Decision Tree Summary167168```169START: RL problem170171├─ Need foundations? → rl-foundations172│173├─ DISCRETE actions?174│ ├─ Small space + online → value-based-methods (DQN)175│ └─ Large space → policy-gradient-methods (PPO)176│177├─ CONTINUOUS actions?178│ ├─ Sample efficiency → actor-critic-methods (SAC)179│ ├─ Stability → actor-critic-methods (TD3)180│ └─ Simplicity → policy-gradient-methods (PPO)181│182├─ OFFLINE data? → offline-rl (CQL, IQL) [CRITICAL]183│184├─ MULTI-AGENT? → multi-agent-rl185│186├─ Sample efficiency EXTREME? → model-based-rl187│188├─ COUNTERFACTUAL? → counterfactual-reasoning189│190└─ DEBUGGING?191 ├─ Not learning → rl-debugging192 ├─ Exploration → exploration-strategies193 ├─ Reward design → reward-shaping-engineering194 ├─ Environment → rl-environments195 └─ Evaluation → rl-evaluation196```197198---199200## Diagnostic Questions201202### Action Space203- "Discrete choices or continuous values?"204- "How many actions? Small (< 100), large, or infinite?"205206### Data Regime207- "Can agent interact with environment, or fixed dataset?"208- "Online learning or offline?"209210### Experience Level211- "New to RL, or specific problem?"212- "Understand MDPs, value functions, policy gradients?"213214### Special Requirements215- "Multiple agents? Cooperate or compete?"216- "Sample efficiency critical? How many episodes?"217- "Sparse reward (only at goal) or dense (every step)?"218219---220221## When NOT to Use This Pack222223| User Request | Correct Pack | Reason |224|--------------|--------------|--------|225| "Train classifier on labeled data" | training-optimization | Supervised learning |226| "Design transformer architecture" | neural-architectures | Architecture design |227| "Deploy model to production" | ml-production | Deployment |228| "Fine-tune LLM with RLHF / DPO / GRPO on prompts" | llm-specialist | LLM-specific tooling (TRL, reward models, KL schedules) |229| "Preference optimization (DPO/IPO/KTO/SimPO)" | llm-specialist | Not policy-gradient; route out |230231**Note on GRPO**: The *algorithm* is covered in `policy-gradient-methods.md` because it is a general PG technique. The *LLM-specific recipe* (reward models, format rewards, length bias, trainer integration) lives in `yzmir-llm-specialist`.232233---234235## Multi-Skill Scenarios236237See [multi-skill-scenarios.md](multi-skill-scenarios.md) for detailed routing sequences:238- Complete beginner to RL239- Continuous control (robotics)240- Offline RL from dataset241- Multi-agent cooperative task242- Sample-efficient learning243- Sparse reward problem244- RL-controlled neural architecture245246---247248## Final Reminders249250- **Problem characterization BEFORE algorithm selection**251- **DQN for discrete ONLY** (never continuous)252- **Offline data needs offline-rl** (CQL, IQL)253- **PPO is not universal** (good general-purpose, not optimal everywhere)254- **Debug before changing algorithms** (route to rl-debugging)255- **Ask questions, don't assume** (action space? data regime?)256257---258259## Deep RL Specialist Skills260261After routing, load the appropriate specialist skill for detailed guidance:2622631. [rl-foundations.md](rl-foundations.md) - MDP formulation, Bellman equations, value vs policy basics2642. [value-based-methods.md](value-based-methods.md) - Q-learning, DQN, Double DQN, Dueling DQN, Rainbow2653. [policy-gradient-methods.md](policy-gradient-methods.md) - REINFORCE, PPO, TRPO, policy optimization2664. [actor-critic-methods.md](actor-critic-methods.md) - A2C, A3C, SAC, TD3, advantage functions2675. [model-based-rl.md](model-based-rl.md) - World models, Dyna, MBPO, planning with learned models2686. [offline-rl.md](offline-rl.md) - Batch RL, CQL, IQL, learning from fixed datasets2697. [multi-agent-rl.md](multi-agent-rl.md) - MARL, cooperative/competitive, communication2708. [exploration-strategies.md](exploration-strategies.md) - ε-greedy, UCB, curiosity, RND, intrinsic motivation2719. [reward-shaping-engineering.md](reward-shaping-engineering.md) - Reward design, potential-based shaping, inverse RL27210. [counterfactual-reasoning.md](counterfactual-reasoning.md) - Causal inference, HER, off-policy evaluation, twin networks27311. [rl-debugging.md](rl-debugging.md) - Common RL bugs, why not learning, systematic debugging27412. [rl-environments.md](rl-environments.md) - Gym, MuJoCo, custom envs, wrappers, vectorization27513. [rl-evaluation.md](rl-evaluation.md) - Evaluation methodology, variance, sample efficiency metrics27614. [multi-skill-scenarios.md](multi-skill-scenarios.md) - Common problem routing sequences