CoolFace
Datasetpublic

ADI2005/spice-circuits-finetune-v3

SPICE Circuits Fine-Tune V3 A high-quality instruction-following dataset for fine-tuning language models to generate valid, simulation-ready SPICE netlists from natural language descriptions. Dataset Summary Property Value Total entries 12,471 Format {"instruction": "...", "output": "..."} PySpice validation 100% pass ngspice simulation 99.2% pass (500-entry spot check) Filepath leaks 0 License Apache 2.0 What Makes V3… See the full description on the dataset page: https://huggingface.co/datasets/ADI2005/spice-circuits-finetune-v3.

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes90downloads
Dataset Card

SPICE Circuits Fine-Tune V3

A high-quality instruction-following dataset for fine-tuning language models to generate valid, simulation-ready SPICE netlists from natural language descriptions.

Dataset Summary

PropertyValue
Total entries12,471
Format{"instruction": "...", "output": "..."}
PySpice validation100% pass
ngspice simulation99.2% pass (500-entry spot check)
Filepath leaks0
LicenseApache 2.0

What Makes V3 Different

Spec-to-value accuracy. Component values are computed deterministically from the target specification using engineering formulas — not picked arbitrarily. If an instruction says "cutoff at 1kHz", the netlist has C = 1/(2π×R×fc) calculated exactly. If the instruction says "gain = 20", the feedback resistor satisfies Rf = gain × Rin exactly.

Dual validation. Every entry passes both PySpice structural parsing (syntax and connectivity) and ngspice .op or .ac simulation (actual circuit behavior). Entries referencing LTspice-only proprietary models are excluded.

Compound instructions. Every circuit family includes multi-specification instruction variants — e.g., "Design with VCC=12V, IC=2mA, hFE=150, voltage divider bias with 10x rule, and AC sweep from 10Hz to 100MHz."

Zero filepath contamination. All real-world entries are cleaned of filepath comment lines before inclusion.

Circuit Families Covered (27 families)

FamilyCount
BJT CE Amplifier1,304
Current Mirror (Simple/PMOS/Wilson/BJT)1,381
RC High-Pass Filter743
Cascode Amplifier (NMOS + BJT)737
RC Low-Pass Filter734
RLC Bandpass Filter708
Op-Amp Configs (inv, non-inv, diff, comp)1,621
LDO Regulator530
CMOS Gates (inverter, NAND, NOR)800
Differential Pair (NMOS + PMOS + BJT)515
Source-Degenerated NMOS388
Zener Regulator320
Op-Amp Integrator / Differentiator352
Two-Stage Miller Op-Amp181
Wien Bridge Oscillator135
Bridge Rectifier120
Common-Base BJT96
Colpitts Oscillator84
Common-Gate NMOS79
MOSFET Switch50
Other / Real V2 cleaned1,593

Data Format

Each entry is a JSON object with two fields:

json
{
  "instruction": "Design a low-pass RC filter with cutoff at 1kHz. Use R=10kΩ and calculate C to achieve exactly this cutoff.",
  "output": "* RC Low-Pass Filter — fc = 1kHz\nVIN IN 0 DC 0 AC 1\nR1 IN OUT 10k\nC1 OUT 0 15.92n\n.ac dec 50 10 100k\n.end"
}

Formulas Implemented

CircuitFormula
RC / Sallen-Key filterC = 1 / (2π × R × fc)
RLC bandpassf0 = 1/(2π√LC), Q = f0·L/R
BJT voltage divider biasR2 = VB/(10·IB), R1 = (VCC−VB)/(11·IB)
BJT CE voltage gainRC = Av × re, re = 26mV / IC
Inverting op-amp gainRf = gain × Rin
Non-inverting op-amp gainRf = (gain − 1) × Rg
Integrator / differentiatorτ = R × C
LDO feedbackVout = Vref × (1 + R1/R2)
Colpitts oscillatorf = 1/(2π√(L × Ceq))

Usage

python
from datasets import load_dataset

ds = load_dataset("ADI2005/spice-circuits-finetune-v3", split="train")
print(ds[0])

Fine-tuning format (Alpaca-style)

python
def format_entry(entry):
    return (
        f"### Instruction:\n{entry['instruction']}\n\n"
        f"### Response:\n{entry['output']}"
    )

Version History

VersionEntriesKey Improvement
V1~1,000Initial real SPICE netlists
V2~3,000Cleaned real data + basic synthetic
V312,471Deterministic formulas, ngspice verification, 27 families, compound instructions

Related