NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ClothCode: Generative Modeling for Garment State Estimation and Dynamics Prediction

Yingdong Ru, Lipeng Zhuang, Shiyu Fan, Zhuo He, Florent P. Audonnet, Gerardo Aragon CamarasaarXiv 2026

TL;DR

ClothCode is a unified generative framework that treats garment state estimation and dynamics prediction as a "translation" task in a shared discrete configuration space. By discretizing complex cloth deformations into a vocabulary of patch-based tokens, the model achieves a 30x speedup over diffusion-based baselines and significantly improves robotic manipulation success rates in real-world folding and flattening tasks.

What Problem Does This Paper Address?

Manipulating cloth is a nightmare for robots. Unlike rigid objects, garments have an almost infinite number of ways they can fold, crumple, and stretch. This leads to three major hurdles:

  1. High-Dimensionality: A single shirt has thousands of vertices to track.
  2. Occlusion: When a robot picks up a towel, half the towel disappears behind the other half, making it hard to "see" the full state.
  3. Computational Cost: To plan a move, a robot needs to simulate many possible futures. Current state-of-the-art models (like those based on conditional diffusion) are often too slow for real-time, closed-loop control.

Existing methods are usually deterministic (which fails to capture the multiple ways cloth might move) or use continuous latent spaces that are computationally expensive to sample.

Methods

The core innovation of ClothCode is the Discrete Garment Representation. Instead of trying to predict the position of every vertex, the authors partition the garment mesh into fixed, "material-aligned" patches.

Overview of the ClothCode framework, showing the discrete representation and the two MGT tasks.

The Tokenization Pipeline

  1. Patchification: The mesh is divided into $P$ patches.
  2. Residual Vector Quantization (RVQ): Each patch's local deformation is encoded into a set of discrete "tokens" (indices from a learned codebook). This turns a complex geometric shape into a compact grid of numbers.
  3. Masked Generative Transformers (MGTs): The authors use two specialized MGTs. One for State Estimation (taking a partial point cloud and "filling in the blanks" to find the missing tokens) and one for Dynamics Prediction (taking current tokens and an action to predict future tokens).

Unlike autoregressive models that predict one token at a time, MGTs predict all tokens in parallel and iteratively refine the ones they are least confident about. This "mask-and-refine" approach is what enables the massive speedup.

Detailed architecture of the tokenizer and the MGT models.

Datasets

The authors built a massive simulated dataset using Isaac Sim 5.1, featuring:

  • Three Templates: A rectangular fabric sheet, a T-shirt, and a sweater.
  • Scale: 134,400 trajectories across 16,800 distinct action instances (folds, repositions, flattens).
  • Diversity: Eight different material configurations (varying stiffness, friction, and density) and randomized camera angles to simulate real-world robot occlusions.

They evaluated the model on three splits: ID (in-distribution), Action-OOD (unseen action parameters), and Physics-OOD (unseen material properties).

Key Insights and Ideas

  • Local Patterns are Universal: While a whole sweater can take infinite shapes, the way a small patch of wool folds is relatively consistent. By learning a "vocabulary" of these local deformations, the model generalizes better to complex global states.
  • Discretization as a Regularizer: By forcing the model to choose from a discrete codebook of physically plausible patch shapes, the authors prevent the "blurry" or physically impossible averages often produced by deterministic models.
  • Parallelism is Essential for Robotics: Moving from diffusion (which requires many sequential denoising steps) to MGTs (which refine tokens in parallel) dropped inference time from ~556ms to ~17ms. This makes it fast enough to be used inside a Model Predictive Control (MPC) loop.

Key Results

ClothCode outperformed the strongest baselines (like UniClothDiff) across the board:

  • Accuracy: Reduced Mean Displacement Error (MDE) by 26.6% for state estimation and 37.0% for dynamics prediction.
  • Speed: Dynamics inference is roughly 33 times faster than diffusion models.
  • Real-World Success: In physical experiments with a Baxter robot, ClothCode improved the success rate of folding and flattening tasks from 56.7% to 78.9%.
Qualitative comparison of dynamics prediction showing ClothCode's superior preservation of garment structure.

As shown in the table below, ClothCode consistently achieves lower error rates across different garment types compared to existing methods like GarmentNets and MEDOR.

TABLE II

Limitations and Future Work

While impressive, ClothCode currently relies on fixed garment templates. The robot needs to know it's looking at a "T-shirt" template to use the correct codebook. The authors note that future work will focus on transferable representations that can handle unseen garment topologies (e.g., a model that can handle a jacket even if it was only trained on shirts) and extending the horizon for even more complex multi-step manipulation tasks.

Summary updated

BibTeX
@misc{ru2026clothcode,
  author = {Yingdong Ru and Lipeng Zhuang and Shiyu Fan and Zhuo He and Florent P. Audonnet and Gerardo Aragon Camarasa},
  title = {{ClothCode: Generative Modeling for Garment State Estimation and Dynamics Prediction}},
  year = {2026},
  eprint = {2610.14200},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.14200},
}
Figure