← Latest papers
🤖 machine learning

The Path Not Taken: Duality in Reasoning about Program Execution

This paper introduces DexBench, a benchmark designed to evaluate large language models' dynamic code understanding by assessing their ability to reason about program execution through two complementary tasks: predicting behavior from inputs and inferring input mutations to achieve specific behavioral objectives.

Original authors: Eshgin Hasanov, Md Mahadi Hassan Sibat, Santu Karmaker, Aashish Yadavally

Published 2026-04-24
📖 4 min read☕ Coffee break read

Original authors: Eshgin Hasanov, Md Mahadi Hassan Sibat, Santu Karmaker, Aashish Yadavally

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 teaching a robot to drive a car.

The Old Way (Current Benchmarks):
Most tests today ask the robot: "If I press the gas pedal, what happens?" The robot might answer correctly, "The car moves forward." But this only proves the robot memorized that specific action. It doesn't prove the robot understands why the car moves, or what would happen if you pressed the brake instead. The robot might be just guessing based on patterns it saw before, without truly understanding the engine.

The New Idea (This Paper):
The authors of this paper argue that to truly test if an AI "gets" how code works, we need to test it on two sides of the same coin at the same time. They call this Dual-Path Reasoning.

Think of it like a choose-your-own-adventure book:

  1. The Forward Path (The "What Happened" Test):
    You give the AI a story and a specific choice (e.g., "You turn left"). The AI must predict exactly what happens next in the story.

    • In coding terms: "Here is a program and an input. What lines of code will run?"
  2. The Backward Path (The "What If" Test):
    Now, you tell the AI: "I want the story to go down a different path (e.g., turn right instead of left). What choice must I have made at the beginning to make that happen?"

    • In coding terms: "Here is a program. I want a specific part of the code to run that didn't run before. What input do I need to change to make that happen?"

The Big Discovery:
The researchers built a new test called DEXBENCH (like a gym for AI brains) with 445 of these "choose-your-own-adventure" puzzles. They tested 13 different AI models.

Here is what they found, using simple analogies:

  • Being Good at One Doesn't Mean Being Good at Both:
    Some AIs were great at predicting what happens when you press the gas (Forward), but terrible at figuring out how to make the car turn right (Backward). Others were the opposite.

    • The Lesson: Just because an AI can predict an outcome doesn't mean it understands the cause. True intelligence requires understanding the connection between cause and effect in both directions.
  • Bigger Isn't Always Better:
    You might think the "smartest" (largest) AI would win. But sometimes, a medium-sized AI that wasn't specifically trained to "think hard" actually did better than a giant, super-complex AI.

    • The Lesson: Size and fancy training don't guarantee you understand how a program actually flows. Sometimes, simpler models that just follow the logic step-by-step are more reliable.
  • The "Hallucination" Trap:
    When the AI tried to solve the "What If" puzzle, many of them made up rules that didn't exist (like saying "If you turn left, the car flies"). They failed to realize that to change the outcome, you have to change the specific input that controls the decision.

Why This Matters:
In the real world, software engineers don't just want AI that can guess what code does. They need AI that can debug (find why something broke) and test (find inputs that break the code).

This paper says: "Stop testing AI with single-choice questions. Start testing them with 'What happened?' AND 'How do I change it?' together." If an AI can't do both, it's just a parrot repeating patterns, not a true programmer.

In a Nutshell:
To know if an AI truly understands a program, don't just ask it to predict the future. Ask it to predict the future, and then ask it to rewrite the past to create a different future. If it can do both, it's actually thinking.

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 →