← Latest papers
🤖 machine learning

Training and Benchmarking Code Generation for Physics-Inspired Animations

This paper introduces SimuScene, a comprehensive dataset and benchmark for training and evaluating large language models on generating executable code for physics-inspired animations, demonstrating that even top models struggle with this task but can be significantly improved through a novel reinforcement learning pipeline utilizing visual rewards.

Original authors: Yanan Wang, Renxi Wang, Yongxin Wang, Xuezhi Liang, Fajri Koto, Timothy Baldwin, Xiaodan Liang, Haonan Li

Published 2026-08-14
📖 4 min read☕ Coffee break read

Original authors: Yanan Wang, Renxi Wang, Yongxin Wang, Xuezhi Liang, Fajri Koto, Timothy Baldwin, Xiaodan Liang, Haonan Li

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a super-smart robot friend who can read a storybook and instantly write the computer code to make a movie of that story. You tell it, "A ball rolls down a hill and bounces off a wall," and you expect to see a ball rolling down a hill and bouncing off a wall. This is the dream of Large Language Models (LLMs): computers that can understand human language and turn it into action. But there's a tricky part. Just because the robot writes code doesn't mean the movie it makes will actually look like the story. The code might run, but the ball might float like a ghost, roll uphill, or turn into a square. This paper explores a specific corner of science where we ask: Can these AI robots not just write the script, but actually direct the physics of the movie so it feels real? It's like asking a chef to not just write a recipe for a cake, but to actually bake one that tastes like a cake, not a brick.

The researchers behind this study, led by a team from Mohamed bin Zayed University of Artificial Intelligence and Sun Yat-sen University, decided to put these AI robots to the ultimate test. They created a new game called SimuScene. Think of it as a giant, automated playground with 52 different physics themes, like gravity, light, electricity, and how fluids flow. They built a system that generates thousands of unique scenarios—like "a spinning disk on a slippery table" or "light bending through a lens"—and then asks the AI to write Python code to animate them. But here's the catch: the AI doesn't just get a pass for writing code that runs. The code has to produce a video that actually looks like the physics described. To check this, they used a special "referee" (a Vision-Language Model) that watches the generated video and answers questions like, "Did the ball bounce?" or "Did the light bend the right way?" If the video fails the questions, the AI fails the test.

The results were a bit of a reality check. Even the smartest, most advanced AI models available today struggled mightily. When the researchers asked 10 different top-tier AIs to generate these animations, the very best one only got about 21.5% of the scenarios right on average. That means for every 100 attempts, the AI only successfully created a video that matched the physics description about 21 times. Most of the time, the code would run, but the animation would be weird: objects might pass through walls, move in the wrong direction, or ignore gravity entirely. It turns out that teaching an AI to write code is one thing, but teaching it to understand the invisible rules of how the world moves and to visualize those rules is a much harder puzzle.

However, the paper doesn't just stop at saying "it's hard." The team also tried a clever trick to make the AIs better. They used a method called Reinforcement Learning, which is like training a dog with treats. Instead of just telling the AI "good job" or "bad job" based on the text, they let the AI generate a video, watched the video, and gave it a "treat" (a reward) only if the video actually looked right. They used a vision-based judge to give these rewards. After this training, the AI models improved significantly. A smaller model that started with a 0% success rate managed to reach an 11.1% pass rate after training, and a larger model jumped from 18.3% to 34.4%. This suggests that while the AIs aren't perfect physics engines yet, they can learn to get better if you show them the actual movies they create and let them see their own mistakes.

In short, this paper shows that while our AI friends are getting great at writing code, they are still learning how to be good directors of physics. They can write the script, but making the movie look real is still a work in progress. The team built a massive dataset of over 7,600 physics scenarios to help train them, and their experiments prove that watching the results (the videos) and learning from them is a powerful way to teach these models. It's a hopeful sign that with the right training, we might soon have AI that can turn our wildest physical descriptions into accurate, moving pictures.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →