Lab: Exploring Prompt Engineering Techniques
Objectives:
- Understand the principles of prompt engineering.
- Discover and practice techniques for crafting effective prompts.
- Observe the impact of prompt variations on generated responses.
General Instructions:
- Read each section carefully.
- Follow the steps in the activities and record your observations.
- Test your prompts in a text-generation tool powered by an LLM (e.g., Copilot).
- Compare the responses obtained to better understand the effects of adjustments in your prompts.
Activity 1: Define a Personality and an Audience
Objective:
Explore how personality and target audience influence the model’s responses.
Steps:
- Write a prompt where the model acts as an art history expert.
- Test these variations:
- A pedagogical expert.
- A popularizer.
- A formal lecturer.
Sample Prompt:
“You are an expert in art history. Explain the Italian Renaissance to a teenage audience.”
Observation Questions:
- How do tone and structure change across variations?
- Which variation seems most suitable for a teenage audience? Why?
Objective:
Learn to guide the model in structuring its responses.
Steps:
- Ask the model to provide “5 steps to resolve a workplace conflict.”
- Test the following variations:
- Present the steps as a numbered list.
- Explain the steps in a narrative paragraph.
- Add a concluding summary of the key points.
Sample Prompt:
“Provide 5 steps to resolve a workplace conflict in a concise list format.”
Observation Questions:
- Does the model follow the formatting instructions?
- Which format do you find the clearest and most useful? Why?
Activity 3: Targeting the Action
Objective:
Learn to direct the model’s responses toward a specific goal.
Steps:
- Ask the model to explain “supervised learning.”
- Test the following variations:
- Add a request for a concrete example.
- Limit the response to under 50 words.
- Tailor the explanation for high school students.
Sample Prompt:
“Explain supervised learning using a simple analogy for high school students.”
Observation Questions:
- Did the model follow your specific instructions?
- Which variation produced the most accessible and comprehensible response?
Activity 4: Handling Specific Scenarios
Objective:
Anticipate and specify how the model should respond in specific situations.
Steps:
- Ask the model to recommend books on creativity.
- Add clauses to handle the following cases:
- If the model doesn’t know of any books, suggest blogs or videos.
- If the request concerns a child, recommend age-appropriate books.
Sample Prompt:
“Recommend books on creativity. If none are available, suggest blogs or online videos. If the request is for a child, recommend age-appropriate materials.”
Observation Questions:
- Does the model correctly address the scenarios you specified?
- What additional instructions could improve the response?
Conclusion
- Quick Summary:
- Did you observe significant differences in responses based on prompt variations?
- Which techniques do you find most useful? Why?
- Further Applications:
- Consider other situations where these techniques could be applied, such as drafting emails, creating educational content, or solving specific problems.
Reformulate this initial, vague prompt:
“Explain artificial intelligence.”
To make it more precise and effective, applying the techniques learned in this lab.
You may use Copilot or the self-training platform for prompt engineering Training.