A Guide to Prompt Writing for Large Language Models like GPT

Ashok Poudel
7 min readFeb 17, 2023

--

Created in Dream-studio: AI mind, playing with words, words in neurons, words in circuit, words in a loop, dreamy, 4K, HD [Stable Diffusion v2.1–768, Cfg Scale: 7, Seed: 4266682539]

Last week, I received a message from a client in the medical industry who was interested in implementing GPT-3 technology on their website. They wanted to automate several aspects of their website, from appointment scheduling to medical billing and insurance claim processing, and were keen on incorporating chat GPT to improve customer service by answering inquiries and providing follow-up messages to patients. However, the client was unaware that well-crafted prompts were essential for consistent and quality results, especially for a medical application.

Prompt writing is a critical skill when working with large language models like GPT-3. The quality of the prompts directly affects the quality of the responses generated by the model. Poor prompts can result in irrelevant or nonsensical responses, while well-crafted prompts can produce accurate and helpful answers. This was a key insight that the client was initially unaware of, and it became clear that they needed guidance on how to write effective prompts.

Additionally, the client was confused about the difference between chat GPT and the GPT-3 model, insisting on implementing chat GPT on their platform. However, chat GPT is just one application of the GPT-3 model, which can be used for a wide range of natural language processing tasks. In this article, my aim is to provide readers with ten tips and strategies to improve their prompt writing skills, enabling them to make the most of large language models like GPT-3 and achieve their goals with effective prompts.

It’s important to note that GPT-3 is not the only language model available. Other models, such as BERT and T5, are also used for natural language processing tasks. The core difference between these models is how they approach language processing. GPT-3 is based on a transformer architecture that generates text based on patterns it has learned from massive amounts of data, whereas BERT uses a masked language model to predict missing words in a sentence and T5 is a transformer model that is pre-trained on a variety of language tasks. However, the principles of effective prompt writing apply to all of these models. In this article, my aim is to provide readers with ten tips and strategies to improve their prompt writing skills, enabling them to make the most of large language models like GPT-3 and achieve their goals with effective prompts.

  1. Be Clear and Specific: The prompts should be specific and clear to avoid confusion and generate accurate responses. For instance, instead of asking “What are the treatment options for my condition?”, the prompt could be “What are the most effective treatment options for [specific condition] in patients with [specific criteria]?”
  2. Use Relevant Context: Providing context in the prompt can help the model generate relevant and accurate responses. For example, instead of asking “What is the best way to schedule an appointment?”, the prompt could be “Can you please help me schedule an appointment for [specific patient] on [specific date and time] with Dr. [specific doctor]?”
  3. Avoid Ambiguity: Ambiguous prompts can result in irrelevant or nonsensical responses. It’s important to avoid ambiguous terms and use clear and specific language. For instance, instead of asking “Can you give me more information about my treatment?”, the prompt could be “What are the side effects and expected outcomes of [specific treatment] for [specific condition] in patients with [specific criteria]?”
  4. Provide Examples: Providing examples in the prompts can help the model understand the context and generate accurate responses. For example, instead of asking “What are the common symptoms of my condition?”, the prompt could be “Can you please provide a list of symptoms that patients with [specific condition] typically experience, such as [specific example symptom] or [specific example symptom]?”
  5. Use Natural Language: Use natural language in the prompts to ensure that the model understands the intent and generates accurate responses. For example, instead of asking “What is the treatment plan for my condition?”, the prompt could be “Can you please provide me with a personalized treatment plan for [specific condition] that takes into account [specific patient information]?”
  6. Focus on the Goal: The prompts should be focused on the goal and objective of the task. For instance, instead of asking “Can you tell me about the doctor’s qualifications?”, the prompt could be “Can you provide me with information about Dr. [specific doctor’s name], including their qualifications, experience, and areas of expertise?”
  7. Use Open-Ended Questions: Using open-ended questions in the prompts can help the model generate more creative and diverse responses. For example, instead of asking “What is the diagnosis for my condition?”, the prompt could be “Can you please help me understand the potential causes of [specific condition] and provide me with a list of potential diagnoses?”
  8. Consider Different Scenarios: It’s important to consider different scenarios and provide prompts for each scenario to ensure that the model generates accurate responses. For example, instead of asking “How can I pay my medical bills?”, the prompt could be “Can you please provide me with information about the different payment options for medical bills, including [specific payment options] and how to process insurance claims?”
  9. Use Simple Language: Using simple language in the prompts can help the model understand the intent and generate accurate responses. For instance, instead of asking “What is the mechanism of action of the medication?”, the prompt could be “How does [specific medication] work to treat [specific condition]?”
  10. Test and Refine: It’s important to test the prompts and refine them based on the responses generated by the model. This can help improve the quality of the prompts and ensure that the model generates accurate responses consistently.

