CoolFace
Modelpublic

harshith0214/psse-agent-gpt-oss-20b-lora

sourceHugging Faceotherupdated 6mo agoView on Hugging Face
0likes6downloads
Model Card

PSSE Agent — GPT-OSS 20B LoRA (v2)

A LoRA adapter fine-tuned on GPT-OSS 20B for automated Power System State Estimation (PSSE) fault diagnosis.

Given a power system snapshot and WLS state estimation outputs (residuals r, normalized Lagrange multipliers λN), the model classifies the fault into one of four categories with high confidence.

Model Details

PropertyValue
Base modelunsloth/gpt-oss-20b-unsloth-bnb-4bit
ArchitectureGPT-OSS 20B (32-expert MoE)
Adapter typeLoRA (PEFT)
LoRA rank / alpha64 / 64
Target modulesq/k/v/o/gate/up/down projections + MoE experts
Trainable parameters31.85M / 20.9B (0.15%)
Training epochs3
Final train loss0.005
Final eval loss0.005
Peak GPU memory56 GB (H100 80GB)
Quantization4-bit (QLoRA)

Task

The model acts as a power-system diagnostic agent using an agentic tool-call loop:

  1. 1.Calls wls_from_path on the provided snapshot
  2. 2.Inspects residuals r and Lagrange multipliers λN
  3. 3.Optionally calls correction tools (correct_measurements_from_path, correct_parameters_from_path, correct_topology_from_path)
  4. 4.Outputs a structured JSON verdict

Output Format

json
{
  "has_error": true,
  "error_family": "parameter_error",
  "suspect_location": {"line_row": 5, "from_bus": 3, "to_bus": 4},
  "recommended_tool": "correct_parameters_from_path",
  "confidence": 0.99
}

Error Classes

ClassDescription
measurement_errorBad sensor reading — concentrated large residuals at specific channels
parameter_errorIncorrect line parameters — large Lagrange multipliers on a specific branch
topology_errorIncorrect network topology — widespread residual pattern
no_errorSystem healthy — residuals within normal bounds

Evaluation Results (held-out test set, IEEE 14-bus)

ClassPrecisionRecallF1Support
measurement_error100.0%100.0%100.0%75
no_error100.0%100.0%100.0%75
parameter_error100.0%100.0%100.0%75
topology_error100.0%100.0%100.0%71
macro avg100.0%100.0%100.0%296
  • —Overall accuracy: 296/296 (100%)
  • —Mean confidence: 0.9875
  • —Null predictions (parse failures): 0/296
Note: Evaluated on held-out samples from the IEEE 14-bus (case14) synthetic dataset. Out-of-distribution generalization to other grid topologies has not been evaluated.

Training Data

  • —Source: Synthetically generated power system diagnostic traces (case14, IEEE 14-bus system)
  • —Total samples: 1,978 (deduplicated on user snapshot)
  • —Split: 70% train (1,400) / 15% val (297) / 15% test (296)
  • —Split strategy: Stratified by error_family × tool_sequence, seed=42
  • —Format: GPT-OSS channel format (commentary{}/final{})

Usage

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="harshith0214/psse-agent-gpt-oss-20b-lora",
    max_seq_length=16384,
    dtype=None,
    load_in_4bit=True,
)
FastLanguageModel.for_inference(model)

Training Infrastructure

  • —Hardware: NVIDIA H100 80GB HBM3
  • —Framework: Unsloth + HuggingFace TRL (SFTTrainer)
  • —Optimizer: AdamW 8-bit, cosine LR schedule
  • —Learning rate: 1e-4, warmup 50 steps
  • —Batch size: 4 × 4 gradient accumulation = 16 effective

Limitations

  • —Trained and evaluated exclusively on the IEEE 14-bus (case14) synthetic test system
  • —Performance on larger or real-world grid topologies is untested
  • —Requires the GPT-OSS base model and Unsloth for inference