사전으로 돌아가기

파인튜닝

Fine-tuning
AI·머신러닝

파인튜닝은 이미 사전 학습된 모델을 작은 과제별 데이터셋으로 추가 학습해 특정 도메인이나 형식, 문체에 맞추는 기법이다. 기본 언어 능력은 베이스 모델이 제공하고, 파인튜닝은 가중치를 조정해 행동을 바꾼다. 잘 고른 예시 몇천 건이 아주 긴 프롬프트보다 나은 결과를 내는 이유다. 모든 파라미터를 갱신하는 전체 파인튜닝은 비용이 커서 실무에서는 효율적인 방법을 쓴다. LoRA는 베이스 가중치를 얼린 채 작은 저계수 어댑터만 학습하고, QLoRA는 여기에 양자화를 더해 GPU 한 장으로도 대형 모델을 다루게 한다. 어댑터는 파일이 작아 고객별로 갈아 끼울 수 있다. 출력 스키마를 강제하거나 사내 문체를 따르게 하거나 전문 용어를 익히게 하는 데 쓰이고, 큰 모델의 행동을 작은 모델로 옮기는 증류에도 쓰인다. 흔한 오해는 지식을 넣는 수단으로 보는 것이다. 자주 바뀌는 정보에는 RAG가 맞다. 데이터를 잘못 고르면 좁은 과제만 잘하고 나머지를 잊는 현상도 생긴다.

Fine-tuning is further training of an already pre-trained model on a smaller, task-specific dataset so it adapts to a domain, format, or style. The base model supplies general language ability, and fine-tuning adjusts weights to shift behaviour, which is why a few thousand good examples can outperform a very long prompt. Full fine-tuning updates every parameter and is expensive, so most work uses parameter-efficient methods. LoRA trains small low-rank adapter matrices and leaves the base weights frozen, and QLoRA adds quantization so a large model can be adapted on a single GPU; adapters are small files that can be swapped per customer. Typical uses are enforcing a strict output schema, matching a house tone, handling specialist vocabulary, and distilling a large model's behaviour into a cheaper small one. Fine-tuning teaches behaviour, not facts, and this is the usual mistake. For information that changes, retrieval-augmented generation is the right tool, since a fine-tuned model still needs retraining when the underlying data moves. Poorly curated data also causes catastrophic forgetting, where the model improves on the narrow task and gets worse at everything else.

사용 예시

  • 고객사는 사내 문서 형식을 지키게 하려고 모델을 LoRA로 파인튜닝했다
  • 자주 바뀌는 상품 정보는 파인튜닝 대신 RAG로 처리하는 편이 낫다는 결론이 나왔다
  • 파인튜닝 후 전문 과제 점수는 올랐지만 일반 대화 품질이 떨어지는 문제가 확인됐다

관련 용어