> ## Documentation Index
> Fetch the complete documentation index at: https://prompt.university/llms.txt
> Use this file to discover all available pages before exploring further.

# Module 2 Assessment

> Test your mastery of task-specific prompting patterns

<Info>
  **Time Estimate:** 45-60 minutes\
  **Passing Score:** 80% (16/20 questions)
</Info>

## Assessment Overview

This assessment evaluates your understanding of task-specific prompting patterns covered in Module 2:

* Text classification techniques
* Information extraction methods
* Content generation strategies
* Text transformation approaches
* Question-answering systems

<Note>
  This assessment includes both multiple-choice questions and a hands-on capstone project. Take your time and demonstrate what you've learned!
</Note>

***

## Part 1: Multiple Choice Questions (20 questions)

### Question 1: Classification Fundamentals

What is the primary challenge when using LLMs for classification tasks?

<Tabs>
  <Tab title="Your Answer">
    A) LLMs are too slow for classification\
    B) LLMs generate text probabilistically, leading to inconsistent output formats\
    C) LLMs cannot understand categories\
    D) LLMs require fine-tuning for every classification task
  </Tab>

  <Tab title="Correct Answer">
    **B) LLMs generate text probabilistically, leading to inconsistent output formats**

    **Explanation:** Since LLMs are designed to generate text, they may produce verbose explanations or inconsistent formats when we need simple labels. Constrained output patterns solve this issue.
  </Tab>
</Tabs>

***

### Question 2: Few-Shot Classification

When using few-shot classification, what is the recommended number of examples per category?

<Tabs>
  <Tab title="Your Answer">
    A) 1 example\
    B) 2-5 examples\
    C) 10-20 examples\
    D) 50+ examples
  </Tab>

  <Tab title="Correct Answer">
    **B) 2-5 examples**

    **Explanation:** Research shows 2-5 examples per category typically provides the best balance between context length and performance improvement.
  </Tab>
</Tabs>

***

### Question 3: Named Entity Recognition

What is the advantage of progressive extraction (simple → complex) in NER tasks?

<Tabs>
  <Tab title="Your Answer">
    A) It's faster than single-step extraction\
    B) It improves accuracy by building complexity gradually\
    C) It requires less context\
    D) It works better with small models
  </Tab>

  <Tab title="Correct Answer">
    **B) It improves accuracy by building complexity gradually**

    **Explanation:** Progressive extraction allows the model to first identify obvious entities, then build on that foundation to extract more complex relationships and implicit information.
  </Tab>
</Tabs>

***

### Question 4: Structured Output

Why should you provide a JSON schema when requesting JSON output?

<Tabs>
  <Tab title="Your Answer">
    A) It makes the model run faster\
    B) It ensures consistent structure and field names\
    C) It's required by the API\
    D) It reduces token usage
  </Tab>

  <Tab title="Correct Answer">
    **B) It ensures consistent structure and field names**

    **Explanation:** Providing a schema template ensures the model outputs data in the exact format you need, with consistent field names and structure.
  </Tab>
</Tabs>

***

### Question 5: Content Generation

What is the most effective way to control the tone of generated content?

<Tabs>
  <Tab title="Your Answer">
    A) Use a higher temperature setting\
    B) Explicitly specify the desired tone in the prompt\
    C) Provide longer context\
    D) Use more examples
  </Tab>

  <Tab title="Correct Answer">
    **B) Explicitly specify the desired tone in the prompt**

    **Explanation:** Directly stating the desired tone (e.g., "professional," "casual," "energetic") is the most reliable way to control output tone.
  </Tab>
</Tabs>

***

### Question 6: Constrained Generation

Which constraint is most effective for controlling output length?

<Tabs>
  <Tab title="Your Answer">
    A) "Keep it short"\
    B) "Be concise"\
    C) "Write exactly 150 words"\
    D) "Don't write too much"
  </Tab>

  <Tab title="Correct Answer">
    **C) "Write exactly 150 words"**

    **Explanation:** Specific numerical constraints (word count, sentence count, paragraph count) are far more effective than vague instructions like "keep it short."
  </Tab>
</Tabs>

***

### Question 7: Code Generation

What should you always include when generating code with LLMs?

<Tabs>
  <Tab title="Your Answer">
    A) Comments explaining the code\
    B) Error handling and input validation\
    C) Type hints or type annotations\
    D) All of the above
  </Tab>

  <Tab title="Correct Answer">
    **D) All of the above**

    **Explanation:** Production-quality code should include documentation (comments), error handling, and type information. Always specify these requirements in your prompt.
  </Tab>
</Tabs>

***

### Question 8: Multi-Step Generation

Why is multi-step generation often more effective than single-step for complex content?

<Tabs>
  <Tab title="Your Answer">
    A) It's faster\
    B) It allows for better structure and organization\
    C) It uses fewer tokens\
    D) It requires less context
  </Tab>

  <Tab title="Correct Answer">
    **B) It allows for better structure and organization**

    **Explanation:** Breaking generation into steps (outline → introduction → body → conclusion) produces more coherent, well-structured content than trying to generate everything at once.
  </Tab>
</Tabs>

***

### Question 9: Translation Patterns

When translating marketing content, what additional information should you provide?

<Tabs>
  <Tab title="Your Answer">
    A) Only the source and target languages\
    B) Context, tone, and cultural considerations\
    C) A dictionary of terms\
    D) Multiple translation options
  </Tab>

  <Tab title="Correct Answer">
    **B) Context, tone, and cultural considerations**

    **Explanation:** Marketing translations require context about the product, desired tone, and cultural sensitivity to be effective and appropriate.
  </Tab>
</Tabs>

***

### Question 10: Summarization Strategy

What's the difference between extractive and abstractive summarization?

<Tabs>
  <Tab title="Your Answer">
    A) Extractive is shorter than abstractive\
    B) Extractive pulls key sentences; abstractive rephrases and synthesizes\
    C) Extractive is more accurate than abstractive\
    D) Abstractive requires more examples
  </Tab>

  <Tab title="Correct Answer">
    **B) Extractive pulls key sentences; abstractive rephrases and synthesizes**

    **Explanation:** Extractive summarization selects important sentences from the source, while abstractive summarization generates new text that captures the main ideas.
  </Tab>
</Tabs>

***

### Question 11: Style Transfer

When adapting text for different reading levels, what should you adjust?

<Tabs>
  <Tab title="Your Answer">
    A) Only vocabulary\
    B) Only sentence length\
    C) Vocabulary, sentence complexity, and concept abstraction\
    D) Only the tone
  </Tab>

  <Tab title="Correct Answer">
    **C) Vocabulary, sentence complexity, and concept abstraction**

    **Explanation:** Effective reading level adaptation requires adjusting vocabulary (simpler words), sentence structure (shorter, clearer sentences), and how abstract concepts are explained.
  </Tab>
</Tabs>

***

### Question 12: Format Transformation

What's the best approach for converting a paragraph into FAQ format?

<Tabs>
  <Tab title="Your Answer">
    A) Ask the model to "make it a FAQ"\
    B) Specify the number of Q\&A pairs and their focus\
    C) Provide one example FAQ\
    D) Just extract questions from the text
  </Tab>

  <Tab title="Correct Answer">
    **B) Specify the number of Q\&A pairs and their focus**

    **Explanation:** Clear specifications about how many Q\&A pairs to create and what aspects to cover ensures comprehensive and useful FAQ conversion.
  </Tab>
</Tabs>

***

### Question 13: Question-Answering Context

Why is providing context crucial for QA tasks?

<Tabs>
  <Tab title="Your Answer">
    A) It makes responses longer\
    B) It grounds answers in specific information and reduces hallucinations\
    C) It's required by the model\
    D) It improves response speed
  </Tab>

  <Tab title="Correct Answer">
    **B) It grounds answers in specific information and reduces hallucinations**

    **Explanation:** Context provides factual grounding, dramatically reducing the likelihood of hallucinated or incorrect information in answers.
  </Tab>
</Tabs>

***

### Question 14: Math Problem Solving

What is the purpose of the GSM8K annotation format (using «calculation»)?

