A hands-on guide to domain customization and fine-tuning
MiniMind provides full-process fine-tuning tools to significantly improve professional scene performance, specifically:
- Data preparation phase:1) Collect domain related conversation data (e.g. medical Q&A records) 2) Convert to standard jsonl format (each line contains instruction/input/output fields) 3) 500-1000 high quality samples are recommended
- Fine-tuning technology selection:
- Base scenario: execute python train_full_sft.py -data_file . /dataset/medical.jsonl
- Higher-order solution: use LoRA technique ( python train_lora.py ), only fine-tune the adapter parameters, save 70% video memory
- Reinforcement scheme: with DPO training ( python train_dpo.py ) to further optimize the output with human preference data
- Effectiveness Verification:1) Test domain-specific questions using eval_model.py 2) Compare answer accuracy before and after fine-tuning 3) Monitor overfitting by wandb visualization of loss curves
The medical customer service scenario empirical tests show that after 2000 data fine-tuning, the accuracy of terminology recognition can be improved from 42% to 78%.
This answer comes from the articleMiniMind: 2 hours from scratch training 26M parameters GPT open source toolsThe































