Apply to my task
arXiv:2507.16587 ★ 72 Jul 22, 2025

LLM-as-a-Judge: The Model Approves Bugs It Wrote Itself

Key result

The paradox: ask an LLM to check its own code and it says "looks great." Even when there's a bug. A two-stage prompt lets you get a critique of any content without an outside reviewer: generate first, then evaluate. But the study exposed the core problem: the model systematically inflates its scores, especially in code, where the text "looks right" but the logic is broken. Use it as an assistant, not as the final authority.

On the Effectiveness ofLLM-as-a-judge for Code Generation and Summarization

Key Aspects of the Study:

The researchers tested how well advanced language models (including GPT-4) handle the role of a "judge" evaluating the quality of content generated by other LLMs. The test tasks were generating program code and writing short descriptions of it (summarization). It turned out that even the most powerful models often get it wrong, especially when they need to find a bug in code: they tend to approve incorrect versions.

Key Result: Language models are unreliable and overly optimistic judges, especially when evaluating their own or another model's generated work, and they often miss factual errors.


The Core of the Method, Explained:

The essence of the "LLM-as-a-judge" method is a two-stage approach to a task instead of a single-stage one.

  1. Stage 1: Generation. First you give the LLM a standard task: write a text, propose ideas, draft a plan, and so on.
  2. Stage 2: Evaluation. Right after that, in the same prompt or in the next message, you ask the same model to step into the role of a critic or expert and evaluate the result it just produced against clearly defined criteria.

The study's main takeaway for users: this method is useful, but it's no silver bullet. In the "judge" role, the model can be biased toward its own results and, most importantly, often misses factual errors (a high rate of "false positive" verdicts). So treat its critique as one more opinion that helps improve the result, not as the final word. You're making the model "look at its work with fresh eyes," but those "eyes" can still be clouded.


Practical Applicability:

  • Direct applicability: Users can start using this pattern in everyday tasks right away. Instead of just asking "Write a blog post," use a two-stage prompt: "1. Write a blog post on topic X. 2. Now act as an experienced editor, evaluate this post for clarity, engagement and lack of clichés, and suggest improvements." This applies directly to any creative or analytical task.

  • Conceptual value: The study gives users a critically important "mental model": an LLM has no true self-awareness or objectivity. Its "evaluation" mode is just another language game based on patterns from its training data. Users learn not to blindly trust the model's claims about the quality of its own work ("Yes, this code is correct," "Yes, this text is perfect") and see the need for external, human review on high-stakes tasks.

  • Adaptation potential: The method is universal and easy to adapt. The study used it for code, but the adaptation mechanism is simple: just change the role and the evaluation criteria.

    • For marketing: the role "experienced marketer," criteria "persuasiveness, call to action."
    • For a lawyer: the role "meticulous attorney," criteria "unambiguous wording, no risks."
    • For a student: the role "strict professor," criteria "structure, argumentation, relevance to the topic."

A Practical Example:

You are a content creation expert. Your work will have two parts.

**Task 1: Generate ideas**

Come up with 3 headline options for a blog post on "How to start investing if you're on a small budget."

---

**Task 2: Critical evaluation**

Now act as an **experienced SEO specialist and editor**. Your task is to impartially evaluate the 3 options proposed above.

Rate each headline on a scale of 1 to 10 on the following criteria:
*   **Appeal (Clickability):** How intriguing the headline is and how much it makes you want to click.
*   **Search optimization (SEO):** How well the headline includes the keywords ("investing," "small budget," "start").
*   **Clarity:** How clear the headline makes what the article will be about.

Present the result as a table. After the table, give a short conclusion on which headline you think is best and why.

Why This Works:

