Skip to main content
Back

CMU's SCALAR Lets LLMs and RL Teach Each Other, Hitting 88% Diamond Collection

SCALAR couples LLMs with reinforcement learning through a self-correcting skill library, achieving 88.2% diamond collection — nearly 2x the best baseline — on the notoriously hard Craftax benchmark.

Pro

Paper, Full Access
  • SCALAR is a bidirectional LLM-RL framework that lets LLMs propose skills and RL execution results correct those proposals iteratively — closing the one-shot feedback gap in prior work.
  • On Craftax, SCALAR achieves 88.2% diamond collection (1.9x over the best baseline) and 9.1% Gnomish Mines entry where all prior methods score 0%.
  • Pivotal Trajectory Analysis examines successful RL rollouts to correct LLM specification errors (e.g., reducing assumed iron requirements from 3 to 1), recovering 20+ percentage points on diamond collection.
  • Frontier Checkpointing saves environment states at skill boundaries so training frames aren't wasted re-executing already-learned prerequisite chains — critical for tasks with 500+ step prerequisites.
  • SCALAR adapts online: when crafting recipes change post-training, trajectory analysis detects and corrects specification drift, recovering from 5% to 86%+ without manual intervention.
  • Constraints: requires predefined symbolic state, fixed skill ordering, and LLM priors that are qualitatively correct; total LLM API cost across all experiments was just $2.83.

Getting a language model to plan is easy. Getting it to actually act in a physical environment is a different problem entirely. LLM-based agents like Voyager excel when they can write code against a high-level API, but the moment you strip away that abstraction and ask them to control an agent at the level of individual motor actions, performance collapses. A new paper from Carnegie Mellon University introduces SCALAR , Self-Supervised Composition and Learning of Skills with LLM Planning and Reinforcement Learning , a framework that closes this gap by making LLMs and RL teach each other.

The grounding problem no one has solved cleanly

The core tension in LLM-RL integration is well understood but poorly resolved. LLM-based agents excel when given high-level action APIs but struggle to ground language into low-level control. Reinforcement learning can handle low-level control through trial and error, but it hits a wall when rewards are sparse across long action sequences , like mining a diamond in a survival game that requires 10+ prerequisite steps.

Prior work tried to bridge this by having LLMs generate reward functions or subgoal sequences that guide RL training. The problem? These one-shot approaches lack feedback to correct specification errors. If the LLM overestimates how much iron you need, or misses a hidden prerequisite, training fails silently and the error is never diagnosed. There is no loop , the LLM proposes once, and the RL agent is left to figure it out.

A bidirectional loop, not a one-way street

SCALAR couples symbolic LLM planning with low-level RL through a learned skill library. The key insight is treating the relationship as bidirectional: the LLM proposes skills, RL trains them, and then the results flow back to correct the LLM's assumptions , iteratively, not just once.

SCALAR four-stage loop: LLM skill proposal, frontier discovery, policy learning, and trajectory analysis

Each skill is formalized at two levels simultaneously. At the symbolic level, it's an operator , a STRIPS-style specification (a classical AI planning format) with preconditions that must hold before execution, positive effects that become true on success, and negative effects (resources consumed). At the neural level, it's an option , a learned RL policy that actually executes the behavior in the environment. The LLM handles the symbolic level; RL handles the neural level.

How it works, step by step

  1. Skill Proposal: Given a game tutorial or task description, the LLM proposes a set of candidate skills with preconditions, effects, and reward functions written as executable JAX code. For example, MakeIronPickaxe might require has(stone_pickaxe), has(iron, 1), and placed(furnace).
  2. Feasibility Filtering: Skills are checked for feasibility (can their preconditions be reached from the current state?) and novelty (do they achieve something not already achievable?). Infeasible or redundant skills are deferred.
  3. Skill Composition: A STRIPS planner sequences already-trained skills to reach the preconditions of the next target skill. Training then runs the prerequisite chain, then trains the new policy on top.
  4. Trajectory Analysis: Once the skill achieves nonzero success, the LLM examines the first successful trajectories , recording the full abstract state sequence from start to termination , and compares them against the original specification. If the spec is wrong (e.g., it said 3 iron were needed but only 1 was used), the spec is corrected and training restarts with the fixed version.
  5. Frontier Checkpointing: To avoid wasting training frames re-executing long prerequisite chains, SCALAR saves the environment state at the moment preconditions first hold, then resets to that saved state with probability 0.9 on episode reset. This ensures most compute goes toward training the current skill, not replaying already-learned ones.

The policy updates use PPO across all active skills simultaneously. Crucially, advantages are computed across skill boundaries , so if an earlier skill leaves the agent in a bad state (low health, wrong position), that penalty propagates back and the earlier skill learns to clean up after itself.