<Tabs>
  <Tab title="Your Answer">
    A) It makes the output look professional\
    B) It helps track intermediate steps and catch errors\
    C) It's required for mathematical operations\
    D) It reduces token usage
  </Tab>

  <Tab title="Correct Answer">
    **B) It helps track intermediate steps and catch errors**

    **Explanation:** The «calculation» notation makes intermediate steps explicit and verifiable, making it easier to identify where errors occur in multi-step problems.
  </Tab>
</Tabs>

***

### Question 15: Complex Question Decomposition

When should you break a question into sub-questions?

<Tabs>
  <Tab title="Your Answer">
    A) Always, for every question\
    B) Only for math problems\
    C) When the question has multiple components or requires multi-step reasoning\
    D) Never, it's inefficient
  </Tab>

  <Tab title="Correct Answer">
    **C) When the question has multiple components or requires multi-step reasoning**

    **Explanation:** Complex questions benefit from decomposition, but simple questions can be answered directly. Use decomposition when it improves clarity and accuracy.
  </Tab>
</Tabs>

***

### Question 16: Handling Uncertainty

What should a QA system do when it doesn't have enough information to answer?

<Tabs>
  <Tab title="Your Answer">
    A) Make an educated guess\
    B) Provide a partial answer\
    C) Explicitly state that the information is not available\
    D) Search for the answer online
  </Tab>

  <Tab title="Correct Answer">
    **C) Explicitly state that the information is not available**

    **Explanation:** Admitting uncertainty is crucial for trustworthy QA systems. It's better to say "I don't know" than to hallucinate or guess.
  </Tab>
</Tabs>

***

### Question 17: Multi-Label Classification

How does multi-label classification differ from multi-class classification?

<Tabs>
  <Tab title="Your Answer">
    A) Multi-label is more accurate\
    B) Multi-label allows items to belong to multiple categories simultaneously\
    C) Multi-label requires more examples\
    D) Multi-label is faster
  </Tab>

  <Tab title="Correct Answer">
    **B) Multi-label allows items to belong to multiple categories simultaneously**

    **Explanation:** Multi-class classification assigns one category per item, while multi-label classification can assign multiple categories to a single item.
  </Tab>
</Tabs>

***

### Question 18: Extraction Validation

Why should you request confidence levels for critical extractions?

<Tabs>
  <Tab title="Your Answer">
    A) It makes the output longer\
    B) It helps identify uncertain extractions that may need human review\
    C) It's required for structured output\
    D) It improves extraction accuracy
  </Tab>

  <Tab title="Correct Answer">
    **B) It helps identify uncertain extractions that may need human review**

    **Explanation:** Confidence levels help you identify which extractions are reliable and which might need verification, especially for high-stakes applications.
  </Tab>
</Tabs>

***

### Question 19: Generation Attributes

Which attribute specification is most effective for marketing copy?

<Tabs>
  <Tab title="Your Answer">
    A) "Write good marketing copy"\
    B) "Target: fitness enthusiasts, Tone: energetic, Length: 150 words, Include: CTA"\
    C) "Make it sound professional"\
    D) "Write something catchy"
  </Tab>

  <Tab title="Correct Answer">
    **B) "Target: fitness enthusiasts, Tone: energetic, Length: 150 words, Include: CTA"**

    **Explanation:** Specific attributes (audience, tone, length, required elements) produce far better results than vague instructions.
  </Tab>
</Tabs>

***

### Question 20: Transformation Fidelity

What's the key balance in text transformation?

<Tabs>
  <Tab title="Your Answer">
    A) Speed vs. accuracy\
    B) Length vs. detail\
    C) Fidelity to source vs. adaptation to target\
    D) Creativity vs. consistency
  </Tab>

  <Tab title="Correct Answer">
    **C) Fidelity to source vs. adaptation to target**

    **Explanation:** Good transformations preserve the core meaning and information (fidelity) while optimizing for the target context, audience, or format (adaptation).
  </Tab>
</Tabs>

***

## Part 2: Capstone Project - Content Moderation System

<Warning>
  **Important:** This hands-on project tests your ability to combine multiple prompting patterns from Module 2.
