Exploring GPT-4 as MR Sequence and Reconstruction Programming Assistant

Moritz Zaiss, Junaid R. Rajput, Hoai N. Dang, Vladimir Golkov, Daniel Cremers, Florian Knoll, Andreas Maier

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


In this study, we explore the potential of generative pre-trained transformer (GPT), as a coding assistant for MRI sequence programming using the Pulseq framework. The programming of MRI sequences is traditionally a complex and time-consuming task, and the Pulseq standard has recently simplified this process. It allows researchers to define and generate complex pulse sequences used in MRI experiments. Leveraging GPT-4’s capabilities in natural language generation, we adapted it for MRI sequence programming, creating a specialized assistant named GPT4MR. Our tests involved generating various MRI sequences, revealing that GPT-4, guided by a tailored prompt, outperformed GPT-3.5, producing fewer errors and demonstrating improved reasoning. Despite limitations in handling complex sequences, GPT4MR corrected its own errors and successfully generated code with step-by-step instructions. The study showcases GPT4MR’s ability to accelerate MRI sequence development, even for novel ideas absent in its training set. While further research and improvement are needed to address complexity limitations, a well-designed prompt enhances performance. The findings propose GPT4MR as a valuable MRI sequence programming assistant, streamlining prototyping and development. The future prospect involves integrating a PyPulseq plugin into lightweight, open-source LLMs, potentially revolutionizing MRI sequence development and prototyping.

Original languageEnglish
Title of host publicationBildverarbeitung für die Medizin 2024 - Proceedings, German Conference on Medical Image Computing, 2024
EditorsAndreas Maier, Thomas M. Deserno, Heinz Handels, Klaus Maier-Hein, Christoph Palm, Thomas Tolxdorff
PublisherSpringer Science and Business Media Deutschland GmbH
Number of pages6
ISBN (Print)9783658440367
StatePublished - 2024
Externally publishedYes
EventGerman Conference on Medical Image Computing, BVM 2024 - Erlangen, Germany
Duration: 10 Mar 202412 Mar 2024

Publication series

NameInformatik aktuell
ISSN (Print)1431-472X


ConferenceGerman Conference on Medical Image Computing, BVM 2024


Dive into the research topics of 'Exploring GPT-4 as MR Sequence and Reconstruction Programming Assistant'. Together they form a unique fingerprint.

Cite this