Why trajectory analysis is the real unlock

The LLM's initial priors are systematically wrong in predictable ways. The LLM's initial priors substantially overestimate resource requirements: 19 wood, 11 stone, and 3 iron before diamond, when only 9 wood, 5 stone, and 1 iron are needed. These overestimates cascade: every extra resource the agent must gather before attempting the target skill is wasted training time.

Trajectory analysis catches something even more subtle. Recording only endpoints is insufficient because the policy may compensate for missing preconditions mid-episode. If the plan delivers 2 iron but the skill needs 3, the agent might occasionally find iron nearby and succeed anyway , endpoints alone would suggest 2 suffices, but the full trajectory reveals the agent collected extra iron, exposing the true requirement.

The ablation numbers are stark. Removing trajectory analysis drops diamond collection from 88% to 67%, and Enter Gnomish Mines from 9.1% to 0%. The Eat Plant task , which requires keeping the agent alive for ~600 steps while a plant matures, a prerequisite the LLM cannot infer from documentation , goes from 91.7% success to 0% without it.

Benchmark results that speak for themselves

On Craftax, SCALAR achieves 88.2% diamond collection, a 1.9x improvement over the best baseline, and reaches the Gnomish Mines 9.1% of the time where prior methods fail entirely. The benchmark , Craftax , is a JAX-accelerated survival game inspired by Minecraft and NetHack, chosen specifically because it has deep prerequisite chains (10+ steps to diamond) and sparse rewards that break flat RL.

Achievement success rates across 21 tasks in Craftax-Classic, comparing SCALAR against PPO and PQN baselines

The full results table tells a nuanced story:

MethodEat Plant (%)Collect Diamond (%)Enter Dungeon (%)Enter Gnomish Mines (%)
PPO-FC23.935.486.60.0
PPO-RNN0.040.989.70.0
PQN-RNN (best baseline)55.346.992.50.0
SCALAR91.788.258.49.1
SCALAR (no Trajectory Analysis)0.067.322.90.0

One honest caveat: SCALAR underperforms on Enter Dungeon (58% vs. 90%+ for baselines). The reason is intentional , SCALAR skips combat with overworld zombies and skeletons because they are not prerequisites for dungeon entry. Baselines receive reward for all achievements equally and incidentally develop combat skills that transfer. Goal-directed learning concentrates signal on the critical path but sacrifices indirect skill transfer from auxiliary behaviors.

What's now possible that wasn't before

The Gnomish Mines result is the headline. Both SCALAR variants reach approximately 9% by training separate skills for dungeon navigation, combat, and mine entry , a task that requires killing 8 orcs on the dungeon floor, which every prior method achieves 0% of the time. This is not a marginal improvement; it is a qualitative capability unlock on a task that was previously intractable.

SCALAR also demonstrates something practically important: online adaptation. When crafting recipes change after training (e.g., iron pickaxe now requires 2 iron instead of 1), trajectory analysis detects the discrepancy from new execution data and corrects the specification without manual intervention. Without correction, SCALAR drops to 5.4% , matching flat PPO. With correction, it recovers to 86%+. This makes the framework robust to environment changes, not just efficient at training.

Where it breaks down

SCALAR has real constraints worth knowing before reaching for it:

  • Requires symbolic state: Preconditions and effects must be expressible in a predefined vocabulary (inventory counts, achievement flags, proximity predicates). Raw pixel environments without symbolic structure are not supported.
  • Fixed skill ordering: The planner enforces a sequential execution order. Subtasks that could be interleaved opportunistically (e.g., explore and fight simultaneously) are forced into a fixed sequence.
  • Frontier Checkpointing needs state serialization: This works in simulators but is non-trivial in real-world robotics or stateful architectures like Transformer-XL, which also requires saving the memory buffer.
  • LLM priors must be qualitatively correct: Trajectory analysis corrects quantitative errors (wrong resource counts) but not qualitative ones (wrong skill structure). It was evaluated on Craftax specifically because LLMs have Minecraft-like priors from training data.

On the practical side, the LLM cost is remarkably low. Total LLM cost for all experiments was $2.83 with 1.429M input tokens and 125k output tokens , because the LLM is only called between training runs for skill proposal and trajectory analysis, never during the RL training loop itself. The actual RL training runs at 1 billion frames per hour on a single H100, using JAX's vectorized execution.

No code repository has been released alongside the paper yet, but the full prompt details for all three LLM phases , skill extraction, prerequisite inference, and reward code generation , are included in the appendix, making the approach reproducible. The paper is submitted to ICML.