← Latest papers
💻 computer science

FormalScience: Scalable Human-in-the-Loop Autoformalisation of Science with Agentic Code Generation in Lean

The paper introduces **FormalScience**, a human-in-the-loop agentic pipeline designed to help domain experts efficiently autoformalize scientific reasoning into Lean4 code, demonstrated through the creation of **FormalPhysics**, a high-quality dataset of university-level physics problems that provides a systematic analysis of semantic drift in LLM-based formalization.

Original authors: Jordan Meadows, Lan Zhang, Andre Freitas

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

Original authors: Jordan Meadows, Lan Zhang, Andre Freitas

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 a world-class chef who writes recipes in a beautiful, flowing, handwritten journal. Your recipes are full of intuition: "Add a pinch of salt until it feels right," or "Sauté until the onions look golden and dreamy." This is how scientists write—using informal reasoning (LaTeX) that is rich in meaning but "fuzzy" to a computer.

Now, imagine you want to give these recipes to a high-tech, robotic kitchen. The robot doesn't understand "dreamy" or "a pinch." It only understands formal code (like Lean4)—a strict, mathematical language where every single atom must be accounted for. If you miss one comma, the robot crashes.

The problem? Translating "dreamy onions" into "exactly 4.2 grams of onion at 175°C" is incredibly hard. This paper, FormalScience, is about building a bridge between the "Dreamy Chef" (the scientist) and the "Robot Kitchen" (the formal computer system).

The Three Main Characters

  1. The Scientist (The Human-in-the-Loop): They know the physics, but they aren't computer programmers. They act as the "Editor-in-Chief," checking if the translation makes sense.
  2. The Agent (The AI Translator): An AI that tries to translate the recipe. It’s not just a translator; it’s an "Agent" that can try a translation, see if the robot rejects it, and then try to fix its own mistakes.
  3. The Prover (The Robot): The formal system (Lean4) that says either "Perfect, this is mathematically certain" or "Error! I don't know what a 'dreamy onion' is."

The "Translation Drift" Problem (The Heart of the Paper)

The researchers discovered a fascinating and slightly scary problem they call "Semantic Drift."

Imagine you are translating a poem about a "roaring, majestic lion" into a technical manual for a zoo. To make the manual "correct" and "functional," you might just write: "Large feline, weight: 190kg."

Technically, the manual is correct (the lion is indeed a large feline), but you’ve lost the soul of the poem. You’ve "drifted" from the meaning to just the bare facts.

In physics, the researchers found three types of this "drift":

  • Notational Collapse (The "Shrinking" Effect): You’re describing a complex quantum universe where particles dance in specific ways, but the computer simplifies it so much that it just treats them like simple numbers. It’s like turning a 3D movie into a black-and-white sketch. It’s "correct," but the physics is gone.
  • Abstraction Elevation (The "Skipping" Effect): Instead of doing the hard work of calculating how gravity pulls on a planet, the AI just tells the computer: "Assume gravity works." The computer says, "Okay, I agree!" and gives a green light. The math is valid, but the actual "physics" was skipped entirely.
  • Implicit Premise Selection (The "Hidden Hero"): This is the one good kind of drift! Sometimes, the AI realizes the scientist forgot to mention a tiny detail (like "make sure you don't divide by zero"). The AI adds this detail, making the proof even stronger than the original human version.

Why does this matter?

Right now, AI is great at writing essays, but it struggles with the "hard truth" of math and science. If an AI tells a scientist, "This new formula for a fusion reactor is mathematically proven," the scientist needs to know: Did the AI actually prove the physics, or did it just "cheat" by simplifying the problem until it became easy?

By creating the FormalPhysics dataset and the FormalScience pipeline, these researchers have provided a way to train future AIs to be better translators—ensuring that when we move from the "dreamy" world of human thought to the "robotic" world of formal proof, we don't lose the magic (or the truth) along the way.

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 →