sft-lfm2.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # SFT Training Config for QMD Query Expansion
  2. # Target: LiquidAI LFM2.5-1.2B-Instruct with LoRA
  3. #
  4. # LFM2.5 is a hybrid model: 10 conv blocks + 6 GQA attention blocks
  5. # Uses ChatML template: <|im_start|>user\n...<|im_end|>\n<|im_start|>assistant\n
  6. # No /no_think needed (not Qwen3)
  7. #
  8. # Usage: uv run train.py sft --config configs/sft-lfm2.yaml
  9. model:
  10. base: "LiquidAI/LFM2.5-1.2B-Instruct"
  11. output: "outputs/sft-lfm2"
  12. trust_remote_code: true
  13. dataset:
  14. name: "data/train-lfm2/"
  15. text_field: "text"
  16. split: "train"
  17. eval_split: 0.1
  18. training:
  19. epochs: 5
  20. batch_size: 4
  21. gradient_accumulation_steps: 4
  22. learning_rate: 2e-4
  23. max_length: 512
  24. warmup_ratio: 0.03
  25. lr_scheduler: "cosine"
  26. lora:
  27. rank: 16
  28. alpha: 32
  29. dropout: 0.0
  30. target_modules:
  31. # Convolution blocks (layers 0,1,3,4,6,7,9,11,13,15)
  32. - "conv.in_proj"
  33. - "conv.out_proj"
  34. # Attention blocks (layers 2,5,8,10,12,14)
  35. - "q_proj"
  36. - "k_proj"
  37. - "v_proj"
  38. - "out_proj"
  39. # FFN (all 16 layers)
  40. - "feed_forward.w1"
  41. - "feed_forward.w2"
  42. - "feed_forward.w3"
  43. generation:
  44. temperature: 0.1
  45. top_k: 50
  46. top_p: 0.1
  47. repetition_penalty: 1.05
  48. gguf: false # LFM2.5 hybrid arch not supported by llama.cpp
  49. tracking:
  50. project: "qmd-query-expansion"
  51. run_name: "sft-lfm2-1.2B"