Generating a simple silicon detector simulation with an open-weight large language model
This paper demonstrates that a quantized Qwen3.6-27B large language model, augmented with custom tools via MCP servers, can successfully generate statistically consistent silicon detector simulations in 42% of 50 independent runs, establishing a proof of concept for using text-based prompts to create Monte Carlo simulations.
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 author. For technical accuracy, refer to the original paper. Read full disclaimer
In the world of particle physics, scientists cannot simply look at the subatomic particles they study; they are too small and move too fast to be seen directly. Instead, researchers build massive, intricate machines called detectors to catch these fleeting particles and record the energy they leave behind. To understand what these machines will see before they are even built, physicists rely on computer simulations. These are complex digital experiments that predict how particles will behave as they crash into different materials, helping scientists design better detectors and interpret the data they collect. For decades, creating these simulations has been a task reserved for highly specialized experts who must write thousands of lines of complex code, a process that is slow, difficult, and prone to human error.
A team of researchers at the University of Liverpool has explored a new way to handle this heavy lifting. They asked whether a modern artificial intelligence, specifically a large language model, could be taught to write the code for these particle simulations on its own. The researchers did not just ask the computer to guess; they built a system that gave the AI access to the specific tools and reference manuals it needed to do the job correctly. By connecting the AI to a simulation program called TOPAS, which is used to model how particles interact with matter, they created a workflow where the computer could write the code, check its own work, run the simulation, and compare the results against a known standard. The goal was to see if a machine could translate a simple sentence describing a physics experiment into a working digital simulation that produces accurate physical data.
The researchers set up a test using a straightforward scenario: a beam of electrons hitting a piece of silicon. They instructed the AI to generate a simulation for this specific setup. The system worked in a loop: the AI would write the necessary configuration file, a specialized tool would check the file for errors, and if the file was correct, the simulation would run. If the simulation produced a result that matched the expected physics, the process was considered a success. If the AI made a mistake, the system would feed the error back to the model, which would then try to fix the code and run again. This cycle continued until the simulation worked or the system gave up after five attempts. The entire process was managed by a local computer system, ensuring that the work remained private and reproducible.
After running this experiment fifty times, the results showed that the approach is possible but not yet perfect. In twenty-one of the fifty attempts, the AI successfully generated a simulation that produced a distribution of energy deposits statistically indistinguishable from the reference simulation. This means the computer correctly predicted how the electrons would scatter and lose energy in the silicon. However, the system failed in the remaining twenty-nine attempts. The most common reason for failure was not a fundamental misunderstanding of physics, but rather the AI running out of digital memory space, known as a context window, as it tried to look up instructions and manage files. In other cases, the AI made syntax errors in the code or lost track of the files it had created. The successful runs took a median of 352 seconds, while the failed attempts often took longer as the system struggled to correct its mistakes.
The study demonstrates that an artificial intelligence can be guided to create working particle physics simulations, but it highlights that the technology still requires significant human oversight and robust support tools. The researchers found that when the AI had access to detailed documentation and the ability to check its own work, it could produce correct results about forty-two percent of the time. This success rate suggests that while the AI is not yet ready to replace human experts, it can serve as a powerful assistant that lowers the barrier to entry for physicists who want to explore different detector designs without needing to master complex coding languages. The work proves that text-based instructions can be turned into functional scientific simulations, provided the AI is given the right resources and a structured way to verify its output.
Looking ahead, the researchers believe that with more detailed examples and better tools, these systems could handle increasingly complex simulations. They plan to test other types of artificial intelligence models and refine the settings that control how the AI thinks and writes. For now, this experiment serves as a proof of concept, showing that the gap between a simple text description and a sophisticated physics simulation can be bridged by machine intelligence, even if the bridge is still under construction. The ability to generate these simulations automatically could eventually allow scientists to iterate on their designs much faster, testing new ideas in a digital space before committing to building expensive physical hardware.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.