Rationalism and Formal Verification: When the Proof Holds and the Patient Is Not Safe

A pump obeys every dose limit while a patient's breathing slows. Formal verification can prove that software meets its specification. This post asks what that proof leaves out, and why the most dangerous failures in health care AI sit between the model and the bedside.

Share
A chart of small rust tiles. Columns of dose tiles all stay below a dashed line marking the hourly limit, while a row of breath tiles beneath them fades from bright to dark and ends in empty
Every dose stayed within the limit. The proof held. The patient's breathing did not.

It is three in the morning on a surgical floor. A man in his sixties is two days past a hip replacement, and a patient-controlled analgesia (PCA) pump stands beside his bed. The pump gives a small dose of opioid each time he presses a button, and it will not give more than his surgeon ordered. It has a lockout interval. It has an hourly limit. It checks every number the nurse entered against the hospital's drug library.

His daughter has been sitting with him since supper. He moans in his sleep, and she cannot stand to watch him hurt. So every few minutes she presses the button for him. Each press falls inside the limits, and the pump does exactly what it was built to do. By four o'clock his breathing has slowed to six breaths a minute.

This is an illustrative case, but the pattern is real. Patient safety officials call it PCA by proxy. In one report to Pennsylvania's patient safety system, a pain service physician walked into a room and found a patient's boyfriend pushing her button. Her oxygen saturation had fallen to 40 percent (Pennsylvania Patient Safety Authority, 2005). The safety of the design rests on one fact about the person at the button. In the advisory's plain words, "A sedated patient will not press the button to deliver more opiate" (Pennsylvania Patient Safety Authority, 2005, p. 1). Take that fact away, and every rule the pump enforces can hold while the patient stops breathing.

What interests me about this case is a simple question. Suppose the pump's software had been formally verified, proven by mathematics to meet every safety requirement written for it. The proof would still hold at four o'clock. Nothing in the code would be wrong. That is the gap formal verification cannot close, and it is the subject of this post.

The core claim

Rationalism is the view that the most secure knowledge comes from reason rather than the senses. René Descartes gave it its most famous form. He opened the Meditations by recalling that he "was struck by how many false things I had believed" (Descartes, 1641/2017, p. 1). He set out to doubt everything he could and to rebuild knowledge only from what his mind could grasp with certainty, taking geometry as his model. Begin with axioms that cannot be false, apply rules that cannot mislead, and the conclusions will be as certain as the starting point.

Computer science gave that hope a working form three centuries later. In 1969, Tony Hoare published "An Axiomatic Basis for Computer Programming." His opening claim is rationalism in its plainest form. "Computer programming is an exact science in that all the properties of a program and all the consequences of executing it in any given environment can, in principle, be found out from the text of the program itself by means of purely deductive reasoning" (Hoare, 1969, p. 576). Hoare gave programmers a logic for doing exactly that. State what must be true before a piece of code runs, state what must be true after it runs, and prove that the code carries one to the other.

Formal verification is the name for this work today. It covers proof assistants, model checkers, and solvers that check a system against a mathematical statement of what it must and must not do. Empiricism, the subject of Post 2, learns what a model does by watching it. The central promise of rationalism is that, for some questions, we can know what a program will do without watching it run at all.

How rationalism shows up in AI practice

Medical device engineering took up these methods well before the current wave of AI. In 2010 the FDA reported that it was helping to develop model-based verification methods for infusion pump software through its Generic Infusion Pump project (U.S. Food and Drug Administration, 2010). Researchers at the University of Minnesota and the University of Pennsylvania later carried that work from start to finish on a generic PCA pump. They wrote the requirements, modeled the pump, proved that the models met the requirements, generated code from the models, and ran the code on a modified commercial pump (Murugesan et al., 2017).

The same ambition has now reached machine learning. Sanjit Seshia, Dorsa Sadigh, and Shankar Sastry define verified artificial intelligence as "the goal of designing AI systems that have strong, ideally provable, assurances of correctness with respect to mathematically specified requirements" (Seshia et al., 2022, p. 46). Guy Katz and colleagues built a tool called Reluplex that can prove certain properties of neural networks directly. They tested it on a prototype collision avoidance system for unmanned aircraft and proved, for example, that a clear-of-conflict advisory would always be issued when an intruding aircraft was far enough away (Katz et al., 2017). They also showed why the work is hard. Verifying even simple properties of these networks is NP-complete, which means the time a proof takes can grow very fast as networks grow.

