-
PDF
- Split View
-
Views
-
Cite
Cite
Brigitte Durieux, Joshua Davis, Philip Moons, Liesbet Van Bulck, How to get the most out of ChatGPT? Tips and tricks on prompting, European Journal of Cardiovascular Nursing, Volume 23, Issue 7, October 2024, Pages e128–e130, https://doi.org/10.1093/eurjcn/zvae016
- Share Icon Share
Introduction
ChatGPT is a robust language model with the ability to comprehend and generate human-like text. It can be used for many applications, including language translation, summarization, and text completion.1
The rise of ChatGPT and other generative artificial intelligence (AI) models has made artificial intelligence more accessible to a wider public. The potential impact of generative AI is also currently being increasingly explored in healthcare.2 Recent studies have discussed and demonstrated the usefulness of generative AI for healthcare and specifically nursing, and have shown that generative AI can ease the burden on healthcare professionals, increase efficiency, and lower healthcare costs, for example by helping with the development of patient information or summarizing clinical notes.3,4
As a consequence, healthcare institutions and medical companies are starting to integrate generative AI into their businesses.5 As this becomes more commonplace, more healthcare workers and researchers will be expected to work with generative AI and need to know how they can use it to its full potential. As such, healthcare workers will have to develop a new skill: prompt engineering.5
Prompts are the instructions that you enter into a large language model (LLM), such as ChatGPT, shaping the resulting output. When interacting with AI systems, it is crucial to understand how to design and refine your prompts to enhance the quality of the responses you receive. Prompt engineering is the technique used to refine prompts to obtain more desired outputs.5 This editorial aims to provide healthcare workers with practical recommendations on how to improve their prompting skills, and hence, to get the most out of their interactions with generative AI.
Prompting recommendations
Several studies have enumerated and discussed general principles when it comes to prompting. For example, being specific, giving appropriate context, and clearly laying out the desired goal, will improve the performance of ChatGPT.6,7 Also in the official OpenAI guide, some valuable advice with regard to prompting has been provided.8 Users are advised to write clear instructions; provide a reference text for how the output should look; split complex tasks into simpler subtasks; and give the model time to think and work with a chain of thought rather than expecting the right answer right away; use external tools; and test changes systematically.8
These recommendations, together with experiences from the authors, have led to the set-up of a step-by-step process (see Central Illustration) that can guide new users in their first prompting experiences.
For each of the steps in the process, an example will be provided to illustrate the step further. In the example, we aim to extract patient-reported signs and symptoms related to a myocardial infarction. Hereby, we assume that the data entered in ChatGPT are anonymized and/or a private and secure ChatGPT connection is used.
Step 1: Define the purpose of the prompt. The first step for successful prompt engineering is to define the purpose of the project. There are two main branches: (i) text creation or refinement, and (ii) text extraction or analysis. In the first case, you want to use verbs such as ‘write’ or ‘create’. In the latter case, you should use verbs such as ‘summarize’ or ‘extract’.
Example: The purpose of this prompt is to extract details from text.
Step 2: Start with a simple prompt. Once the use case is defined, start with the simplest prompt possible, and see how well ChatGPT performs. Based on this first attempt, there are many opportunities for ‘tuning’ the prompt to get a better outcome.
Example: ‘Which experiences does this patient have regarding myocardial infarction? [Insert patient data]’.
Step 3: Make the prompt more specific. The next step is to adjust your prompt to try to improve performance. Try adding context, specifying how you want outputs to look, giving examples, and adjusting the length of the prompt.
Add context: You can give the model context by using phrases such as ‘respond as a clinician’ or ‘respond in a manner appropriate for an academic conference’.
Example: ‘Numbness and tingling in the left arm and jaw tension are different ways pain radiates in relation to myocardial infarction.’
(b) Specify the output format: Deciding on an output format that works best for the use case (e.g. sentence formatted a certain way, table, or list) and enforcing it for all outputs can help make outputs easier to review and use.

