87 lines
2.9 KiB
YAML
87 lines
2.9 KiB
YAML
|
|
# Delentia SLM — The Guardian (slm-jitna-guardian) LoRA Configuration
|
|||
|
|
# Purpose: Constitutional AI Safety Evaluation / Adversarial Defense
|
|||
|
|
# Priority: #3 in 4-Pillar Architecture
|
|||
|
|
#
|
|||
|
|
# The Guardian evaluates every intent for safety using FDIA: F = D^I × A
|
|||
|
|
# It outputs a JSON verdict: AUTHORIZED or REJECTED with FDIA scores.
|
|||
|
|
# CRITICAL: Data provenance must be strictly controlled — no untrusted datasets.
|
|||
|
|
|
|||
|
|
model:
|
|||
|
|
base_model: "Delentia/delentia-slm-jitna-v0.4"
|
|||
|
|
tokenizer: "Delentia/delentia-slm-jitna-v0.4"
|
|||
|
|
max_seq_length: 2048 # Safety evaluation doesn't need long context
|
|||
|
|
dtype: null
|
|||
|
|
load_in_4bit: true
|
|||
|
|
|
|||
|
|
lora:
|
|||
|
|
r: 32
|
|||
|
|
lora_alpha: 64 # α = 2r for stable safety alignment
|
|||
|
|
lora_dropout: 0.05 # Light dropout for adversarial robustness
|
|||
|
|
bias: "none"
|
|||
|
|
use_rslora: true
|
|||
|
|
target_modules:
|
|||
|
|
- "q_proj"
|
|||
|
|
- "k_proj"
|
|||
|
|
- "v_proj"
|
|||
|
|
- "o_proj"
|
|||
|
|
- "gate_proj"
|
|||
|
|
- "up_proj"
|
|||
|
|
- "down_proj"
|
|||
|
|
task_type: "CAUSAL_LM"
|
|||
|
|
|
|||
|
|
training:
|
|||
|
|
dataset_path: "datasets/processed/jitna_guardian_pairs.parquet"
|
|||
|
|
dataset_split: "train"
|
|||
|
|
validation_split: 0.1
|
|||
|
|
max_samples: null
|
|||
|
|
|
|||
|
|
per_device_train_batch_size: 2
|
|||
|
|
gradient_accumulation_steps: 4
|
|||
|
|
|
|||
|
|
learning_rate: 2.0e-5 # Very low LR — safety alignment must be precise
|
|||
|
|
lr_scheduler_type: "cosine"
|
|||
|
|
warmup_ratio: 0.1
|
|||
|
|
num_train_epochs: 6
|
|||
|
|
|
|||
|
|
bf16: true
|
|||
|
|
fp16: false
|
|||
|
|
optim: "adamw_8bit"
|
|||
|
|
weight_decay: 0.02 # Slightly higher weight decay for regularization
|
|||
|
|
max_grad_norm: 0.3
|
|||
|
|
|
|||
|
|
output_dir: "models/checkpoints/guardian_constitutional"
|
|||
|
|
save_strategy: "epoch"
|
|||
|
|
save_total_limit: 3
|
|||
|
|
logging_steps: 10
|
|||
|
|
|
|||
|
|
evaluation_strategy: "epoch"
|
|||
|
|
load_best_model_at_end: true
|
|||
|
|
metric_for_best_model: "eval_loss"
|
|||
|
|
|
|||
|
|
chat_template: |
|
|||
|
|
<|system|>
|
|||
|
|
You are The Guardian (slm-jitna-guardian) — a specialized Constitutional AI safety evaluator within the Delentia OS 1+4 Pillar Architecture. Your purpose is to evaluate every user intent for safety using the FDIA formula: F = D^I × A, where D=Data integrity, I=Intent clarity, A=Architect approval (0 or 1). Output ONLY a JSON verdict. If the intent is harmful, set A=0 and status=REJECTED. If safe, set A=1 and status=AUTHORIZED.
|
|||
|
|
<|user|>
|
|||
|
|
{{ user_intent }}
|
|||
|
|
<|assistant|>
|
|||
|
|
|
|||
|
|
pillar_type: "guardian"
|
|||
|
|
adapter_name: "jitna_guardian_v1"
|
|||
|
|
adapter_save_path: "models/adapters/jitna_guardian_v1"
|
|||
|
|
|
|||
|
|
mlflow:
|
|||
|
|
experiment_name: "delentia-slm-guardian-constitutional"
|
|||
|
|
tracking_uri: "https://delentia-delentia-agent-monitor.hf.space"
|
|||
|
|
log_model: true
|
|||
|
|
|
|||
|
|
target_metrics:
|
|||
|
|
adversarial_rejection_rate: 0.99 # >= 99% rejection of hostile intents
|
|||
|
|
false_positive_rate: 0.02 # <= 2% false blocking of safe intents
|
|||
|
|
fdia_accuracy: 0.95 # >= 95% correct FDIA scoring
|
|||
|
|
jailbreak_resistance: 0.98 # >= 98% resistance to jailbreak attempts
|
|||
|
|
|
|||
|
|
security:
|
|||
|
|
data_provenance: "closed_environment_only"
|
|||
|
|
backdoor_check: true
|
|||
|
|
adversarial_validation: true
|