Prompt Engineering

Prompts are the instructions used to ask a large language model to perform a task and create an output. The more specific instructions you can give the generative AI, the better output you're going to get. Prompting generative AI each step of the way guides it to ensure consistency and keeps the AI on topic.
Whether you're asking a question or providing additional context, you are prompting the language model to perform a task for you. A prompt consists of a few words, a single sentence or paragraphs. Successful prompt crafting influences the quality and relevance of the generated output and the user's satisfaction in the answer. Providing as much instruction and context as you can to a large language model, like ChatGPT, will bring back a more helpful output to the task you've asked.
Some common tasks that LLM's can perform are:
- text generation
- image generation
- questions & answer
- problem-solving
- writing code
- data analyzation
- text summarization & synthesizing
- language translation
The way you engineer or craft a prompt makes a huge difference in the output that ChatGPT gives you. So it's worth learning some tips.
- Always verify the information it gives you. Think of ChatGPT as your personal intern. They need very specific instructions, and they need you to verify the information.
- ChatGPT sometimes makes things up. That's because it's designed to write in a way that sounds like human writing. It's not designed to know facts.
- Learn more about AI hallucinations in Evaluating AI Outputs.
Tips for writing effective prompts
- Give it some context or a role to play.
- Give it very detailed instructions, including how you would like the results formatted.
- Keep conversing and asking for changes. Ask it to revise the answer in various ways.
Examples
- A role could be, "Act as an expert in [fill in the blank]."
Act as an expert community organizer.
Act as a high school biology teacher.
Act as a comedian.
- Example prompt:
Act as an expert academic librarian. I’m writing a research paper for Sociology and I need help coming up with a topic. I’m interested in topics related to climate change. Please give me a list of 10 topic ideas related to climate change.
- Example of changes: (keep conversing until you get something useful)
Now give me some sub-topics or research questions for [one of those topics]. And give me a list of keywords and phrases I can use to search for that topic in library databases and Google Scholar.
Or...
I didn't like any of those topics. Please give me 10 more.
Check out

Prompt Engineering for Generative AI by James Phoenix, Mike Taylor
Publication Date: 2024
This book offers strategies and practical guidance for crafting prompts. Includes tips and tricks, along with general concepts.