The broadest recent proposal is called guaranteed safe AI. David Dalrymple, Yoshua Bengio, Stuart Russell, and their coauthors describe three components (Dalrymple et al., 2024).

  1. A world model, a mathematical description of how the AI system affects the world around it.
  2. A safety specification, a statement of which effects are acceptable.
  3. A verifier, a mechanism that produces a proof certificate that the AI meets the specification relative to the world model.

That last phrase matters more than any other in what follows. The authors know the world model can be wrong. They recommend watching the system at runtime for signs of model inaccuracy, with a trustworthy backup ready to intervene, as one layer in what safety engineers call defense in depth. Their own medical example shows how much the approach demands. A diagnostic agent would need a world model of the human body that describes "the complexities and nuances of human physiology and pathology" (Dalrymple et al., 2024, p. 14).

Every method in this section proves something about a model, given a specification. No method in this section proves that the model matches the world.

Strengths

It offers certainty where testing cannot. Testing samples behavior. A test set of ten thousand cases says nothing about case ten thousand and one. A proof covers every input within its scope, including the rare ones no one thought to try. For a pump that must never exceed its hourly limit, that matters a great deal.

It forces people to say exactly what they mean. Before anything can be proven, someone must write the requirement in a form a machine can check. That work exposes vague and conflicting requirements early, when they are cheap to fix. The pump team found this firsthand. One requirement said that a patient bolus "shall take precedence over a square bolus." Did that mean the patient's dose replaced the programmed dose, or paused it? The answer changes how much drug a patient can receive, and the work of modeling is what brought the question to light (Murugesan et al., 2017). Smith saw the same thing in 1985. The attempt to prove often uncovers errors that the finished proof itself would never catch (Smith, 1985).

It can find weak spots that data alone will miss. Samuel Finlayson and colleagues warned that a small, carefully designed change to an input can make a medical model confidently wrong (Finlayson et al., 2019). A track record built on ordinary data will rarely reveal these weak spots, because ordinary data rarely contains them. A robustness proof can show that no change within a stated bound will flip the output. That protection carries a price. Finlayson and colleagues note that current defenses cost accuracy, and that models both highly accurate and robust to such attacks remain an open problem (Finlayson et al., 2019).

It produces evidence that others can check. A proof is a document. A regulator, an auditor, or a hospital committee can review what was proven and what was assumed. That is a better basis for trust than a vendor's word.

Weaknesses

A proof connects a program to a model, but it cannot connect a model to the world. This is the oldest objection and the most important one. The philosopher James Fetzer made it in 1988, in the same journal that had published Hoare. "Algorithms, as logical structures, are appropriate subjects for deductive verification. Programs, as causal models of those structures, are not" (Fetzer, 1988, p. 1048). A program runs on hardware, in a building, beside a patient. None of that is inside the proof.

Brian Cantwell Smith made the same point three years earlier, with a medical example. A system that governs drug therapy must model the patient, the drug, and how fast the body absorbs it, perhaps treating that rate as a number tied to body weight. A proof can show that the program matches that model. It says nothing about whether the model matches the patient. Smith thought "relative consistency" was a more honest name than correctness for what such proofs show (Smith, 1985). The pump at four o'clock is relatively consistent with its specification. It is not correct about the room.

The specification can be wrong, and nothing in the proof will say so. Nancy Leveson and Clark Turner studied the Therac-25, a radiation therapy machine involved in six known accidents with massive overdoses between June 1985 and January 1987, which led to deaths and serious injuries (Leveson & Turner, 1992). The Therac-25 did have coding errors. But Leveson and Turner observed that this made it unusual. Most computer-related accidents, they wrote, trace instead to errors in the requirements, such as omissions and environmental conditions and system states that the software handled badly. A proof against a requirement that left something out will faithfully certify the omission.

