Subgoals as State Contracts: Running Hierarchical RL Rollouts on Ephemeral Serverless Workers

Long-horizon reinforcement learning (RL) tasks, such as crafting a diamond pickaxe in a Minecraft-like world or steering a simulated ant through a giant maze, need episodes that last a long time and depend heavily on what happened earlier in the episode. Serverless computing, where cloud functions start in milliseconds, bill per second, and can be killed by the provider at any moment, suits short, independent work and handles long, stateful work poorly. This proposal argues that manually specified subgoals, the human-written milestones that hierarchical RL has spent a decade trying to replace with learned ones, are useful to systems for a reason the RL literature has not considered. A fixed list of milestones gives a natural place to cut a long episode into short pieces. Each piece starts from a saved snapshot of a state where milestone $k$ was reached and tries to reach milestone $k+1$. The collection of reached snapshots only ever grows, so many short-lived workers can add to it in parallel without locking or coordinating with each other.

In two sentences: we treat each subgoal boundary as a checkpoint and keep a "frontier" of snapshots per subgoal in a grow-only store. Ephemeral cloud functions then pull a snapshot, attempt the next subgoal, push any success, and shut down the instant they fail. The research question is whether this decomposition makes hierarchical RL cheaper and more robust to worker eviction than both monolithic training and today's serverless RL systems. A second question is what it costs when the subgoals are learned rather than hand-written, since learned subgoals change the store's keys while training runs.

Core Claim

The case against manual decomposition is about learning quality. Hand-written subgoals miss optimal trajectories and break when the environment changes (Seong and Shim), and they cannot be written for domains without human expertise (Drappo et al.; Tomar et al.). We do not dispute this evidence. It motivates the hybrid arm below. Our claim concerns a different axis.

A subgoal sequence fixed in advance gives a stable schema for execution state. The store maps each subgoal index to a set of reached simulator snapshots. Adding to a set is commutative, associative and idempotent, so the store is a lattice in the sense used by the Anna key-value store in Cloudburst, and it is monotone in the sense of the CALM theorem that Hydro uses to decide which code can run without coordination.

The research file identifies an apparent conflict between coordination-free serverless state and the strict "reach it or fail" order of causal subgoals (Strict Subgoal Execution; CDHRL). That conflict goes away at the level of the frontier. Reaching milestone $k+1$ is order-dependent inside one segment. Across segments, however, "snapshot $s$ is known to satisfy milestone $k$" is a fact that never becomes false. Failure is local: a failed segment adds nothing and simply ends.

The claim extends to learned subgoals with one sharp design rule. Learned subgoals may be added to the key set, which keeps the store monotone. Removing or merging subgoals is non-monotone and requires a coordinated barrier. We predict that the cost of learned decomposition on this executor depends on how often the learner retracts subgoals, and that a hybrid works best: a manual skeleton plus learned refinements that are only ever added.

Research Program

We will build a segment executor on a Cloudburst-style substrate. Cloudburst co-locates mutable caches with function executors, which it calls logical disaggregation with physical colocation. It reports 25x faster access than Lambda+Redis and 79x faster than Lambda+S3 for 8MB objects (Cloudburst). Snapshots and the current policy weights live in the local caches. The frontier sets live in the lattice store.

A segment function works in four steps. It samples a source subgoal $k$ with a priority rule; the default favours subgoals whose frontier is large but whose successor frontier is small. It restores a snapshot from frontier $k$. It runs the option for subgoal $k+1$ under a step budget. It then pushes the transitions to the learner, and on success also pushes the reached snapshot to frontier $k+1$.

Following Strict Subgoal Execution, the segment terminates immediately on failure, here meaning budget exhaustion or a detected dead end. Because of the serverless setting, that termination also ends billing. SSE introduced stop-on-failure purely to improve sample efficiency. We measure its effect on cloud cost.

The learner stays on a GPU server, as in Nitro. Both Nitro and MINIONSRL found fully serverless learning infeasible, and we adopt that hybrid split rather than fight it. What we change is the actors. In Nitro and MINIONSRL, actors run whole flat episodes, keep no state, and ship full trajectories. Here they are segment-scoped and stateful only through the shared frontier. Eviction of a worker loses at most one segment, never an episode.

We also need a scaling rule. Nitro scales actor count from a measure of how much curvature the policy's loss surface has at the current round. MINIONSRL trains an RL scheduler that takes 10 to 50 hours to learn. We use a simple rule that needs no training: launch more segment workers for subgoal $k+1$ while its success rate from frontier $k$ is rising. This resembles the burst handling in Sponge, where transient serverless operators absorb load spikes and merge partial state back, applied here to bursts of exploration at a newly opened subgoal.

The decomposition comes from one of three sources:

  1. A fixed manual sequence, such as wood, stone, iron, diamond.
  2. Subgoals learned during training: the causal graph from CDHRL in the Minecraft world, or waypoints on a graph of reachable states in the ant mazes, as in SSE.
  3. A hybrid in which learned subgoals can only be inserted between manual ones.

The analysis side records, for each run:

  • dollars and wall-clock time to reach a target success rate on the final subgoal;
  • 99th-percentile segment latency;
  • snapshot bytes per segment;
  • the fraction of compute spent on segments that failed;
  • recovery time under injected eviction;
  • for learned decompositions, the number of non-monotone schema changes and the cost of each barrier.

