Encoding Human Priors

Encoding Human Priors – Data Augmentation and Prompt Engineering #


Q1: What is the main focus of this lecture? #

  • How to encode human priors into machine learning through:
    • Training data augmentation
    • Prompt engineering at test time (especially for LLMs).

Q2: Why do ML models need human priors? #

  • ML models often fail in simple ways.
  • They lack common sense (e.g., failing to recognize a rotated dog image).
  • Human priors capture invariances and domain knowledge that models don’t inherently learn.

Q3: What is data augmentation and why is it important? #

  • Data augmentation creates new training examples by applying transformations (e.g., rotation, flipping).
  • Helps address:
    • Overfitting (memorization)
    • Underfitting (lack of data)
    • Class imbalance or biased datasets.
  • Saves time and cost, especially when labeled data is expensive (e.g., in healthcare).

Q4: What are examples of data augmentation techniques? #

  • Simple methods: Rotation, flipping.
  • Advanced methods:
    • Mixup: Blending images and labels (e.g., 60% cat + 40% dog).
    • Synthetic generation: Using DALL-E, Stable Diffusion to generate new data.
    • Simulation-to-real transfer: e.g., Google’s RetinaGAN for robotics.
  • Text augmentation: Back-translation (English → French → English) to generate paraphrases.

Q5: What is prompt engineering? #

  • Prompt engineering manipulates inputs to LLMs at test time.
  • Example: Instead of “Write a letter of recommendation,” prompt with “Write a letter for a student who got into MIT” to get higher-quality output.
  • Leverages the language interface humans naturally use.

Q6: Why does prompt engineering work especially well for LLMs? #

  • LLMs are trained on massive language datasets.
  • Humans can easily adapt prompts to guide the model without retraining it.
  • Providing context and examples (“few-shot prompting”) improves results.

Q7: How are GPT-3 and ChatGPT different in handling prompts? #

  • GPT-3: Predicts next token, assumes user might be creating forms/questions.
  • ChatGPT: Trained for dialogue and commands, better at instruction-following.

Q8: What are best practices in prompt engineering? #

  • Add examples (“few-shot”) to define task behavior.
  • Build context templates for reusability.
  • Iteratively tweak prompts to observe effects on output.

Q9: How does data augmentation vs. prompt engineering differ? #

Aspect Data Augmentation Prompt Engineering
When applied Before training At test time
What is changed Training dataset Input prompt
Goal Teach model invariances Guide model behavior dynamically
Typical models Any ML models Mainly LLMs (e.g., GPT family)

Q10: Final Takeaway #

  • Encoding human priors via data (training-time or test-time) dramatically improves model robustness.
  • Data is the bridge to insert human knowledge into ML systems effectively.

References #