Table of Contents
Fetching ...

AutoFLUKA: A Large Language Model Based Framework for Automating Monte Carlo Simulations in FLUKA

Zavier Ndum Ndum, Jian Tao, John Ford, Yang Liu

TL;DR

AutoFLUKA represents a significant advancement in automating MC simulation workflows, offering a robust solution to the inherent limitations, and opens new paradigms for research and development in high energy physics, medical physics, nuclear engineering space and environmental science.

Abstract

Monte Carlo (MC) simulations, particularly using FLUKA, are essential for replicating real-world scenarios across scientific and engineering fields. Despite the robustness and versatility, FLUKA faces significant limitations in automation and integration with external post-processing tools, leading to workflows with a steep learning curve, which are time-consuming and prone to human errors. Traditional methods involving the use of shell and Python scripts, MATLAB, and Microsoft Excel require extensive manual intervention and lack flexibility, adding complexity to evolving scenarios. This study explores the potential of Large Language Models (LLMs) and AI agents to address these limitations. AI agents, integrate natural language processing with autonomous reasoning for decision-making and adaptive planning, making them ideal for automation. We introduce AutoFLUKA, an AI agent application developed using the LangChain Python Framework to automate typical MC simulation workflows in FLUKA. AutoFLUKA can modify FLUKA input files, execute simulations, and efficiently process results for visualization, significantly reducing human labor and error. Our case studies demonstrate that AutoFLUKA can handle both generalized and domain-specific cases, such as Microdosimetry, with an streamlined automated workflow, showcasing its scalability and flexibility. The study also highlights the potential of Retrieval Augmentation Generation (RAG) tools to act as virtual assistants for FLUKA, further improving user experience, time and efficiency. In conclusion, AutoFLUKA represents a significant advancement in automating MC simulation workflows, offering a robust solution to the inherent limitations. This innovation not only saves time and resources but also opens new paradigms for research and development in high energy physics, medical physics, nuclear engineering space and environmental science.

AutoFLUKA: A Large Language Model Based Framework for Automating Monte Carlo Simulations in FLUKA

TL;DR

AutoFLUKA represents a significant advancement in automating MC simulation workflows, offering a robust solution to the inherent limitations, and opens new paradigms for research and development in high energy physics, medical physics, nuclear engineering space and environmental science.

Abstract

Monte Carlo (MC) simulations, particularly using FLUKA, are essential for replicating real-world scenarios across scientific and engineering fields. Despite the robustness and versatility, FLUKA faces significant limitations in automation and integration with external post-processing tools, leading to workflows with a steep learning curve, which are time-consuming and prone to human errors. Traditional methods involving the use of shell and Python scripts, MATLAB, and Microsoft Excel require extensive manual intervention and lack flexibility, adding complexity to evolving scenarios. This study explores the potential of Large Language Models (LLMs) and AI agents to address these limitations. AI agents, integrate natural language processing with autonomous reasoning for decision-making and adaptive planning, making them ideal for automation. We introduce AutoFLUKA, an AI agent application developed using the LangChain Python Framework to automate typical MC simulation workflows in FLUKA. AutoFLUKA can modify FLUKA input files, execute simulations, and efficiently process results for visualization, significantly reducing human labor and error. Our case studies demonstrate that AutoFLUKA can handle both generalized and domain-specific cases, such as Microdosimetry, with an streamlined automated workflow, showcasing its scalability and flexibility. The study also highlights the potential of Retrieval Augmentation Generation (RAG) tools to act as virtual assistants for FLUKA, further improving user experience, time and efficiency. In conclusion, AutoFLUKA represents a significant advancement in automating MC simulation workflows, offering a robust solution to the inherent limitations. This innovation not only saves time and resources but also opens new paradigms for research and development in high energy physics, medical physics, nuclear engineering space and environmental science.

Paper Structure

This paper contains 19 sections, 31 equations, 10 figures, 1 table.

Figures (10)

  • Figure 1: Schematic of a hypothetical FLUKA workflow adopted for the automation. Steps 3 and 9 are highlighted because they require a human in the loop to verify the FLUKA-Fortran code syntax and to judge the accuracy of the results respectively.
  • Figure 2: A simple chat completion model. important parameters include specifying the LLM type with the corresponding API key and temperature
  • Figure 3: Schematic of an LLM Agent workflow. With additional tools and prompt fine-tuning, the agent can utilize the thought capabilities of LLMs to perform actions by connecting with interfaces, invoking and executing tools on external environments while receiving feedback and optimizing the process until success.
  • Figure 4: Schematic view of the multi-agent workflow, showing the supervisor AI agent at the top, coordinating actions of different agents within the blocks. (b) –Graph visualization of the multi-agent workflow. Notice that each agent takes actions from as well as reports back to the agent supervisor until the task is marked as complete, after which the FINISH + END sequence is triggered. The human in the loop is to log into the system to initiate the action.
  • Figure 5: FLUKA geometry of the setup for the “Charged pion fluence inside and around a proton-irradiated Beryllium (Be) target”. A proton beam of momentum = 50 GeV/c impinges on a slap of Be from the left and crosses through the right slap. Secondary particles like pions are generated in these two slaps and their corresponding fluence and current scored.
  • ...and 5 more figures