Testing Prompts with Manual Evaluation
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks and see fewer ads — read each lesson on a single page with Pro
Testing Prompts with Manual Evaluation
Introduction: Why Manual Evaluation Matters
In the world of artificial intelligence, we often focus on the power of the model itself—its parameter count, its architecture, or its training data. However, the true performance of an AI application is rarely dictated by the model alone; instead, it is determined by the interaction between the model and the instructions provided to it. This interaction is governed by prompt engineering. While automated evaluation tools and metrics like ROUGE or BLEU scores have their place, they often fail to capture the nuance, tone, and subjective quality required for high-stakes applications. This is where manual evaluation becomes an indispensable pillar of your development lifecycle.
Manual evaluation is the process of human experts reviewing, critiquing, and scoring the outputs generated by a language model based on specific prompts. It is the "ground truth" stage of development. Even when you eventually move toward automated testing or LLM-as-a-judge frameworks, those systems must be calibrated against human judgment. Without a rigorous manual testing process, you risk deploying applications that hallucinate, exhibit unwanted bias, or fail to follow complex constraints that an automated script might miss. This lesson explores how to design, execute, and scale manual evaluation processes to ensure your prompts are reliable, consistent, and effective.
Understanding the Evaluation Framework
Before diving into the "how," we must establish the "what." Evaluation is not simply looking at an output and deciding if it "looks good." Effective evaluation requires a structured framework that defines what "good" actually means for your specific use case. If you are building a legal document summarizer, "good" means high fidelity to the source text and zero hallucinations. If you are building a creative writing assistant, "good" means engaging prose and adherence to stylistic guidelines.
To evaluate prompts manually, you need to establish a rubric. A rubric converts subjective feelings into objective data points. Without a rubric, your evaluators will drift, providing inconsistent feedback that makes it impossible to iterate on your prompt effectively. A standard evaluation rubric should score outputs on dimensions such as:
- Accuracy: Does the output contain factual errors or hallucinations?
- Adherence to Constraints: Did the model follow negative constraints (e.g., "do not mention X") and formatting requirements (e.g., "return JSON only")?
- Tone and Style: Is the output consistent with the desired brand voice or persona?
- Helpfulness: Does the output directly answer the user's intent?
- Safety: Does the output violate any content policies or safety guidelines?
Callout: Subjective vs. Objective Evaluation It is helpful to distinguish between "hard" constraints and "soft" constraints. A hard constraint is binary: did the model return a JSON object? Yes or no. A soft constraint is subjective: is the tone professional? These require different evaluation approaches. Always prioritize binary, objective checks in your automated pipelines, but use manual evaluation to calibrate the nuances of soft constraints.
Step-by-Step Guide: Setting Up a Manual Evaluation Process
Setting up a manual evaluation process requires more than just sitting down with a spreadsheet. It requires a systematic workflow that allows for reproducibility and iteration.
Step 1: Define the Evaluation Dataset (The "Golden Set")
You cannot evaluate a prompt in a vacuum. You need a curated set of inputs that represent the diversity of queries your application will face in production. This dataset, often called a "Golden Set," should include:
- Typical Queries: The bread-and-butter requests your users will make.
- Edge Cases: Queries that are ambiguous, intentionally difficult, or designed to test the limits of the model.
- Adversarial Examples: Attempts to break the prompt, such as injection attacks or requests for prohibited content.
Step 2: The Evaluation Environment
Create a simple interface for your evaluators. While a spreadsheet (like Google Sheets or Excel) is a starting point, it can quickly become unmanageable. Consider using a dedicated evaluation interface or a lightweight web form. The goal is to minimize the "cognitive load" on the evaluator. They should see the Prompt, the Input, and the Output side-by-side, with clear buttons or fields for scoring each dimension of your rubric.
Step 3: Calibrating the Evaluators
If you have multiple people performing evaluations, you will run into the issue of "inter-rater reliability." One person might be a harsh grader, while another is lenient. Before starting the full evaluation, perform a calibration session. Have all evaluators score the same ten examples. Compare the results, discuss the discrepancies, and refine the definitions of your rubric until everyone is aligned.
Step 4: Iterative Testing
Run your prompt against the Golden Set. Collect the outputs and have them scored. Analyze the results to identify where the model failed. Was it a logic error? A misunderstanding of the persona? A failure to follow a format? Use these insights to tweak your prompt, then re-run the entire Golden Set. This cycle of testing, refining, and re-testing is the heart of prompt engineering.
Practical Example: Evaluating a Customer Support Bot
Let us imagine we are building a customer support bot for a software company. The prompt instructs the model to be "concise, professional, and always ask for a ticket ID if the issue involves a technical bug."
The Input (Golden Set Sample)
- Query: "My dashboard is showing a 500 error when I try to save the settings."
- Expected Behavior: The model should acknowledge the error, remain professional, and explicitly request a ticket ID.
The Evaluation Rubric
| Metric | 1 (Poor) | 3 (Neutral) | 5 (Excellent) |
|---|---|---|---|
| Conciseness | Rambling, includes fluff | Acceptable length | Direct and to the point |
| Tone | Too casual or robotic | Professional but stiff | Helpful and empathetic |
| Constraint | Did not ask for ID | Asked, but buried in text | Asked clearly as a priority |
Note: When designing your rubric, avoid vague terms like "good" or "bad." Use descriptive anchors. For example, instead of saying "1 = Bad," say "1 = The output contains conversational filler that ignores the user's immediate problem."
Code Snippet: Tracking Results Programmatically
While the evaluation is manual, you should manage your data programmatically to keep track of versions. Using a simple Python script to log your evaluations can help you keep a history of what worked and what didn't.
import json
# A structure to track evaluation results
def log_evaluation(prompt_id, input_text, output_text, scores, comments):
entry = {
"prompt_id": prompt_id,
"input": input_text,
"output": output_text,
"scores": scores,
"comments": comments
}
# In a real scenario, save this to a database or JSON file
with open("eval_log.json", "a") as f:
f.write(json.dumps(entry) + "\n")
# Example usage
scores = {"conciseness": 5, "tone": 4, "constraint_adherence": 5}
log_evaluation(
"v1.2-support-bot",
"My dashboard is showing a 500 error.",
"I'm sorry to hear that. Could you please provide your ticket ID?",
scores,
"The model followed instructions perfectly."
)
This approach allows you to filter your results later. You can calculate the average score for "v1.2" and compare it against "v1.1" to see if your changes actually improved performance or if they introduced new regressions.
Best Practices for Manual Evaluation
1. Version Control Your Prompts
Never edit a prompt in a production environment. Use a versioning system. Whether it is a simple file naming convention (prompt_v1.txt, prompt_v2.txt) or a more robust git-based repository, you must be able to roll back to a previous version if a new prompt change causes unexpected behavior.
2. Blind Evaluation
When possible, hide the version of the prompt from the evaluator. If an evaluator knows they are reviewing the "new and improved" prompt, they may be biased toward giving it higher scores. By shuffling outputs from different versions and presenting them anonymously, you get a much more honest assessment.
3. Focus on "Why" Not Just "What"
A numerical score tells you that a prompt is failing, but it doesn't tell you how to fix it. Always require a "reasoning" or "comment" field in your evaluation tool. If a model fails to follow a constraint, the evaluator should document exactly what part of the prompt was ignored. This qualitative data is far more valuable for debugging than a list of numbers.
4. Manage Evaluator Fatigue
Manual evaluation is mentally taxing. An evaluator who has been reviewing prompts for three hours will be significantly less attentive than one who has been at it for thirty minutes. Keep evaluation sessions short—ideally no more than 60 to 90 minutes at a time. Encourage breaks and rotate the evaluation tasks among team members to maintain fresh perspectives.
Tip: If you have a large dataset, use a sampling strategy. You do not need to manually evaluate every single output once you have a baseline. You can evaluate a representative sample of 10-20% of the outputs to monitor for regressions after you have performed a full audit on the complete set.
Common Pitfalls to Avoid
Avoiding Over-Optimization
A common mistake is "over-fitting" to the Golden Set. If you keep tweaking your prompt until it perfectly handles every item in your test set, you might inadvertently make the prompt too brittle for the real world. A prompt that is overly specific to the nuances of your test data may struggle when it encounters the chaotic, unpredictable nature of actual user queries. Always test your prompt against a "hold-out" set—data that the prompt has never seen before—to ensure it generalizes well.
Ignoring Implicit Biases
Evaluators bring their own biases to the table. If your team is homogenous, your evaluation will be, too. If your application is intended for a global audience, ensure your Golden Set includes diverse names, cultural references, and linguistic styles. Make sure your evaluators are aware of their own potential biases and encourage them to flag outputs that might be culturally insensitive or exclusionary, even if they technically "follow the instructions."
The "Prompt Drift" Trap
As you iterate, prompts often become bloated with "do not do this" and "remember to do that" instructions. This is known as prompt drift. Eventually, the model struggles to prioritize the most important instructions because the prompt has become a wall of text. If your evaluation shows that the model is ignoring core instructions, it is often better to simplify the prompt rather than adding more constraints.
Comparison: Manual vs. Automated Evaluation
To choose the right approach, it is useful to see how manual and automated evaluation compare in different scenarios.
| Feature | Manual Evaluation | Automated Evaluation |
|---|---|---|
| Depth of Insight | High (captures nuance) | Low (mostly binary/metrics) |
| Cost | High (time-intensive) | Low (computationally cheap) |
| Scalability | Low (limited by human time) | High (can run on millions) |
| Consistency | Variable (human error) | High (perfectly consistent) |
| Best For | Quality control, calibration | Regression testing, monitoring |
Use manual evaluation to establish the quality baseline and to handle complex, creative, or high-stakes tasks. Use automated evaluation to ensure that as you scale, you aren't breaking existing functionality.
Advanced Evaluation: Human-in-the-Loop (HITL)
As your application grows, you might consider a "Human-in-the-Loop" (HITL) model. This doesn't mean a human reviews every output, but rather that you build a feedback mechanism directly into your user application. When a user receives an output, provide a simple "thumbs up/thumbs down" button.
This provides you with a massive stream of real-world evaluation data. However, be careful: user feedback is notoriously noisy. A user might give a "thumbs down" because they don't like the answer, even if the answer was factually correct. Use this data as a signal for where to investigate, rather than as a definitive score for your prompt's quality. When you see a spike in negative feedback for a certain type of query, pull those examples into your manual evaluation pipeline for a deeper investigation.
Handling Ambiguity in Prompts
One of the most frequent reasons for poor performance is that the prompt itself is ambiguous. If the instructions are open to interpretation, the model will interpret them in ways you didn't intend. Manual evaluation is the best way to uncover these hidden ambiguities.
When an evaluator marks an output as "incorrect," ask them: "Could the model have interpreted the instruction differently?" If the answer is yes, then the prompt is at fault, not the model. You must rewrite the prompt to be more explicit.
Example of an Ambiguous Instruction:
- "Write a response that is helpful and friendly."
Refining the Instruction:
- "Write a response that is helpful by providing a step-by-step solution. Maintain a friendly tone by using polite greetings and acknowledging the user's frustration."
The second version leaves much less room for the model to hallucinate or adopt a tone that doesn't fit your brand. By using manual evaluation to identify these gaps, you can systematically tighten your prompts.
Building a Culture of Evaluation
Finally, treat evaluation as a first-class citizen in your development process. It should not be something you do at the very end before deployment. It should be an ongoing, integrated part of the development lifecycle. Developers should be encouraged to run small-scale manual checks every time they modify a prompt, even if it is just a minor wording change.
Create a shared document or internal wiki where you track the "Prompt History." For each version of a prompt, record:
- The Change: What was modified?
- The Reasoning: Why was it modified?
- The Result: Did the manual evaluation scores improve?
- The Impact: Did it negatively affect other parts of the system?
This documentation becomes an invaluable asset for new team members and helps prevent the team from repeating the same mistakes. It transforms prompt engineering from a "black art" into an engineering discipline.
Callout: The "One-Shot" Fallacy Many developers believe that if a prompt works once, it will work forever. This is the "one-shot" fallacy. Language models are stochastic; they have a degree of randomness. A prompt that works perfectly once might fail on the next attempt. Manual evaluation of a set of examples is the only way to account for this stochastic nature and ensure that your prompt is robust across many iterations.
Common Questions (FAQ)
Q: How many examples do I need in my Golden Set? A: There is no magic number, but for most applications, 50 to 100 high-quality, representative examples are sufficient to get a reliable baseline. Quality is far more important than quantity. Ten carefully crafted, difficult examples are more valuable than 100 generic ones.
Q: What if my evaluators disagree? A: Disagreement is actually a good sign—it means your rubric might be too vague. Use these disagreements as a chance to refine your definitions. If two people disagree on whether an output is "professional," it means you need to define what "professional" means in the context of your specific application.
Q: Can I use another LLM to perform the manual evaluation? A: This is known as "LLM-as-a-Judge." It is a powerful technique, but it is not a replacement for human evaluation. You should use human evaluation to verify that the "Judge LLM" is actually making correct decisions. If the Judge LLM and a human disagree, the human is always right.
Q: How often should I re-evaluate my prompts? A: You should re-evaluate whenever the underlying model version changes (e.g., upgrading from GPT-3.5 to GPT-4). Even if your prompt remains the same, the model's behavior might change, leading to unexpected regressions.
Key Takeaways
- Manual Evaluation is Ground Truth: Automated metrics are useful, but human judgment is the only way to ensure your AI application meets the qualitative standards required for real-world use.
- Define a Structured Rubric: Move beyond "good/bad" ratings. Use clear, descriptive criteria for accuracy, tone, constraint adherence, and safety to ensure consistent feedback.
- The Golden Set is Essential: Build a curated dataset of typical queries, edge cases, and adversarial examples. This is your primary tool for measuring progress and identifying regressions.
- Iterate Systematically: Treat prompt engineering as an engineering cycle. Test, analyze the "why" behind failures, refine the prompt, and re-test the entire set.
- Focus on Generalization: Avoid overfitting your prompt to your test data. A great prompt should handle unseen queries with the same reliability as the ones in your Golden Set.
- Document Everything: Maintain a history of your prompt versions, the changes made, and the evaluation results. This prevents "prompt drift" and helps the team learn from past iterations.
- Manage Evaluator Fatigue: Keep evaluation sessions short and focused to maintain high-quality, consistent feedback. Remember that a tired evaluator is an unreliable one.
By following these principles, you will move from guessing whether your prompts work to having a clear, data-driven understanding of your AI application's performance. This shift is what separates hobbyist projects from professional-grade AI systems.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons