Planning with Spatial-Temporal Abstraction from Point Clouds for Deformable Object Manipulation

Effective planning of long-horizon deformable object manipulation requires suitable abstractions at both the spatial and temporal levels. Previous methods typically either focus on short-horizon tasks or make strong assumptions that full-state information is available, which prevents their use on deformable objects. In this paper, we propose PlAnning with Spatial-Temporal Abstraction (PASTA), which incorporates both spatial abstraction (reasoning about objects and their relations to each other) and temporal abstraction (reasoning over skills instead of low-level actions). Our framework maps high-dimension 3D observations such as point clouds into a set of latent vectors and plans over skill sequences on top of the latent set representation. We show that our method can effectively perform challenging sequential deformable object manipulation tasks in the real world, which require combining multiple tool-use skills such as cutting with a knife, pushing with a pusher, and spreading the dough with a roller.


Introduction
Consider a typical cooking task of making dumplings from dough. People plan over which piece of dough to manipulate and which tool to use in sequence, incorporating both spatial and temporal abstractions. A spatial abstraction reasons about objects, parts, and their relations to each other, such as reasoning about pieces of dough instead of reasoning about individual dough particles; such a spatial abstraction enables efficient planning and compositional generalization. On the other hand, a temporal abstraction incorporates abstract actions represented as a set of skills. With abstract actions, the agent plans for the types and parameters of the skills to execute over a period of time, instead of making plans for low-level actions such as joint torques at each time step. Temporal abstractions allow planning at the skill level, enabling more efficient optimization for solving long-horizon tasks. An autonomous robot that operates in unstructured environments should be able to reason about world dynamics using high-level spatial and temporal abstractions instead of reasoning only over the physical state, raw sensory observation, or low-level robot actions.
The research community is making rapid progress towards developing state abstractions for manipulating deformable objects, including key points [1,2], graphs [3,4], dense object descriptors [5], or implicit functions [6,7]. However, most of these approaches do not make abstractions at the temporal level, limiting their use to short-horizon tasks. Methods are also being developed with temporal abstractions, planning over a set of skills to solve long-horizon tasks [8,9,10]. However, the lack of spatial abstraction severely limits their generalization ability. Therefore, it remains a key question in robot learning on how to learn spatial and temporal abstractions within a unified framework for complex and long-horizon manipulation tasks.
In this work, we focus on the challenging task of sequential deformable object manipulation, as shown in Figure 1. We consider a set of dough manipulation tasks that require sequentially applying different skills using multiple tools to manipulate dough, such as spreading using a roller, cutting using a knife and pushing using a pusher, where the longest task requires applying 6 skills in sequence. Deformable objects like dough have nearly infinite degrees of freedom. As such, in this work, we dynamically cluster points in a point cloud into different groups and learn a point cloud encoder to map each element in the group into a latent vector. In this way, we obtain a compositional 3D set representation of the state space. Given an observation and a target point cloud, we then sample skill sequences with subgoals generated in this latent space. We learn skill abstraction modules to determine the feasibility and score of each skill sequence and use them for planning.
Our contribution of this paper is a framework that PlAns with Spatial and Temporal Abstraction (PASTA) by learning a set of skill abstraction modules over a 3D set representation. Our framework can compose a set of skills to solve complex tasks with more entities and longer-horizon than what was seen during training. We show that PASTA significantly outperforms an ablation that performs planning with a flat representation without a spatial abstraction (e.g. without a set representation). Finally, our planner can be trained in simulation and transferred to the real world.