The pump team saw a small version of this. On the real pump, a counter for the drug left in the reservoir sometimes rolled past zero and reported that the reservoir had been refilled when it had not. None of the formal checks caught it, because none of the properties they checked forbade it. As the authors put it, "the verification will only guarantee compliance with the properties actually used in the verification" (Murugesan et al., 2017, Section 6.3).

Proof is a social process too. Richard De Millo, Richard Lipton, and Alan Perlis argued in 1979 that mathematicians come to trust a theorem through reading, checking, and arguing with one another. In their words, a proof "is only one step in the direction of confidence" (De Millo et al., 1979, p. 271). Machine-checked proofs of large systems are rarely read by anyone. Their paper drew sharp replies, and proof tools have grown much stronger since. But the question they raised remains. Who has actually examined what was assumed?

It strains against how modern AI is built. Hoare could reason about a program because a person wrote each line with a purpose. A deep learning model has no such lines. Its behavior lives in millions of learned weights, and its requirements are often unclear even to the people who built it. What would a formal specification for "detect diabetic retinopathy" look like? We can prove narrow properties, such as robustness within a small bound. We cannot prove that a model sees disease.

Certainty can breed overconfidence. Leveson and Turner name overconfidence in software as a factor in the Therac-25 accidents. Earlier machines in the line had relied on hardware interlocks, and the Therac-25 leaned on software in their place (Leveson & Turner, 1992). When people believe something has been proven, they may stop watching. A verified label on a device can quietly remove the very human checks that were catching what the proof could not see. The nurse who might have noticed the daughter at the bedside may assume the pump has it handled.

Health care stress test

Return to the man on the surgical floor, and suppose the pump's software had been verified against the FDA's generic safety requirements. What would the proof establish? It would show that the pump never delivers a dose during its lockout interval, never exceeds the hourly limit, and responds correctly to blocked lines, low batteries, and keypad entries. Each of those statements could be true. All of them were true at four o'clock.

What the proof could not contain was the assumption underneath the whole design. Patient-controlled analgesia is safe because the patient controls it, and a sedated patient stops asking for more (Pennsylvania Patient Safety Authority, 2005). That fact is about human physiology and human behavior. It lives in the room, outside the code. When the daughter pressed the button, she changed the room, and the model of the room inside the proof did not change with her.

The larger record of infusion pumps follows the same pattern. From 2005 through 2009, the FDA received about 56,000 reports of adverse events tied to infusion pumps, including numerous injuries and deaths, and manufacturers conducted 87 recalls (U.S. Food and Drug Administration, 2010). The agency concluded that many of the problems traced to deficiencies in design and engineering, and it named software defects among them.

Verification is a strong answer to software defects. It is a weak answer to a design that assumes the wrong things about the patient and the people around the patient.

The FDA seemed to sense this. The same white paper asked manufacturers to test pumps in the setting where they would be used, to account for real-life environmental and user interface issues. The pump researchers also checked their design against a closed-loop model in which a pulse oximeter and a safety interlock tell the pump to stop when a patient's breathing falters (Murugesan et al., 2017). That widens the model to take in the patient's body. Every widening helps. Every widened model still leaves something out.

There is a fairness question here as well. Someone writes the world model, and it will describe some patients better than others. A pump modeled on a typical adult may poorly describe a frail older woman with sleep apnea, a child, or a patient whose kidneys clear the drug slowly.

The proof will be equally certain for all of them. The model will not be equally true.

As a hospital chaplain, what strikes me about this case is where the knowledge lives. The nurse who knows the daughter has been at the bedside all evening holds information no proof contains. So does the respiratory therapist who hears that the snoring has changed. Verification can secure the machine. It cannot see the room.

So the stress test points to a division of labor. Proof can tell us that a device does what we said it should do. People, data, and monitoring must tell us whether what we said was enough.

Fit rating

Mixed. Rationalism earns a strong place in AI governance for narrow, well-specified, high-stakes components. Dose limits, interlocks, and robustness bounds are the right targets for proof. It fits poorly as a general account of how a health system can know that an AI tool is safe, because the most dangerous failures sit in the gap between the model and the bedside.

