Agentic MR sequence development: leveraging LLMs with MR skills for automatic physics-informed sequence development
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Physics. The day in general physics: instruments, methods and results across the field.
Kai: We're looking at the paper: "Agentic MR sequence development".
Title and authors: Kai: So we’re looking at this paper titled "Agentic MR sequence development: leveraging LLMs with MR skills for automatic physics-informed sequence development." It sounds like they're trying to use an agent framework to make pulse sequences automatically.
Mira: Right, it suggests using an agent that has knowledge about MRI physics and can refine the code based on feedback until it gets a physically valid sequence without much help from a human.
Lev: It’s interesting because programming these sequences is usually super time-consuming, requiring deep expertise in physics and hardware constraints, and this paper seems to tackle that by automating the generation process.
Kai: Exactly, the authors are focusing on taking something like PyPulseq and adding an agent loop that uses structured feedback to iteratively fix the code until it meets all the physical requirements.
Mira: They’re essentially trying to bridge the gap between general-purpose language models and these highly constrained physics tasks by giving them a systematic way to check their work against known MRI physics.
Lev: I wonder if that iterative refinement loop, Agent4MR, actually translates well when you try to run it on real hardware with its overhead and latency involved.
Kai: That's a good point, because the speed of that refinement loop is crucial for practical use in a clinical or research setting.
Mira: The implication here is that we might see a significant reduction in the number of back-and-forth interactions needed to get a usable sequence from an MRI task.
The paper's summary: Kai: So what does the paper actually say about how this Agent4MR system works? It talks about extending prompt-based workflows with this agent mode where the LLM generates code and then refines it based on a validation report.
Mira: They implemented an automated validation report that checks things like echo time, repetition time, k-space trajectory characteristics, gradient and RF raster timing.
Lev: So they’re not just letting the LLM guess; they have this structured feedback mechanism that tells the agent exactly what's wrong with the generated sequence.
Kai: Right, and then the agent keeps refining that code until that validation report says all those constraints are satisfied or it hits a set limit of iterations.
Mira: The main focus is on this metric: the number of user interactions needed until a human is satisfied with the generated MRI pulse sequence. Lower numbers mean more efficient generation, meaning less help needed from us.
Lev: That’s interesting because for real hardware, we’d need to figure out if that feedback loop can actually converge quickly enough without getting stuck in local minima during refinement.
Kai: It seems they are testing this across different LLMs to see which one is best at generating and refining these physics-informed sequences autonomously.
Mira: The overall summary is that this agentic approach can produce artifactfree, physically valid sequences in a single user interaction, which is a big win for rapid prototyping.
The paper's improvements: Kai: So what are the specific improvements they point to in their method? They’re highlighting how this framework reduces the user-issued instruction or correction count significantly.
Mira: They show that compared to just using the LLM alone, this agent-based approach leads to far fewer required user interactions until the user is happy with a sequence.
Lev: The paper suggests that by giving the LLM these MR specific skills and validation tools, we bypass the need for deep manual tuning of timing and k-space coverage.
Kai: They're showing that this method maintains correct timing and k-space coverage even in complex acquisitions, which is something traditional methods often struggle with.
Mira: The authors are also exploring how autonomous agents can perform research by having them try to improve the IRSE-EPI pipeline against a signal-equation target.
Lev: That’s the autonomous part; they’re not just generating one good sequence, they're letting agents compete and refine both the sequence code and reconstruction code together.
Kai: They show that this agentic MR research community setup, where agents improve against a challenge, can lead to significant improvements in things like the mean absolute error of around zero point one six seven compared to a baseline of about zero point two six six.
Conclusion: Mira: So wrapping up, the main implication here is that an appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers.
Kai: It means non-experts could potentially refine or innovate MR sequences guided by biological or clinical questions, because the system handles the heavy lifting of ensuring physical correctness.
Lev: From my side, it’s about making the process less dependent on a human having to manually debug every single timing parameter and gradient step.
Kai: The Agent4MR system is presented as the first thing that combines an LLM with automated execution, physics-based validation, and simulation in one loop to produce scannerready sequences with minimal user intervention.
Mira: That suggests that high-level logic isn't the only part of scientific discovery; this whole agentic loop is a key component for sequence development.
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany · Department of Artificial Intelligence in Biomedical Engineering, Friedrich-Alexander-Universität Erlangen-Nürburg · Pattern Recognition Lab, Friedrich-Alexander-Universität Erlangen-Nürburg
physics.med-ph
Submitted: 2026-04-14
Updated: 2026-12-01
Comments: Word count abstract/body: 223 / 4303
Code: https://github.com/rmoskwa/Pulsepal
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 85/100
The gist: Agent4MR consistently produced artifactfree, physically valid sequences in a single user interaction, reducing the number of required interactions below the human baseline while maintaining correct…
Key concepts
- Agent4MR
- This is an agent framework where an LLM acts as an agent. It iteratively generates MRI pulse sequences, uses automated validation reports to check physical rules, and refines the sequence until all constraints are met or a limit is reached. This allows for autonomous sequence development.
- Physics-based Validation Report
- This report analyzes a generated PyPulseq sequence to extract key physical properties such as echo time (TE), repetition time (TR), k-space trajectory characteristics, and gradient/RF timing. It acts as structured feedback that tells the agent exactly where the sequence violates physical constraints, enabling precise corrections.
- Autonomous MR Research
- This capability allows agents to compete against each other in an MR autoresearch setup to improve pulse sequences and reconstruction methods against a specific signal-equation target. Agents iteratively explore different strategies, such as multi-window filtering or phase correction, to find better solutions autonomously.
Terminology
Summary
Agent4MR consistently produced artifactfree, physically valid sequences in a single user interaction, reducing the number of required interactions below the human baseline while maintaining correct timing and k-space coverage. p. 0 We tested
an MR autoresearch on a fluid-suppressed spin-echo EPI challenge for
three different model generations. Results: Across all models, Agent4MR consistently produced artifactfree, physically valid sequences in a single user interaction, reducing the
number of required interactions below the human baseline while maintaining correct timing and k-space coverage.Where the paper says it
The Problem Addressed
Programming MRI pulse sequences requires extensive research effort as well as deep expertise in MRI physics, hardware constraints, and sequence design.<ref:2604.13282#pg2,Programming MRI pulse sequences requires extensive research effort as well as deep expertise in MRI physics, hardware constraints, and sequence design>. p. 1 Introduction
Programming MRI pulse sequences requires extensive research effort as well as deep expertise in
MRI physics, hardware constraints, and sequence
design, which makes it also time-consuming. Moreover, even small modifications to existing sequences can involve non-trivial debugging and validation, creating a barrier to rapid prototyping and
methodological innovation. One of the
main hurdles is the need for a model to understand and reason about the complex physical constraints of MRI, such as the effects of RF pulses
and their exact timing on tissue magnetization
and contrast, and the impact of gradient waveforms and thus k-space sampling trajectories on
image quality. These challenges require not only
the ability to generate code but also the ability
to reason about the physical implications of the
code, which is a significant challenge for current
LLMs. Prior work showed that
concise, example-driven prompts can enable LLMs
to generate executable PyPulseq-based MRI sequences, positioning LLMs as intelligent assistants
rather than fully autonomous designers[7]. However, many generated sequences still exhibit physical inconsistencies, particularly in complex acquisitions.Where the paper says it
Where the paper says it
Where the paper says it
The Agentic Framework
Agent4MR is an agent-based framework that iteratively generates and refines pulse sequences using validation reports.<ref:2604.13282#pg5>. The LLM operates in an agent mode, generating code and refining it based on structured feedback. p. 2 1 Methods
Agent4MR - LLM with MR specific skills,
validation tools and tests
We extend the prompt-based workflows [7] with
an agent-based refinement loop (Agent4MR). The
LLM operates in an agent mode, generating code
and refining it based on structured feedback. The
LLM operates in an agent mode, generating code
and refining it based on structured feedback. We
implement an automated validation report that analyzes a generated PyPulseq sequence and extracts
key properties: echo time (TE), repetition time
(TR), k-space trajectory characteristics, gradient
and RF raster timing, and other consistency metrics. We
implement an automated validation report that analyzes a generated PyPulseq sequence and extracts
key properties: echo time (TE), repetition time
(TR), k-space trajectory characteristics, gradient
and RF raster timing, and other consistency metrics. The agent continues refinement until the validation report indicates that constraints are satisfied or a predefined iteration limit is reached.Where the paper says it
Where the paper says it
Where the paper says it
Performance Across Models
Across all evaluated models, the use of the concise MRI-specific context (LLM4MR) substantially reduced the number of required user interactions compared with the unprompted baseline (LLM).<ref:2604.13282#pg6,Across all evaluated models, the use of the concise MRI-specific context (LLM4MR) substantially reduced the number of required user interactions compared with the unprompted baseline (LLM)>. p. 5 Figure 4(a–c) summarizes
the results per model. Effect of context and tool-equipped
agent refinements on user interactions
Across all evaluated models, the use of the concise MRI-specific context (LLM4MR) substantially
reduced the number of required user interactions
compared with the unprompted baseline (LLM),
see blue to green bar improvement in Figure 4(a–c). However, even with
the LLM4MR context, many LLM-generated sequences exhibited errors in key parameters such
as TE, TR, k-space trajectory, or gradient timing: LLM-only sequences frequently showed physically inconsistent trajectories or incorrect timing,
while LLM4MR sequences improved but still contained residual errors. In contrast, the Agent4MR
configuration generated sequences that were consistently correct, satisfying the target acquisition
parameters, k-space trajectories, and timing constraints without user intervention, see green to red
bar improvement in Figure 4(a–c). However, even with
the LLM4MR context, many LLM-generated sequences exhibited errors in key parameters such
as TE, TR, k-space trajectory, or gradient timing: LLM-only sequences frequently showed physically inconsistent trajectories or incorrect timing,
while LLM4MR sequences improved but still contained residual errors. In contrast, the Agent4MR
configuration generated sequences that were consistently correct, satisfying the target acquisition
parameters, k-space trajectories, and timing constraints without user intervention, see green to red
bar improvement in Figure 4(a–c). The agent’s iterative refinement loop, driven by the structured
validation report, allowed it to autonomously detect and correct errors in TE, TR, and gradient
events, producing fully valid sequences across all
evaluated LLMs. This comparison confirms that the agent framework is robust across LLMs, which indicates that
the context and validation might be more important than the exact model.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Autonomous Research Capabilities
Following Karpathy’s autoresearch approach, agents can formulate a goal and let multiple agents try to solve it autonomously.<ref:2604.13282#pg5,Following Karpathy’s autoresearch approach [9] we can now formulate a goal and let multiple agents try to solve it autonomously>. p. 2 The ideal case requires only the initial task prompt. MR autoresearch - An Agent4MR research
community
Following Karpathy’s autoresearch approach [9] we
can now formulate a goal and let multiple agents
try to solve it autonomously. The design of the
harness - execution and validation tools, feedback
format, and orchestration - proves as more important as the choice of LLM. Beyond that benchmark,
MR autoresearch on a constrained FLAIR spinecho EPI task showed that competing autonomous
agents can iteratively refine both pulse sequence
and reconstruction code against a signal-equation
target, with best agent results surpassing the accuracy of a human-designed multi-echo EPI. Still, the exploration and analysis by the agents consistently improved the images with regard to the given quality
metric. Over 28 experiments, the agents improved from a
baseline MAE of ∼0. Over 28 experiments, the agents improved from a
baseline MAE of ∼0. 8 s, TE=100 ms,
single-shot 96Œ96 NUFFT) to a best MAE of
∼0. An agentbased approach (Agent4MR) with structured validation feedback consistently yields correct, physically valid MR sequences with a single user interaction, independent of the model. Autonomous
MR research (MR autoresearch) is in principle possible with such specialized agents given a well defined leaderboard challenge.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Conclusion on Agentic Development
The design of the harness - execution and validation tools, feedback format, and orchestration - proves as more important as the choice of LLM.<ref:2604.13282#pg10,The design of the harness - execution and validation tools, feedback format, and orchestration - proves as more important than the choice of LLM>. p. 9 Conclusion
We have shown that an agent-based framework
(Agent4MR) with structured validation feedback
and MR- and PyPulseq-specific context consistently produces correct, physically valid spin-echo
EPI sequences with a single user interaction across
multiple base LLMs, outperforming both an unprompted baseline and a recently trained human
with the same tools and task. The design of the
harness - execution and validation tools, feedback
format, and orchestration - proves as more important as the choice of LLM. Beyond that benchmark,
MR autoresearch on a constrained FLAIR spinecho EPI task showed that competing autonomous
agents can iteratively refine both pulse sequence
and reconstruction code against a signal-equation
target, with best agent results surpassing the accuracy of a human-designed multi-echo EPI. Agentic sequence development is therefore a promising
path for reducing the effort and expertise required
to implement and iterate on MRI pulse sequences,
including open-ended, objective-driven exploration
of acquisition and reconstruction. Beyond that benchmark,
MR autoresearch on a constrained FLAIR spinecho EPI task showed that competing autonomous
agents can iteratively refine both pulse sequence
and reconstruction code against a signal-equation
target, with best agent results surpassing the accuracy of a human-designed multi-echo EPI. Agentic sequence development is therefore a promising
path for reducing the effort and expertise required
to implement and iterate on MRI pulse sequences,
including open-ended, objective-driven exploration
of acquisition and reconstruction. Autonomous
MR research (MR autoresearch) is in principle possible with such specialized agents given a well defined leaderboard challenge. While such agents are not immune to hallucinations, and often still follow non-ideal paths, the
possibility of validation, using our suggested tools,
strongly reduces the risk of the LLM returning a
non-ideal sequence as solution. Autonomous
MR research (MR autoresearch) is in principle possible with such specialized agents given a well defined leaderboard challenge. While such agents are not immune to hallucinations, and often still follow non-ideal paths, the
possibility of validation, using our suggested tools,
strongly reduces the risk of the LLM returning a
non-ideal sequence as solution.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Limitations and Future Work
In practice, we observed that Gemini can return cached answers: identical prompts yielded identical outputs across runs.<ref:2604.13282#pg10>. The limitation of this study for the human benchmark is obvious, as we only recruited one student assistant for this. p. 9 Another
common sequence, the turbo spin echo (TSE) sequence required more MR physics domain knowledge about the k-space effect of inversion pulses,
which we added to the context, but could then also
be created consistently. The limitation of this study for the human benchmark is obvious, as we only recruited one student
assistant for this. 5 h coding session is also a quite
extensive participation when compared to typical
survey times for scientific studies. To benchmark
humans and agents on a level playing field, a dedicated challenge such as a “Pulseq Olympiad” would
be highly valuable. 5 h coding session is also a quite
extensive participation when compared to typical
survey times for scientific studies. To benchmark
humans and agents on a level playing field, a dedicated challenge such as a “Pulseq Olympiad” would
be highly valuable. With an agent that reliably generates and validates
any possible pulse sequence, it becomes feasible
to produce and simulate many different sequence
variants in order to address a concrete clinical or
methodological goal - for example, reducing a specific artifact or satisfying time, energy, or performance constraints. With MR autoresearch using
Agent4MR we started to explore such trade-offs;
our results point to a path where the agent supports systematic sequence optimization for wellposed objectives. With an agent that reliably generates and validates
any possible pulse sequence, it becomes feasible
to produce and simulate many different sequence
variants in order to address a concrete clinical or
methodological goal - for example, reducing a specific artifact or satisfying time, energy, or performance constraints. With MR autoresearch using
Agent4MR we started to explore such trade-offs;
our results point to a path where the agent supports systematic sequence optimization for wellposed objectives. Individual experiments, including
multiple simulation and reconstruction runs, could
take up to 1h. Despite being encouraged to report
also non-winning results, the agents were generally
competitive and refined approaches to get a low
MAE before publishing it to the leaderboard. Individual experiments, including
multiple simulation and reconstruction runs, could
take up to 1h. Despite being encouraged to report
also non-winning results, the agents were generally
competitive and refined approaches to get a low
MAE before publishing it to the leaderboard. 836 million tokens, with an estimated
API cost of €75. Interestingly, the final codes the agents created for
the challenge were approximately 3,0005,000 tokens. 836 million tokens, with an estimated
API cost of €75. Interestingly, the final codes the agents created for
the challenge were approximately 3,0005,000 tokens.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Token Usage Analysis
The experimental evaluation involved a significant volume of token processing across three model generations.<ref:2604.13282#pg8,The experimental evaluation involved a significant volume of token processing across three model generations>. p. 7 However, the six shot sequence won by using much more scan time, so we
moved the challenge to the more interesting time
restricted version. Token Usage and Cost Analysis
The experimental evaluation involved a significant
volume of token processing across three model generations. While Gemini 3. 1 Pro processed
fewer tokens than the Flash 3 variant, it accounted
for the largest portion of the experimental expenditure, totaling approximately €59. In contrast, the Agent4MR
configuration generated sequences that were consistently correct, satisfying the target acquisition
parameters, k-space trajectories, and timing constraints without user intervention, see green to red
bar improvement in Figure 4(a–c). The agent’s iterative refinement loop, driven by the structured
validation report, allowed it to autonomously detect and correct errors in TE, TR, and gradient
events, producing fully valid sequences across all
evaluated LLMs. Overall, the experiments across all models required
a total of 233. 836 million tokens, with an estimated
API cost of €75. Overall, the experiments across all models required
a total of 233. 836 million tokens, with an estimated
API cost of €75. Overall, the experiments across all models required
a total of 233. 836 million tokens, with an estimated
API cost of €75. Overall, the experiments across all models required
a total of 233. 836 million tokens, with an estimated
API cost of €75. Interestingly, the final codes the agents created for
the challenge were approximately 3,0005,000 tokens. Thus around 125,000 tokens for one challenge, still the context, the thinking processes and
the tests required 1,000 times more tokens, compared to the final output. 00
Real scans
We also successfully tested a skill so that agents
can send the generated Pulseq sequence directly to
the scanner and run it, receive data and use the
same reconstruction codes to create images (data
not shown). The study we performed could in principle be run over a real scanner, however the target
and loss definition has then to be adjusted, potentially with a multi-shot sequence as a target or using quantification.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Autonomous Research Refinements
The autonomous agents refined the IRSE-EPI pipeline by exploring various strategies such as multi-window filtering, multi-shot introduction, phase correction, and differentiable TI/TE optimization.<ref:2604.13282#pg7,The staircase shows improvement from baseline (∼0. p. 6 Experiments are ranked by
MAE loss (worst to best). The staircase shows improvement from baseline (∼0. The staircase shows improvement from baseline (∼0. 2659) to best (∼0. 2659) to best (∼0. 1666)
through multi-window filtering, multi-shot introduction, phase correction, and differentiable TI/TE
optimization. 8 s, TE=100 ms,
single-shot 96Œ96 NUFFT) to a best MAE of
∼0. As each agent had access to the previous
attempts the winning strategy combined multiple
previous approaches: 2-shot EPI with per-shot signal scaling, and PulseqZero-optimized TI/TE/FA
before NUFFT reconstruction. With an agent that reliably generates and validates
any possible pulse sequence, it becomes feasible
to produce and simulate many different sequence
variants in order to address a concrete clinical or
methodological goal - for example, reducing a specific artifact or satisfying time, energy, or performance constraints. With MR autoresearch using
Agent4MR we started to explore such trade-offs;
our results point to a path where the agent supports systematic sequence optimization for wellposed objectives. With an agent that reliably generates and validates
any possible pulse sequence, it becomes feasible
to produce and simulate many different sequence
variants in order to address a concrete clinical or
methodological goal - for example, reducing a specific artifact or satisfying time, energy, or performance constraints. With MR autoresearch using
Agent4MR we started to explore such trade-offs;
our results point to a path where the agent supports systematic sequence optimization for wellposed objectives. With an agent that reliably generates and validates
any possible pulse sequence, it becomes feasible
to produce and simulate many different sequence
variants in order to address a concrete clinical or
methodological goal - for example, reducing a specific artifact or satisfying time, energy, or performance constraints. With MR autoresearch using
Agent4MR we started to explore such trade-offs;
our results point to a path where the agent supports systematic sequence optimization for wellposed objectives.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Model Generation Impact
Performance improved with the base model generation, indicated by the minimal MAE of each autoresearch experiment dropping from 0.239 (a, Gemini 2. p. 2 008) m, TE = 100 ms). ”
For each of three base LLMs (Gemini 2. 008) m, TE = 100 ms). ”
For each of three base LLMs (Gemini 2. Also
here tasks could be resolved with only one interaction, e. turning an existing full feature FLASH
to multi-echo functionality with both bipolar and
monopolar gradients, as well as echo labels in PyPulseq (data not shown). Also
here tasks could be resolved with only one interaction, e. turning an existing full feature FLASH
to multi-echo functionality with both bipolar and
monopolar gradients, as well as echo labels in PyPulseq (data not shown). Effect of context and tool-equipped
agent refinements on user interactions
Across all evaluated models, the use of the concise MRI-specific context (LLM4MR) substantially
reduced the number of required user interactions
compared with the unprompted baseline (LLM),
see blue to green bar improvement in Figure 4(a–c). This trend was consistent across Gemini 2. Effect of context and tool-equipped
agent refinements on user interactions
Across all evaluated models, the use of the concise MRI-specific context (LLM4MR) substantially
reduced the number of required user interactions
compared with the unprompted baseline (LLM),
see blue to green bar improvement in Figure 4(a–c). This trend was consistent across Gemini 2. Also
here tasks could be resolved with only one interaction, e. turning an existing full feature FLASH
to multi-echo functionality with both bipolar and
monopolar gradients, as well as echo labels in PyPulseq (data not shown). Also
here tasks could be resolved with only one interaction, e. turning an existing full feature FLASH
to multi-echo functionality with both bipolar and
monopolar gradients, as well as echo labels in PyPulseq (data not shown). 008) m, TE = 100 ms). ”
For each of three base LLMs (Gemini 2. 008) m, TE = 100 ms). ”
For each of three base LLMs (Gemini 2. Despite being encouraged to report
also non-winning results, the agents were generally
competitive and refined approaches to get a low
MAE before publishing it to the leaderboard. This experiment was repeated with different generations of the same model as shown in the appendix
Figure 8, with the result that later models also create better performing MR sequences. Introducing the MR- and PyPulseq-context improved task
grounding and reduced both the mean interaction
count and its variability, indicating more stable behavior across repeated trials. However, even with
the LLM4MR context, many LLM-generated sequences exhibited errors in key parameters such
as TE, TR, k-space trajectory, or gradient timing: LLM-only sequences frequently showed physically inconsistent trajectories or incorrect timing,
while LLM4MR sequences improved but still contained residual errors. The sequence had echo train length of
7, 5 k-space segments and two dummy refocusing
pulses. We also ran an early experiment without time restriction, which could be solved by a six-shot approach with near perfect result, see also in the
appendix Figure 7. 2659) to best (∼0. 1666)
through multi-window filtering, multi-shot introduction, phase correction, and differentiable TI/TE
optimization.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Final Synthesis
An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers.<ref:2604.13282#pg1,Conclusion: An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers>. p. 0 Autonomous agents could
then improve a sequence to match a given target contrast in an autoresearch approach. Conclusion: An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers and may ultimately enable non-experts to refine or innovate
MR sequences guided by biological or clinical questions, or let swarms
of agents realize sequence programming for them. Autonomous agents could
then improve a sequence to match a given target contrast in an autoresearch approach. Conclusion: An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers and may ultimately enable non-experts to refine or innovate
MR sequences guided by biological or clinical questions, or let swarms
of agents realize sequence programming for them. Autonomous agents could
then improve a sequence to match a given target contrast in an autoresearch approach. Conclusion: An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers and may ultimately enable non-experts to refine or innovate
MR sequences guided by biological or clinical questions, or let swarms
of agents realize sequence programming for them. More focused on education, but still combining MR physics
and Pulseq knowledge, is the open-source tool
PulsePal[15]. To our knowledge, Agent4MR is the
first agentic system that combines an LLM with automated execution, physics-based validation, and
simulation in a single loop to produce scannerready sequences with minimal user intervention. While such agents are not immune to hallucinations, and often still follow non-ideal paths, the
possibility of validation, using our suggested tools,
strongly reduces the risk of the LLM returning a
non-ideal sequence as solution. Whether LLMs can truly reason remains an open
question, but high-level logic is only one part of the
scientific process. Much of research is grounded in
rigorous, repetitive work: analyzing similar setups
or systematically combining existing approaches. Even if AI agents never achieve true reasoning,
they are already incredibly powerful when it comes
to doing this heavy lifting.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
References
[1] Kelvin J. Layton, Stefan Kroboth, Feng Jia, Sebastian Littin, Huijun Yu, Jochen Leupold, Jon-Fredrik Nielsen, Tony Stöcker, and Maxim Zaitsev. Pulseq: A rapid and hardware-independent pulse sequence prototyping framework. p. 1 Introduction
Programming MRI pulse sequences requires extensive research effort as well as deep expertise in
MRI physics, hardware constraints, and sequence
design, which makes it also time-consuming. Moreover, even small modifications to existing sequences can involve non-trivial debugging and validation, creating a barrier to rapid prototyping and
methodological innovation.Where the paper says it
[2] Keerthi Sravan Ravi, Sairam Geethanath, and John Thomas Vaughan. PyPulseq: A Python package for MRI pulse sequence design. p. 1 A massive leap to democratization of MR sequence programming came with the open-source
MR sequence definition standard Pulseq and its
Python implementation PyPulseq. These tools,
for the first time, allowed MRI pulse sequences
to be defined in a complete form outside of
vendor-specific environments[1, 2].Where the paper says it
[3] Moritz Zaiss, Simon Weinmüller, H. N. Dang, J. Endres, Z. Hu, L. G. Hanson, and F. Glang. MRIpulseq: Learning MR sequence programming with Pulseq through simulation and measurement. p. 1 This open,
hardware-independent representation has enabled
reproducible sequence development, sharing, and
education. The combination of Pulseq with
MR simulations provides a fast feedback loop
for learning MR sequence programming[3]. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
[4] Jon-Fredrik Nielsen and Douglas C. Noll. TOPPE: A framework for rapid prototyping of MR pulse sequences. p. 1 Introduction
Programming MRI pulse sequences requires extensive research effort as well as deep expertise in
MRI physics, hardware constraints, and sequence
design, which makes it also time-consuming. Moreover, even small modifications to existing sequences can involve non-trivial debugging and validation, creating a barrier to rapid prototyping and
methodological innovation.Where the paper says it
[5] Cristoffer Cordes, Simon Konstandin, David Porter, and Matthias Günther. Portable and platform-independent MR pulse sequence programs. p. 1 These tools,
for the first time, allowed MRI pulse sequences
to be defined in a complete form outside of
vendor-specific environments[1, 2]. This open,
hardware-independent representation has enabled
reproducible sequence development, sharing, and
education. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
[6] Moritz Zaiss, Junaid R. Rajput, Hoai N. Dang, Vladimir Golkov, Daniel Cremers, Florian Knoll, and Andreas Maier. p. 0 Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR). Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR). Use all tools to validate
the sequence. ”
As a comparable human baseline we chose a student assistant developer who was recently trained
in PyPulseq programming and already solved other
sequence tasks in our research group, but was at
the same time naive to the spin echo EPI concept. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
[7] Moritz Zaiss. Mr physicist’s last exam – LLM4MR. p. 0 These agents can perform also
autonomous research. Methods: We evaluated Agent4MR on a spin-echo EPI task across
three state-of-the-art LLMs and compared it to a context-only baseline
(LLM4MR) and to a human developer with the same tools. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
[8] Moritz Zaiss, Jonathan Endres, and Simon Weinmüller. Agentic MR sequence development—leveraging LLMs with MR tools and tests for physics-informed sequence development. p. 0 Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR). Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
[9] Andrej Karpathy. Autoresearch: A minimalist framework for automated machine learning research. p. 9 Even with more flexible optimizers that
use discrete differences or gradient-free approaches,
or reinforcement learning approaches, one needs to
define the parameters that need to be optimized
and at least the sequence skeleton containing these
parameters. Now agent-based autoresearch has all
flaws of hallucinating LLMs, but is completely free
of any restriction of the to be optimized sequence. The ideal case requires only the initial task prompt. MR autoresearch - An Agent4MR research
community
Following Karpathy’s autoresearch approach [9] we
can now formulate a goal and let multiple agents
try to solve it autonomously.Where the paper says it
Where the paper says it
[10] Alexander Loktyushin et al. Mr-zero: Learning mri sequence design from scratch. p. 9 While conventional optimization is common in MR
sequence development, it is often limited to parts of
the sequence design that can be formulated in a differentiable manner, meaning an analytical equation
exists, and certain variables of the sequence are optimized. Even with more flexible optimizers that
use discrete differences or gradient-free approaches,
or reinforcement learning approaches, one needs to
define the parameters that need to be optimized
and at least the sequence skeleton containing these
parameters. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
[11] Jonathan Endres, Simon Weinmüller, N. Dang, and Moritz Zaiss. p. 0 Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR). Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR). This open,
hardware-independent representation has enabled
reproducible sequence development, sharing, and
education. The combination of Pulseq with
MR simulations provides a fast feedback loop
for learning MR sequence programming[3]. Agentic MR sequence development: leveraging LLMs with MR
skills for automatic physics-informed sequence development
Moritz Zaiss1,2∗
, Amr Aly1
, Jonathan Endres1
, Tobias Dornstetter1
, Simon Weinmüller1
, Andreas Maier2,3
1
Institute of Neuroradiology, University Hospital Erlangen, Erlangen, Germany
2Department of Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
3Pattern Recognition Lab,
Friedrich-Alexander-Universität
Erlangen-Nürnberg, Erlangen,
Germany
Correspondence:
Moritz Zaiss1,2
moritz. de
Funding Information:
This work was supported by the
German Federal Ministry of
Research, Technology and Space
(BMFTR).Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
[12] Juergen Hennig, Antonia Barghoorn, Shuoyue Zhang, and Maxim Zaitsev. Single shot spiral tse with annulated segmentation. p. 7 Due to its single shot approach, it was at
least faster than all agentic solutions with < 3s duration. The most elegant and potentially better realization of such a multi-"SE-EPI" might be the spiral TSE of Hennig et al. Due to its single shot approach, it was at
least faster than all agentic solutions with < 3s duration. The most elegant and potentially better realization of such a multi-"SE-EPI" might be the spiral TSE of Hennig et al.Where the paper says it
Where the paper says it
[13] S. Hussain, J. Huber, M. Günther, and D. Hoinkiss. Seqgpt: Training a large language model to generate MRI pulse sequences. p. 8 SeqGPT[13] represents a different
paradigm: a model trained on pseudo-random MRI
sequence data in the gammaSTAR language to generate pulse sequence structure for subsequent, conventional optimization by users or LLMs. An alternative line of work uses a domain-specific language for scanner-independent sequences and applies AI-driven optimization on top[14].Where the paper says it
[14] Daniel Christopher Hoinkiss, Jörn Huber, Christina Plump, Christoph Lüth, Rolf Drechsler, and Matthias Günther. AI-driven and automated MRI sequence optimization in scanner-independent MRI sequences formulated by a domain-specific language. p. 8 SeqGPT[13] represents a different
paradigm: a model trained on pseudo-random MRI
sequence data in the gammaSTAR language to generate pulse sequence structure for subsequent, conventional optimization by users or LLMs. An alternative line of work uses a domain-specific language for scanner-independent sequences and applies AI-driven optimization on top[14].Where the paper says it
[15] Robert Moskwa. Pulsepal.<ref:2604.13282#pg14,[15] Robert Moskwa.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Agent4MR can turn general-purpose LLMs into reliable MRI sequence developers by using an
agent-based framework that automatically generates and refines PyPulseq sequences using a structured, physics-aware validation report.
-
The improved system can achieve artifactfree, physically valid sequences in a single user interaction across all evaluated models, reducing the number of required interactions below the human baseline while maintaining correct timing and k-space coverage.
-
Autonomous agents can perform autonomous research by being asked to
outperform each other
in an MR autoresearch setup to find better methods for sequence and reconstruction approaches. -
The system can refine sequences autonomously by using
an agent-based approach with structured validation feedback,
allowing it to autonomously detect and correct errors in TE, TR, and gradient events until constraints are satisfied or a predefined iteration limit is reached. -
The system can perform autonomous MR research by iteratively improving both pulse sequence and reconstruction code against a signal-equation target using an Agent4MR setup, even when facing challenges like time restrictions.
Abstract
Purpose: Novel MR sequence developments still today allow generation of new diagnostic tools or novel imaging biomarkers. Programming MRI pulse sequences, however, is time-consuming and requires deep expertise in sequence design, restrictions by hardware constraints and MRI physics; even small modifications often require substantial debugging and validation. LLMs can assist when given structured prompts and error feedback, but many generated sequences still exhibit physical inconsistencies. We present Agent4MR, an agent-based framework that automatically generates and refines PyPulseq sequences using a structured, physics-aware validation report. These agents can perform also autonomous research. Methods: We evaluated Agent4MR on a spin-echo EPI task across three state-of-the-art LLMs and compared it to a context-only baseline (LLM4MR) and to a human developer with the same tools. We tested an MR autoresearch on a fluid-suppressed spin-echo EPI challenge for three different model generations. Results: Across all models, Agent4MR consistently produced artifact-free, physically valid sequences in a single user interaction, reducing the number of required interactions below the human baseline while maintaining correct timing and k-space coverage. Autonomous agents could then improve a sequence to match a given target contrast in an autoresearch approach. Conclusion: An appropriate agentic harness with physics-based validation can turn general-purpose LLMs into reliable MRI sequence developers and may ultimately enable non-experts to refine or innovate MR sequences guided by biological or clinical questions, or let swarms of agents realize sequence programming for them. Keywords: MRI; pulse sequence; PyPulseq; large language models; agents; autoresearch, sequence development.
Related papers
- BART Online Open-Source Sequence Toolbox for Computational MRI
- Liver Lesion Detection with Task-Specific Organ-Level Tube Current Modulation: A Retrospective Reader Study
- Subwavelength registration of skull-compensating acoustic holograms via nonlinear parametric array feedback
- Fail-closed conformal multiresolution error control for conservative three-dimensional dose remapping in synthetic phantoms
- The Contrast Order: An Order-Based Image Quality Criterion for Nonlinear Beamformers
- Constrained estimation of rotational invariants of the cumulant expansion (RICE) for rapid tensor-valued diffusion MRI