Introduction-to-LLM-and-RAG

Lab: Exploring Prompt Engineering Techniques

Objectives:


General Instructions:

  1. Read each section carefully.
  2. Follow the steps in the activities and record your observations.
  3. Test your prompts in a text-generation tool powered by an LLM (e.g., Copilot).
  4. 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:

  1. Write a prompt where the model acts as an art history expert.
  2. 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:


Activity 2: Specify Output Format

Objective:

Learn to guide the model in structuring its responses.

Steps:

  1. Ask the model to provide “5 steps to resolve a workplace conflict.”
  2. 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:


Activity 3: Targeting the Action

Objective:

Learn to direct the model’s responses toward a specific goal.

Steps:

  1. Ask the model to explain “supervised learning.”
  2. 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:


Activity 4: Handling Specific Scenarios

Objective:

Anticipate and specify how the model should respond in specific situations.

Steps:

  1. Ask the model to recommend books on creativity.
  2. 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:


Conclusion

  1. Quick Summary:
    • Did you observe significant differences in responses based on prompt variations?
    • Which techniques do you find most useful? Why?
  2. Further Applications:
    • Consider other situations where these techniques could be applied, such as drafting emails, creating educational content, or solving specific problems.

Optional: Extra Exercise

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.