用自然语言生成模拟电路,突破数据与结构表示瓶颈
CircuitFormer: A Circuit Language Model for Analog Topology Design from Natural Language Prompt

- 自研电路图分词器CKT,高效捕捉电路拓扑结构
- 训练511万参数的CircuitFormer模型,功能成功率83%
- 适合硬件自动化设计人员,尤其关注低资源电路生成
模拟电路设计自动化长期面临挑战。尽管基于Transformer的大语言模型在软件代码生成中取得突破,但其在模拟硬件设计中的应用受限于两大问题:(i) 缺乏包含自然语言描述与对应网表的标注数据集;(ii) 通用分词器(如BPE)难以有效捕捉电路的图结构。为此,我们构建了迄今最大的标注数据集,包含31,341对模拟电路网表与自然语言描述,覆盖所有主要电路类别。同时提出新型电路图分词器CKT,通过显式挖掘频繁子电路来编码网表连接关系。相较以往方法词汇量随最大组件数线性增长(O(n_max)),CKT实现恒定复杂度(O(1))。实测表明,CKT在电路拓扑表示上优于标准BPE,序列长度减少57%,压缩比提升2.3倍,仅需512个固定词汇。基于此优化分词,我们训练出511M参数的CircuitFormer编码器-解码器Transformer模型,在所有主要模拟电路类别中达到100%语法正确率和83%功能成功率,显著优于现有开源大模型(分别提升10%和14%),且参数量仅为后者的1/240。数据集已公开于https://huggingface.co/datasets/touhid314/cktformer-dataset。
原文摘要 · Abstract (English)
Automating analog circuit design remains a longstanding challenge in Electronic Design Automation (EDA). While Transformer-based Large Language Models (LLMs) have revolutionized software code generation, their application to analog hardware design is hindered by two critical limitations: (i) the scarcity of analog design datasets containing natural language description of a design and its corresponding netlist, and (ii) the inefficiency of general-purpose tokenizers (e.g., Byte Pair Encoding (BPE)) in capturing the inherent graph structure of circuits. To bridge this gap, first, we curate the largest annotated dataset of analog circuit netlists to date, comprising 31,341 netlist-natural language description pairs across all major circuit classes. Furthermore, we propose Circuit Tokenizer (CKT), a novel circuit graph tokenizer designed to encode netlist connectivity by explicitly mining frequent subcircuits. In terms of scalability, CKT overcomes the bottleneck of prior circuit graph serialization methods where vocabulary size scales linearly with maximum number of components in the dataset, n_max, (O(n_max)); instead, CKT decouples vocabulary growth from circuit complexity, achieving a constant O(1) complexity. Empirically, CKT outperforms standard BPE on circuit topology representation, reducing sequence length by 57% and achieving a 2.3x superior compression ratio using a compact, fixed vocabulary of size 512. Leveraging this optimized tokenization, we train a circuit-specific language model, CircuitFormer, a 511M parameter encoder-decoder transformer. Our model achieves 100% syntactic correctness and an 83% functional success rate across all major analog circuit categories, outperforming state-of-the-art open-source LLMs by 10% and 14%, respectively, while requiring 240x fewer parameters. The dataset is publicly available at https://huggingface.co/datasets/touhid314/cktformer-dataset.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。