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

Property Value
Base model unsloth/gpt-oss-20b-unsloth-bnb-4bit
Architecture GPT-OSS 20B (32-expert MoE)
Adapter type LoRA (PEFT)
LoRA rank / alpha 64 / 64
Target modules q/k/v/o/gate/up/down projections + MoE experts
Trainable parameters 31.85M / 20.9B (0.15%)
Training epochs 3
Final train loss 0.005
Final eval loss 0.005
Peak GPU memory 56 GB (H100 80GB)
Quantization 4-bit (QLoRA)

Task

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

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

Output Format

{
  "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

Class Description
measurement_error Bad sensor reading — concentrated large residuals at specific channels
parameter_error Incorrect line parameters — large Lagrange multipliers on a specific branch
topology_error Incorrect network topology — widespread residual pattern
no_error System healthy — residuals within normal bounds

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

Class Precision Recall F1 Support
measurement_error 100.0% 100.0% 100.0% 75
no_error 100.0% 100.0% 100.0% 75
parameter_error 100.0% 100.0% 100.0% 75
topology_error 100.0% 100.0% 100.0% 71
macro avg 100.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

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
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for harshith0214/psse-agent-gpt-oss-20b-lora

Adapter
(67)
this model