파인튜닝 접근법

Python으로 배우는 LLM 입문

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

파인튜닝

 

LLMs 파인튜닝 화학 활용 사례

Python으로 배우는 LLM 입문

풀 파인튜닝

 

  • 전체 모델 가중치 업데이트
  • 계산 비용이 큼

 

풀 파인튜닝

Python으로 배우는 LLM 입문

부분 파인튜닝

 

  • 일부 레이어 고정
  • 태스크 전용 레이어만 업데이트

 

부분 파인튜닝

Python으로 배우는 LLM 입문

전이 학습

 

  • 사전 학습 모델을 관련 있지만 다른 태스크에 적응
  • 한 도메인의 지식을 관련 도메인에 전이

전이 학습 패러다임

Python으로 배우는 LLM 입문

N샷 러닝

  • 제로샷 러닝: 예시 없음
  • 원샷 러닝: 예시 1개
  • 퓨샷 러닝: 예시 여러 개
Python으로 배우는 LLM 입문

원샷 러닝

from transformers import pipeline

generator = pipeline(task="sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")

input_text = """
Classify the sentiment of this sentence as either Positive or Negative.
Example:
Text: "I'm feeling great today!" Sentiment: Positive
Text: "The weather today is lovely." Sentiment:
"""

result = generator(input_text, max_length=100)
print(result[0]["label"])
POSITIVE
Python으로 배우는 LLM 입문

Let's practice!

Python으로 배우는 LLM 입문

Preparing Video For Download...