2026-05-09 17:21:11 +08:00
|
|
|
|
model:
|
|
|
|
|
|
name: "hfl/chinese-macbert-large"
|
|
|
|
|
|
hidden_size: 1024
|
|
|
|
|
|
num_heads: 8
|
|
|
|
|
|
dropout: 0.1
|
|
|
|
|
|
use_lora: false
|
|
|
|
|
|
|
|
|
|
|
|
data:
|
|
|
|
|
|
train_path: "data/processed/train.jsonl"
|
2026-05-09 17:56:13 +08:00
|
|
|
|
val_path: "data/processed/val.jsonl"
|
|
|
|
|
|
test_path: "data/processed/test.jsonl"
|
|
|
|
|
|
max_persona_len: 128
|
|
|
|
|
|
max_context_len: 512
|
|
|
|
|
|
max_response_len: 256
|
2026-05-09 17:21:11 +08:00
|
|
|
|
max_history_turns: 5
|
2026-05-09 17:56:13 +08:00
|
|
|
|
num_workers: 4 # DataLoader worker processes per GPU
|
2026-05-09 17:21:11 +08:00
|
|
|
|
|
|
|
|
|
|
training:
|
|
|
|
|
|
epochs: 10
|
2026-05-09 17:56:13 +08:00
|
|
|
|
per_gpu_batch_size: 32 # 4 GPUs × 32 = 128 effective batch per step
|
|
|
|
|
|
gradient_accumulation_steps: 1 # effective_batch = per_gpu × n_gpu × accum
|
2026-05-09 17:21:11 +08:00
|
|
|
|
lr: 2e-5
|
|
|
|
|
|
warmup_steps: 200
|
|
|
|
|
|
weight_decay: 0.01
|
|
|
|
|
|
gradient_clip: 1.0
|
2026-05-09 17:56:13 +08:00
|
|
|
|
eval_steps: 200 # global steps between validation runs
|
|
|
|
|
|
mixed_precision: "bf16" # RTX 5090 has native BF16; use "fp16" for older GPUs
|
|
|
|
|
|
seed: 42
|
2026-05-09 17:21:11 +08:00
|
|
|
|
|
|
|
|
|
|
loss_weights:
|
2026-05-09 17:56:13 +08:00
|
|
|
|
binary: 1.0
|
|
|
|
|
|
level: 1.0
|
2026-05-09 17:21:11 +08:00
|
|
|
|
primary: 1.0
|
2026-05-09 17:56:13 +08:00
|
|
|
|
fine: 1.0
|
2026-05-09 17:21:11 +08:00
|
|
|
|
|
|
|
|
|
|
evaluation:
|
|
|
|
|
|
binary_threshold: 0.5
|
2026-05-09 17:56:13 +08:00
|
|
|
|
fine_threshold: 0.4
|
2026-05-09 17:21:11 +08:00
|
|
|
|
|
|
|
|
|
|
logging:
|
2026-05-09 17:56:13 +08:00
|
|
|
|
project: "CompanionGuard-RL"
|
|
|
|
|
|
run_name: "detector-macbert-4gpu"
|
2026-05-09 17:21:11 +08:00
|
|
|
|
use_wandb: true
|
|
|
|
|
|
|
|
|
|
|
|
output:
|
|
|
|
|
|
checkpoint_dir: "checkpoints/detector"
|