Let’s cover the basics of writing effective AI prompts.

Crafting an effective prompt

  1. Be clear: Writing clearly is not easy. It’s a craft that takes practice. But, here are a few tricks that pros use to be as clear as possible:
    1. Write short sentences and phrases.
    2. Try to have only one verb in a sentence, instruction, or phrase.
    3. Use HeminwayApp.com to check how difficult your sentences are to read. Aim for 8th-grade reading level or lower.
  2. Use role-playing: You can tell a model that they’re a college professor, a New York City tour guide, or any other role that might help the model respond to your questions more effectively. For example, if I want to compose some sales emails with ChatGPT, I might begin my prompt with, “You’re a tech sales rep…”
  3. Make corrections: If the first answer isn't correct, tell the model to correct it.

Prompt Engineering 101

Prompt Engineering gets a bit more technical and takes the craft of prompt writing to another level.

Delimitate: Prompt structure impacts a model’s response. A helpful trick is to dilimitate, or use symbols that the model understands to separate parts of a prompt. For example, I can use 3 quote marks like this “”” to signal the start of a new portion. Here’s how:

You’re a tech sales rep. Summarize the top 5 topics from the following text as bullet points.

Text: “””

{{Add your text here}}

“””

Few-Shot Prompting: Few-shot prompting is when you give the model a few examples of what you want it to do. You show both the input (what the user asks for) and the output (how the model should respond to that type of ask). Then, you run the prompt you originally wanted to run. For example:

Task: Summarize the text in 1 sentence. 

Text: """ In Ireland, September usually marks the beginning of the autumn season. The weather in September is generally mild, but it can be quite variable. Average high temperatures typically range from 15°C to 19°C (59°F to 66°F), while average lows generally range from 10°C to 12°C (50°F to 54°F).

September can still have some quite pleasant and warm days, especially in the early part of the month. However, rain is always a possibility in Ireland, and the frequency of rainy days tends to increase as the month progresses and the season shifts further into autumn.

Remember, the weather can vary year to year, so it's always a good idea to check a reliable weather forecast closer to your visit for the most accurate information."""

Response: September temps range from 50s to low 70s with few rainy days in the first half of the month. 

Task: Summarize the text in 1 sentence. 

Text """ {{Insert your text}}
"""
Response:

Iterative Prompting: If the first response from the model isn't what you want, you can adjust your prompt a little at a time. It’s important not to change too much about your prompt for a single iteration.