arXiv:2610.32225cs.ROOct 2026

Manuscript Offprint

arXiv:2610.32225

RoboCode: Learning Reusable Action Primitives for Robot Manipulation

Xianyue Peng, Devi Amarsaikhan, Iman Soltani

Abstract

Recent robot manipulation policies commonly predict continuous action chunks directly from observations, without explicitly modeling reusable structure in the action space. However, manipulation demonstrations often contain recurring short-horizon motion patterns that are shared across tasks. We introduce ROBOCODE, which learns these patterns through a shared soft-gated primitive action interface. Rather than assigning each action chunk to a single discrete code, ROBOCODE represents it as a soft composition of multiple learned primitives, providing a flexible intermediate representation of short-horizon actions. The primitive interface is learned from action chunks pooled across multiple tasks and then frozen while task-specific state encoders are trained to map current state inputs into the shared latent space.

Experiments on five ManiSkill manipulation tasks address three questions. First, the learned primitive interface reconstructs action chunks with an average reconstruction MSE of 0.0187. Second, analysis of code activations reveals structured code reuse across tasks. Third, ROBOCODE achieves the highest or tied closed-loop success rate on all evaluated tasks, with an average success rate of 75.6%, compared with 68.8% for ACT and 41.6% for the larger Diffusion Policy baseline. These results suggest that soft-gated primitive codebooks provide an effective and interpretable intermediate action representation for robot manipulation.

1 Introduction

Robot manipulation is often modeled as a sequence of continuous actions. Across tasks, demonstrations repeatedly contain short motion patterns such as reaching, lifting, placing, and pushing. This suggests that manipulation trajectories may be better understood through reusable primitive structure rather than as independent action chunks.

This raises a question of action representation. Recent token-based robot policies discretize each action dimension into bins [10], offering a simple interface but splitting coordinated actions into dimension-wise decisions. Task-level commands and planning operators [1] provide semantic structure, but often require a large vocabulary of task-specific actions, limiting generalization across tasks. Primitive-level representations offer a more compositional abstraction, capturing reusable motion units while preserving coordination across action dimensions and time.

Prior work has explored reusable units for robot manipulation [17, 25, 12], including behavior segments, semantic skill spaces, and discrete action modes. However, a single primitive may not be sufficiently expressive for a short action chunk, since the chunk can contain multiple motion factors. Inspired by memory-augmented models [4, 23], we learn primitive codes as entries in a shared primitive codebook and represent each chunk as a soft composition of multiple entries.

We propose ROBOCODE, a two-stage framework for learning soft-gated primitive codebooks from robot demonstrations. The first stage jointly learns an action encoder and a shared primitive action interface from multi-task action chunks. The second stage trains task-specific observation-to-gate policies that use this frozen interface to generate continuous action chunks for execution.

Our aim is to study whether soft-gated primitive codebooks provide an effective intermediate action representation for robot manipulation. The method does not require manually designed primitives, task rewards, or task labels during primitive learning; it discovers reusable action components directly from demonstrations. Our contributions are:

• We introduce a soft-gated primitive action representation that represents short-horizon manipulation actions as compositions of multiple learned primitives, rather than direct continuous predictions or single-code assignments.

• The proposed two-stage framework learns a shared primitive action interface from pooled multi-task demonstrations and reuses the frozen interface for task-specific closed-loop control.

• Experiments on five ManiSkill manipulation tasks demonstrate structured cross-task primitive reuse. ROBOCODE achieves the highest or tied success rate across all evaluated tasks, reaching an average success rate of 75.6%, compared with 68.8% for ACT and 41.6% for DP-Large. Controlled ablations and transfer experiments further examine the roles of soft composition and cross-task primitive sharing.

References (25)