KCLNet: Electrically Equivalence-Oriented Graph Representation Learning for Analog Circuits

Peng Xu, Yapeng Li, Tinghuan Chen, Tsung-Yi Ho, Bei Yu

TL;DR

KCLNet bridges the gap between deep learning and analog circuit design by embedding Kirchhoff's Current Law (KCL) directly into a Graph Neural Network (GNN). By converting circuits into directed acyclic graphs and enforcing electrical current conservation during training, it achieves massive performance gains across critical electronic design automation (EDA) tasks like circuit classification and subcircuit detection.

What Problem Does This Paper Address?

In the world of Electronic Design Automation (EDA), machine learning has successfully optimized digital circuits by leveraging the discrete, predictable rules of Boolean algebra. Analog circuits, however, remain a stubborn bottleneck. They operate in continuous domains and are highly sensitive to physical characteristics, parasitics, and process variations, making analog design a slow, manual, and error-prone process.

While researchers have tried using Graph Neural Networks (GNNs) to model analog circuits, standard approaches treat circuits as undirected graphs. This ignores the actual direction of current flow and misses fundamental physical constraints. Without these physical priors, standard AI models struggle to generalize across different circuit topologies.

Methods

To inject domain-specific physics into machine learning, the authors introduce KCLNet, which consists of three core components:

  1. Directed Acyclic Circuit Graph Conversion: Instead of treating a circuit as an undirected network, KCLNet uses topological sorting to convert it into a Directed Acyclic Graph (DAG). It designates voltage nodes as "sources" (starts) and ground nodes as "sinks" (ends), aligning graph edges with the actual physical path of current flow.
  2. Electrically-Simulated Asynchronous Message Passing: Standard GNNs update all nodes simultaneously. KCLNet introduces an Asynchronous GNN (AGNN) that propagates information layer-by-layer from the voltage source down to the ground, mimicking how current actually moves through a circuit.
DAG conversion and asynchronous message passing scheme.
  1. Electrically Equivalent Contrastive Learning (KCL Loss): This is the core innovation. Inspired by Kirchhoff’s Current Law—which states that current entering a junction must equal the current leaving it—the model enforces that the sum of node embeddings at equivalent depths must be equal (Positive Pairs). To prevent the model from cheating or collapsing, it creates "Hard Negatives" by intentionally dropping out the highest-current node embeddings, creating an electrical contradiction that forces the network to truly learn circuit physics.
The framework of the physics-guided contrastive learning scheme (KCL Loss).

Datasets

The authors evaluated KCLNet by expanding the open-source ANALOG topology dataset into three large-scale task benchmarks:

  • ANALOG-CLS-428k: 428,320 samples across 12 general circuit classes for analog circuit classification.
  • ANALOG-DET-242k: 242,320 samples for analog subcircuit detection.
  • ANALOG-GED-194k: 194,000 mutated circuit pairs used to predict Graph Edit Distance (GED) to evaluate structural similarity preservation.

Key Insights and Ideas

  • Physics as a Regularizer: Kirchhoff's Current Law isn't just for circuit simulators; it serves as an excellent inductive bias for neural networks. Enforcing embedding equality across graph depths keeps the embedding space orderly and physically meaningful.
  • Smart Negative Sampling: Traditional contrastive learning relies on random graph augmentations (like randomly deleting edges), which can ruin a circuit's functionality entirely. KCLNet's approach of dropping high-magnitude nodes creates a physical contradiction rather than a random structural mutation, forcing the model to learn the underlying electrical constraints.
  • Data Efficiency: Because KCLNet bakes physical laws directly into its architecture, it requires significantly fewer training epochs to outperform general-purpose graph pre-training methods.

Key Results

KCLNet was tested against standard GNN baselines (GCN, GIN, GraphSAGE) and general graph contrastive learning frameworks (GraphCL):

  • Analog Circuit Classification: KCLNet achieved a 20.77% absolute improvement in Acc@1 and F1-score compared to the standard GIN baseline.
  • Analog Subcircuit Detection: The model achieved a staggering 43.36% gain in mean Average Precision (mAP) and a 51.02% gain in Intersection over Union (IoU) over the best-performing baseline models.
  • Graph Edit Distance (GED) Prediction: KCLNet reduced Mean Absolute Error (MAE) by up to 3.8%, proving it preserves structural and physical similarities better than vanilla GNNs.

Limitations and Future Work

While KCLNet successfully tackles current conservation, it only looks at one side of the coin. The authors note three primary directions for future research:

  1. Modeling Kirchhoff's Voltage Law (KVL): Incorporating voltage-loop constraints alongside current constraints.
  2. Advanced Encoders: Exploring more powerful backbone architectures, such as Graph Transformers, instead of standard GCN variants.
  3. Multi-Modal Inputs: Integrating raw SPICE simulation codes directly into the learning pipeline to provide richer electrical context.

Summary updated

BibTeX
@inproceedings{xu2026kclnet,
  author = {Peng Xu and Yapeng Li and Tinghuan Chen and Tsung-Yi Ho and Bei Yu},
  title = {{KCLNet: Electrically Equivalence-Oriented Graph Representation Learning for Analog Circuits}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i2.37109},
}
Figure