Do Clinicians Know How to Prompt? The Need for Automatic Prompt Optimization Help in Clinical Note Generation (2024)

Abstract: This study examines the effect of prompt engineering on the performance of Large Language Models (LLMs) in clinical note generation. We introduce an Automatic Prompt Optimization (APO) framework to refine initial prompts and compare the outputs of medical experts, non-medical experts, and APO-enhanced GPT3.5 and GPT4. Results highlight GPT4-APO’s superior performance in standardizing prompt quality across clinical note sections. A human-in-the-loop approach shows that experts maintain content quality post-APO, with a preference for their own modifications, suggesting the value of expert customization. We recommend a two-phase optimization process, leveraging APO-GPT4 for consistency and expert input for personalization.

## introduction large language models (llms), including iterations of the generative pre-trained transformer (gpt) series, have dramatically expanded the scope of natural language processing (nlp). their applications now range from simple q&a to the intricate demands of clinical documentation, necessitating the craft of prompt engineering @xcite @xcite @xcite @xcite . the quality of a prompt is paramount, as it is typically created by a human mentor to guide an llm mentee to generate the document. yet, this prompt creation process is encumbered by the complexities of human expression-rich in subtleties and cultural nuance-that often surpass the computational confines of llms, resulting in a cognitive gap @xcite . variances in prompt quality lead to differences in prompt efficacy, which can fluctuate considerably (1) when switching between llm mentees (as shown in figure 1 , 'mentor' modifies the prompt to allow 'mentee' to perform the targeted task better) and (2) across various sections of the documentation or (3) among different human mentors, as illustrated in figure 1 . this inherent variability underscores the need for a consistent tool that standardizes prompt quality to achieve reliable uniformity in llm performance. in the clinical domain, where the stakes are particularly high, optimizing prompt engineering is critical to help busy clinicians most efficiently use llms for clinical practice. our study adopts automatic prompt optimization (apo) @xcite as a novel solution to address these challenges. apo refines the initial prompts provided by clinicians, adapting them to the nuanced requirements of different clinical note sections for ai-assisted clinical documentation. thus, the resulting clinical notes are significantly enhanced in quality and efficiency. through a comprehensive comparative analysis, our research elucidates how apo, when used with human experts, substantially elevates the refinement process of prompts. our first experimental set pits generic prompts, modified by medical experts, non-medical experts, and apo-enhanced gpt3.5 and gpt4, against each other. the results highlight apo-gpt4's remarkable ability to elevate content generation, revealing an inherent capacity for selfimprovement that aligns with recent academic discourse. our second experimental set delves into the potential of human-in-the-loop systems. here, we further refine apo-generated prompts with human experts. contrary to non-expert interventions, which often detracted from the quality of the content, expert modifications maintained the high standards set by apo. moreover, our human preference feedback suggests that, while experts may not significantly alter the content quality, they prefer the results of their own modifications, pointing to a personalized touch without sacrificing the quality of the content. in light of our findings, we advocate a twopronged approach to prompt optimization: initially employing apo-gpt4 to standardize prompt quality, followed by expert-led customization based on preference. this strategy offers a pragmatic balance, effectively harnessing the power of ai while respecting the nuances of human expertise. ## related work soft prompts and parameter adjustments offer promising results for open-source llms @xcite @xcite , while discrete prompt searches @xcite and reinforcement learning @xcite push the boundaries further. closed-source llms, conversely, necessitate gradient-free optimization, relying on iterative prompt refinement and natural language feedback for efficacy @xcite @xcite @xcite @xcite @xcite @xcite . in the clinical context, synthesizing such optimization techniques has been pivotal. foundational work in automated note generation @xcite @xcite @xcite @xcite informs our approach, integrating apo to streamline medical documentation. this research leverages both iterative enhancement and expert feedback, embodying the iterative, gradient-free optimization approach to improve the precision of clinical llm applications. ## method we are given a dataset d of n i.i.d training clinical data, comprised of f features (@xmath0, the name of a soap @xcite note section foot_0 , the ground truth section clinical note summary, the model-generated section clinical note summary, etc. our method broadly consists of a "forward pass" (3.1) and a "backward pass" (3.2). first, an llm generates summaries for a batch h from a section @xmath1. an llm is then asked via a fixed prompt p ∇ to provide suggestions to make p 0 more suitable for s given the ground truth and generated summaries, producing an answer g. afterward, another fixed prompt, p δ , is used to command the llm to use g to fix p 0 , outputting a new prompt p ′ . p ′ should now be slightly more tailored to generate better summaries for s, closer to the theoretical optimal prompt p * . this is executed for all s utilizing a random sample of data h (batch) from each section, where h ⊆ n. this process is illustrated in figure 2 and detailed in algorithm 1 foot_1 . ## conclusion our investigation has demonstrated the profound impact of prompt engineering on the effectiveness of llms, specifically in clinical note generation. implementing our apo framework has notably advanced the standardization of prompt quality, particularly with gpt4, which has shown superior performance in generating clinical notes. incorporating a human-in-the-loop approach further validated the importance of expert involvement, indicating a clear preference for expert-modified prompts, suggesting that personalized tweaks to apo-generated prompts yield user-preferred outcomes without compromising the content's integrity.