Yolo 深圳
深セン
今すぐ参加
用語集

人間のフィードバックによる強化学習(RLHF)

Reinforcement Learning from Human Feedback(RLHF)が、モデルを人間の価値観に合わせることでAIのパフォーマンスを向上させ、より安全でスマートなAIを実現する様子をご覧ください。

Reinforcement Learning from Human Feedback (RLHF) is an advanced machine learning technique that refines artificial intelligence models by incorporating direct human input into the training loop. Unlike standard supervised learning, which relies solely on static labeled datasets, RLHF introduces a dynamic feedback mechanism where human evaluators rank or rate the model's outputs. This process allows the AI to capture complex, subjective, or nuanced goals—such as "helpfulness," "safety," or "creativity"—that are difficult to define with a simple mathematical loss function. RLHF has become a cornerstone in the development of modern large language models (LLMs) and generative AI, ensuring that powerful foundation models align effectively with human values and user intent.

RLHFの中核コンポーネント

RLHFプロセスは、一般的に3段階のパイプラインに従い、生の予測能力と人間に整合した行動との間のギャップを埋めるように設計されている。

  1. 教師あり微調整(SFT):ワークフローは通常、事前学習済み基盤モデルから開始される。開発者は、専門家が作成した質問と回答のペアなど、高品質な小規模なデモンストレーションデータセットを用いて初期微調整を行う。このステップでは、タスクに求められる一般的な形式とトーンをモデルに教えることで、ベースラインポリシーを確立する。
  2. Reward Model Training: This phase is the distinguishing feature of RLHF. Human annotators review multiple outputs generated by the model for the same input and rank them from best to worst. This data labeling effort generates a dataset of preferences. A separate neural network, called the reward model, is trained on this comparison data to predict a scalar score that reflects human judgment. Tools available on the Ultralytics Platform can streamline the management of such annotation workflows.
  3. Reinforcement Learning Optimization: Finally, the original model acts as an AI agent within a reinforcement learning environment. Using the reward model as a guide, optimization algorithms like Proximal Policy Optimization (PPO) adjust the model's parameters to maximize the expected reward. This step aligns the model's policy with the learned human preferences, encouraging behaviors that are helpful and safe while discouraging toxic or nonsensical outputs.

実際のアプリケーション

RLHF has proven critical in deploying AI systems that require high safety standards and a nuanced understanding of human interaction.

  • 対話型AIとチャットボット:RLHFの最も顕著な応用例は、チャットボットを「有用」「無害」「誠実」に調整することである。偏見を含む出力、事実誤認のある出力、危険な出力を罰則化することで、RLHFはLLMにおける幻覚現象を軽減し、アルゴリズムバイアスのリスクを低減する。これにより、仮想アシスタントは正当な問い合わせには有用でありつつ、有害な指示を拒否できるようになる。
  • ロボティクスと物理制御:RLHFはテキストを超え、 複雑な物理タスクに対する完璧な報酬関数の定義が困難な ロボティクスAIの領域にまで拡張される。例えば、混雑した倉庫内を移動する方法を学習するロボットは、 どの経路が安全で、どの経路が混乱を引き起こしたかについて、人間の監督者からフィードバックを受け取ることがある。 このフィードバックは、目標達成のみに基づく単純な 深層強化学習よりも効果的に、 ロボットの制御ポリシーを洗練させる。

RLHFと標準的な強化学習の比較

RLHFの特異的な有用性を理解するには、従来の強化学習(RL)との区別が有用である。

  • 標準的なRL:従来の設定では、報酬関数は環境によってハードコードされることが多い。 例えばビデオゲームでは、環境が明確な信号を提供する(勝利で+1、敗北で-1)。エージェントは この定義されたマルコフ決定過程(MDP)内で 自身の行動を最適化する。
  • RLHF:創造的な物語を書くことや礼儀正しい運転など、多くの現実世界のシナリオにおいて、 「成功」は主観的なものです。RLHFは、ハードコードされた報酬を人間の嗜好から導出された学習型報酬モデルに置き換えることでこの問題を解決します。これにより、「品質」や「適切さ」といった明示的にプログラムすることが不可能な抽象的な概念の最適化が可能になります。

知覚とフィードバックループの統合

視覚アプリケーションにおいて、RLHFに整合したエージェントは、行動前に環境状態を認識するためにコンピュータビジョン(CV)に依存することが多い。YOLO26などの堅牢な検出器が知覚層として機能し、構造化された観測値(例:「3メートル先に障害物を検出」)を提供し、ポリシーネットワークがこれに基づいて行動を選択する。

The following Python example illustrates a simplified concept where a YOLO model provides the environmental state. In a full RLHF loop, the "reward" signal would come from a model trained on human feedback regarding the agent's decisions based on this detection data.

from ultralytics import YOLO

# Load YOLO26n to act as the perception layer for an intelligent agent
model = YOLO("yolo26n.pt")

# The agent observes the environment (an image) to determine its state
results = model("https://ultralytics.com/images/bus.jpg")

# In an RL context, the 'state' is derived from detections
# A reward model (trained via RLHF) would evaluate the action taken based on this state
detected_objects = len(results[0].boxes)

print(f"Agent Observation: Detected {detected_objects} objects.")
# Example output: Agent Observation: Detected 4 objects.

強力な知覚モデルと人間のフィードバックを通じて洗練されたポリシーを組み合わせることで、開発者は知能的であるだけでなく、AI安全原則と厳密に整合したシステムを構築できる。スケーラブルな監視技術(例:憲法AI)に関する継続的な研究はこの分野を進化させ続けており、大規模な人間によるアノテーションのボトルネックを軽減しつつ、高いモデル性能を維持することを目指している。

Ultralytics コミュニティに参加する

AIの未来を共に切り開きましょう。グローバルなイノベーターと繋がり、協力し、成長を。

今すぐ参加