Testing LLM performance effectively requires a well-designed prompt and a clear evaluation framework. Here's a comprehensive approach:
The Prompt/Question
A good prompt for comparison should ideally be multi-faceted, requiring different capabilities from the LLM. It should test:
- Information Retrieval/Synthesis: Can it access and combine relevant knowledge?
- Reasoning/Logic: Can it make sensible connections or deductions?
- Instruction Following: Can it adhere to specific formatting or content requirements?
- Creativity/Tone: Can it generate engaging or appropriately toned content?
- Constraint Handling: Can it work within given limitations (e.g., budget, persona)?
Here's a suggested prompt:
Prompt:
"You are an experienced travel agent. A family of four (two adults, two children aged 8 and 12) wants to go on a 7-day trip to Europe in July. They are keen on exploring historical sites and enjoying good food, but they are on a moderate budget (e.g., avoiding luxury resorts, opting for public transport where feasible).
Please provide:
- Three distinct European city/region suggestions that meet their criteria.
- For each suggestion, justify why it's a good fit for this family's interests and budget.
- For each suggestion, outline one specific historical activity and one specific food-related activity that would appeal to both adults and children.
- Conclude with one unique, surprising, or fun fact related to any of your chosen destinations that might pique their interest.
Format your answer clearly with headings for each destination and bullet points for activities. Keep the tone friendly and helpful, like a travel agent."
What to Check For (Evaluation Criteria)
When evaluating each LLM's answer to the prompt, consider the following criteria. You'll want to score each criterion for every LLM's response.
-
Accuracy & Factuality (Weight: High)
- Are the historical sites real? Are the food suggestions plausible for the region?
- Are the justifications accurate regarding history, food, and budget appropriateness?
- Is the "fun fact" genuinely factual?
-
Relevance & Appropriateness (Weight: High)
- Do the suggestions truly fit a family with 8 and 12-year-olds? (e.g., not overly academic, not too complex for kids)
- Do the suggestions align with a "moderate budget" and "history/food" interests?
- Are the activities suitable for both adults and children?
-
Completeness & Instruction Following (Weight: High)
- Did it provide exactly three distinct suggestions?
- Did it provide justification for each?
- Did it outline one historical and one food-related activity for each suggestion?
- Did it include the fun fact at the end?
- Did it use the requested formatting (headings, bullet points)?
-
Clarity & Coherence (Weight: Medium)
- Is the language easy to understand?
- Does the answer flow logically from one point to the next?
- Is there any awkward phrasing or repetition?
-
Creativity & Uniqueness (Weight: Medium)
- Are the suggestions standard or does it offer slightly less common but still viable options?
- Are the activity ideas imaginative or just generic?
- Is the fun fact genuinely unique or surprising?
-
Tone & Persona (Weight: Medium)
- Does it maintain a "friendly and helpful travel agent" tone throughout?
- Does it sound natural and engaging?
-
Conciseness & Verbosity (Weight: Low)
- Is the answer direct and to the point, or overly verbose/repetitive? (Aim for informative but not rambling).
-
Safety & Harmlessness (Weight: N/A for this prompt, but good to keep in mind generally)
- Does it avoid generating harmful, biased, or inappropriate content? (Unlikely to be an issue with this prompt, but crucial for others).
How to Rank and Compare Them (Scoring Rubric)
To rank and compare, use a scoring rubric. Assign numerical scores to each criterion for each LLM's response.
Suggested Scoring Scale:
- 0: Fail / Not present (e.g., missing a required section, completely inaccurate)
- 1: Poor (present but very weak, many errors, major gaps)
- 2: Fair (meets some requirements, but with noticeable flaws or inaccuracies)
- 3: Good (meets most requirements, minor flaws, generally accurate)
- 4: Excellent (meets all requirements, highly accurate, well-articulated)
- 5: Outstanding (exceeds expectations, perfect accuracy, insightful, very well-crafted)
Example Rubric Table (for one LLM's response):
| Criteria | Score (0-5) | Notes / Specific Examples (for justification) |
|---|
| 1. Accuracy & Factuality | | e.g., "All facts correct for Rome, but Pisa suggested a non-existent activity." |
| 2. Relevance & Appropriateness | | e.g., "Family-friendly activities well-chosen. Budget seems plausible." |
| 3. Completeness & Instruction Following | | e.g., "Missing fun fact. Only 2 destinations given instead of 3." |
| 4. Clarity & Coherence | | e.g., "Well-organized with clear headings. Easy to read." |
| 5. Creativity & Uniqueness | | e.g., "Standard city suggestions. Fun fact was a bit generic." |
| 6. Tone & Persona | | e.g., "Maintained friendly travel agent tone throughout." |
| 7. Conciseness & Verbosity | | e.g., "A bit too verbose in justifications. Could be more concise." |
| Total Score | XX/35 | |
Comparison Process:
- Standardize the Prompt: Ensure you use the exact same prompt for every LLM you test. Don't rephrase or add subtle differences.
- Generate Responses: Get responses from all the LLMs you want to compare (e.g., ChatGPT-4, Gemini Advanced, Claude 3 Opus, Llama 3 70B, etc.).
- Anonymize (Optional but Recommended): If you're doing this subjectively, try to hide which LLM generated which response before you evaluate. This reduces bias.
- Score Each Response: Go through each LLM's answer systematically, applying the rubric and assigning a score for each criterion. Add detailed notes to justify your scores.
- Sum Scores: Calculate the total score for each LLM's response.
- Compare Totals: The LLM with the highest total score is generally the "best" for this specific prompt and your criteria.
- Qualitative Analysis: Beyond scores, read through your notes.
- Did one LLM consistently excel in a certain area (e.g., creativity, accuracy)?
- Did another consistently struggle (e.g., instruction following, tone)?
- Are there any significant "failure modes" for a particular LLM (e.g., hallucination, refusal to answer)?
- Repeat (Crucial!): This is just one prompt. A single prompt isn't enough for a comprehensive test. Run several different prompts, covering various tasks (e.g., summarization, code generation, creative writing, logical puzzles, debate). Aggregate scores across multiple prompts to get a more robust comparison.
- Contextualize "Best": Remember that "best" depends on your intended use case. An LLM that's great at creative writing might be poor at factual recall, and vice-versa. Your testing should align with the specific tasks you plan to use the LLM for.
By following this structured approach, you'll be able to objectively evaluate, rank, and compare the performance of different LLMs based on their output.