CktFormalizer: Autoformalization of Natural Language into Circuit Representations
Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Xiachong Feng, Chaofan Tao, Ngai Wong · 2026
Read CktFormalizer: Autoformalization of Natural Language into Circuit Representations by Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Xiachong Feng, Chaofan Tao, Ngai Wong (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-07782.txt.
Introduction
Jing Xiong and seven co-authors build infrastructure to let language model agents design real circuits inside a proof assistant. Hardware is the bottleneck in agent-driven design: agents struggle to express, compile, and refine designs in a tight loop. Their CktLean system embeds a typed hardware language in Lean, with compilation to SystemVerilog and interactive proof feedback.
On top of it, CktFormalizer generates, repairs, and optimizes hardware and proves source-level equivalence. Across four benchmark suites, compilation rates ran from about ninety-one to over ninety-nine percent, and nearly all simulation-passing designs completed synthesis and layout checks. Interactive proof-state feedback raised equivalence proof completion noticeably, and hardware feedback drove area reductions of up to about fifty-nine percent in the optimization loop.
Catalog record
| CREATOR | Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Xiachong Feng, Chaofan Tao, Ngai Wong |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 65 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.07782
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
CktFormalizer: Autoformalization of Natural Language into Circuit Representations Jing Xiong, Qi Han, Chenchen Ding, He Xiao, Xiachong Feng, Chaofan Tao, Ngai Wong Abstract LLMs can generate hardware descriptions from natural language specifications, but the resulting Verilog often contains width mismatches, combinational loops, and incomplete case logic that pass syntax checks yet fail in synthesis or silicon. We present CktFormalizer , a framework that redirects LLM-driven hardware generation through a dependently-typed HDL embedded in Lean 4. Lean serves three roles: (i) type checker :dependent types encode bit-width constraints, case coverage, and acyclicity, turning hardware defects into compile-time errors that guide iterative repair; (ii) correctness firewall :compiled designs are structurally free of defects that cause silent backend failures (the baseline loses 20% of correct designs during synthesis and routing; CktFormalizer preserves all of them); (iii) proof assistant :the agent constructs automated theorem equivalence proofs over arbitrary input sequences and parameterized widths, beyond the reach of bounded SMT-based checking. On VerilogEval (156 problems), RTLLM (50 problems), and ResBench (56 problems), CktFormalizer achieves simulation pass rates competitive with direct Verilog generation while delivering substantially higher backend realizability: 95–100% of compiled designs complete the full synthesis, place-and-route, DRC, and LVS flow. A closed-loop PPA optimization stage yields up to 35% area reduction and 30% power reduction through validated architecture exploration, with automated theorem proofs ensuring that each optimized variant remains functionally equivalent to its formal specification. 1 Introduction Hardware design remains one of the most error-prone and labor-intensive disciplines in computing. A single bit-width mismatch or missing case in a finite state machine can propagate silently through synthesis, only to surface weeks later as a silicon bug costing millions of dollars to fix. Despite decades of progress in electronic design automation (EDA), the dominant hardware description language (HDL), Verilog and VHDL, still lack the static guarantees taken for granted in software: dependent types, exhaustive pattern matching, and machine-checked proofs of correctness. Two largely independent research threads have sought to address this gap. On one hand, type-safe HDL such as Chisel ( 3 ) , Bluespec ( 22 ) , and C \lambda ash ( 2 ) embed hardware descriptions in host languages with richer type systems, eliminating entire classes of bugs at compile time. On the other hand, large language models (LLMs) demonstrate remarkable ability to generate Verilog from natural language specifications ( 27 ; 17 ) , promising to democratize hardware design by lowering the barrier to entry. Yet these two threads remain disconnected: LLM-generated Verilog inherits the pitfalls of the target language and the ambiguity of natural language, while type-safe HDLs still require expert knowledge to use effectively. Table 1 summarizes the key differences. We argue that these threads are complementary : an HDL with dependent types provides precise, formal constraints that enable an LLM agent to reason about functional equivalence and make steady progress, particularly in settings where SMT-based (Satisfiability Modulo Theories) verification often struggles to converge. Table 1: Comparison of the traditional EDA flow and the CktFormalizer flow. Capability Trad. Ours Target language Verilog Lean DSL Compile-time width safety ✗ ✓ Comb. loop prevention ✗ ✓ Exhaustive case coverage ✗ ✓ Feedback latency Hours ms Error diagnostics EDA logs Type errors Formal equiv. proofs ✗ ✓ Auto Verilog extraction N/A ✓ In this paper, we present CktFormalizer , a framework that unifies LLM-driven code generation with formal verification by targeting a dependently-typed hardware domain-specific language (DSL) embedded in Lean ( 21 ) . Given a natural language specification, an LLM agent generates hardware whose bit-width safety, loop freedom, and case exhaustiveness are enforced at compile time. The compiled design is automatically extracted to synthesizable SystemVerilog, simulated against reference testbenches, and physically synthesized via OpenROAD ( 1 ) , an open-source digital layout implementation toolchain, with the SkyWater 130nm PDK ( 13 ) . A closed-loop PPA optimization stage feeds synthesis metrics back to the agent for iterative refinement with equivalence guarantees. The key insight behind CktFormalizer is that the compiler is the verifier . Rather than generating Verilog and hoping it is correct, the agent receives immediate, actionable feedback from Lean’s type system at every iteration, feedback that is far more informative than the cryptic warnings of a Verilog linter. This transforms the LLM’s generate-and-test loop from a stochastic search over syntactically valid programs into a type-guided refinement process that systematically narrows the space of candidate designs. Our contributions are as follows: • We introduce CktFormalizer , the first framework combining LLM-driven hardware generation with a Lean-embedded HDL, providing an end-to-end pipeline from natural language to synthesizable silicon with closed-loop PPA optimization. • We demonstrate that targeting a type-safe HDL substantially improves LLM success rates compared to direct Verilog generation, as compile-time type errors provide structured feedback that guides the agent toward correct designs. The framework further scales to industry-relevant IP such as multi-channel handshake bus interfaces (Appendix A.9 ). • We show that the framework can produce formally verified hardware, including machine-checked equivalence proofs between specifications and optimized implementations, bridging the gap between LLM-generated code and provably correct hardware. 2 Related Work Hardware Abstractions and Verification. The limitations of Verilog and VHDL motivate a rich line of work on higher-level HDLs and formal methods. Tools such as Chisel ( 3 ) , Bluespec ( 22 ) , and C \lambda ash ( 2 ) raise the level of abstraction and eliminate classes of bugs by construction, while High-Level Synthesis (HLS) ( 12 ; 7 ) compiles C/C++ to RTL at the cost of micro-architectural control. However, these tools often still rely on post-hoc formal verification via model checking ( 11 ; 4 ) or equivalence checking ( 6 ) after the RTL is generated. An alternative approach embeds hardware directly in proof assistants to enable verification by construction , such as Kami ( 10 ) and Silver Oak ( 25 ) in Coq, or ACL2 for industrial verification ( 15 ) . CktFormalizer builds on this tradition by targeting Lean ( 21 ) , leveraging its dependent types and metaprogramming to provide both seamless SystemVerilog extraction and rich compile-time feedback that uniquely benefits LLM agents. LLMs for Hardware Design. The application of LLMs to hardware design has gained momentum. Early work explored generating Verilog from English descriptions ( 23 ) , and recent general-purpose code models ( 9 ; 26 ; 19 ) and fine-tuned models such as VeriGen ( 28 ) have been evaluated on Verilog tasks using benchmarks such as VerilogEval ( 17 ) and RTLLM ( 20 ) . Conversational frameworks such as Chip-Chat ( 5 ) and ChipGPT ( 8 ) further explore multi-step hardware design flows. A common limitation across this body of work is that LLMs generate Verilog directly, inheriting all of its pitfalls: the generated code may contain width mismatches, unintended latches, or combinational loops that pass syntax checks but fail in synthesis or silicon. Our work addresses this by redirecting the LLM to target a type-safe HDL, where the compiler catches these errors immediately and provides structured feedback for iterative correction. LLM Agents and Automated Theorem Proving. Beyond single-pass generation, tool-augmented LLM agents show strong results in software engineering (e.g., ReAct ( 31 ) , SWE-agent ( 29 ) ). These agents