LLMPhy: Parameter-Identifiable Physical Reasoning Combining Large Language Models and Physics Engines

Anoop Cherian, Radu Corcodel, Siddarth Jain, Diego Romeres

TL;DR

This paper introduces LLMPhy, a novel framework that combines Large Language Models (LLMs) with physics engines to tackle complex physical reasoning tasks. By leveraging LLMs' world knowledge and physics engines' simulation capabilities, LLMPhy can infer hidden physical parameters and construct accurate digital twins of scenes, leading to state-of-the-art performance on challenging physical reasoning benchmarks.

What Problem Does This Paper Address?

Many current approaches to physical reasoning in AI either sidestep or struggle with identifying crucial physical parameters like mass, friction, or damping. These parameters are fundamental to accurately simulating and predicting how objects interact in the real world, which is essential for applications like robotics and collision avoidance. Existing benchmarks often don't focus on this "parameter identifiability" problem, leaving a gap in evaluating AI's ability to truly understand and reason about physical systems.

Methods

LLMPhy employs a black-box optimization framework that integrates LLMs with physics simulators. The core idea is to bridge the gap between the implicit physical knowledge within LLMs and the explicit world models in physics engines. LLMPhy breaks down the problem into two main sub-tasks:

  1. Parameter Estimation: The LLM is prompted to generate Python code that defines physical parameters (e.g., friction, stiffness) for objects in a scene. This code is then executed in a physics engine, and the resulting simulation error (e.g., difference in object trajectories) is fed back to the LLM as a prompt to refine its parameter estimates. This forms an "analysis-by-synthesis" loop.
  2. Scene Layout Estimation: The LLM is used to infer the discrete properties of the scene, such as object types, locations, and colors, by generating code that reconstructs the scene.

This iterative process, where the LLM proposes code, the simulator executes it, and the error guides refinement, allows LLMPhy to learn physical parameters and scene layouts without requiring explicit gradients or differentiability of the simulator.

Datasets

The authors introduce three new zero-shot datasets to evaluate LLMPhy's capabilities:

  • TraySim: A synthetic environment with multi-body dynamics and contact-rich interactions, designed to test parameter estimation and physical reasoning.
  • CLEVRER-LLMPhy: An adaptation of the CLEVRER dataset, using PyBullet as the physics engine and incorporating more physics parameters and geometries.
  • Real-TraySim: A real-world tabletop robotic manipulation setting that requires constructing digital twins to predict object trajectories.

Key Insights and Ideas

  • LLMs as Physics Reasoners: LLMs, when coupled with physics engines, can go beyond simple pattern recognition to perform deep physical reasoning, including inferring hidden parameters.
  • Analysis-by-Synthesis Loop: The iterative process of generating code, simulating, and using reconstruction error as feedback is a powerful way for LLMs to learn complex physical properties.
  • Parameter Identifiability is Crucial: Accurately inferring physical parameters is key to building reliable digital twins and achieving robust physical reasoning.
  • LLM's Implicit World Knowledge: LLMs possess a surprising amount of implicit knowledge about physics that can be leveraged through program synthesis.

Key Results

LLMPhy achieved state-of-the-art performance on the newly introduced datasets, outperforming baselines like Bayesian optimization and CMA-ES by 6-12% in accuracy. The framework demonstrated faster and more stable convergence, highlighting its efficiency in inferring latent parameters. Experiments also showed that stronger LLMs (e.g., OpenAI's ol) led to more effective reasoning and convergence. Real-world experiments validated LLMPhy's generalization capabilities.

Limitations and Future Work

The authors acknowledge that LLMPhy's performance is dependent on the fidelity of the underlying simulator and that it incurs higher computational overhead compared to traditional methods. Future work could explore efficiency improvements, integration with more advanced simulators, and extending the framework to broader reasoning tasks like causality and planning in real-world robotics. They also suggest that fine-tuning LLMs specifically for black-box optimization could further enhance performance.

Summary updated

BibTeX
@inproceedings{cherian2026llmphy,
  author = {Anoop Cherian and Radu Corcodel and Siddarth Jain and Diego Romeres},
  title = {{LLMPhy: Parameter-Identifiable Physical Reasoning Combining Large Language Models and Physics Engines}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=5aLtvjoQpn},
}
Figure