</Warning>

### Project Overview

Build a comprehensive content moderation system that:

1. **Classifies** content safety levels
2. **Extracts** problematic elements
3. **Generates** explanations
4. **Suggests** modifications for reviewed content

### Project Requirements

Your system should handle social media posts and classify them into three categories:

* **Safe:** Appropriate for all audiences, no policy violations
* **Review:** Potentially problematic, needs human review
* **Unsafe:** Clear policy violations (hate speech, violence, explicit content, harassment)

### Task 1: Classification Prompt (25 points)

Design a prompt that classifies content into Safe/Review/Unsafe categories.

**Requirements:**

* Include clear definitions for each category
* Provide 2-3 examples per category
* Request both classification and reasoning
* Handle edge cases

<Accordion title="Sample Solution">
  ```
  You are a content moderation assistant. Classify social media posts according to these categories:

  **Safe:** Appropriate for all audiences. No policy violations. Constructive, informative, or neutral content.

  **Review:** Potentially problematic content that needs human review. This includes:
  - Borderline language or topics
  - Content that might be offensive to some but not clearly violating policies
  - Ambiguous cases requiring context

  **Unsafe:** Clear policy violations including:
  - Hate speech or discrimination
  - Explicit violence or threats
  - Sexually explicit content
  - Harassment or bullying
  - Dangerous misinformation

  Examples:

  Post: "Just finished a great workout! Feeling energized 💪"
  Classification: Safe
  Reasoning: Positive personal update, no policy concerns

  Post: "Politicians are all corrupt. The whole system needs to be torn down."
  Classification: Review
  Reasoning: Strong political opinion but not threatening. Needs review for context and intent.

  Post: "I hope [specific person] gets hurt for what they did"
  Classification: Unsafe
  Reasoning: Direct threat of violence toward an individual

  Now classify this post:

  Post: [INSERT POST]

  Classification:
  Reasoning:
  ```
</Accordion>

***

### Task 2: Extraction Prompt (25 points)

For posts classified as "Review" or "Unsafe," extract specific problematic elements.

**Requirements:**

* Identify problematic words/phrases
* Categorize the type of violation
* Extract context that might affect classification
* Use structured output (JSON format)

<Accordion title="Sample Solution">
  ```
  Extract problematic elements from the flagged content:

  Post: [INSERT POST]
  Classification: [Review/Unsafe]

  Extract the following information in JSON format:

  {
    "problematic_elements": [
      {
        "text": "exact phrase or word",
        "type": "hate_speech|violence|harassment|explicit|misinformation",
        "severity": "low|medium|high"
      }
    ],
    "context_factors": [
      "factors that might affect classification"
    ],
    "target": "who or what is targeted (if applicable)",
    "intent": "apparent intent of the post"
  }

  Extraction:
  ```
</Accordion>

***

### Task 3: Explanation Generation (25 points)

Generate clear explanations for why content was flagged.

**Requirements:**

* Explain the classification decision
* Reference specific policy violations
* Use appropriate tone (firm but not accusatory)
* Provide educational value

<Accordion title="Sample Solution">
  ```
  Generate a moderation explanation for the user:

  Post: [INSERT POST]
  Classification: [Safe/Review/Unsafe]
  Problematic Elements: [FROM EXTRACTION]

  Create an explanation with these components:
  1. Clear statement of the decision
  2. Specific policy violations (if any)
  3. Why this content is problematic
  4. Educational note about community standards

  Tone: Professional, firm, educational (not accusatory)
  Length: 75-100 words

  Explanation:
  ```
</Accordion>

***

### Task 4: Modification Suggestions (25 points)

For "Review" content, suggest how it could be modified to be acceptable.

**Requirements:**

* Preserve the user's core message when possible
* Provide 2-3 specific modification options
* Explain what makes each modification acceptable
* Maintain the user's voice