Related Work
Model-based Planning for Sequential Manipulation. One line of research for sequential manipulation is Task and Motion Planning (TAMP). TAMP systems typically assume known object states and known effects for the action operators [11,12,13,14,15]. However, it is difficult to estimate states and dynamics for unknown objects or from partial observations. While recent works have made progress in learning certain components of the system, such as the logical states [16] from high dimensional observations or learning action models [17,18,19] from interactions, they still require either known states or known action operators. In contrast, we do not assume known states or action operators, and learn a 3D set representation as well as the action model with the representation.
Another approach learns dynamics directly from visual observations [3,20,21]. Most of these works focus on learning a one-step dynamics model for planning short-horizon tasks. A few works learn the dynamics model over a set of skills and use it for sequential manipulation of rigid objects [22,23] or deformable objects [8]. However, these works do not use an object-centric representation and thus cannot easily generalize to more complex scenes. In contrast, our framework unifies both temporal and spatial abstraction and can perform long-horizon manipulation for complex tasks with more objects than in previous work, as we will show.
Planning with Spatial Abstraction. Prior works leverage spatial abstraction to facilitate solving tasks that involve complex dynamics and high-dimensional observations. These works either model a compositional system with Graph Neural Networks (GNN) [3,4,7,24,25] or learn policies directly from object-centric representations [26,27]. These works demonstrate compositional generalization, but they learn policies or one-step dynamics models for planning, which can be difficult for solving long-horizon tasks. In contrast, our framework connects temporally extended spatial abstractions with a feasibility predictor to plan over a longer time horizon. Xu et al. [28] learns a planner grounded Step 1 Step 2 Step 3 Enumerate attention structures goal pc < l a t e x i t s h a 1 _ b a s e 6 4 = " q 3 a 5 t F d R x J p g 1 7 j L v + 1 f 9 + n 9 w c j g a T 0 e T j 8 G 4 C d l g j z w j z 8 l L M i a v y R F 5 T 4 7 J j F D y n f w g P 8 m v 6 E N U R 6 t o v S m N e p c 9 T 8 g 1 R N / + A K V A 4 W 4 = < / l a t e x i t > u obs 0 < l a t e x i t s h a 1 _ b a s e 6 4 = " 7 J i d 2 C b 9 t R M a 2 X 5 r f W Q 5 k I w e v q c = " < l a t e x i t s h a 1 _ b a s e 6 4 = " J / g 5 j 7 W v l J X U k C 1 z S N 2 j 2 I 8 y k r o = " < l a t e x i t s h a 1 _ b a s e 6 4 = " K S Z 1 W v 0 k y P L H L A U 4 R l 9 4 k 3 4 J k 0 q I 3 g S r a u z n 3 4 + J y 8 5 s z Y J P n Z i 6 5 c v X b 9 x s 7 N / q 3 b d + 7 e G + z e P z K q 0 R S m V H G l T 3 J i g D M J U 8 s s h 5 N a A x E 5 h + P 8 9 F V b P 1 6 C N k z J 9 3 Z V Q y Z I J V n J K L E B m g 9 G L u 2 W z H S V Z 2 4 U J 1 0 M k / h l i M l k u E F 8 M 3 f j I U 6 8 n w / 2 N i D e t O G / y C b Z O 3 j 4 9 t f v r 9 G H w / l u 7 A V 9 Q 9 / R j + h 1 J C I b L d e t U e 9 8 5 g G 6 F N H n P x R Y 4 A k = < / l a t e x i t > u 2,0 < l a t e x i t s h a 1 _ b a s e 6 4 = " r l 7 < l a t e x i t s h a 1 _ b a s e 6 4 = " 2 p C 8 G 9 C q m A R a V X F F U 5 H d h U 0 5 G w k = " > A A A C y X i c d V F N b x M x E H W W r x K + U h A n L i s K U g 9 R t K n a 0 N 4 q c U H i U i T S V s q G a N Y 7 u 7 H q j 8 X 2 t g 3 G J / 4 D F 3 4 K J 6 7 0 x J F / g z d p U B v B S L Z G 7 8 2 M n + d l F W f G J s n v V n T j 5 q 3 b d 9 b u t u / d f / D w U W f 9 8 a F R t a Y 4 p I o r f Z y B Q c 4 k D i 2 z H I 8 r j S A y j k f Z y e u G P z p F b Z i S 7 + 2 s w r G A U r K C U b A B m n R 2 X D o f M t J l N n b 9 X j K P b t L b C z E Y d J e I r z + 4 U g H 3 E 5 d 4 P + l s L I l 4 W R r / R Z b J x v 7 T 7 1 8 3 L 3 6 9 O J i s t z 6 n u a K 1 Q G k p B 2 N G / a S y Y w f a M s r R t 9 P a Y A X 0 B E o c h V S C Q D N 2 c 2 k + f h m Q P C 6 U D k f a e I 5 e 7 X A g j J m J L F Q K s F O z y j X g P 7 k s U z z 3 K 5 C 4 r k b X H P P u a b P g P A j m p d L M T s X W q m h b 7 I 4 d k 1 V t U d K F 5 q L m s V V x s / c 4 Z x q p 5 b O Q A A 0 T G I 3 p F D R Q G 9 x p p z k W 4 Y H 5 z 5 z S I E v 0 L l j i G 0 u 6 Y c c 7 z Z W E J y W e U S U E y N y l o E s B 5 9 6 l q k I N V u l m b W d B H W e C W e M u e d + + 6 t f / k 8 O t X n / Q 2 3 4 X j N s m i 1 g j z 8 h z s k n 6 5 B X Z J 2 / I A R k S S r 6 R H + Q n u Y j e R h + j 8 + j T o j R q X f Y 8 I d c i + v I H W X 3 i r Q = = < / l a t e x i t > u goal 0 < l a t e x i t s h a 1 _ b a s e 6 4 = " h e i E H x I E U + U D k f a e I 5 e 7 X A g j J m J P F Q K s F O z y j X g P 7 k 8 V 7 z w K 5 C 4 r k b X H I v u a b P g I g j m p d L M T s X W q m g 7 2 R 0 5 J q v a o q Q L z Z O a x 1 b F z d 7 j g m m k l s 9 C A j R M Y D S m U 9 B A b X C n n R U 4 C Q / M f + a U B l m i d 8 E S 3 1 j S D T v e a a 4 k P C n x j C o h Q B Y u A 1 0 K O P c u U x V q s E o 3 a z s L 6 j g T z B p 3 y f v 2 V b / + n x x u 9 d J + b / t d M G 6 b L G K N P C P P y S Z J y S u y T 9 6 Q A z I g l H w j P 8 h P c h G 9 j T 5 G 5 9 G n R W n U u u x 5 Q q 5 F 9 O U P W 6 7 i r g = = < / l a t e x i t > u goal e E H w m M / A A q d g d z 8 r s A w D F j / z x o K u s P W 2 y l s f z N w O 1 r 7 p r i S M 1 H j B j V K g C 5 + B r R R 8 a 3 1 m a r R A x n a 2 X Q R 1 U i h B z q / y b T / s K 1 3 f z k 1 w t D N M 3 w 5 3 v y S D v V 2 2 j A 3 2 n L 1 k r 1 n K 3 r E 9 d s B G b M w 4 k + w 7 + 8 l + R S + i / e h T 9 H l Z G v V W P c / Y t Y g O / w K j Z 9 R 7 < / l a t e x i t > P goal < l a t e x i t s h a 1 _ b a s e 6 4 = " R q X c s s B x M Z p 6 Z H z g m T 8 Y 7 l n + W J Y = " > A A A C m X i c b V F N b 9 N A E N 2 Y j 5 b w 1 c K x F 4 s I i U M V 2 V W B 3 i j i U n E K g j S V 6 l C N 1 2 N n l f 2 w d s c t 0 e I f w Z H y S / g p / B v W S Q 4 0 Z a R d P b 2 Z 2 X n 7 J q + l c J Q k f 3 r R n b v 3 7 m 9 t P + g / f P T 4 y d O d 3 W e n z j S W 4 5 g b a e x Z D g 6 l 0 D g m Q R L P a o u g c o m T f P 6 h y 0 8 u 0 T p h 9 B d a 1 D h V U G l R C g 4 U q M n o q z e 5 a y 9 2 B s k w W U Z 8 G 6 R r M H j 3 + 2 c X 1 6 O L 3 d 7 3 r D C 8 U a i J S 3 D u P E 1 q m n q w J L j E t p 8 1 D m v g c 6 j w P E A N C t 3 U L / W 2 8 We then sample point clouds (pc) from the demonstration trajectories to train our set skill abstraction modules. (c) We map point clouds into a latent set representation and plan over tool-use skills to perform long-horizon deformable object manipulation tasks. P obs , P goal are the observation and target pc; ui,j denotes component j at step i. The example shows our method performs the CutRearrange task, which requires cutting the dough into two pieces with a knife and transporting each piece to its target location. on object-centric visual observation and can solve long-horizon tasks. However, its planner takes a symbolic goal and plans in a predefined symbolic domain to output symbolic subgoals. In contrast, our method does not require defining a symbolic planning domain.
Deformable Object Manipulation. Deformable objects have nearly infinite degrees of freedom and complex dynamics, making them very challenging to manipulate. Previous works have explored pouring liquid [6,29,30], rope manipulation [31,32], and cloth manipulation [33,34,4,35,36]. Other papers have also explored manipulating elasto-plastic objects such as deforming them by grasping [3,37], rolling [38,39,40], or cutting [41]. However, these works mostly only consider manipulation with one skill at a time. In contrast, we consider the task of sequential manipulation using multiple tools. The one exception is DiffSkill [8], where multiple skills are chained together. However, DiffSkill uses RGB-D images to represent the scene. In contrast, we use a 3D set representation that separately encodes each entity in the scene, enabling compositional generalization to tasks with more objects and longer-horizon. Furthermore, we use point clouds as the input and we are able to transfer our planner from simulation to the real world.

