ファインチューニングのアプローチ

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 入門

練習しましょう!

Pythonで学ぶ LLM 入門

Preparing Video For Download...