Alignment Unlocks Complementarity: A Framework for Multiview Circuit Representation Learning

Zhengyuan Shi, Jingxin Wang, Wentao Jiang, Chengyu Ma, Ziyang Zheng, Zhufei Chu, Weikang Qian, Qiang Xu

TL;DR

MixGate is a novel multiview circuit representation learning framework that solves the challenge of structural heterogeneity across different Boolean circuit graphs (such as AIGs and XMGs). By enforcing functional alignment before applying masked circuit modeling, it unlocks the complementary strengths of different circuit views, significantly boosting performance on downstream Electronic Design Automation (EDA) tasks.

What Problem Does This Paper Address?

In the world of chip design and logic synthesis, Boolean circuits can be represented in various graph formats. For example, an And-Inverter Graph (AIG) provides a simple, structurally detailed view, while an XOR-Majority Graph (XMG) offers a high-level, semantically richer abstraction. Fusing these different "views" via machine learning holds immense promise for improving EDA tools.

Self-supervised techniques like Masked Language Modeling (think BERT) have revolutionized NLP and computer vision, and researchers want to apply them to circuits via Masked Circuit Modeling (MCM). However, because an AIG and an XMG look completely different structurally, a model cannot naively map them together. Without a common frame of reference, the cross-view context is perceived as pure noise, causing standard self-supervised fusion methods to fail.

Methods

The authors introduce MixGate, a framework built around an "alignment-first" training curriculum to bridge the gap between structurally diverse circuit languages.

Figure 1: The MixGate Framework. A target circuit (e.g., And-Inverter Graph, AIG) is converted into multiple complementary views: Majority-Inverter Graph (MIG), XOR-AND Graph (XAG) and XOR-Majority Graph (XMG). Dedicated graph encoders process each view, and a hierarchical circuit tokenizer efficiently organizes the resulting embeddings into structured tokens. These multi-view tokens are fused by Transformer blocks to produce a refined output embedding, which is enriched with complementary features and leads to improved performance on downstream tasks

Key components of the methodology include:

  1. Equivalence Gates Identification: Using a combination of random simulation and formal SAT sweeping, the pipeline identifies functionally identical nodes across different graph views to establish a ground truth for alignment.
  2. Equivalence Alignment Loss: Before doing any heavy cross-view fusion, the model minimizes the $L_1$ distance between the functional embeddings of these equivalent nodes, creating a shared, function-aware representation space.
  3. Hierarchical Circuit Tokenizer: Passing thousands of individual gate nodes into a Transformer is computationally prohibitive. MixGate introduces a tokenizer that aggregates node embeddings into three progressively coarser levels: hop-level, subgraph-level, and graph-level tokens.
  4. Progressive Training Curriculum: Training happens in three distinct stages:
  5. Stage 1: Focuses on basic signal probability prediction and functional alignment.
  6. Stage 2: Introduces truth-table distance prediction to refine functional semantics.
  7. Stage 3: Finally activates the multiview masked modeling loss to reconstruct masked circuit cones using the now-aligned cross-view signals.
Figure 3: Overview of hierarchical circuit tokenizer

Datasets

  • ForgeEDA: The primary dataset used for training, consisting of 1,189 large-scale, high-quality circuit designs partitioned into approximately 15,000 sub-circuits to serve as individual training samples.
  • EPFL Combinational Benchmark Suite: Used to evaluate the model's generalization and scalability on large-scale industrial circuits containing up to 58,000+ nodes and 1,600+ logic levels.

Key Insights and Ideas

  • Alignment is a Strict Precondition: The most critical finding is that masking alone actually hurts performance. Without functional alignment acting as a "Rosetta Stone," the Transformer cannot understand why two completely different subgraphs behave identically, treating the alternative view as noise.
  • Handling Degraded Gates: The authors modified standard GNN aggregators to explicitly handle "degraded" gates (e.g., a Majority gate where one input is a constant 0 behaves like an AND gate). Differentiating native and degraded forms prevents the model from being misled during structural aggregation.
  • Simplicity Wins ($L_1$ over Contrastive Loss): While contrastive losses (like InfoNCE) are popular for alignment, the authors found that a simple $L_1$ loss pulling positive pairs together works better for circuits. Contrastive losses require large-scale negative sampling, which is prohibitively expensive on circuit graphs and adds 1.5× computational overhead without any accuracy benefits.

Key Results

  • The Power of Alignment + Masking: In ablation studies, using the masking objective alone degraded Signal Probability Prediction (SPP) loss by 2.02%. However, combining masking with alignment (+Mask +Align) yielded the best results, improving SPP by 7.08% and Truth-Table Distance Prediction (TTDP) by 5.02% over the baseline.
  • Multiview Fusion Gains: Refining AIG embeddings with multiview inputs (MIG, XAG, XMG) reduced TTDP loss by a remarkable 31.11% compared to single-view models.
  • Drastic Efficiency Improvements: Thanks to the hierarchical tokenizer, MixGate reduced memory usage by 25.94% and cut inference time by 48.77% in XMG refinement tasks, all while maintaining or slightly improving functional accuracy.
  • Industrial Scalability: When tested on massive EPFL benchmarks (like the div circuit with 58,798 nodes), resource consumption grew linearly rather than exponentially, proving its viability for real-world industrial EDA flows.

Limitations and Future Work

Currently, MixGate relies on SAT-based checks to generate fine-grained node-level equivalence labels. While effective, this approach is limited to graph representations derived directly from netlists.

The authors note that extending this alignment-first principle to more heterogeneous EDA modalities—such as bridging the massive semantic gap between high-level hardware description languages (RTL code) and gate-level netlists—remains an open challenge. Additionally, future work will investigate scalable approximations for equivalence discovery to bypass exact SAT solving on ultra-large-scale designs.

Summary updated

BibTeX
@misc{shi2025alignment,
  author = {Zhengyuan Shi and Jingxin Wang and Wentao Jiang and Chengyu Ma and Ziyang Zheng and Zhufei Chu and Weikang Qian and Qiang Xu},
  title = {{Alignment Unlocks Complementarity: A Framework for Multiview Circuit Representation Learning}},
  year = {2025},
  eprint = {2509.20968},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.20968},
}
Figure