ファインチューニング手法

Python で学ぶ LLM の入門

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

ファインチューニング

LLMのファインチューニングにおける化学のユースケース

Python で学ぶ LLM の入門

フルファインチューニング

  • モデル全体の重みが更新される
  • 計算負荷が高い

完全なファインチューニング

Python で学ぶ LLM の入門

部分的ファインチューニング

  • 一部のレイヤーは固定されています
  • タスク固有のレイヤーのみ更新されます

部分的な微調整

Python で学ぶ LLM の入門

転移学習

  • 事前学習済みモデルを、異なるが関連するタスクに適応させること
  • あるドメインの知識を関連する別のドメインに活用します

転移学習のパラダイム

Python で学ぶ LLM の入門

Nショット学習

  • ゼロショット学習: 例なし
  • ワンショット学習:1つの例
  • フューショット学習: いくつかの例
Python で学ぶ LLM の入門

One-shot 学習

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...