← Latest papers
💻 computer science

Agentic Proof and Property-Based Testing via Property-Templates in Data-Intensive Computing

This paper proposes a dual-track validation framework that leverages parameterized property templates to simultaneously enhance formal proof engineering in Lean 4 and automate property-based testing in PySpark for Apache Spark, effectively reducing AI hallucinations and intent misalignments while bridging the gap between formal models and real-world implementations.

Original authors: Seongmin Lee, Yaoxuan Wu, Miryung Kim

Published 2026-07-13
📖 5 min read🧠 Deep dive

Original authors: Seongmin Lee, Yaoxuan Wu, Miryung Kim

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're building a massive, super-fast library where books are sorted, stacked, and retrieved by a team of robot librarians (that's your data system, like Apache Spark). For years, the hardest part of coding these robots was writing the instructions. But now, with AI getting cheaper and smarter at writing code, the bottleneck has shifted. The real problem isn't writing the code anymore; it's making sure the AI didn't accidentally invent a rule that sounds good but is actually wrong, or writing a test that checks the wrong thing.

The authors of this paper, Seongmin Lee, Yaoxuan Wu, and Miryung Kim, propose a clever solution to this "intent crisis." They call it DUALVERI, and it's like giving the AI a set of "fill-in-the-blank" templates instead of asking it to write a whole novel from scratch.

The Two-Track Detective Game

To prove a robot librarian is doing its job, you usually need two things:

  1. The Math Proof: A perfect, logical argument showing the robot must work correctly in every possible universe (using a tool called Lean 4).
  2. The Real-World Test: Running the robot with millions of random book piles to see if it actually works in the messy real world (Property-Based Testing, or PBT).

Usually, doing both is exhausting. If you ask an AI to do it alone, it often "hallucinates"—it writes a proof that looks perfect but proves nothing, or writes a test that runs but checks the wrong thing.

The Magic of "Property Templates"

The authors noticed that in data systems, many rules look exactly the same, just with different ingredients. For example, "The total sum of all books equals the sum of the books in each pile" is a rule that applies to counting, summing, or finding the max, but the structure is identical.

Instead of asking the AI to reinvent the wheel for every single rule, they created Property Templates. Think of these as a "Mad Libs" game for math and code.

  • The Template: A pre-built skeleton with "holes" where the specific ingredients (like "count" or "sum") go.
  • The Agent: The AI only has to fill in the holes, not build the whole house.

This works on two tracks simultaneously:

  • Track 1 (The Proof): The template provides a pre-verified "lift" mechanism. The AI just has to prove the local rule for the specific ingredients, and the template automatically lifts that proof to cover the whole system.
  • Track 2 (The Test): The template provides a pre-built test engine. The AI just plugs in the specific function, and the template automatically generates thousands of varied, realistic test scenarios.

What They Found (The Numbers)

When they tested this on 400 different rules in the Apache Spark system, the results were quite clear:

  • Proofs got better and cheaper: Using the templates, the AI successfully generated machine-checked proofs 2.6 times more often for some families of rules (averaging 1.6 times more). It also cut down on "hallucinations"—proofs that compile but are nonsense—by 59%.
  • Tests got more accurate: Without templates, the AI often wrote tests that didn't match the intended goal (22 times out of 100 in some cases). With templates, those mistakes dropped to just 1.
  • Cost went down: Because the AI had less to figure out, the cost to generate these tests dropped by up to 5.7 times (averaging 3.8 times).

The "Double-Check" Bonus

Here's the coolest part: because they ran both the Math Proof and the Real-World Test, they could catch things neither could catch alone.

  • If the Math Proof says "It's perfect" but the Real-World Test finds a bug, it means the mathematical model of the system was missing a detail about how the real software behaves.
  • If the Real-World Test passes but the Math Proof fails, it suggests the model needs to be expanded to cover more complex scenarios.

In their study, for 130 out of 400 properties, both tracks agreed, giving the strongest possible evidence that the system is correct. For the others, the disagreement helped them find gaps in their understanding.

What They Argue Against

The paper explicitly argues against the idea that you can just let an AI generate tests or proofs from scratch without structure. In a pilot study where they let an AI generate tests without templates, the results were "individually meaningful but collectively unsystematic." The AI failed to vary the surrounding workload or cover specific types of user-defined functions, leading to tests that were too narrow or missed the point entirely. The paper suggests that structure is essential; you can't just rely on the AI to "figure it out" on its own if you want scale and accuracy.

How Sure Are They?

The authors are very confident in their numbers because they ran actual experiments. They didn't just simulate this; they generated 400 specific properties, ran them through a real Lean 4 prover, and executed them on a real PySpark system. They measured success rates, costs, and error types directly.

However, they do note that while the templates reduced hallucinations significantly, they didn't eliminate them entirely for every single type of rule (specifically for complex aggregation rules, some "cheating" proofs still slipped through). They also point out that a machine-checked proof only guarantees the theorem is correct relative to the model—if the model itself is wrong, the proof is technically "correct" but practically useless. So, while the method is a huge step forward, human inspection is still needed to ensure the AI didn't "game" the definitions.

In short, the paper suggests that by giving AI a "fill-in-the-blank" template for recurring rules, we can make it much better at proving and testing complex data systems, saving time, money, and preventing silent errors.

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 →