Learning Reusable Robot Skills for Long-Horizon Tasks

Peter Bubenik Β· Apple ML Β· Β· Source
Image for REFACTOR-VLA: Unsupervised Library Learning of Typed Motor Programs

Step-by-Step Teaching

Step 1: The Problem β€” Why Monolithic VLA Models Fall Short

What is a VLA Model?

A Vision-Language-Action (VLA) model takes:

  • πŸ‘οΈ Visual input (camera feed)
  • πŸ’¬ Language instruction ("pick up the cup")
  • ➑️ Outputs raw motor commands (move arm 2cm left, close gripper, etc.)

The Monolithic Problem

Instruction β†’ [Big Black Box Model] β†’ raw motor commands
                                       (no structure, no reuse)

Think of it like this:

Imagine writing a computer program where every task requires rewriting everything from scratch, with no functions, no libraries, no reusable code.

Two core problems:

ProblemExplanation
Poor long-horizon performanceNo ability to chain structured sub-tasks reliably
Poor interpretabilityCannot understand what the model learned

Step 2: Existing Approaches and Their Gaps

Before REFACTOR-VLA, two main approaches existed:

Approach A: Clustering Embeddings

(e.g., AtomicVLA, AtomSkill)

Action sequences β†’ Contrastive Embeddings β†’ Cluster similar ones

❌ Problem: Clustering embeddings doesn't directly answer: "Do these two action sequences produce the same behavioral outcome?"

Approach B: LLM as Judge

(e.g., BLADE, LRLL)

Action sequences β†’ Ask LLM: "Are these equivalent?" β†’ Group them

❌ Problem: The LLM has no knowledge of the robot's actual physics/dynamics. It's like asking someone who has never driven a car to judge if two driving maneuvers are equivalent.

The Core Gap

None of these methods properly define behavioral equivalence in terms of what actually happens when the robot executes the actions.


Step 3: REFACTOR-VLA's Solution β€” The Big Picture

REFACTOR-VLA introduces a wake/sleep architecture β€” borrowed conceptually from how the human brain consolidates learning:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              REFACTOR-VLA                   β”‚
β”‚                                             β”‚
β”‚  😴 SLEEP PHASE          β˜€οΈ WAKE PHASE      β”‚
β”‚  (Discover Skills)       (Use Skills)       β”‚
β”‚                                             β”‚
β”‚  Cluster motor           Generate typed     β”‚
β”‚  programs using BEK  β†’   lambda programs    β”‚
β”‚                          from skill library β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 4: The Sleep Phase β€” Discovering Skills with BEK

What is the Behavioral-Equivalence Kernel (BEK)?

The BEK answers: "Are two action sequences behaviorally equivalent?"

It does this by simulating outcomes in a learned latent world model (Mφ):

Action Sequence A ──┐
                    β”œβ”€β”€β–Ί MΟ† (World Model) ──► Predicted Outcome A ──┐
Action Sequence B β”€β”€β”˜                         Predicted Outcome B ──┴──► Compare β†’ Similarity Score

Analogy:

Instead of asking "do these two recipes look similar on paper?", you actually cook both dishes (in simulation) and compare the results.

Why a Latent World Model?

  • Running real robot experiments for every comparison is too slow and expensive
  • The world model MΟ† simulates outcomes cheaply in a compressed (latent) space
  • It is calibrated to the robot's actual dynamics β€” unlike an LLM judge

Clustering Result

Similar action segments β†’ grouped into reusable skills


Step 5: The Wake Phase β€” Using Skills with Typed Lambda Terms

What are Typed Lambda Terms?

These are structured, composable mini-programs inspired by the Hindley-Milner type system (a formal system from programming language theory).

Simple analogy:

# Instead of raw commands:
[move_x: 2, move_y: 0, gripper: close, move_x: -1, ...]

# You get structured programs:
Ξ» pick(object: Cup) β†’ Ξ» place(location: Table) β†’ done

Why types matter:

FeatureBenefit
TypedPrevents nonsensical combinations (e.g., "pick a location")
Lambda termsSkills are composable and reusable
StructuredInterpretable β€” you can read what the robot plans to do

The Action Decoder

The typed lambda terms are fed into a library-conditioned rectified-flow action decoder that converts the structured program back into actual motor commands.

Typed Lambda Term β†’ [Rectified Flow Decoder] β†’ Motor Commands
     (structured)      (conditioned on skill library)    (executable)

Step 6: Quality Gates β€” Not All Skills Are Accepted

REFACTOR-VLA uses two filters before adding a skill to the library:

Gate 1: Minimum Description Length (MDL)

"Does adding this skill actually compress our description of behavior?"

Analogy: Only add a word to a dictionary if it saves space overall β€” not if it's so specific it's only used once.

MDL Check: Length(library + skill) < Length(without skill)?
           YES β†’ Keep skill | NO β†’ Discard

Gate 2: Return-Preservation Gate

"Does using this skill maintain task performance?"

Performance with skill β‰₯ threshold? 
YES β†’ Accept | NO β†’ Reject

Together: These gates ensure the library stays compact, useful, and performance-preserving.


Step 7: Three-Phase Training Schedule

Phase A          Phase B              Phase C
────────         ────────             ────────
World Model  β†’   Policy           β†’   Skill
Warmup           Optimization         Discovery

Train Mφ         Train policy         Cluster action
(+ InfoNCE       using skill          fragments into
 loss)           library              reusable skills

Key Detail: InfoNCE Loss in Phase A

  • InfoNCE is a supervised contrastive loss β€” it trains the world model to pull similar outcomes together and push different outcomes apart
  • This dramatically improves the quality of skill clustering in Phase C

Step 8: Experimental Findings β€” What the Results Tell Us

Finding 1: Bigger β‰  Better (World Model Size)

World Model SizePerformance on 4 Suites
188M parametersβœ… Better
430M parameters❌ Worse on all 4

Lesson: Simply scaling up the world model hurts performance. Architecture and training objectives matter more than raw size.

Finding 2: InfoNCE Loss Dramatically Improves Skill Quality

Measured by Normalized Mutual Information (NMI) β€” scores closer to 1.0 = better clustering:

Benchmark SuiteNMI Score
Object0.462 Β± 0.021
Spatial0.867 Β± 0.025
Goal0.915 Β± 0.013
LIBERO-100.754 Β± 0.010

Lesson: The training objective (adding InfoNCE) is a high-leverage design choice β€” more impactful than model size.


Summary: The Complete Picture

REFACTOR-VLA System
═══════════════════════════════════════════════════════

INPUT: Raw demonstrations (video + language + actions)

PHASE A: Train World Model Mφ with InfoNCE loss
         β†’ Learns to simulate robot outcomes accurately

PHASE C: Sleep — Use BEK + Mφ to cluster action segments
         β†’ Discover behaviorally equivalent skill groups
         β†’ Filter with MDL + Return-Preservation gates
         β†’ Build reusable SKILL LIBRARY

PHASE B: Wake β€” Policy generates typed lambda terms
         β†’ Selects and composes skills from library
         β†’ Rectified-flow decoder produces motor commands

OUTPUT: Structured, interpretable, reusable robot behaviors
        that work on long-horizon tasks

Key Concepts Checklist

ConceptOne-Line Summary
Monolithic VLARaw command generation, no reusable structure
BEKMeasures behavioral equivalence via world model simulation
Latent World Model (Mφ)Simulates robot outcomes cheaply
Typed Lambda TermsStructured, composable skill programs
MDL CriterionKeeps library compact and non-redundant
Return-Preservation GateEnsures skills don't hurt performance
Wake/Sleep ArchitectureAlternates between using and discovering skills
InfoNCE LossContrastive objective that improves skill clustering quality
NMIMetric measuring clustering quality (0=random, 1=perfect)

More to study