This prompt works thanks to several mechanics tied directly to the study's findings:

  1. Task decomposition: Instead of one complex request ("come up with the best SEO-optimized headline"), we split the process into "first sketch some options," then "analyze them." This reduces the model's cognitive load and lets it focus on each subtask separately.
  2. Role activation: The phrase "act as an experienced SEO specialist and editor" makes the model draw on the parts of its knowledge tied to SEO and editing text patterns. This improves the quality of the analysis.
  3. Clear criteria: By setting specific criteria (Appeal, SEO, Clarity), we steer the model's "thought process" and make it evaluate the result from several angles instead of giving a generic, useless answer like "all options are good."
  4. Accounting for limitations (on the user's side): Remembering the study's findings, a user who gets the answer will know the model was probably too lenient with itself (especially on "Clarity") and may have missed a better phrasing. This nudges the user not to accept the top option as perfect but to refine it.

Another Practical Example

**Context:** I'm preparing for an interview for a "Product Manager" position and want to rehearse my answer to "Tell me about your biggest failure."

**Task 1: Generate an answer**

Write a draft answer to this question. The answer should mention a hypothetical project (for example, launching a new feature in a mobile app) that didn't hit its KPIs.

---

**Task 2: Evaluation from an HR perspective**

Now imagine you are an **experienced HR director** who has run thousands of interviews. Your task is to evaluate the answer above as critically as possible.

Analyze the text on the following parameters:
*   **Answer structure:** Is there a clear structure (situation, task, actions, result/lessons)?
*   **Taking ownership:** Does the candidate take responsibility, or blame external circumstances?
*   **Lessons learned:** Are the takeaways specific and useful, or generic phrases?
*   **Negative impression:** Does the failure look so catastrophic that it would scare off an employer?

After the analysis, give specific recommendations on which phrases to rewrite so the answer sounds more convincing and professional.

Why This Example Works: The Mechanism.

This prompt is effective because it uses the same basic principles (decomposition, role, criteria) but adapts them to a subtler task of interpersonal communication.

  1. Switching perspective: The model first generates the text from the "candidate's" point of view and then analyzes it from the "employer's." This makes it evaluate not just the content but how the other side might perceive it.
  2. Focus on "hidden pitfalls": The evaluation criteria (Taking ownership, Negative impression) specifically target the typical mistakes people make when answering this tough question. This helps the model spot weak points it may have created itself during generation.
  3. Using "negativity bias": The study showed that LLMs tend to overrate generated content. The request to "evaluate as critically as possible" and the role of an "experienced HR director" are an attempt to counter this built-in tendency toward self-approval and make the model hunt for flaws harder. In effect, the user is applying the study's findings to "hack" the model's behavior and get more honest feedback.

Usefulness Score: 92

02

Main Evaluation Criteria

  • A. Relevance to prompting techniques: Very high. The entire study is devoted to testing the effectiveness of a specific prompting pattern: "LLM-as-a-judge."
  • B. Better conversational answers: High. The method directly aims to improve the final result by evaluating and picking the best of several generated options.
  • C. Direct practical applicability: Very high. The "generate, then evaluate" technique requires no code or special tools and can be applied immediately by any user in any chat interface.
  • D. Conceptual value: Exceptional. The study exposes fundamental limitations and "blind spots" of LLMs. It clearly shows that models (even GPT-4) are unreliable evaluators, prone to false-positive verdicts and biases. This is critical knowledge for setting realistic user expectations.
  • E. New useful practice (clustering): The paper falls into three clusters at once:
    • #1 (Prompt phrasing techniques): Presents the "LLM-as-a-judge" meta-technique, which often involves role-play and step-by-step reasoning.
    • #2 (LLM behavioral patterns): Identifies specific behavioral patterns: self-bias, a tendency to inflate scores, and an especially high rate of false positives (approving incorrect results).
    • #7 (Reliability and stability): Examines a method meant to improve reliability while also showing its limits.
  • Practicality checklist (+15 points): The paper gives ready-made prompt constructions, reveals non-obvious LLM behaviors and offers ways to improve answer accuracy. Bonus points applied.
03

Numeric Usefulness Score

Arguments for a high score (92/100): Despite its focus on program code, this paper offers a universal and extremely valuable lesson for any LLM user. The key finding, "an LLM is an unreliable and overly optimistic judge," is a fundamental principle everyone should know if they're trying to use an LLM for self-checking or quality evaluation. The "generate, then evaluate" technique is easy to apply and can significantly improve results, as long as the user keeps in mind the limitations the study uncovered. The conceptual value here outweighs the narrow domain of the experiments.

Counterarguments (why the score could be lower): The study's main focus on generating and summarizing code may mislead or scare off an ordinary user, who might wrongly assume the findings apply only to programming. Users will have to adapt and transfer these findings to their non-technical tasks (writing, marketing, etc.) on their own.

Counterarguments (why the score could be higher): If the study had been run on more general tasks from the start (for example, writing essays or marketing copy), its value would be obvious to 100% of the audience, and the score could be close to 100. Even as it stands, though, its findings on LLM behavioral patterns are so important that they deserve the highest marks.


Research digest

Key result

The paradox: ask an LLM to check its own code and it says "looks great." Even when there's a bug. A two-stage prompt lets you get a critique of any content without an outside reviewer: generate first, then evaluate. But the study exposed the core problem: the model systematically inflates its scores, especially in code, where the text "looks right" but the logic is broken. Use it as an assistant, not as the final authority.

Principle

You split the task into two stages. Stage 1: "write X." Stage 2: "now you're a strict Y, evaluate this against criteria A, B, C." Criteria are the key: not 'evaluate the quality' but specifically 'are there unhandled errors, are edge cases covered, are there generic phrases'. Add "as critically as possible": it partly breaks the model's built-in optimism. Partly. Switching roles flips the model from author mode to editor mode, so it reaches for a different layer of patterns from its training.

Why it works

Splitting the task lightens the load: the model does one thing at a time instead of everything at once. Switching roles pulls out a different layer of knowledge: an "experienced editor" looks at a text differently than its "author." Specific criteria direct attention where it's needed. But here's where the study slaps your wrist: an LLM doesn't run code, it reads it as text. If the code "looks right," the model approves it. It misses logic bugs far more often than syntax bugs, precisely because they don't jump out visually.

When to apply

Content tasks → headlines, website copy, posts, when there's no editor around but you need a second pair of eyes. Interview prep → simulate how a hiring manager sees your answer. Marketing → check how persuasive the copy is through a skeptic's eyes. Legal wording → catch ambiguities. NOT a fit for: code in a production system without human review, high-stakes critical documents; a false approval there costs dearly.

Mini recipe

1. First ask it to create the content you need, plainly, without overcomplicating 2. In a new message (or in the same prompt after a separator), set the role: "Now you are [a specific expert]" 3. Give specific criteria, not "evaluate" but "check: is there X, is Y present, is there no Z" 4. Add "as critically as possible": it signals that praise isn't wanted, weaknesses are 5. For code, still check it yourself or run it: the model doesn't execute code, it guesses from how it looks

Examples

[BAD]: `Write a sorting function in Python and tell me if it works correctly` [GOOD]: `Write a function that sorts a list without built-in methods. Then act as a senior developer and check as critically as possible: does it handle an empty list and a single-element list, are there logic errors in the loop, are the variable names clear. Point to the specific lines with problems if you find any, not just 'everything looks fine'.`

In plain words

Here's the thing: evaluating code isn't the same as proofreading text. Traditional metrics like CodeBLEU or Pass@k often drop the ball because they look at syntax, not logic. The study shows that LLM-as-a-judge (one model checking another) works head and shoulders above them because it understands semantics. The model doesn't just compare characters; it judges whether the code solves the task and how readable it is, acting like an experienced tech lead rather than a dumb compiler.

It's like asking your neighbor to rate your chili. Ordinary metrics are a kitchen scale: they'll check that you added exactly 200 grams of beans, but they couldn't care less about taste. LLM-as-a-judge is a professional chef who tastes the dish and knows you oversalted it, even if the gram-by-gram proportions are perfect. On paper everything's there, but you can't eat it, and the model catches those screwups instantly, unlike rigid algorithms.

What actually delivers: using GPT-4o or Llama-3 as judges shows high correlation with human ratings (up to 0.8-0.9 on some tests). The researchers singled out two key scenarios: Code Generation and Code Summarization (describing what code does). In both, the judge model understands context better and can make a reasoned case for why the code is total garbage, pointing out logic holes that tests simply won't catch.

The methods were tested on Python and Java, but the principle is universal. You can plug this approach into any CI/CD pipeline or use it to automatically filter synthetic data when training new models. If you're building a system that writes code, you don't need thousands of human testers; a well-tuned judge that weeds out junk on the fly is enough. Automated quality control now goes beyond simple unit tests.

Bottom line: trusting old metrics in 2024 is a road to nowhere. LLM-as-a-judge is the new standard: it saves time and gives honest feedback. The key is to use strong models like GPT-4 for evaluation, or you'll end up with the blind leading the blind. Bring a model into your review process and watch code quality climb without endless manual fixes.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on LLM-as-a-Judge: The Model Approves Bugs It Wrote Itself arXiv:2507.16587

Sign in to apply this study New accounts get 50 free credits.

Get the week’s best papers by email

One email on Sundays with the highest-rated new techniques. Unsubscribe with one click.