After careful consideration of the challenges and limitations associated with implementing large language models like GPT-3 in the healthcare industry, I recommended that my client limit the scope of their project to the automation and customer service aspects only. I advised them against using the model for generating personalized treatment plans, providing medical information, and managing patient records. Instead, I suggested that they focus on using the technology to automate appointment scheduling, streamline medical billing and insurance claim processing, and improve customer service through efficient responses to inquiries and follow-up messages to patients. It was my professional opinion that the potential risks of using these models in clinical settings outweighed the benefits, and that the model should be used as a supplement to, rather than a replacement for, the expertise and judgment of medical professionals.

In certain use cases, fine-tuning the language model can be a valuable approach to improving the accuracy and effectiveness of the system. By training the model on specific data sets or custom prompts, it is possible to improve the relevance and specificity of the generated responses, particularly in specialized areas like healthcare. As a software developer, data science teacher, and an occasional poet, I have been closely following the advancements of GPT technology since the release of GPT-2, and have a strong understanding of how to fine-tune these models for custom use cases and application automations. If you have any questions or need assistance with fine-tuning your GPT model, feel free to contact me at ashok.poudel@gmail.com. Together, we can leverage the power of GPT to build more efficient, effective, and impactful systems.

PS: Thanks to the GPT magic and my exceptional prompt writing skills, this article practically wrote itself! Who needs a ghostwriter when you’ve got ChatGPT and some killer prompt directions?

Bonus Article

Boosting Your Productivity as a Techie with ChatGPT Prompts

Here’s a guide for techies to boost their productivity using ChatGPT prompts:

  1. Define your objective: Before starting with prompts, you need to define what you want to achieve. Do you want to increase your coding speed or learn new technologies? Do you want to streamline your workflow or find ways to automate tasks? Once you have a clear objective, you can use GPT prompts to find solutions.
  2. Use specific keywords: When using ChatGPT, make sure to use specific keywords related to your objective. For example, if you want to learn Python, use keywords such as “Python tutorials”, “Python resources”, “Python beginner guide”, etc. This will help GPT generate more relevant prompts.
  3. Experiment with different prompts: GPT prompts can generate a variety of results based on the input. Experiment with different prompts and tweak the input to see which prompts work best for you. You can also try different GPT models to see which one generates the best results.
  4. Use it to automate tasks: GPT prompts can also be used to automate tasks. For example, you can use GPT to generate scripts for repetitive tasks, such as renaming files or resizing images. You can also use GPT to generate boilerplate code for your projects.
  5. Collaborate with others: GPT prompts can be used to collaborate with other techies. OpenAi’s community is a great place to get engaged.
  6. Stay up-to-date with the latest trends: GPT prompts can help you stay up-to-date with the latest trends in technology. Be active on reddit communities and hacker news.
  7. Use GPT to improve your writing: GPT prompts can be used to improve your technical writing skills. You can use GPT to generate ideas for blog posts or to generate technical documentation for your projects.

In summary, GPT prompts can be a powerful tool for techies to boost their productivity. By defining your objective, using specific keywords, experimenting with different prompts, automating tasks, collaborating with others, staying up-to-date with the latest trends, and improving your writing, you can use GPT prompts to become a more productive techie.

--

--

Ashok Poudel
Ashok Poudel

Written by Ashok Poudel

Web Development | Senior Technical Manager | Generative AI Enthusiast | Don't hesitate to reach out: https://www.linkedin.com/in/ashokpoudel/

No responses yet