Abstract: We propose KnotGym, an interactive environment for complex, spatial reasoning and manipulation. KnotGym includes goal-oriented rope manipulation tasks with varying levels of complexity, all requiring acting from pure image observations. Tasks are defined along a clear and quantifiable axis of complexity based on the number of knot crossings, creating a natural generalization test. KnotGym has a simple observation space, allowing for scalable development, yet it highlights core challenges in integrating acute perception, spatial reasoning, and grounded manipulation. We evaluate methods of different classes, including model-based RL, model-predictive control, and chain-of-thought reasoning, and illustrate the challenges KnotGym presents.
Introduction
Spatial reasoning is a cornerstone of human intelligence, yet it remains a significant hurdle for AI. While benchmarks exist for static visual QA or rigid-body robotics, manipulating deformable objects like rope is notoriously difficult due to their infinite-dimensional configuration space. Existing rope manipulation tasks often rely on "dense rewards" based on Euclidean distance, which fails to capture the underlying logic of a knot. A rope can look visually distinct but be topologically identical, or look almost the same but have one crucial crossing reversed. True spatial reasoning requires an agent to understand these abstract topological structures from raw image observations.
The KnotGym Environment
KnotGym is built using the MuJoCo physics simulator, modeling ropes as a "chain of beads." To focus on reasoning rather than low-level motor control, the environment utilizes an abstract action space where the agent selects a 3D point on the rope and applies a force vector. The observation space is restricted to 2D RGB image projections of the current state and a target "goal" image.
The core innovation of KnotGym is the use of Gauss codes—a formal mathematical notation describing the sequence of over-and-under crossings. A task is considered "solved" only when the manipulated rope’s Gauss code matches the goal’s code. This creates a "many-to-one" mapping where many physical configurations are considered correct, forcing agents to learn topology rather than simple shape mimicry.
Task Definitions and Complexity
KnotGym features three primary tasks that form a "Generalization Ladder" based on the number of crossings (#X):
- unknot: Untangling a complex knot into a simple loop.
- tie: Tying a simple loop into a specific target knot.
- convert: Transforming one complex knot into another.
Complexity scales factorially with the number of crossings, providing a clear metric for how well a model generalizes from simple tasks (e.g., 2 crossings) to complex ones (4+ crossings).
Experimental Evaluation
We evaluated four distinct classes of methods:
- Model-free RL: PPO (Proximal Policy Optimization).
- Model-based RL: DreamerV3, which learns an internal world model.
- Test-time Search: TD-MPC2 for local planning.
- Prompted VLMs: GPT-4 using chain-of-thought prompting to plan manipulation steps.
Key Results
- DreamerV3 Dominance: The model-based approach significantly outperformed PPO and TD-MPC2, particularly on the
unknottask, reaching over 90% success for knots with 2-3 crossings. - The Complexity Wall: As crossings increased to 4, success rates for
tieandconvertplummeted. Most models performed no better than a random policy, suggesting they memorize specific maneuvers rather than learning knot logic. - VLM Grounding Failure: While GPT-4 could identify goal Gauss codes and describe reasonable plans in text, it failed to translate these into precise coordinates and forces, highlighting a gap in "intuitive physics."
- Strategy Gaps: In
unknottasks, RL models often discovered a "shake and pull" strategy—using inertia to untangle. However, this heuristic fails fortieorconverttasks, which require precise, multi-step reasoning.
Conclusion
KnotGym demonstrates that acute perception is mandatory for spatial reasoning; solving a knot often depends on a few pixels where segments cross. While model-based RL shows promise, the environment remains a humbling reminder that "simple" tasks like untangling a pair of headphones remain a frontier of spatial intelligence. Future work will focus on GPU-based simulation for higher complexity and improving the grounding of vision-language models in physical manipulation.
Summary updated