← Latest papers
💻 computer science

From Program Slices to Causal Clarity: Evaluating Faithful, Actionable LLM-Generated Failure Explanations via Context Partitioning and LLM-as-a-Judge

This paper demonstrates that the quality of LLM-generated failure explanations is causally dependent on context composition, showing that evidence-rich, failure-specific artifacts significantly improve causal clarity and actionable repair outcomes compared to generic or overly large contexts.

Original authors: Julius Porbeck (Hasso Plattner Institute, University of Potsdam, Germany), Christian Medeiros Adriano (Hasso Plattner Institute, University of Potsdam, Germany), Holger Giese (Hasso Plattner Institute
Published 2026-05-21
📖 5 min read🧠 Deep dive

Original authors: Julius Porbeck (Hasso Plattner Institute, University of Potsdam, Germany), Christian Medeiros Adriano (Hasso Plattner Institute, University of Potsdam, Germany), Holger Giese (Hasso Plattner Institute, University of Potsdam, Germany)

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a mystery: a computer program has crashed, and you need to know why it happened so you can fix it.

In the past, we've asked powerful AI assistants (Large Language Models, or LLMs) to act as our detectives. They can look at the messy code and the error messages and tell us what went wrong. But sometimes, these AI detectives give us answers that are vague, misleading, or just plain wrong. If the detective gives you the wrong clue, you might fix the wrong part of the machine, making the problem worse.

This paper is like a training manual for AI detectives. The researchers wanted to figure out: What kind of information should we give the AI to make it give the best, most helpful explanation?

Here is the breakdown of their investigation using simple analogies:

1. The Problem: "The Information Overload"

Imagine you are trying to find a specific needle in a haystack.

  • The Old Way: You dump the entire barn, the whole farm, and the neighbor's field into a pile and ask the AI, "Find the needle." The AI gets overwhelmed by all the extra hay (irrelevant code) and might miss the needle or give a confused answer.
  • The New Idea: Instead of dumping everything, you carefully select just the hay bales where the needle is most likely to be. You give the AI a "sliced" portion of the information—just the code that actually caused the crash, the specific test that failed, and the error message.

2. The Experiment: The "Context Buffet"

The researchers set up a massive tasting experiment. They took 12 real software bugs and created 93 different "buffets" (context configurations) for the AI to eat from.

  • Some buffets had just the error message.
  • Some had the code and the test.
  • Some had the code plus a "slice" of the program showing exactly which lines were running when it broke.
  • Some had everything (the whole barn).

They asked three different AI models (think of them as three different detectives with different personalities) to look at these buffets and write an explanation for why the bug happened.

3. The Scorecard: What Makes a Good Explanation?

The researchers didn't just ask, "Did the AI fix the bug?" They asked, "Was the explanation good?" They graded the AI on six things, like a teacher grading an essay:

  1. Readability: Is it easy to read?
  2. Problem ID: Did it correctly identify what broke?
  3. Causal Chain: Did it explain how the problem happened step-by-step? (e.g., "Because X happened, Y went wrong, which caused Z to crash.")
  4. Actionability: Did it tell the human what to actually do next?
  5. Grounding: Did it point to specific lines of code or evidence, or was it just guessing?
  6. Brevity: Was it too long and wordy?

4. The "AI Judge" vs. Human Judges

Since they couldn't ask thousands of humans to read every explanation, they used an AI Judge to grade the AI's work.

  • The Finding: The AI Judge was very good at agreeing with human experts on the "serious" stuff (Did it find the right problem? Is the logic sound?).
  • The Glitch: The AI Judge was bad at agreeing with humans on "style" stuff (like how short or long the answer was). Humans found "brevity" hard to judge consistently, and the AI Judge got confused too.

5. The Big Discoveries

Here is what they learned about feeding the AI:

  • Less is often more (but the right "less"): Giving the AI the entire codebase (the whole barn) often made the explanations vaguer. The AI got distracted by the noise.
  • The "Golden Ticket" Ingredients: The best explanations came when the AI was given executable evidence—specifically the Code that broke and the Test that failed. These were the most helpful clues.
  • The "Noise" Ingredient: Adding long documents or descriptions (like "Docstrings") often made the explanations worse. It was like giving the detective a 50-page biography of the suspect instead of the crime scene photos.
  • The "Slice" Strategy: For some AI models, using "program slices" (mathematically cutting out only the lines of code that actually influenced the crash) helped the AI focus better.

6. The Payoff: Better Explanations = Better Fixes

The most important finding is the link between a good explanation and a good fix.

  • When the AI gave a high-quality, clear, and actionable explanation, it was much more likely to successfully fix the bug in the next step.
  • When the AI gave a low-quality, vague explanation, it was actually worse than if the AI had tried to fix the bug without an explanation at all. A bad explanation can lead you down the wrong path.

Summary

This paper teaches us that to get the best results from AI debugging tools, we shouldn't just dump all the data on them. We need to be curators. We need to carefully select the right "clues" (code, tests, and specific error lines) and filter out the noise. When we do this, the AI becomes a much sharper detective, giving us clear, truthful reasons for why things broke, which helps us fix them faster and more accurately.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →