|
| 1 | +model: |
| 2 | + model_name: "prajjwal1/bert-tiny" # or your own TinyBERT |
| 3 | + num_labels: 2 |
| 4 | + use_fast_tokenizer: true |
| 5 | + |
| 6 | +data: |
| 7 | + dataset_path: "data/real_1k" |
| 8 | + max_len: 128 |
| 9 | + |
| 10 | +training: |
| 11 | + # ── bookkeeping ──────────────────────────────────────────────────────────── |
| 12 | + output_dir: "runs/student/real_1k" |
| 13 | + overwrite_output_dir: true |
| 14 | + run_name: "student_real_1k" |
| 15 | + |
| 16 | + report_to: "wandb" |
| 17 | + wandb_project: "senti_synth_student" |
| 18 | + |
| 19 | + alpha: 0.5 # hard‑vs‑soft mix |
| 20 | + temperature: 2.0 |
| 21 | + |
| 22 | + # ── batch size & epochs ──────────────────────────────────────────────────── |
| 23 | + per_device_train_batch_size: 16 # fits comfortably on 24 GB VRAM |
| 24 | + per_device_eval_batch_size: 16 |
| 25 | + gradient_accumulation_steps: 1 |
| 26 | + num_train_epochs: 50 # SST‑2 is tiny; 2–3 epochs suffice |
| 27 | + |
| 28 | + # ── precision & speed ────────────────────────────────────────────────────── |
| 29 | + fp16: false # enable mixed precision |
| 30 | + bf16: true # turn off to avoid dual precision modes |
| 31 | + # torch_dtype: "auto" # (optional) lets HF pick fastest dtype |
| 32 | + |
| 33 | + # ── optimiser & scheduler ───────────────────────────────────────────────── |
| 34 | + learning_rate: 0.00003 # good starting LR for GPT‑2 on small corpora |
| 35 | + warmup_ratio: 0.1 |
| 36 | + |
| 37 | + # ── misc performance knobs ──────────────────────────────────────────────── |
| 38 | + dataloader_num_workers: 8 |
| 39 | + gradient_checkpointing: true # big memory win on GPT‑style decoders |
| 40 | + max_grad_norm: 1.0 |
| 41 | + |
| 42 | + # ── logging, saving, early stop ─────────────────────────────────────────── |
| 43 | + logging_steps: 20 |
| 44 | + eval_steps: 100 |
| 45 | + save_steps: 100 |
| 46 | + save_total_limit: 3 |
| 47 | + load_best_model_at_end: true |
| 48 | + metric_for_best_model: "eval_f1" |
| 49 | + greater_is_better: true |
| 50 | + |
| 51 | + use_early_stopping: true |
| 52 | + early_stopping_patience: 2 |
| 53 | + early_stopping_threshold: 0.0005 |
| 54 | + |
| 55 | + do_test_eval: true |
0 commit comments