← Latest papers
🤖 AI

Formally Verified Code Synthesis for Structured Data Translation in a Medical Internet of Things

This paper presents a formally verified, LLM-powered evolutionary code synthesis system that reliably generates low-cost, trustworthy translation code between medical IoT device data (such as pulse oximeter JSON schemas) and the FHIR standard, ensuring strict adherence to predefined requirements.

Original authors: Colin Samplawski, Adam D. Cobb

Published 2026-06-23
📖 4 min read☕ Coffee break read

Original authors: Colin Samplawski, Adam D. Cobb

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 trying to connect a new, smart medical device (like a pulse oximeter that clips onto a finger) to a complex, high-tech ambulance network. This network is like a busy hospital where every piece of equipment speaks a different language. The new device speaks "JSON" (a specific digital format), but the hospital's main computer only understands "FHIR" (a strict, standardized medical language).

Usually, a human programmer would have to write a translator to convert the device's language into the hospital's language. But in this paper, the authors are trying to do this automatically using Artificial Intelligence (AI), specifically a type called a Large Language Model (LLM).

Here is the problem: AI is great at writing code, but it's also known to "hallucinate" (make things up) or make subtle mistakes. In a medical setting, a tiny error in code could be dangerous. You can't just trust the AI; you need a guarantee that the translation is perfect.

The Solution: A "Teacher" and a "Proofreader"

The authors built a system that acts like a creative partnership between two distinct roles:

  1. The Creative Writer (The AI): This is the LLM. It acts like a fast, imaginative writer who tries to draft the translation code. It uses a technique called an "evolutionary algorithm," which is like natural selection. The AI drafts a code, checks if it works, and if it fails, it tries again, learning from its mistakes and mixing ideas from previous attempts to get better.
  2. The Strict Proofreader (The Formal Verifier): This is a mathematical tool called PVS (Prototype Verification System). Think of this as a super-strict math teacher who doesn't care if the code looks right or if it works on a few test cases. The teacher demands a mathematical proof that the code will always work correctly, no matter what data is fed into it.

How they work together:
The AI writes a draft. The Proofreader checks it.

  • If the Proofreader says, "This is mathematically impossible," the AI tries again.
  • If the Proofreader says, "I have a proof that this is 100% correct," the system accepts the code and stops.

The Real-World Test: The Pulse Oximeter

To test this, the authors tried to integrate a pulse oximeter into their system.

  • The Input: The device sends data in a messy, custom format.
  • The Output: The system needs that data in a clean, standard medical format (FHIR).

They ran the system 10 times. Here is what happened:

  • Success: In every single run, the system eventually found a translation that the Proofreader could mathematically verify as perfect.
  • Speed: On average, it found a working solution in about 10 minutes.
  • Cost: It cost less than $1.00 in computer processing fees to find the first working solution.
  • Consistency: Even though the AI tried different paths and made different mistakes along the way, every single successful run ended up with the exact same correct result. This proves the system isn't just getting lucky; it's finding the one true mathematical answer.

Why This Matters (According to the Paper)

The paper claims this is a breakthrough for "Medical Internet of Things" (MIoT). It shows that you can use AI to write code for connecting new medical devices without needing a human programmer to sit there and check every line. The "Proofreader" (formal verification) acts as a safety net, ensuring that the code generated is trustworthy and reliable before it is ever used.

In short, they built a system where an AI does the heavy lifting of writing code, but a mathematical engine acts as the final gatekeeper to ensure the code is safe for medical use.

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 →