← Latest papers
💬 NLP

CktFormalizer: Autoformalization of Natural Language into Circuit Representations

CktFormalizer is a framework that leverages Lean 4's dependently-typed HDL to guide LLMs in generating hardware descriptions that are guaranteed to be syntactically correct, free of synthesis-breaking defects, and functionally verified through machine-checked proofs, thereby achieving near-perfect backend realizability and enabling safe, automated PPA optimization.

Original authors: Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Zunhai Su, Chaofan Tao, Ngai Wong

Published 2026-05-11
📖 4 min read☕ Coffee break read

Original authors: Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Zunhai Su, Chaofan Tao, Ngai Wong

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 asking a very talented but slightly careless architect to draw a blueprint for a house based on a verbal description.

In the traditional world of chip design, you would ask the architect to write the instructions in Verilog (a language used to describe computer chips). The architect might write a beautiful description, but because Verilog is a bit like a loose set of rules, the architect might accidentally say, "Connect a 4-inch pipe to an 8-inch pipe," or "Create a hallway that loops back into itself."

The computer checks the grammar and says, "Looks good!" But when the house is actually built (the chip is manufactured), those mistakes cause the pipes to burst or the hallway to trap people. These are expensive, silent failures that only show up weeks later.

CKTFORMALIZER is a new framework that changes the game. Instead of letting the architect write directly in the loose language of Verilog, it forces them to write in a strict, mathematical language called Lean.

Here is how it works, using a simple analogy:

1. The Strict Editor (The Compiler)

Think of Lean as a super-strict editor who knows exactly how a house must be built.

  • The Old Way: The architect writes "Connect pipe A to pipe B." The editor doesn't check sizes. Later, the construction crew finds out Pipe A is too small.
  • The CKTFORMALIZER Way: The architect tries to write "Connect Pipe A (size 4) to Pipe B (size 8)." The editor immediately slams the door and says, "Error! You cannot connect these. Fix it now."
  • The Result: The architect (an AI) gets instant feedback. They can't move forward until the sizes match perfectly. This catches "width mismatches" and "loops" before a single brick is laid.

2. The Safety Net (Type Safety)

In the old system, you might accidentally leave a door open in a room, and the house is built with a drafty, broken room. In the Lean system, the rules are so strict that it is physically impossible to write a blueprint with a broken room.

  • If the architect forgets to describe what happens when a switch is flipped, the editor says, "You missed a case! You must describe every possibility."
  • This ensures that the design is "correct by construction." If it compiles (passes the editor's check), it is guaranteed to be structurally sound.

3. The Proof of Truth (Formal Verification)

Usually, to check if a house design works, you build a tiny model and test it. Sometimes the model works, but the real house doesn't.
CKTFORMALIZER uses mathematical proofs. The AI doesn't just guess; it writes a mathematical proof that says, "This new, cheaper design does exactly the same thing as the original perfect design."

  • It's like having a mathematician prove that your new, cheaper blueprint is 100% identical in function to the original, down to the last atom, for every possible scenario, not just the ones you tested.

4. The Optimization Loop (The Smart Renovator)

Once the AI has a design that works, the system doesn't stop. It acts like a smart renovator who looks at the blueprint and says, "We can make this house 35% smaller and use 30% less energy."

  • The AI tries to rearrange the rooms (the circuit logic).
  • It builds a new version.
  • It immediately runs the "Strict Editor" again to make sure the new version still works perfectly.
  • It then runs a physical simulation to see how much space and power it saves.
  • If the new version is better and still mathematically proven to be correct, it keeps it. If not, it rolls back.

The Results

The paper tested this on hundreds of design problems (like building counters, memory units, and traffic light controllers).

  • The Baseline (Old Way): When they tried to build the chips, about 20% of the designs that looked correct on paper actually failed when they tried to manufacture them.
  • CKTFORMALIZER (New Way): 100% of the designs that passed the strict editor successfully made it through the entire manufacturing process (synthesis, placement, and routing) without failing.
  • Efficiency: The system also managed to shrink the designs and save power significantly (up to 35% less area) while proving they were still perfect.

In Summary

CKTFORMALIZER is like giving an AI architect a magic rulebook that prevents them from making mistakes before they even start drawing. Instead of building a house and hoping it doesn't collapse, it forces the architect to prove the house is solid before the first brick is ordered. This turns chip design from a game of "guess and check" into a process of "prove and build," resulting in chips that are smaller, more efficient, and guaranteed to work.

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 →