すべてのプロダクト
Search
ドキュメントセンター

Platform For AI:エージェントツール呼び出し蒸留

最終更新日:Sep 29, 2026

エージェントツール呼び出し蒸留テンプレートは、マルチターンツール呼び出しの SFT データセットを大規模に構築します。ロールペルソナを起点に、複数ステップのタスクを合成し、要件ファジングを行い、ツール定義を検証し、ツール呼び出しトラジェクトリのロールアウトを実行し、ルーブリック評価で最良のトラジェクトリを選択します。これにより、小規模なモデルにマルチターンツール呼び出しとタスク分解を学習させるトレーニングデータを生成します。

テンプレートの概要

このテンプレートは、小規模なモデルにマルチターンツール呼び出しとタスク分解を学習させます。パイプラインはロールペルソナを起点に複数ステップのタスクを合成し、曖昧なユーザーリクエストとツール定義の検証をシミュレーションします。続いて教師モデルが、完全なツール呼び出しトラジェクトリのロールアウトを複数回実行し、ルーブリック評価で最良のトラジェクトリを選択して、エージェント機能のトレーニング用 SFT データセットを生成します。

重要

このテンプレートは単一ステージの作成のみをサポートします:蒸留データの構築。生徒モデルのトレーニングステージは含まれません。蒸留の完了後、生成された SFT データセットを使用して、生徒モデルをお客様自身でトレーニングしてください。

エージェントツール呼び出し蒸留パイプラインは、次のステップで構成されます:

ステップ

名前

説明

1

タスク合成

ロールペルソナに基づき、複数ステップの操作とツール連携が必要なタスクを合成します。

2

要件ファジング

明確なタスクを、実際のユーザーがよく行う曖昧な表現に書き換えます。これにより、モデルが能動的に明確化し、追加の質問を行えるようにトレーニングします。

3

ツール検証

各タスクに必要なツール定義が完全で利用可能であることを検証します。ツール定義が欠落している、または矛盾しているタスクは破棄します。

4

トラジェクトリのロールアウト

教師モデルがアシスタントとして動作し、各タスクを解決します。同時に、ツールの応答とユーザーからの追加の質問をシミュレーションします。各タスクは、後続の選択に備えて複数回ロールアウトされます。

5

ルーブリックに基づく選択

各トラジェクトリをルーブリックに照らしてスコアリングし、複数回のロールアウトから上位のトラジェクトリをトレーニング対象として選択します。

6

SFT データセットの構築

選択したトラジェクトリを、マルチターン会話の SFT トレーニングデータセットとして組み立てます。

操作手順

  1. PAI console にログオンします。左側のナビゲーションペインで、モデルアプリケーション > モデル蒸留 (ModelDistill) を選択します。

  2. タスクの作成 をクリックして 知識蒸留テンプレート タブに移動するか、知識蒸留テンプレート タブに直接移動します。

  3. Agent Tool Call Distillation を選択し、テンプレートの使用 をクリックして、知識蒸留ジョブの作成 ページに移動します。以下で説明する主要パラメータを設定し、その他の設定はデフォルト値のままにします。

  4. 基本設定 を設定します:

    • タスク名 :システムによって自動入力されます。

    • 出力パス :アクセス権限のある OSS パスを指定します。例:oss://mybucket.oss-cn-hangzhou-internal.aliyuncs.com/agent-distill/。

      説明

      ファイルの上書きを防ぐため、蒸留タスクごとに個別の出力ディレクトリを作成してください。OSS バケットは PAI サービスと同じリージョンに存在する必要があります。

  5. 次へ をクリックして 蒸留データ構築 に移動します:

    • [教師モデル]:教師モデルのソース をトークンサービスに設定し、ドロップダウンリストからツール呼び出し機能が強力なモデル (例:qwen3.8-max) を選択します。

    • [データセット]:アクセス権限のある OSS ディレクトリまたはファイルを選択します。サンプルデータをダウンロードして使用できます。

    • 知識蒸留の設定 :デフォルト値が事前入力されています。必要に応じて変更します。

      • agent.max_steps:タスクあたりのインタラクションターン数の上限です。デフォルト:20。

      • agent.repeat_times:タスクあたりのロールアウト反復回数です。デフォルト:2。ロールアウト回数を増やすと高品質なデータが得られますが、コストが増加します。

      • テンプレート固有の追加パラメータ (ロール温度やルーブリックなど) については、以下の [Configuration] セクションをご参照ください。

    • [計算リソース]:リソースタイプ を 汎用コンピューティングリソース に設定し、リソースのソース を パブリックリソース に設定します。次に、タスクリソース から適切な リソース仕様 (例:ecs.c6.large) を選択します。

  6. 作成 をクリックし、課金確認ダイアログで OK をクリックします。ページはタスク詳細の基本設定ページにリダイレクトされ、タスクのステータスを追跡できます。

    説明

    エージェントツール呼び出し蒸留テンプレートは、単一ステージモード (蒸留データの構築) のみをサポートします。生徒モデルのトレーニングはサポートされません。