Method
Given a point cloud of the dough P obs and a goal point cloud P goal , our objective is to execute a sequence of actions a 1 , ..., a Ttot that minimizes the distance between the final observed point cloud and the goal D(P obs Ttot , P goal ) where P obs Ttot is the observation point cloud at time T tot . We aim to solve long-horizon tasks that require chaining multiple skills in novel scenes with more objects than training. To do so, we present a general framework that incorporates spatial and temporal abstractions, as summarized in Figure 2. We use point clouds as input to all our modules to enable easier transfer from simulation to the real world and to enable robustness to changes in viewpoint.
We assume access to an offline dataset of demonstration trajectories D demo from K skills, where each trajectory demonstrates one of the skills using one tool. We can learn skill policies by imitation learning from these demonstrations. To chain these skills to solve long-horizon tasks, we train a set of skill abstraction modules (Sec. ) which can be used for planning in the latent space (Sec. ).

Spatial Abstraction from Point Clouds
Scene Decomposition: First, we describe our spatial abstraction of the point cloud observation. Given a point cloud P ∈ R N ×3 , we first cluster the points into different components based on their proximity in space. In this paper, we apply DBSCAN [42] to P and group points into a set of entity point clouds {P i ∈ R Ni×3 } i=1...C by separating points from high-density regions into different clusters. While other works on scene decomposition can also be used [43], we find this simple method to be sufficient for our tasks.
Entity Encoding: Planning directly in the high-dimensional space of point clouds is inefficient. To enable efficient planning in a latent space, we train a point cloud variational autoencoder (VAE) [44]. The VAE model includes three modules: A point cloud encoder φ : R Ni×3 → U that maps each entity point cloud to a latent vector, a decoder ψ : U → R Ni×3 that maps from a latent space back into a point cloud, and a prior distribution over the latent space p u : U → [0, 1] which can be used to generate samples from the latent space during planning. We can then encode the point clouds {P i } into a set of latent vectors: {u i } i=1...C as our set latent representation. We further achieve translation invariance by separating the translation from its shape embedding. See the Appendix for details.

Learning Skills by Imitation
Given the demonstration trajectories D demo of K skills, we first distill these trajectories into K closed-loop policies. The input to the policy for the k th skill π k is a subset of the observed point clouds {P o i } and goal point clouds {P g j }, and a tool point cloud P tool k . The policy only sees a subset of the dough point cloud and goal point cloud in the scene to enable compositional generalization to scenes with more objects. For example, a dough-spreading policy will only see the dough being spread. To achieve this, we train each set point cloud policy with behavior cloning and hindsight relabeling [45] on the demonstration dataset with an attention mask that filters out the non-relevant entity point clouds. During planning, this attention mask will be provided by the planner. The policy outputs an action at each timestep to control the tool directly.

Neural Spatial and Temporal Abstraction
We assume that each skill learned from the demonstration is only capable of performing a single-stage task with a single tool for a single object. To solve longer-horizon tasks, we further learn a feasibility predictor and a cost predictor. They can be used to plan subgoals that chain the skills into a sequence, such that each subgoal is feasible for the corresponding policy to reach and the final subgoal reaches a given goal. Additionally, all these modules take in the set representation {P 1 . . . P C } as input to achieve compositional generalization.
Set Feasibility Predictor Similar to DiffSkill [8], we train a feasibility predictor ...Ng are latent set representations of an observation and goal point cloud respectively. The feasibility predictor outputs a value in [0, 1] denoting if the goal can be reached from the observation by executing the k th skill. In DiffSkill, the feasibility predictor uses a flat representation that takes in a single latent vector for all objects in the scene as input. However, as our skills such as cutting or spreading only need to take in a subset of the objects as input, we use the same attention method for the feasibility and assume that the feasibility predictor only takes as input a subset of the full set Here, N k and M k are the number of components in the observation and goal for skill k. The number of components in the observation and goal can be different since the number of components can change before and after executing a skill; for example, the cut skill takes one component as observation and cuts it into two components. As another example for robot assembly [46], the number of entities increases when a piece is disassembled into parts and the number of entities decreases when the parts are assembled. In this work, we manually define the number of entities N k , M k per skill. Determining which subset to attend to when executing each skill can be difficult; we make this decision during planning and defer the details to Sec. . We parameterize f k to be invariant to permutation using max-pooling layers. See Appendix for details.
We train the feasibility predictor of skill k with positive examplesÛ o ,Û g , where the goalÛ g can be reached from the observationÛ o within T timesteps by executing skill k. The negative examples are goalÛ g that cannot be reached from the observationÛ o using skill k. During training, we obtain positive pairs for the feasibility predictor by sampling two point clouds (P obs , P goal ) from the same trajectory in the demonstration set. To findÛ o ,Û g , we first cluster the observation and goal point clouds into two sets {P o i }, {P g j } respectively. Then, we match point clouds in the observation set to those in the goal set by finding the pairs of point clouds that are within a Chamfer distance of : We then remove these point clouds from the corresponding set, since these are the point clouds that have already been moved to the target location in the goal. We can then encode the remaining point clouds intoÛ o ,Û g as explained above. We generate hard negative samples by replacing one entity in the positive examples with a random latent vector.
Set Cost Predictor As we do planning in a latent space, we train a set cost predictor as our planning objective which determines how close a plan is to a given goal. The set cost predictor C takes two latent set representation as input U o , U g . Since our tasks focus on matching each entity in the observation with one in the goal, we assume they have the same number of components, i.e.
To compute the cost, we try to find the matching entity with the minimal where σ is a permutation and c θ is a cost prediction network parameterized by an MLP trained to predict the Chamfer Distance between the point clouds corresponding to the two latent vectors. This allows faster planning compared to first decoding latent vectors to point clouds and then computing their distance. Finally, optimization of the cost is done by performing Hungarian matching between the two sets containing latent vectors.

