Validating AI models and agents with property-based testing

How PBT works

A PBT generator can be applied by creating hundreds of receipts, each tested several times to measure when the model is consistent. This is one way to validate a model’s stability. Then, create thousands of variants of each receipt that don’t change the underlying meaning; for example, reordering the lines, reformatting the amounts, or changing the guest name. If the same line gets classified two ways for inputs that mean the same thing, at least one is wrong, and you’ve found a defect even though you never learned which classification was correct.

PBT takes inputs that created defects and runs a systematic search called shrinking. It simplifies the input by dropping line items, reducing amounts, and shortening descriptions, then reruns the simplified receipt and its variant through the assertion. It keeps only simplifications that still fail by returning different results, and repeats the shrinking and asserting process until no further simplification is possible while still failing.

What comes back is the smallest input that still breaks. A hotel folio with multiple line items might shrink to two lines: “Room Charge $289.00” and “Marketplace $97.63.” Reordering those two lines flips Marketplace from hotel to grocery, highlighting the defect. The minimal case tells you where the model is unstable; here, a line’s category depends on what precedes it.

Donner Music, make your music with gear
Multi-Function Air Blower: Blowing, suction, extraction, and even inflation

Leave a reply

Please enter your comment!
Please enter your name here