LitGPT 전체 모델 파인튜닝

LitGPT 전체 모델 파인튜닝

'full' 방식은 모델의 모든 파라미터를 파인튜닝합니다(파라미터 효율적 방법인 finetune_adapter 와 대조). 훨씬 비싸며 주로 비교 연구의 베이스라인으로 권장됩니다.

출처: finetune_full.md — 공식문서

준비(1회)

  1. README 지침대로 의존성 설치.
  2. download_model_weights 가이드대로 가중치 다운로드·변환.

LitGPT 는 Alpaca, LIMA, Dolly 같은 공통 파인튜닝 데이터셋을 제공하며 자체 데이터셋도 준비할 수 있습니다.

파인튜닝 실행

litgpt finetune_full tiiuae/falcon-7b --data Alpaca
# falcon-7b 는 각 ~40GB 메모리 GPU 8개 이상 필요 (devices 로 GPU 수 조절 가능)
# 다른 출력 디렉토리: --out_dir out/full/my-model-finetuned
# bfloat16 미지원 GPU: --precision 32-true (MPS/맥)

체크포인트는 주기적으로 out_dir 에 저장됩니다.

모델 테스트

litgpt generate tiiuae/falcon-7b   --prompt "Recommend a movie to watch on the weekend."   --finetuned_path out/full/my-model-finetuned/lit_model_finetuned.pth

자체 데이터셋으로 파인튜닝

JSON 파일에 instruction/output(및 선택 input) 쌍을 넣습니다.

[{"instruction": "Arrange the given numbers in ascending order.",
  "input": "2, 4, 0, 8, 3",
  "output": "0, 2, 3, 4, 8"}]
litgpt finetune tiiuae/falcon-7b   --data JSON --data.json_path data/mydata.json --out_dir data/mydata-finetuned

더 알아보기