Planning with Set Representation
Given an observation and a goal point cloud P obs , P goal , we plan for the types of skills to apply in sequence, the attention for each skill (i.e. findÛ o ⊆ U o ), and the latent subgoals for each skill (i.e. the exact value for each latent vector inÛ o ). As the simplest approach, we run a three-level nested optimization: In the top level, we exhaustively search over the combinations of skills to apply at each step, i.e. k 1 . . . , k H , where k h indexes the skill applied at the high-level step h. We only keep the sequences that end with the same set cardinality as the goal by ensuring that In the second-level optimization, we search over different attention structures. Denote the latent set at the high level step h to be U h . We formally define the attention structure at step h to be I h , which consists of a list of indices, each of length N k h , such that I h selects a subset from U h−1 to be the input to the feasibility predictor, i.e.Û h−1 = U h−1 I h ⊆ U h−1 . Assume that we have N h components before applying skill k h , i.e. |U h−1 | = N h and skill k h takes K h components as its observation. We can search over all C K h N h combinations of attention structures. For components not considered by the skill, its latent vector will remain the same at step h. The combination of each skill attention yields an attention structure I for the whole plan, as illustrated in Fig. 2(c). For this level of optimization, we use a sampling-based procedure to avoid an exhaustive search over topologically equivalent attention structures. See the Appendix for how we do this efficiently.
In the low-level optimization, for each attention structure I, we follow the optimization in DiffSkill [8]. We first sample multiple initializations for the set of latent subgoals U, where each latent vector in the set is initialized from our generative model. We can then perform gradient descent to further optimize the latent subgoals on the following objective: where k is the skill sequence, I is the attention structure of the plan, U is the set of all latent subgoals, Optimize latent subgoalsÛ 1 , . . .Û H according to Sec. to obtain cost J(k, I, U) ; 5 Choose skill sequence k, attention structure I, and subgoals U that minimizes J(k, I, U) ; 6 for h ← 0 to H − 1 do 7 Decode the subgoal fromÛ h using the decoder ψ ; 8 Execute policy π ki following the subgoal ; and U g is the goal set. Finally, we can use our policy to execute our plan by following each subgoal. A summary of our method can be found in Algorithm 1.

Experiments
Our experiments are categorized into three parts: In Sec. 8, we describe the experimental setups and the baselines we consider. In Sec. 8 and Sec. 8, we show that PASTA outperforms the baselines and ablate different components in our framework. In Sec. 8, we demonstrate that PASTA can be effectively transferred to the real world without any fine-tuning.

Simulation Tasks and Baselines
Environment setups We consider several long-horizon dough manipulation tasks and divide them into two categories. First, we consider the three tasks from Diffskill [8]: LiftSpread, GatherTransport, and CutRearrange. These tasks require the agent to sequentially compose at most two skills to spread, cut or transport the dough. We further propose two new generalization tasks: CutRearrangeSpread (CRS) and CRS-Twice, where there are more entities during testing than during training. Similar to prior work [8], we specify the minimal planning horizon required for each task. Our approach also succeeds when we increase the horizon up to twice as long. See the Appendix, Sec 4.5 for details.

Generalization tasks
The CRS task provides a number of demonstration trajectories performing one of the three skills: Cutting with a knife, pushing with a pusher, and spreading with a roller. The demonstration of each skill only shows a tool manipulating a single piece of dough. During testing, the agent needs to cut a dough into two, transport one piece to a spreading area and then spread it. Generalization to more entities is required as there will be two entities in the scene, whereas during training there was only one entity. Can we do even more generalization? In the CRS-Twice task, we use the same agent trained on the CRS dataset and ask it to cut two pieces of dough from a chunk, transport both of them to a spreading area, and spread them both. This is a 6-horizon task with up to 3 entities in the scene, much more complex than the skill demonstrations the agent is trained on. Due to the long-horizon nature of CRS-Twice, we specify the skill skeleton and use receding horizon planning for all the planning-based methods. See the Appendix for details.
Baselines We consider several baselines in simulation: First, a gradient-based trajectory optimizer with oracle information (Traj-Opt), which can solve single-stage tasks for deformable object manipulation as shown in prior works [47]. Second, a model-free RL with Soft Actor Critic [48] with RGB-D image input (SAC-Image). Third, a SAC agent that takes in the dough, target dough, and tool point clouds as input, the same as our method (SAC-Point). Fourth is DiffSkill, a model-based planning method from Lin et al. [8], which takes RGB-D images as input and has no spatial abstraction. The last one is Flat 3D, which extends DiffSkill to use 3D point clouds as input, with a "flat" 3D representation that encodes the whole scene to a single latent vector without any spatial abstraction.
Metric We specify goals as 3D point clouds of different geometric shapes such as boxes and spheres at specific locations. We report the normalized decrease in the Earth Mover Distance (EMD) approximated by the Sinkhorn diverge [49] computed as s(t) = s0−st s0 , where s 0 , s t are the initial and current EMD. We additionally set a threshold for the score to determine the success of a trial.