Example: ‘Please give a bullet-pointed list of all relevant signs or symptoms a patient experiences related to myocardial infarction.’
(c) Add examples: If you have a desired output format, you can include it in your prompt via examples. One simple way to do this is to say ‘the output format is shown below delimited by triple quotes: ‘“your format”’. This clearly gives the model an example and additionally separates the rest of your prompt and data from the formatting/example. You can also use examples to help illustrate how you want ChatGPT to perform a task.
Example: ‘For example, if the patient says ‘I have tightness in my chest’, please output: Chest tightness.’
(d) Adjust the length of your prompt: As you edit your prompt, keep in mind input size. If you are analysing a ‘large’ body of text, splitting it into smaller units will likely increase performance for any analysis. ChatGPT performs better on information at the beginning and the end of a text; as such if the ‘middle’ is smaller, the analysis will improve.9
Example: ‘Which experiences does this patient have regarding myocardial infarction? [Insert half of patient data]’ + ‘Which experiences does this patient have regarding myocardial infarction? [Insert second half of patient data]’ + ‘Please, merge the data from the two previous answers.’
Step 4: Fine-tune the prompt further. You can further adjust the prompt until you receive the desired output. Trial and error is an essential step when prompting. If the output is not what you are looking for, be more specific. For extraction tasks, such as symptom summarization, consider what you are asking for (e.g. all symptoms mentioned vs. all symptoms present). Small changes in phrasing can have large impacts on the quality of the output. Some tasks are too complex to be processed at once. Splitting these tasks into smaller, simpler tasks will help you reach better outputs.
Example: ‘You are a clinician reviewing patient notes for any mention of signs or symptoms that could relate to myocardial infarction. You are specifically looking for mention of numbness and tingling in the left arm, jaw tension, chest pain, and chest tightness, but can include other related symptoms if needed. [Insert patient data]’
Step 5: Re-evaluate the prompt over time. Consider that your prompts may need to evolve or change over time. If you are using models for a standard or consistent task, know that they may not always perform in a consistent manner. Generative AI models are continuously developed and rapidly updated; we recommend building prompt testing into project and/or practice workflow to keep abreast of when prompts require adjustment.
Example: Keep a log of your current prompt and the data on which it was tested. Re-run occasionally over time to see how the output changes over time, and if at any point the prompt stops receiving a desired output. You may have to repeat Step 3(d) to adjust your prompt so that it continues performing as intended.
Accessing generative AI models via an application programming interface
OpenAI offers the usage of their application programming interface (API) for a separate cost. The API allows one to programmatically interact with models, including more advanced models that are publicly available for free. There are several clear benefits to the API, such as the ability to automate data inputs and customize model parameters such as output size or temperature. To use the API, programming skills are needed.
Conclusion
As generative AI will increasingly be used in all kinds of healthcare settings, healthcare workers should learn how to most effectively use generative AI and hence, will have to learn how to conduct and improve prompts. Some recommendations have been highlighted in this editorial, and a step-by-step process is provided to help new users with their first prompting experiences.
Funding
This work was supported by the Research Foundation Flanders (FWO) (grant number K210723N to Dr Liesbet Van Bulck) and by the National Institutes of Health, National Institute on Aging Medical Student Training in Aging Research Program (grant number 5T35AG038027-13 to Joshua Davis).
Data availability
Not applicable.
References
Author notes
The opinions expressed in this article are not necessarily those of the Editors of European Journal of Cardiovascular Nursing or of the European Society of Cardiology.
Brigitte Durieux and Joshua Davis Shared first authorship because the first two authors contributed equally to the study.
Conflict of interest: The authors have no relationships relevant to the contents of this paper to disclose. During the preparation of this work, the authors used ChatGPT to assist with the writing process. After using this tool, the authors reviewed and edited the content as needed and took full responsibility for the content of the publication.
Comments