設定

このセクションでは、エージェントツール呼び出し蒸留テンプレートに固有の主要設定パラメータについて説明します。基本設定とリソース設定は一般的な蒸留と同一です。ここでは、テンプレート固有のパラメータ差分のみを記載します。

Basic configuration

Basic configuration includes the task name and output path. The output path is the root directory for all task artifacts, including the distillation dataset. You don't need to specify a separate output path for the dataset.

Distillation data construction

Teacher model

The Agent tool call distillation template requires only one teacher model, which plays four roles: problem solver, tool simulator, user simulator, and scorer. Select a model with strong tool calling capabilities and long-context support. The teacher model source supports only PAI Token Service.

Dataset

Select an input directory or file. The data format requirements are as follows:

  • Format: JSONL seed file containing role personas.

  • Tasks and tool calling trajectories are synthesized automatically by the pipeline. No manual authoring is required.

Sample data:

{"id": "agent_001", "background": "A college student studying marine biology is planning a field trip to a coastal research station and needs to compare equipment rental prices, weather windows and permit requirements."}
{"id": "agent_002", "background": "A small business owner wants to organize a local concert on a tight budget and needs help finding venues, contacting artists and planning the promotion."}
{"id": "agent_003", "background": "A developer is preparing to migrate a service to another cloud region and needs to inventory dependencies, estimate the downtime window and draft a rollback plan."}

Distillation configuration

The distillation configuration is provided in YAML format with recommended defaults from the algorithm team. Adjust the parameters as needed. The following table lists key parameters and their descriptions.

Section

Description

dataset

  • output_path (default: distillation_dataset.jsonl): Agent trajectories are delivered as-is in .jsonl format, not flattened into single-turn Q&A pairs. You can change this to a different relative .jsonl file path.

backend

  • timeout (default: 1200.0): Maximum wait time per request in seconds. Must accommodate responses that fill max_tokens (16384). At observed throughput of 38–58 tokens/s, this requires over 400 seconds.

  • max_retries (default: 3): Number of network-level retries per request.

generation

  • system_prompt (default: "You are a helpful assistant that follows instructions precisely and uses XML tags for structured output."): System prompt used when the teacher model generates trajectories. Requires the model to follow instructions precisely and use XML tags for structured output.

  • temperature (default: 0.7): Controls generation diversity. A value of 0.7 balances diversity and stability.

  • max_tokens (default: 16384): Maximum number of tokens per generation. Multi-turn tool calling trajectories are long, so sufficient space is required.

sft

  • skip_empty (default: true): Skip empty samples.

  • min_length (default: 10): Filter out overly short samples.

  • max_length (default: 131072): Multi-turn tool calling trajectories are long. The upper limit is higher than that for text distillation.

agent

  • max_steps (default: 20): Maximum number of tool calling steps per trajectory.

  • repeat_times (default: 2): Number of rollout iterations per task for rubric-based selection.

  • max_tool_calls (default: 20): Maximum number of tool calls per turn.

  • use_rubrics (default: true): Whether to enable rubric-based selection.

pipeline

  • agent_trajectory: Problem-solving temperature is 0.7 (diversity needed). Tool simulation and user simulation temperature is 0.5 (stability needed).

  • agent_rubrics: Temperature 0.0 (scoring must be reproducible). solution_top_k defaults to 3 (keep the top-scoring trajectories per task). The max_workers parameter in each stage controls the number of concurrent threads. Lower this value if you encounter 429 rate limiting.