Comparison with Baselines in Simulation
Method Task (Horizon) DiffSkill tasks Generalization tasks LiftSpread (2) GatherMove (2) CutRearrange (3) CRS (3) CRS-Twice (6) Traj-Opt (Oracle) [   Effectively using spatial abstraction to model the scene, PASTA achieves 100% success rate in CRS and retains a good performance in CRS-Twice. All the baselines, especially the planning baselines (DiffSkill, Flat 3D) fail dramatically, as they can only produce plans that consist of scenes seen in training. Impressively, PASTA is the only approach that reaches a non-zero success rate on these tasks that require compositional generalization. PASTA has a computational complexity of O(K H · |I| · T G ), where K is the number of skills, H is the planning horizon, |I| is the number of attention structures and T G is the time it takes to solve each gradient-based optimization. We discuss more efficient planning algorithms in the limitation section as well as in the Appendix, Sec. 5.   Table 2 shows the quantitative performance of each ablation and PASTA in CutRearrange. First, we consider a variant of feasibility predictor's training, which removes the hard negative samples and only uses random negative sampling (No Hard Negatives), which halves the success rate. Second, we consider two variants of the planner, one without gradient-descent (No Gradient Planning) and one without sampling (No Sampling Planning). The results show that both components are crucial to planning. We provide more ablations on the policy and the planner in the Appendix. Figure 3 shows our real world setup. We use a Franka robot with an Azure Kinect camera capturing the RGB-D observation of the workspace. The robot is equipped with a tool station [50] that allows an automatic change of tools. For real world "dough", we use Kinect Sand as a proxy because of its stable physical property. We transfer the feasibility predictor and cost predictor of PASTA directly from simulation and define heuristic controllers for the skills. For evaluation, we first generate a desired target point cloud and then reset the dough to its initial shape and record its point cloud. We then plan using PASTA and then use the heuristic controllers to follow the plan. Finally, we report the normalized improvement EMD. We compare with the Flat3D method and also with human.

Real World Experiments
We evaluate three of the simulation tasks: CutRearrange, CRS, and CRS-Twice. For each task, we evaluate the same four initial and target shapes for all methods and report the performance in Table 3. Figure 3 shows the keyframes from the execution of PASTA. We overlay the planned subgoals as well

Observation
Step 1 Step 2 Step 3 Final 3D view

Observation
Step 1 Step 2 Step 3 Final 0.820 CutRearrange CRS-Twice Observation Step 1 Step 2 Step 3 Step 4 3D view Step 5 Step  Figure 3: Real world setup and execution with planned subgoals. Our workspace consists of a Franka robot, a top-down camera, and a novel tool changer behind the robot that allows the robot to automatically switch tools.
For each task, we show frames after executing a skill overlaid with the decoded point cloud subgoal; we report the final performance in red and overlay the ground truth target in green in the final frame. Additionally, we include a 3D view of the last generated subgoal to show the shape variations.
as the final goal. PASTA performs on par with human in the real world, highlighting the robustness of our planner and the advantage of using 3D representation for sim2real transfer.  Table 3: Normalized improvement on real world tasks. Each entry shows the mean and std of the performance over 4 runs. Flat 3D does not produce any meaningful plan for CRS, so we do not evaluate it on CRS-Twice.

Conclusions and Limitations
In this work, we propose a planning framework named PASTA that incorporates both spatial and temporal abstraction by planning with a 3D latent set representation with attention structure. We demonstrate a manipulation system in the real world that uses PASTA to plan with multiple tool-use skills to solve the challenging deformable object manipulation tasks, and we show that it significantly outperforms a flat 3D representation, especially when generalizing to more complex tasks.
Limitations: First, we only transfer the planner to the real world and use heuristic controllers instead of the policy trained in simulation. This is due to the sim2real gap caused by the differences in dough's physical parameters, table friction, and occlusions from the robot arm. Prior work [38] shows promising results in transferring a closed-loop policy taking partial point clouds as input, and future work can explore better sim2real methods. Second, our planner exhaustively searches overall skill combinations and attention structures and does not scale well to longer sequences with more skills. Future work can incorporate more efficient search algorithms or priors to prune the search space. Finally, we rely on an unsupervised clustering method for entity decomposition and a point cloud VAE for mapping an observation to our latent set representation. Future work can incorporate self-supervised methods for learning the decomposition. For further discussion on the limitations and future work, please see Sec. 5 of the Appendix.
1 Implementation Details

Entity Encoding
To train our point cloud variational autoencoder [44], we normalize the point cloud of each entity P i to be centered at the origin, i.e.P i = P i − t i , where t i is the mean of all points in P i . We then encode each centeredP i into a latent encoding: consists of the encoding of the point cloud's shape z i and the position of the center of the point cloud t i . We model the point cloud's position t i explicitly such that the learned latent embedding z i can focus on shape variation alone and the model that plans over u i can still reason over point clouds at different spatial locations. During training, we record the 3D bounding box of all training data t min , t max ∈ R 3 , and we sample from [t min , t max ] during planning. We denote this combined distribution of u = [z, t] as P u .

Details on Training Set Feasibility Predictor
Hard Negative Samples Suppose skill k takes N k latent vectors from observationÛ o and M k latent vectors from goalÛ g as input.
To generate random pairs of observations and goals as negative samples for the feasibility predictor, we can sample each latent point cloud representation u i by sampling the shape z i from the VAE prior p z and sampling the position t i from the distribution of positions in the training dataset. Such random negative samples are used similarly in DiffSkill [8]. However, as the combined dimension of the set representation becomes larger compared to a flat representation, we need a way to generate harder negative samples. To do so, for a positive pair of set representation ({u o i }, {u g j }), we randomly replace one of the entities u o i or u g j with a random sample in the latent space and use it as a negative sample. Our ablation results show that this way of generating hard negative samples is crucial for training our set feasibility predictor.
Noise on Latent Vectors During training of the feasibility predictor, for each of the input latent vector u = [z, t], where z ∈ R Dz is the latent encoding of the shape and t ∈ R 3 is the 3D position of the point cloud, we add a Gaussian noise to each part, i.e.ẑ = z + σ z andt = t + σ t , where ∼ N (0, I). The amount of noise determines the smoothness of the feasibility landscape. Without any noise, planning with gradient descent with the feasibility function becomes much harder.

Details on the Attention Structure for Planning with Set Representation
Given the initial latent set observation U obs with N o components, and the skill sequences k 1 , . . . , k H , in this section we describe how to generate the attention structure. We denote the latent set representation at step h as U h , h = 1 . . . H and define U 0 = U obs . As skill k h takes in N k h components as input and M k h components as output, by calculation we know that U h has N o + h i=1 M ki − N ki components. From now on, we denote |U h | = N h and U h = {u h,1 , . . . , u h,N h }. As the skill k h only applies to a subset of the input U h−1 , we now formally define the attention structure at step h to be I h , which consists of a list of indices, each of length N k h , such that I h selects a subset from U h−1 to be the input to the feasibility predictor, i.e.
However, enumerating all I h is infeasible, as there are C N k h N h combinations for each step. Fortunately, we do not have to enumerate all different structures. The insight here is that, for each attention structure I 1 , . . . I H , we will perform a low-level optimization. In this low-level optimization, we will first initialize all the latent vectors to be optimized from P u and then perform gradient descent on them. As many of the attention structures yield topologically equivalent tree structures (An example of such a tree is illustrated in Figure 2c of the main paper), and each latent vector in the tree is sampled independently from the same distribution P u , these topologically equivalent tree structures result in the same optimization process. As such, we do not need to exhaust all of such attention structures.
Instead of enumerating each topologically different structure and then sampling multiple initializations for the low-level optimization, we randomly sample sequences (I 1 , . . . I H ) and perform low-level gradient-descent optimization on all the samples. In this way, with enough samples, we will be able to cover all attention structures. Now, we can sequentially build up the subgoals latent set representation during planning. Specifically, assuming that we have constructed the previous latent set representation U h−1 , we will now describe the procedure for constructing U h , as well as the predicted feasibility for the current skill k h , i.e. f k h (Û o,h ,Û g,h ), whereÛ o,h ,Û g,h are the subset of U h−1 and U h attended by the feasibility predictor. First, we generate I h by randomly choosing the index of a subset from U h−1 . U h are composed of two parts: The first part is the latent vectors generated by applying the skill k h . For this part, we will create a set of new vectors u h,0 , . . . u h,M h k . This part of the latent vectors will be attended by the feasibility predictor asÛ g,h = {u h,0 , . . . u h,M h k }. The second part of U h comes from the previous latent set vectors that are not modified by the skill, i.e. U h−1 \ U h−1 I h , and U h is the addition of both parts, i.e.
In this way, we can sequentially build up U h from U h−1 , and U 0 is simply U obs . At the same time, we have determined our attention structure and the feasibility prediction. Our objective can thus be written as arg min where U is the set union of all latent vectors to be optimized.

Network Architectures
Set Feasibility Predictor We use a Multi-Layer Perceptron (MLP) with ReLU activations for our feasibility predictor. We apply max-pooling to the transformed latent vectors ofÛ o andÛ g to achieve permutation invariance. Below is our architecture: Set Policy The set point cloud policy for the k th skill π k takes in an observed point cloud P obs , a goal point cloud P goal , and a tool point cloud P tool k and outputs an action at each timestep to control the tool directly. The tool point cloud P tool is obtained by sampling points on the mesh surface of the tool and then transforming these points to the same camera frame as the P obs and P goal , assuming the pose of the tool is known from the robot state. Instead of taking latent vectors as input, the policy functions directly in point cloud space, which allows it to handle times when spatial abstraction is ambiguous. For instance, during cutting and merging, the number of dough components gradually increases or decrease, during which the latent set representation is not changing smoothly while the point clouds change smoothly during the process. We later show the advantage of using point clouds directly as the policy input. We concatenate each point's (x, y, z) coordinates with a one-hot encoding to indicate whether the point belongs to the observation, tool, or goal, and we input the points into a PointNet++ [51] encoder followed by an MLP which outputs the action. We use a point cloud for the tool to allow the PointNet encoder to reason about the interaction between the tool and the dough in the same space. We use PyTorch Geometric's [52] implementation of PointNet++ and with the following list of modules in our encoder.  200  200  1500  1200  # of target configurations  200  200  1500  1200  # of training trajectories  1800  1800  1350  1080  # of testing trajectories  200  200  150  120  # of total trajectories  2000  2000  1500  1200  # of total transitions  1e5  1e5 7.5e4 6e4

Training Details
Training data. We inherit the data generation procedure from DiffSkill [8]: first, we randomly generate initial and target configurations. The variations in these configurations include the location, shape, and size of the dough and the location of the tool. We then sample a specific initial configuration and a target configuration and perform gradient-based trajectory optimization to obtain demonstration data. For each task, the demonstration data consists of all the transitions from executing the actions outputted by the trajectory optimizer. We perform a train/test split on the dataset and select 5 configurations in the test split for evaluating the performance for all the methods. More information about training and testing data can be found in Table 4.
Point cloud VAE. We train our point cloud VAE by maximizing the evidence lower bound (ELBO). For a dataset of observations P (X), which consists of the segmented point cloud of each entity in the scene, we optimize the following objective: where Q φ (z|X) is the encoder modeled as a diagonal Gaussian, P ψ (X|z) is the decoder, and p(z) is standard Gaussian. The VAE is pretrained, and we fix its weights prior to training the other modules.
Point cloud policy. We train our point cloud policy with standard behavioral cloning (BC) loss, i.e. for the k-th skill, we sample a transition from the demonstration data, which contains the observed point clouds {P o i }, goal point clouds {P g j }, a tool point cloud P tool k , and the action of the tool a. Then, we match point clouds in the observation set to those in the goal set by finding the pairs of point clouds that are within a Chamfer Distance of : {(P o i , P g j ) | D Chamf er (P o i , P g j ) < } and filter out the non-relevant point clouds. Last, we pass the filtered point clouds into the policy and minimize the following loss: Feasibility predictor. We train the feasibility predictor for the k-th skill by regressing to the groundtruth feasibility label using mean squared error (MSE) as loss, i.e.
During training, we obtain positive pairs for the feasibility predictor by sampling two point clouds (P obs , P goal ) from the same trajectory in the demonstration set. To findÛ o ,Û g , we first cluster the observation and goal point clouds into two sets {P o i }, {P g j } respectively. Then, we match point clouds in the observation set to those in the goal set by finding the pairs of point clouds that are within a Chamfer Distance of : {(P o i , P g j ) | D Chamf er (P o i , P g j ) < }. We then remove these point clouds from the corresponding set, since these are the point clouds that have already been moved to the target location in the goal. We can then encode the remaining point clouds intoÛ o ,Û g using our VAE.
Cost predictor. We train the cost predictor by simply regressing to the Chamfer Distance (CD) between two entities represented by their latent vectors, i.e.  where P i and P j are point clouds of a single entity sampled from the dataset and φ is the encoder.
There are two reasons that we train a cost predictor on latent vectors instead of directly computing the Chamfer Distance between two point clouds. For one, decoding each latent vector would greatly bottleneck the planning speed. Experiments on CutRearrange show that with our learned cost predictor, the planning takes 35s; on the other hand, if we decode the latent vectors and use the Chamfer Distance, even with a subsampled point cloud of 200 points, the planning takes 37200s (around 10 hours), which is impractical to use. Moreover, using a cost predictor can also offer us the flexibility to incorporate more complex reward functions in the future.
Finally, We train our policy, feasibility predictor, and cost predictor with the following loss: We use λ π = 1, λ f = 10, and λ c = 1 for all of our experiments.

Hyperparameters for Simulation Dough
We use PlasticineLab [47] for evaluating our simulation experiments. We provide the hyperparameters that are relevant to the properties of the dough in simulation to enhance the replicability of our results. See Table 5 for details.

Hyperparameters for DBSCAN
To cluster a point cloud, we use Scikit-learn's [53] implementation of DBSCAN [42] with eps=0.03, min_samples=6, min_points=10 for all of our environments. Further, we assign each noise point identified by DBSCAN to its closest cluster. Table 6 shows the hyperparameters used for PASTA in our simulation tasks. Planning for CRS-Twice requires a large amount of samples. Therefore, we modify the planner to improve sample efficiency. See Sec. 2.4 for details.

Receding Horizon Planning for CRS-Twice
As the planning horizon increases, the number of possible skill sequences as well as the number of possible attention structures increases exponentially. The task of CRS-Twice has a planning horizon of 6 and is a much more difficult task to solve. As such, for this task, we specify the skill sequences and use Receding Horizon Planning (RHP). Starting from the first time step, we follow the procedure in Algorithm 1 but only optimize for H RHP steps into the future and compare the achieved subgoal with the final target to compute the planning loss. After optimization, we take the first subgoal from the plan and discard the rest of the plan. We then repeat this process until we reach the overall planning horizon H. In our experiments, we use H RHP = 3. While we can perform model predictive control and execute the first step before planning for the second step, we find this open-loop planning and execution to be sufficient for the task.

Heuristic Policies
Transferring the learned policies from simulation to the real world can be more difficult than transferring the planner itself, as the policies are affected more by the sim2real gap, such as the difference in friction and properties of dough in the real world. To sidestep this challenge, for our real world experiments, we design three heuristic policies: cut, push, and roll to execute the generated plans in the real world.
Just like our learned policies in simulation, each heuristic policy takes in the current observation and the generated subgoal in point clouds and outputs a sequence of desired end effector positions used for impedance control. In addition, each policy takes in the attention mask provided by the planner indicating the components of interest. The same DBSCAN procedure is used for this. The cut policy first calculates the cutting point by computing the length ratio of the resulting components. Then it cuts the dough and separates it such that the center of mass of each resulting component matches the one in the subgoal. For the push policy, given a component and a goal component, the policy pushes the dough in the direction that connects the two components' center of mass. The roll policy first moves the roller down to make contact with the dough. Then, based on the goal component's length, the policy calculates the distance it needs to move the roller back and forth when making contact with the dough.

Procedure for Resetting the Dough
To compare different methods with the same initial and target configurations, we first use a 3D-printed mold to fit the dough to the same initial shape. We then overlay the desired initial location on the image captured by the top-down camera and place the dough at the corresponding location in the workspace to ensure different methods start from the same initial location.

Procedure for the Human Baseline
Following the same procedure in section 3.2, we first reset the dough to the initial configuration. Then, we overlay the goal point cloud on the image captured by the top-down camera. The overlay image is shown on a screen and presented to the human in real-time when the human is completing the task.

Procedure for Making the Real Dough
Material Quantity(g) Baker's percentage(%) Flour 300 100 Water 180 60 Yeast 3 1 We follow the recipe shown in Table 7 to make the real dough. Following the tradition of baking, we use the backer's percentage, so that each ingredient in a formula is expressed as a percentage of the flour weight, and the flour weight is always expressed as 100%. First, we take 300 grams of flour, 3 grams of yeast, and 180 grams of water into a basin. Then, we mix the ingredients and knead the dough for a few minutes. Next, we use a food warp to seal the dough in the basin and put them in the refrigerator to let the dough rest for 4-5 hours. Finally, we take out the dough from the refrigerator and reheat it with a microwave for 30-60 seconds to soften it.  Ablations on feasibility predictor. Following the discussions in Sec 1.2, we train a feasibility predictor without adding any noise to show that adding noise helps with the optimization landscape during planning. We call this ablation No Smoothing Feasibility. As shown in Table 8, this variant only achieves half of the success rate of PASTA, suggesting the importance of noise during training.
Ablations on policy. We consider two ablation methods for our set policy. First, we consider a Shared Encoder Policy that takes in the latent vectors from the encoder and uses a max pooling layer followed by an MLP to produce the action. The architecture is very similar to our Set Feasibility Predictor. Our results in Table 8 show that this architecture has zero success in our task. We hypothesize that this is because the entity encoding can be unstable during the skill execution. For example, during cutting, the dough slowly transitions from one piece to two pieces, making the input to the policy unstable.
Second, we compare with a Tool Concat Policy that takes in the observation and goal point cloud of the dough, passes them through a PointNet++ [51] encoder to produce a feature, and then concatenates the tool state to the feature. The concatenated feature is passed through a final MLP to output the action. In comparison, the set policy in PASTA takes the point cloud of the tool and concatenates it with the dough in the point cloud space before passing it to the PointNet. We hypothesize that this way allows PointNet to reason more easily about the spatial relationships between the tool point cloud and the dough point cloud. Results in Table 8 highlight the advantage of using a point cloud to represent the tool.
Ablation on set representation. We consider a variant of PASTA Set without Filtering, which uses the same set representation as PASTA, but does not filter entities that are approximately the same both during training and testing. This filtering is only possible with a set representation and we want to show the advantage of this filtering. For this ablation, during training, the feasibility predictor takes in all the entities in the scene in set representation, and the policy takes in the concatenation of point clouds from each entity. During planning, we do not enumerate attention structures but  instead optimize for all the entities. As shown in Table 8, without filtering, this ablation performs significantly worse than PASTA, showing that filtering is an important advantage enabled by our set representation.

Visualization of the Latent Space
We visualize the latent space of PASTA in CutRearrange in Figure 6 and visualize the latent space of Flat 3D baseline in Figure 7 for comparison. Since we use a latent dimension of 2 for all of our environments, we can visualize the original latent space without applying any dimensionality reduction techniques. PASTA only encodes the shape of each entity and thus can better model the variations in shapes. On the other hand, Flat 3D couples the shape variation with the relative position of two entities. This makes a flat representation difficult to generalize compositionally to scenes with different numbers of entities or scenes with entities that have novel relative spatial locations to each other.

Runtime of PASTA
We implement the planning in the latent set representation in an efficient way, which can plan with multiple different structures in parallel on a GPU. To demonstrate the efficiency of PASTA, we vary the number of samples used for planning and record the planning time and final performance. We conduct the experiments in CutRearrange. Figure 5a shows that the planning time scales approximately linearly with the number of samples, and Figure 5b shows the planning performance versus the number of samples. As the result suggests, PASTA can achieve its optimal performance with a very short amount of planning time (under 1 minute) for the majority of our tasks. Finally, we summarize the planning time for all of our tasks in simulation in Table 9.
LiftSpread GatherMove CutRearrange CRS CRS-Twice* Planning time (seconds) 58 35 35 307 7810 Table 9: Summary of planning time of PASTA in all of the simulation tasks. CRS-Twice uses Receding Horizon Planning, which results in an increase in planning time.

Additional metrics for real world experiments
We also quantitatively computed the action error v.s. subgoal error for our real world trajectories. The results are shown in Table 10. From the results in the table, our planned goal is closer to the ground truth goal than the achieved goal, measured by the Earth Mover's Distance (EMD), which shows that the controller does not compensate for the error of the planner.

Robustness of PASTA
We show that PASTA is robust to two types of variations and can retain high performance.
Robust to planning horizon First, we increase the planning horizon from the minimal length for the task (3) to twice the minimal length (6), and we observe that PASTA retains a high performance across all horizons. The results are shown in Table 11. This suggests that in practice, one can specify a maximum planning horizon for PASTA when the exact horizon is unknown.
Robust to distractors Second, we show that PASTA is robust to distractors in the scene. We add 2 distractor objects in CRS (which makes the scene have 4 objects in total). We observe that PASTA retains a normalized performance of 0.879 and 100% success rate (without distractor: 0.896/100%) using the same amount of samples to plan. Our planner is able to ignore the distractors using our attention structure at every step to only attend to the relevant components in the scene. We also added an example trajectory with distractor dough pieces to our website under "CRS with distractors".

Further Discussion on Limitations and Future Work
More Efficient Planning Planning skill sequences with a large search space is a challenging problem by itself but much progress has been made by the task and motion planning community to obtain a plan skeleton [54,55,56]. For example, Caelan et al. [54] propose two methods, the first one is to interleave searching the skill sequence with lower-level optimization and the second one is to have lazy placeholders for some skills. Danny et al. [56] propose to predict skill sequences from visual observation. Recent works have also explored finding skill sequences using pre-trained language models [57,58].
Sim2Real Transfer for Real Dough One possible approach is to train with domain randomization to make the policy more robust to changing dynamics (e.g. stickiness) of dough. Another option is to perform online system identification of the dough dynamics parameters [59,60] or real2sim methods [61,62]. In future work, we can also integrate our method with other works that perform low-level dough manipulation in the real world, such as recent work from Qi et al. [63].
Goal Specification Our planner requires specifying the goal with a point cloud and coming up with a point cloud goal is not always easy. However, rapid progress are being made with languageconditioned manipulation and future work can combine language to specify more diverse tasks.  Figure 6: Latent space of PASTA in CutRearrange. We sample coordinates on a grid from the 2D latent space encoding the shapes and then decoding each latent vector into a point cloud. We then rearrange the decoded point cloud into the grid based on the corresponding coordinates in the latent space.  Figure 7: Latent space of Flat 3D in CutRearrange. We sample coordinates on a grid from the 2D latent space encoding the shapes and then decoding each latent vector into a point cloud. We then rearrange the decoded point cloud into the grid based on the corresponding coordinates in the latent space.