Fundamentals of GenAI (30%)

Prompting Techniques

KEY CONCEPTS

  • Zero-shot: No examples provided
  • One-shot: Single example provided
  • Few-shot: Multiple examples provided
  • Chain-of-thought: Step-by-step reasoning
  • Role prompting: Assigning persona to model
  • Prompt chaining: Sequential prompts building on each other
  • ReAct framework: Reasoning + Action
  • System instructions vs user prompts

WHAT THE EXAM IS REALLY TESTING

Know when to apply each technique. Zero-shot for simple tasks, few-shot for format consistency, chain-of-thought for reasoning tasks.

COMMON TRAPS

  • !Overusing few-shot when zero-shot suffices
  • !Confusing chain-of-thought with few-shot
  • !Not recognizing when examples hurt performance
  • !Confusing ReAct framework with React.js

OFFICIAL DOCUMENTATION

STUDY Q&A

  • What is zero-shot prompting?
    Zero-shot prompting is a technique where the model is given a task without any example. It is suitable for simple tasks where the model can generalize from its pre-training.
  • What is few-shot prompting and when is it preferable?
    Few-shot prompting involves providing the model with a few examples to guide its output. It is preferable when you need consistent formatting or when the task is ambiguous without context.
  • What is chaining and why is it useful in complex workflows?
    Chaining refers to the sequential use of multiple prompts, where the output of one prompt becomes the input for the next. This is useful for decomposing complex tasks into manageable steps.
  • What is Chain of Thought prompting and when should it be used?
    Chain of Thought prompting encourages the model to reason step-by-step, making it suitable for tasks that require logical reasoning or multi-step problem solving.

PRACTICE QUESTIONS

8 questions available for this topic

PRACTICE NOW →