<Accordion title="Sample Solution">
  ```
  Suggest modifications for this reviewed content:

  Original Post: [INSERT POST]
  Issues: [PROBLEMATIC ELEMENTS]

  Provide 2-3 alternative versions that:
  - Preserve the core message
  - Remove or rephrase problematic elements
  - Comply with community standards
  - Maintain the user's authentic voice

  Format:
  Option 1: [Modified version]
  Changes: [What was changed and why]

  Option 2: [Modified version]
  Changes: [What was changed and why]

  Option 3: [Modified version]
  Changes: [What was changed and why]

  Suggestions:
  ```
</Accordion>

***

### Complete System Integration

Combine all four components into a single, comprehensive moderation workflow:

<Accordion title="Complete System Prompt">
  ```
  # Content Moderation System

  You are a content moderation assistant that processes social media posts through a multi-stage analysis.

  ## Stage 1: Classification

  Classify the post as Safe, Review, or Unsafe using these definitions:

  **Safe:** Appropriate for all audiences, no policy violations
  **Review:** Potentially problematic, needs human review (borderline cases)
  **Unsafe:** Clear policy violations (hate speech, violence, explicit content, harassment)

  ## Stage 2: Extraction (if Review or Unsafe)

  Extract problematic elements in JSON format:
  {
    "problematic_elements": [...],
    "context_factors": [...],
    "target": "...",
    "intent": "..."
  }

  ## Stage 3: Explanation

  Generate a clear, educational explanation (75-100 words) of the decision.

  ## Stage 4: Suggestions (if Review only)

  Provide 2-3 modified versions that preserve the message while addressing concerns.

  ---

  Process this post:

  Post: [INSERT POST]

  Output:

  **Classification:**
  **Reasoning:**

  **Extracted Elements:** (if applicable)

  **Explanation:**

  **Modification Suggestions:** (if Review)
  ```
</Accordion>

***

### Testing Your System

Test your complete system with these sample posts:

1. **Safe Example:** "Just adopted a rescue dog! Meet Charlie 🐕"
2. **Review Example:** "Can't believe how stupid some people are. This country is going downhill fast."
3. **Unsafe Example:** "I know where you live and I'm coming for you"

<Accordion title="Expected Outputs">
  **Post 1 - Safe:**

  * Classification: Safe
  * Reasoning: Positive personal update, no policy concerns
  * No extraction needed
  * Brief confirmation of safety

  **Post 2 - Review:**

  * Classification: Review
  * Reasoning: Strong negative opinion with potentially offensive language, but no direct threats
  * Extraction: "stupid" (low severity), generalized criticism
  * Suggestions: Rephrase without insulting language

  **Post 3 - Unsafe:**

  * Classification: Unsafe
  * Reasoning: Direct threat with specific intent to harm
  * Extraction: Threat of violence, specific target
  * Explanation: Clear policy violation, immediate action required
  * No modification suggestions (content cannot be salvaged)
</Accordion>

***

## Scoring Rubric

### Multiple Choice (60 points)

* 3 points per question
* 16/20 correct required to pass (48/60 points)

### Capstone Project (40 points)

* Task 1 (Classification): 10 points
* Task 2 (Extraction): 10 points
* Task 3 (Explanation): 10 points
* Task 4 (Modification): 10 points

**Total: 100 points**\
**Passing Score: 80 points**

***

## Evaluation Criteria

Your capstone project will be evaluated on:

<CardGroup cols={2}>
  <Card title="Accuracy" icon="bullseye">
    Correct classification and extraction of problematic elements
  </Card>

  <Card title="Clarity" icon="message">
    Clear, understandable explanations and suggestions
  </Card>

  <Card title="Completeness" icon="list-check">
    All required components included and properly structured
  </Card>

  <Card title="Practicality" icon="wrench">
    System is usable and produces actionable results
  </Card>
</CardGroup>

***

## Next Steps

<Check>Complete all 20 multiple-choice questions</Check>
<Check>Build and test your content moderation system</Check>
<Check>Verify your system handles all three classification categories</Check>
<Check>Test with edge cases and ambiguous content</Check>

Once you've completed this assessment, you're ready to move on to Module 3: Advanced Prompting Techniques!

<Card title="Continue to Module 3: Advanced Techniques" icon="rocket" href="/module-3/index">
  Master Chain of Thought, decomposition, and RAG
</Card>
