CodeHOI: Code with Agents for Physically Plausible 4D Hand-Object Interaction
Organizations: Korea Electronics Technology Institute (KETI)
Abstract
Modeling 4D hand-object interaction (HOI) is fundamental to understanding manipulation. This requires physics, since hands move objects only by touch and each material responds differently. Yet existing methods ignore this physics or simulate only a narrow range of matter. Programs can instead describe any matter with its physics, but coding agents omit the hand that drives the interaction. We close this gap with CodeHOI, to our knowledge the first agentic framework that writes physically plausible 4D HOI as programs. To write one, an Object Agent first builds each object with the physics of its matter. An HOI Agent then specifies the hands by their contacts and simulates each kind of matter with an established physics solver. Finally, an Evaluator Agent checks each result against physical laws. We also introduce CodeHOI-Bench with 100 reconstruction and generation tasks across four kinds of matter. With off-the-shelf frontier models, CodeHOI writes interactions that are plausible for every kind of matter and remain so when transferred to an independent physics engine. It thereby enables coding agents to write physically plausible HOI across diverse matter.
Figures & tables
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| With Feedback | Fresh Attempts | Paired | ||||||
|---|---|---|---|---|---|---|---|---|
| Revisions | SR ( ) | Tokens ( ) | Cost ( ) | SR ( ) | Tokens ( ) | Cost ( ) | SR | / |
| 0 | 0 0.0 | 102.3 | 0 5.63 | 0 0.0 | 102.3 | 0 5.63 | 0/0 | |
| 1 | 10.0 | 144.0 | 0 8.02 | 10.0 | 165.0 | 0 9.76 | 12.0 | 3/3 |
| 2 | 22.5 | 176.4 | 10.00 | 15.0 | 223.8 | 13.48 | 14.5 | 6/3 |
| 3 | 27.5 | 199.6 | 11.45 | 22.5 | 279.9 | 16.95 | 17.1 | 7/5 |
| Input | Task | Instruction | Hidden Annotations |
|---|---|---|---|
| Rigid | |||
| SR1 | “Stack the red, green and blue cubes with red at the bottom and blue on top; leave the yellow cube where it is.” | • the objects stand stacked, bottom to top: red_cube green_cube blue_cube • blue_cube is let go at the end • blue_cube is at rest at the end ( 5 cm/s) • yellow_cube moves 1 cm | |
| SR2 | “Take the cap block off the top of the tower without knocking any other block off.” | • block_41 moves on the table 6 cm • block_39 moves on the table 0.5 cm • block_40 moves on the table 0.5 cm • block_00 moves on the table 0.5 cm | |
| SR3 | “Carry the tower of cubes 15 cm to the right without it falling apart.” | • cube_1 moves to the right 12 cm • cube_6 moves to the right 12 cm • the objects stand stacked, bottom to top: cube_1 cube_2 cube_3 cube_4 cube_5 cube_6 | |
| SR4 | “Stand the fallen bowling pin back up.” | • pin ends pointing up, off by 10 ∘ • pin is let go at the end • pin is at rest at the end ( 5 cm/s) | |
| SR5 | “Pull the ball at the left end out to the side and let it go, so that the ball at the right end swings out.” | • ball_1 rises 2 cm • ball_1 is let go at the end • ball_5 rises 1 cm • hands stay 0.3 cm clear of ball_5 | |
| Metric | Definition | Unit | Tasks |
|---|---|---|---|
| Placement and Motion | |||
| Rise | Maximum rise of the centroid | cm | IF3, SR5, SR8 |
| Displacement | Final displacement of the centroid along an axis, in the table plane or in 3D | cm | 21 tasks |
| Maximum tilt | Maximum tilt of the object’s up axis during the motion | ∘ | IF2, IR2, SF6, SF7, SF10 |
| Final orientation | Final angle between an object axis and a target world direction | ∘ | 6 tasks |
| Transferred fraction | Fraction of the object in or on the receiver at the end | % | 20 tasks |