# v0.5.0 classifier CE-only full run — promoted from the smoke (val_macro_f1=0.444 at step 2000).
#
# CE-only = CRF NLL term dropped from training. CRF stays at inference via frozen mask + Viterbi.
# This fixes the 9-run dual-loss curvature-conflict divergence (CRF gradient dominated CE by 8-20×
# in the conflict regime below loss ~0.41. model was being dragged off its CE-preferred basin).
#
# Identical to v0_5_0-classifier-ce-only-smoke.yaml except:
#   - max_steps: 2000 → 50000
#   - eval_every_steps: 500 → 2500
#   - save_every_steps: 2000 → 500 (gfx1103 GPU hang resilience)
#   - log_every_steps: 50 → 100
#   - train_rows_per_epoch: 1000000 (unchanged)
#   - output_dir: ce-only-smoke → ce-only-full
#
# Launch:
#
#   node packages/mailwoman/tools/training/launch/launch.run.ts start --config v0_5_0-classifier-ce-only-full.yaml

data:
  corpus_dir: /data/corpus/versioned/v0.4.0/corpus-v0.4.0
  tokenizer_dir: /data/models/tokenizer/v0.5.0-a1
  max_length: 128
  country_weights:
    US: 1.0
    FR: 1.0
  source_weights:
    wof-admin: 2.0
    wof-postalcode: 2.0
    ban: 3.0
    tiger: 4.0
    usgov-nppes: 2.0
    usgov-hrsa-fqhc: 2.0
    usgov-imls-pls: 2.0
    usgov-nad: 1.0
    state-ia-contractors: 2.0
    state-tx-notaries: 1.5
    state-ny-notaries: 2.0
  train_rows_per_epoch: 1000000
  val_rows: 2048
  coarse_filter: true

model:
  hidden_size: 256
  num_hidden_layers: 6
  num_attention_heads: 4
  intermediate_size: 1024
  max_position_embeddings: 128
  type_vocab_size: 1
  hidden_dropout_prob: 0.1
  attention_probs_dropout_prob: 0.1
  use_crf: true
  label_smoothing: 0.0
  crf_normalization: per_sequence
  crf_loss_weight: 0.0
  use_phrase_priors: false
  phrase_feature_dim: 10

train:
  output_dir: /data/models/checkpoints/v0_5_0-classifier-ce-only-full
  seed: 42
  batch_size: 16
  eval_batch_size: 16
  grad_accum_steps: 8
  learning_rate: 1.5e-4
  weight_decay: 0.01
  warmup_steps: 500
  grad_clip_norm: 1.0
  max_steps: 50000
  eval_every_steps: 2500
  save_every_steps: 500
  log_every_steps: 100
  precision: bf16
  num_workers: 0
  csv_log_path: "{output_dir}/train_log.csv"
  lr_schedule: constant

eval:
  golden_dir: ""
  val_jsonl: ""
