CodeHOI: Code with Agents for Physically Plausible 4D Hand-Object Interaction

Seonghwan Park, Inho Chang, Min-Gyu ParkarXiv 2026

TL;DR

Think about what happens when you pick up a coffee mug versus squeezing a sponge or pouring water: your hands only move things through physical contact, and every material responds according to its own physical laws. Existing AI models for 4D (3D space + time) hand-object interaction either ignore physics—leading to ghostly, floating grasps—or can only handle rigid blocks. CodeHOI bridges this gap by using a team of LLM coding agents to write executable programs that pair contact-driven virtual hands with established physics solvers, bringing dough, cloth, and liquids within reach of digital manipulation.

What Problem Does This Paper Address?

Whether you are building AR/VR worlds, animating films, or training dexterous robots, modeling how hands manipulate objects in 3D over time (4D HOI) is foundational. Yet, current data-driven methods mostly memorize motions on rigid objects and ignore physical laws, often allowing fingers to pass straight through solid surfaces or objects to levitate.

Meanwhile, LLM coding agents have become surprisingly adept at writing code to generate 3D scenes and physics simulations. However, they consistently omit the most important actor: the hand. Coordinating a multi-jointed hand so that its physical contact alone drives an object's material response is tough. CodeHOI asks: can coding agents write self-contained programs that model both the intricate contacts of human hands and the diverse physics of the matter they touch?

Methods

CodeHOI requires zero task-specific training data. Instead, it turns 4D reconstruction (matching a video) and generation (following a prompt from an image, 3D scene, or text) into a closed-loop programming task run by three specialized agents:

Figure 2. Overview of CodeHOI. From an input and an instruction, three agents write a 4D hand-object interaction as a program. (i) The Object Agent builds every object in the input and gives it named parts, joints and its own physics. (ii) The HOI Agent decides which parts the hands should touch or avoid, defines each hand through its contacts and simulates how every object responds. (iii) The Evaluator Agent checks each result by measurement and by its renders, then accepts it or sends it back with a review. Here round 0 is returned because the index finger penetrates the handle and the thumb is raised, and the revised round 1 is accepted.
  1. Object Agent: Writes procedural code to build objects at real-world scale, splitting them into semantic parts (e.g., mug handle vs. rim), defining joints, and assigning physical material parameters.
  2. HOI Agent: Rather than guessing awkward joint angles directly, this agent plans contacts—specifying where fingertips and palms should touch or avoid over time. An optimization routine fits a standard parametric hand model (MANO) to these contact targets. Crucially, to simulate how objects react, CodeHOI hooks into four established, standard physics solvers in NVIDIA Warp: MPM (dough, grains), FEM (elastic solids), FLIP (liquids), and XPBD (cloth, rope). Multiple solvers can even run together in one program—like a cloth soaking up spilled water.
  3. Evaluator Agent: Combines a deterministic checker with a visual critic. First, the checker measures hard physics—flagging finger penetration, objects floating untouched, or grasps that violate friction cones. Then, a vision-language critic inspects rendered frames in a fresh context (preventing lenient grading) and sends revision notes back to the generators for up to three rounds.

Datasets

BecauseCodeHOI is training-free, no training datasets are used. For evaluation, the authors introduce CodeHOI-Bench, a suite of 100 tasks evenly split across four regimes of matter: rigid, deformable, co-dimensional (thin sheets/ropes), and flowing (liquids/grains).

It includes:

  • 20 Reconstruction clips: Real-world videos curated from seven existing datasets (including DexYCB, ARCTIC, and GigaHands).
  • 80 Generation tasks: Prompts paired with images, 3D scenes, or text alone, evaluated against hidden success conditions (e.g., water vs. honey in identical cups requiring different pouring motions).

Key Insights and Ideas

  • Specify contacts, not poses: Having an LLM directly code 3D hand joint rotations is brittle. Having the agent code where the fingers should touch the object and letting mathematical optimization solve the hand's anatomy is the secret sauce that makes manipulation work.
  • Rigid vs. non-rigid failures are fundamentally different: In generation tasks, when agents fail on rigid objects, over half the time they achieve the goal state but break a rule (like grabbing the wrong part). On non-rigid matter, ~80% of failures happen because the agent couldn't coax the material into the desired physical state (like closing the hole in a squeezed soft ring).
  • Deterministic checks do the heavy lifting: First-round code—written with the deterministic physics checker before any visual LLM critique—already solves 45% to 60% of generation tasks. Visual revision adds a solid 6.3 to 13.8 percentage point boost, proving that hard physical measurements matter more than a model's visual impression.
  • Real physics enables zero-shot robot transfer: Because every object carries real physical units rather than animation keyframes, generated human-hand interactions can be retargeted to simulated 22-DoF robot hands in an independent physics engine (Genesis) without any learned policy.

Key Results

Testing four off-the-shelf frontier models as backbones (Claude Opus 5.5, Claude Sonnet 5.5, GPT-6 Astra, and GPT-6.1 Sol):

  • Generation: GPT-6 Astra leads overall, solving 90.0% of rigid tasks, 80.0% of flowing tasks, and 70.0% of deformable tasks, while Claude Opus 5.5 leads on co-dimensional tasks (60.0%).
  • Reconstruction: GPT-6.1 Sol leads on 12 of 18 metrics, keeping hand-object penetration under 1.0 mm across all 20 clips and achieving a 21.0 mm Chamfer distance on deformable objects.
  • Visual Quality: Blind pairwise Elo ratings consistently rank both GPT models above both Claude models across all four types of matter—a ranking that holds steady even when swapping which model acts as the judge.
Figure 4. Qualitative comparison of the four backbones on CodeHOI-Bench. Each column covers one kind of matter, with a reconstruction clip in the upper block and a generation task in the lower block. In each block, the input row shows three frames of the video or the image or 3D scene with its instruction, and the rows below show three frames of the interaction written with each backbone (i.e., Opus 5.5, Sonnet 5.5, GPT-6 Astra and GPT-6.1 Sol). Reconstructions follow the input closely for every backbone, whereas generations differ more in the objects each backbone builds and in how it carries out the instruction.

Limitations and Future Work

  • Exact contact and fluids in reconstruction: While hands avoid penetrating objects, matching exact ground-truth contact locations from video remains weak (Contact F1 $\le$ 0.48). Reconstructing flowing matter is even harder, with poured particle containment reaching at most 21.4%.
  • One-way forces: The simulations are physically plausible rather than predictive—forces pass one way from kinematic hands to objects (the object doesn't push the hand back).
  • Sim-to-robot gaps: When transferring motions to robot hands in Genesis, pure position control cannot regulate grip force, requiring a minor workaround that attaches grasped objects to the robot hand until release. Using these transferred rollouts as training demonstrations for robot reinforcement learning or vision-language-action (VLA) models is a prime avenue for future work.

Summary updated

BibTeX
@misc{park2026codehoi,
  author = {Seonghwan Park and Inho Chang and Min-Gyu Park},
  title = {{CodeHOI: Code with Agents for Physically Plausible 4D Hand-Object Interaction}},
  year = {2026},
  eprint = {2611.31976},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.31976},
}
Figure