One honest constraint: restoring a snapshot requires a simulator that can be reset to a saved state. MuJoCo and grid crafting worlds can, but real robots cannot, so the claim is scoped to simulated training. Starting segments from frontier states also shifts the training distribution away from full episodes from the initial state. We therefore always report final success from true start states.

Baselines

The naive reference point is stateless serverless with remote storage. The segment executor stays identical, but snapshots and weights go to S3 and frontiers to DynamoDB. Hellerstein et al. report this style of architecture as 21x slower and 7.3x more expensive than EC2 for model training. The question is whether that penalty survives once segments are long relative to snapshot transfer.

The strongest algorithmic competitor is SSE run monolithically on a dedicated GPU virtual machine with its own vectorized actors. It reports nearly 100% success on AntDoubleKeyChest, where HIRO and HIGL get 0% (Strict Subgoal Execution). It is the strongest method on exactly the reach-or-fail hierarchical tasks we target, and it already uses failure-terminated segments, only without distributing them.

The strongest systems competitor is MINIONSRL-style scheduling of full-episode, stateless serverless actors running the same hierarchical policy. MINIONSRL reports cost cut by up to 86%, with SpaceInvaders falling from about $26 to about $7.8, and training time cut by up to 52% (MINIONSRL). Matching it isolates what segmenting adds beyond serverless billing. Nitro's flat actor boosting, reported at up to 6x reward and 42% lower cost (Nitro), is run as the flat reference.

Fairness rules apply to every system. All systems get the same environments and seeds and the same learner GPU. They also get the same tuning budget, a fixed number of hyperparameter trials per method. Total serverless and VM spending is capped at an equal dollar amount, and we compare success curves against dollars spent and against wall-clock time.

Two ablations isolate the key ingredients:

  • Boundary ablation. Cut segments at fixed time intervals rather than subgoal boundaries, with snapshots taken at those cuts. This tests whether subgoals specifically matter or whether any checkpointing would do.
  • Coordination ablation. Replace the grow-only frontier with a locked, transactional store. This tests whether coordination-free merging matters.

Beating the field means the following: final-subgoal success matching monolithic SSE within its seed variance, at lower dollars-to-target than both SSE-on-VM and the MINIONSRL-style executor, with the gap growing under injected eviction.

Why not just…?

Why not just run SSE on a Ray-style VM cluster where memory persists? This is the real threat when worker eviction is absent and rollout times are uniform. MINIONSRL's evidence that static clusters waste money while waiting at synchronization barriers (MINIONSRL) concerns flat synchronous training, not segmented hierarchical rollouts, so it does not settle the question. The SSE-on-VM baseline under equal dollars does. If it ties us without eviction, our contribution narrows to robustness under eviction and bursty demand, and we will say so.

Why not just store snapshots in S3 behind plain Lambda? If snapshots are small and segments run for seconds, transfer cost may be negligible, and colocated caching would be unnecessary. We expect the penalty to grow with snapshot size and policy size; skill ensembles and world models are large, and Cloudburst's 25x and 79x gaps are for 8MB objects. We sweep snapshot and model size to find the crossover rather than assume it.

Why not just learn the subgoals and drop manual specification? The learning-quality evidence favours learned subgoals, for example CDHRL reaching iron and diamond milestones far more often than HAC or MEGA (CDHRL). Our three-way decomposition comparison measures directly whether the systems advantage of a stable schema outweighs this. The hybrid arm exists because we expect neither pure option to win on both axes.

Why not just use periodic checkpoints and ignore subgoals? The boundary ablation answers this. Fixed-interval cuts give no notion of progress. Their frontiers cannot be prioritized by which milestone they reach, and failure cannot be detected early. We predict more compute wasted in failed segments, measured as the failed-segment fraction.

Proposed Experiments

The environments are 2D-Minecraft with its wood-to-diamond chain from CDHRL, AntDoubleKeyChest and AntMazeBottleneck from Strict Subgoal Execution, and the online AntMaze-Giant simulator from OGBench. In OGBench the offline baselines score 0% on the hardest maze and puzzle tasks, while COMPPLAN reaches up to 79% on AntMaze-Giant by composing policies. On 2D-Minecraft, no numerical success rate is reported on Lacuna for any baseline, so we report our own reproduction of CDHRL.

Three checks are decisive:

  1. Dollars-to-target. At equal final success, the frontier executor should be cheaper than both SSE-on-VM and the full-episode serverless executor. Failure of this prediction falsifies the core claim.
  2. Eviction sweep. We kill 0%, 10% and 30% of workers at random. The frontier executor's dollars-to-target should degrade far less than full-episode actors, because each eviction loses only one segment.
  3. Decomposition comparison. Manual, learned and hybrid subgoals should order as predicted. Barrier cost should scale with the number of subgoal retractions, and the hybrid should match learned decomposition's final success at close to manual decomposition's cost.

If the boundary ablation performs as well as subgoal cuts, the "subgoals as state contracts" thesis is wrong, and the result reduces to generic checkpointed serverless RL.