A question for governance teams

When a vendor tells your committee that a system has been formally verified, who on your side reads the specification and the world model? Who at the bedside is asked whether those assumptions match your patients? And who checks whether the world model describes your sickest patients as well as it describes the average ones?

Next, pragmatism

Rationalism asks whether a claim can be proven. Pragmatism asks what difference the claim makes when we act on it. If rationalism asks whether the pump's logic is sound, pragmatism asks whether the pump, as used on that floor, kept patients safe, and what the hospital learns when it does not. Charles Sanders Peirce, William James, and John Dewey held that the meaning of an idea lies in its practical consequences. The learning health system rests on that idea, treating knowledge as something tested and revised in daily use. Post 6 asks what "works" means, and for whom.

References

Dalrymple, D., Skalse, J., Bengio, Y., Russell, S., Tegmark, M., Seshia, S., Omohundro, S., Szegedy, C., Goldhaber, B., Ammann, N., Abate, A., Halpern, J., Barrett, C., Zhao, D., Zhi-Xuan, T., Wing, J., & Tenenbaum, J. (2024). Towards guaranteed safe AI: A framework for ensuring robust and reliable AI systems (arXiv:2405.06624). arXiv. https://doi.org/10.48550/arXiv.2405.06624

De Millo, R. A., Lipton, R. J., & Perlis, A. J. (1979). Social processes and proofs of theorems and programs. Communications of the ACM, 22(5), 271–280. https://doi.org/10.1145/359104.359106

Descartes, R. (2017). Meditations on first philosophy (J. Bennett, Trans.). Early Modern Texts. https://www.earlymoderntexts.com (Original work published 1641)

Fetzer, J. H. (1988). Program verification: The very idea. Communications of the ACM, 31(9), 1048–1063. https://doi.org/10.1145/48529.48530

Finlayson, S. G., Bowers, J. D., Ito, J., Zittrain, J. L., Beam, A. L., & Kohane, I. S. (2019). Adversarial attacks on medical machine learning. Science, 363(6433), 1287–1289. https://doi.org/10.1126/science.aaw4399

Hoare, C. A. R. (1969). An axiomatic basis for computer programming. Communications of the ACM, 12(10), 576–580, 583. https://doi.org/10.1145/363235.363259

Katz, G., Barrett, C., Dill, D. L., Julian, K., & Kochenderfer, M. J. (2017). Reluplex: An efficient SMT solver for verifying deep neural networks. In R. Majumdar & V. Kunčak (Eds.), Computer aided verification: CAV 2017 (Lecture Notes in Computer Science, Vol. 10426, pp. 97–117). Springer. https://doi.org/10.1007/978-3-319-63387-9_5

Leveson, N. G., & Turner, C. S. (1992). An investigation of the Therac-25 accidents (UCI Technical Report No. 92-108). University of California, Irvine. https://escholarship.org/uc/item/5dr206s3

Murugesan, A., Heimdahl, M. P. E., Whalen, M. W., Rayadurgam, S., Komp, J., Duan, L., Kim, B.-G., Sokolsky, O., & Lee, I. (2017). From requirements to code: Model based development of a medical cyber physical system. In M. Huhn & L. Williams (Eds.), Software engineering in health care (Lecture Notes in Computer Science, Vol. 9062). Springer. https://doi.org/10.1007/978-3-319-63194-3_7

Pennsylvania Patient Safety Authority. (2005). PCA by proxy: An overdose of care. PA-PSRS Patient Safety Advisory, 2(2). Produced by ECRI and ISMP.

Seshia, S. A., Sadigh, D., & Sastry, S. S. (2022). Toward verified artificial intelligence. Communications of the ACM, 65(7), 46–55. https://doi.org/10.1145/3503914

Smith, B. C. (1985). The limits of correctness. ACM SIGCAS Computers and Society, 14–15(1–4), 18–26. https://doi.org/10.1145/379486.379512

U.S. Food and Drug Administration. (2010). Infusion pump improvement initiative [White paper]. Center for Devices and Radiological Health. https://www.fda.gov/media/116949/download

Read more