# ────────────────────────────────────────────────────────────────────────────
MLX-LM LoRA 파인튜닝 설정 (Gemma-3-1B-it)
# ────────────────────────────────────────────────────────────────────────────
model: "models/gemma-3-1b-it"
train: true
data: "./mlx_data"
seed: 42
# ────────────────────────────────────────────────────────────────────────────
# 1. 반복 횟수 (iters)
# 총 4,389샘플 ÷ batch_size 8 ≃ 549스텝/epoch
# 5에폭 학습 → 549 × 5 = 2,745 스텝
iters: 2745
# ────────────────────────────────────────────────────────────────────────────
# 2. 배치·메모리 최적화
# ────────────────────────────────────────────────────────────────────────────
batch_size: 8
grad_checkpoint: true
# ────────────────────────────────────────────────────────────────────────────
# 3. Learning Rate & Scheduler
# ────────────────────────────────────────────────────────────────────────────
learning_rate: 5e-5
lr_schedule:
name: cosine_decay
warmup: 200
warmup_init: 1e-7
arguments: [5e-5, 1800, 1e-7]
# ────────────────────────────────────────────────────────────────────────────
# 4. LoRA 파라미터
# ────────────────────────────────────────────────────────────────────────────
lora_layers: 6
lora_parameters:
keys:
- "self_attn.q_proj"
- "self_attn.k_proj"
- "self_attn.v_proj"
- "self_attn.o_proj"
rank: 24
alpha: 48
scale: 10.0
dropout: 0.15
# ────────────────────────────────────────────────────────────────────────────
# 5. Early Stopping
# ────────────────────────────────────────────────────────────────────────────
early_stopping:
monitor: "valid_loss"
patience: 10
min_delta: 0.0005
mode: "min"
restore_best_weights: true
verbose: true
# ────────────────────────────────────────────────────────────────────────────
# 6. 검증·체크포인트 설정
# ────────────────────────────────────────────────────────────────────────────
val_batches: -1 # 전체 validation 사용
steps_per_report: 20
steps_per_eval: 100
save_every: 100
test: true # test.jsonl이 준비된 경우에만
test_batches: -1 # 전체 test 사용