Skip to Main Content
Libraries
askus Ask us
 

Prompt Engineering for GenAI - Beginner-Level Course

The ability to design meaningful prompts for GenAI tools is one of the core competencies required to successfully use them, and this workshop is designed to introduce to the basics of prompt design. By understanding how GenAI works and by exploring differ

Activity 1: Applying the Principles of Prompt Engineering

"Be concise." (Principle 1)

  • Aim for brevity & clarity.
  • Use language that is as simple as possible, without sacrificing necessary details.

Now, let's practice principle 1:

Bad prompt:
Can you provide me with a detailed explanation of the photosynthetical process and thesignificance of this biochemical reaction?

Improved prompt - compare their AI-generated outcomes:
Explain the process of photosynthesis and its significance in detail.

Another bad prompt - try improving this one yourself. Do you see a quality boost in your outcome?
Can you give me a thorough description of the biological process of cell division and explain why this biochemical event is so important for the evolution of life?
 

"Be clear." (Principle 2) 

  • Avoid vague & ambiguous wording.

  • Be as specific as necessary for the task, without sacrifizing brevity.


Let's practice principle 2:

Bad prompt: 
How do I produce a paper?

Improved prompt - compare their results: 
Explain the common steps of writing a research paper for a peer reviewed
academic journal.

"Include context & logical structure." (Principle 3) 

  • Provide context to improve reasoning

  • Build structured & coherent prompts


Let's apply principle 3:

Bad prompt:
Mention tasks involved in writing a research paper.

Improved prompt - what are the differences in their results? Did they improve?
List the steps involved in writing a research paper for a student assignment. Begin with selectinga topic, end with proofreading the final draft.

"Break down complex tasks." (Principle 4) 

  • Avoid combining several tasks in one prompt

  • Avoid asking for several outcomes/formats in one prompt


Exercise, principle 4:

Bad prompt: 

Design a comprehensive marketing campaign for a new eco-friendly product, detailing the target audience, key messaging, and promotional strategies. Provide specific examples of advertising mediums such as social media, print, and television, and create a visual mockup of an advertisement in a modern minimalist style. Write meaningful alt-text for the advertisement, summarizing its content for enhanced accessibility. Finally, draft a 2-minute pitch script for presenting this marketing campaign to potential investors.

Improved prompt (here → a prompt chain, each numerated sub-task representing a follow-up prompt):
1. Design a comprehensive marketing campaign for a new eco-friendly product, detailing the target audience, key messaging, and promotional strategies.

2. Provide specific examples of advertising mediums such as social media, print, and television, and create a visual mockup of an advertisement in a modern minimalist style.

3. ...

Continue breaking down the original task into sub-tasks/follow-up-prompts. Try both versions –the original one, and the prompt chain you created from it – and compare. How did the outcome change?

"Specify desired output." (Principle 5) 

  • That includes defining specifics like:

    • Style & tone

    • Depth & length

    • Format, language, or content type

    • 'Temperature' = the parameter controlling precision & randomness ('creativity')


Apply principle 5:

Bad prompt: 
Draft a paragraph on climate change.

Improved prompt - Do you experience a difference?
Draft a newspaper paragraph on climate change in the simplistic style of a tabloid paper. Use a sensational tone.

Continue specifying your desired output, by adding instructions on length, language, or output-temperature (=creativity level). What has changed in your results?

"Reflect & adapt your approach." (Principle 6) 

  • Continuously evaluate outcomes

  • Be flexible, fine-tune, & improve

  • Prompt not leading to desired outcome? → Adjust, then re-run!


Surely, in practicing principles 1-5, you have already applied principle 6, by running and re-running your prompts, after fine-tuning it. Let's move on to principle 7...

"Combine these principles." (Principle 7) 

  • Apply these principles together for optimal results


Practice principle 7 – by jointly applying principles 1-6:

Earlier prompt, using tone and style:
Draft a paragraph on climate change in the simplistic style of a tabloid paper. Use a sensational tone.

Improved prompt, through added clarity, context, temperature:  - Do you experience a difference?

Draft a newspaper paragraph of 500 words including a headline, on the effects of climate change. Apply the simplified grammar of a tabloid paper, and use sensational language. Be creative when describing climate change’s effects.

Continue specifying your desired output, by adding instructions on length, language, or output-temperature (=creativity level). What has changed in your results?

Ready? Or want to explore this workshop's other activities?

→ Move on to Activity 2: Exploring Selected Prompt Engineering Techniques

Creative Commons License
This work by The University of Victoria Libraries is licensed under a Creative Commons Attribution 4.0 International License unless otherwise indicated when material has been used from other sources.