Circuit Transformer: A Transformer That Preserves Logical Equivalence
Xihan Li, Xing Li, Lei Chen, Xing Zhang, Mingxuan Yuan, Jun Wang

TL;DR
The paper introduces the Circuit Transformer, a neural model that generates logic circuits strictly equivalent to Boolean functions, ensuring correctness and outperforming existing methods in producing compact, accurate circuits.
Contribution
A novel generative neural model with a decoding mechanism that guarantees logical equivalence, advancing neural approaches in circuit synthesis.
Findings
Outperforms existing neural methods on benchmarks
Generates more compact and accurate circuits
Strictly preserves logical equivalence during generation
Abstract
Implementing Boolean functions with circuits consisting of logic gates is fundamental in digital computer design. However, the implemented circuit must be exactly equivalent, which hinders generative neural approaches on this task due to their occasionally wrong predictions. In this study, we introduce a generative neural model, the "Circuit Transformer", which eliminates such wrong predictions and produces logic circuits strictly equivalent to given Boolean functions. The main idea is a carefully designed decoding mechanism that builds a circuit step-by-step by generating tokens, which has beneficial "cutoff properties" that block a candidate token once it invalidate equivalence. In such a way, the proposed model works similar to typical LLMs while logical equivalence is strictly preserved. A Markov decision process formulation is also proposed for optimizing certain objectives of…
Peer Reviews
Decision·ICLR 2025 Poster
a. A decoding mechanism that builds circuits step-by-step using tokens with "cutoff properties" to block invalid tokens. b. A "Circuit Transformer" model incorporates this mechanism as a masking layer. c. Formulation of equivalence-preserving circuit optimization as a Markov decision process
1. It is not clear why we need circuit transformer. What does this approach buy compared to existing commercial tools for performing logic synthesis from truth tables? There are methods like the Quine-McCluskey method and its many optimized variants built into commercial logic synthesis tools that can handle Boolean functions of a much larger scale than what this paper proposes. Without a comparative analysis with logic synthesis, this paper's motivation is unclear. 2. Scalability: While the pa
- A novel transformer-based method to generate a circuit while preserving the semantics of the original Boolean function. - Experiments show good performance compared with other methods.
- The motivation and intuition behind the proposed method are not immediately clear. Including a concrete illustrative example or practical application would significantly aid in understanding the approach. - The authors provide an example illustrating how a feasible circuit can be constructed using the proposed method, but the process for selecting each token $s_i$ is not explicitly explained in the example. This leaves ambiguity about whether the selection is deterministic or nondeterministic,
Representing circuits sequentially with cutoff properties is novel and integrates well with sequential generative methods such as Transformers. Formally guaranteeing the correctness of a generative solution is immensely important for circuit design. The authors show that an inherently sound generative process is beneficial compared to validating solutions past generation. Integrating symbolic methods into the generative process not only gives formal guarantees on the result but also improves p
## Related Work I believe the related work (line 155ff, Schmitt et al. d’Ascoli et al.) is relevant because of the similarity in the domains and the usage of Transformers. While I agree that feasibility guarantees are important for tasks requiring correctness, it may be challenging to attribute the failure cases in related works solely to their absence, given the differences in task complexities. Both related works target very different tasks than this work. Because of the incomparability of th
Code & Models
Videos
Taxonomy
TopicsAnalog and Mixed-Signal Circuit Design · Sensor Technology and Measurement Systems
MethodsAttention Is All You Need · Linear Layer · Layer Normalization · Multi-Head Attention · Softmax · Dropout · Byte Pair Encoding · Absolute Position Encodings · Residual Connection · Position-Wise Feed-Forward Layer
