CircuitFormer: A Circuit Language Model for Analog Topology Design from Natural Language Prompt
作者: Md Touhidul Islam, Sujan Kumar Saha, Farimah Farahmandi, Mark Tehranipoor
分类: cs.AI
发布日期: 2026-05-07
🔗 代码/项目: HUGGINGFACE
💡 一句话要点
提出CircuitFormer与电路专用分词器CKT,实现基于自然语言的模拟电路拓扑自动设计
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 电路设计自动化 大语言模型 图神经网络 网表生成 分词器优化 模拟电路
📋 核心要点
- 现有LLM在模拟电路设计中面临缺乏标注数据,且通用分词器无法有效表征电路图结构信息的挑战。
- 提出电路专用分词器CKT,通过挖掘频繁子电路实现电路拓扑的高效编码,并将词表复杂度优化至O(1)。
- CircuitFormer模型在模拟电路设计任务中达到100%语法正确率,且参数量较现有SOTA模型减少了240倍。
📝 摘要(中文)
模拟电路设计的自动化在电子设计自动化(EDA)领域长期面临挑战。尽管基于Transformer的大语言模型(LLM)在代码生成领域取得了革命性进展,但应用于模拟硬件设计时受限于两点:一是缺乏包含自然语言描述与对应网表(netlist)的标注数据集;二是通用分词器(如BPE)难以捕捉电路固有的图结构。为此,本文构建了目前最大的模拟电路网表标注数据集,包含31,341对网表与自然语言描述。此外,提出了电路专用分词器(CKT),通过挖掘频繁子电路来编码网表连通性,将词表增长复杂度从线性O(n_max)降至常数O(1)。基于此,作者训练了5.11亿参数的编码器-解码器模型CircuitFormer,在所有主要模拟电路类别中实现了100%的语法正确率和83%的功能成功率,在参数量减少240倍的情况下,性能显著优于现有主流大模型。
🔬 方法详解
问题定义:论文旨在解决模拟电路设计自动化中,自然语言提示到电路网表生成的映射难题。现有方法直接套用文本分词器(如BPE)处理网表,无法理解电路的拓扑连通性,且随着电路规模增大,词表大小呈线性增长,导致模型难以扩展。
核心思路:引入“电路即语言”的建模思想,通过挖掘电路中重复出现的子电路结构作为基本语义单元(Token),从而将复杂的网表结构转化为紧凑的序列,使Transformer能够学习电路的拓扑逻辑。
技术框架:整体流程包括:1. 数据集构建,涵盖各类模拟电路;2. CKT分词器训练,通过频繁子图挖掘算法提取电路基元;3. CircuitFormer模型训练,采用Encoder-Decoder架构,以自然语言描述为输入,生成对应的电路网表序列。
关键创新:核心创新在于CKT分词器,它打破了传统分词器随电路规模线性扩展的限制,实现了词表大小与电路复杂度解耦,显著提升了序列压缩比,使模型能更高效地捕捉电路的层级结构。
关键设计:CKT采用固定大小为512的词表,通过频繁子电路挖掘算法优化编码效率。CircuitFormer模型参数量为511M,在训练过程中针对电路网表的语法约束进行了专门的优化,确保生成的网表在EDA工具中具备极高的可执行性。
🖼️ 关键图片
📊 实验亮点
实验表明,CKT分词器相比标准BPE将序列长度缩短了57%,压缩比提升2.3倍。CircuitFormer在模拟电路生成任务中达到100%语法正确率和83%功能成功率,较现有开源大模型分别提升10%和14%,且参数量仅为后者的1/240,展现了极高的参数效率。
🎯 应用场景
该研究可广泛应用于EDA工具链的智能化升级,辅助工程师快速生成模拟电路拓扑原型。其价值在于大幅缩短电路设计周期,降低模拟电路设计的门槛,并为未来实现全自动化的硬件设计生成系统提供核心技术支撑。
📄 摘要(原文)
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.