Microsoft SkillOptを用いたインストルメント付きプロンプト最適化の実装、スキル進化分析およびベースライン比較に関するコーディングチュートリアル
マイクロソフトの SkillOpt ツールを用いた、OpenAI 互換モデルによるプロンプト最適化とスキル進化の具体的な実装手順と評価結果を解説する技術記事である。
キーポイント
SkillOpt の環境構築と設定
Google Colab 上で SkillOpt リポジトリをクローンし、OpenAI API キーを設定して gpt-4o を最適化モデル、gpt-4o-mini をターゲットモデルとして構成する手順が示されている。
最適化ループの実行とメカニズム
ロールアウト、反射、集約、選択、更新、検証ベースのゲートという一連のプロセスを通じて、スキルを自動的に改善する最適化ループが実行される。
詳細なパフォーマンス分析と可視化
学習履歴の監査、精度の変化の可視化、編集予算の挙動、累積トークン使用量の監視など、最適化プロセスを多角的に評価する機能が実装されている。
ベースラインとの比較検証
最適化前の元のシードスキルと、進化後のスキルを SearchQA データセット上で比較し、コストを抑えつつの性能向上を実証している。
評価用ヘルパー関数の実装
CLIコマンドを実行し、標準出力からハード/ソフトの精度を正規表現で抽出する `run_cli` と `parse_acc` 関数を定義している。
初期シードスキルとベースライン評価
SearchQA環境用の初期スキルファイルが存在しない場合はデフォルトを作成し、学習前の未見検証データセットにおけるベースライン精度を計測する。
動的なトレーニング設定の適用
RUN_KNOBS から抽出されたパラメータ(学習率、バッチサイズ、エポック数など)を動的にコマンドライン引数として伝達し、スローアップデートとメタスキル機能を有効化した最適化ループを実行します。
影響分析・編集コメントを表示
影響分析
この記事は、LLM のプロンプトエンジニアリングを自動化・体系化する「SkillOpt」というツールの実用的な導入ガイドを提供しており、開発者がコスト効率よくモデル性能を向上させるための具体的なロードマップを示しています。特に、最適化プロセスの各ステップを可視化し、定量的に評価できる点は、AI アプリケーションの開発現場における品質保証とリソース管理に大きな影響を与える可能性があります。
編集コメント
プロンプト最適化の自動化ツールを、具体的なコード例とともに解説しており、実務での導入検討に役立つ詳細な技術情報を含んでいます。
本チュートリアルでは、Microsoft SkillOpt 向けの計測済みワークフローを実装します。SkillOpt リポジトリを設定し、OpenAI 互換モデルへのアクセスを接続し、最適化器とターゲットモデルを構成して、コストを管理可能な範囲に抑えるためにサンプル数を制限した SearchQA 最適化パイプラインを実行します。まず、元のシードスキル(seed skill)をベースラインとして評価し、その後、SkillOpt がロールアウト(rollout)、リフレクション(reflection)、集約(aggregation)、選択(selection)、更新(updating)、および検証に基づくゲート(validation-based gating)を通じてスキルを改善する実際の最適化ループを実行します。その過程で、トレーニング履歴を検索し、精度の変化を可視化し、編集予算(edit-budget)の挙動を確認し、累積トークン使用量を監視し、進化したスキルと元のベースラインを比較します。
SkillOpt 環境セットアップ
コードをコピーしました
別のブラウザを使用してください
import os, re, json, glob, subprocess, pathlib, difflib
try:
from google.colab import userdata
OPENAI_KEY = userdata.get("OPENAI_API_KEY")
except Exception:
OPENAI_KEY = os.environ.get("OPENAI_API_KEY", "")
OPENAI_KEY = OPENAI_KEY or "sk-PASTE-YOUR-KEY-HERE"
assert OPENAI_KEY.startswith("sk-"), "Set a real OpenAI key (Colab Secrets -> OPENAI_API_KEY)."
OPTIMIZER_MODEL = "gpt-4o"
TARGET_MODEL = "gpt-4o-mini"
RUN = "outputs/searchqa_adv"
LIMIT = 24
RUN_KNOBS = dict(num_epochs=2, batch_size=8, minibatch=4, merge_batch=4,
workers=2, lr=4, lr_sched="cosine", limit=LIMIT)
if not pathlib.Path("/content/SkillOpt/scripts/train.py").exists():
subprocess.run("git clone --depth 1 https://github.com/microsoft/SkillOpt.git",
shell=True, cwd="/content")
subprocess.run('pip -q install -e .
必ずJSON形式で返してください。translation フィールドのみ。他のフィールド(technical_terms 等)は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
&& pip -q install "openai>=1.0" pandas matplotlib',
shell=True, cwd="/content/SkillOpt")
os.chdir("/content/SkillOpt")
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://api.openai.com/v1"
os.environ["AZURE_OPENAI_API_KEY"] = OPENAI_KEY
os.environ["AZURE_OPENAI_AUTH_MODE"] = "openai_compatible"
SPLIT = "data/searchqa_id_split"
CFG = "configs/searchqa/default.yaml"
COMMON = ["--azure_openai_endpoint","https://api.openai.com/v1",
"--cfg-options","model.backend=azure_openai",
"model.azure_openai_auth_mode=openai_compatible"]
SkillOpt を実行するための Colab 環境を完全に用意します。OpenAI API キーを読み込み、最適化アルゴリズムと対象モデルを定義し、SkillOpt リポジトリをクローンして必要な依存関係をインストールします。また、SkillOpt スクリプトが選択されたモデルと通信できるように、OpenAI 互換バックエンドを設定します。
ベースライン Skill 評価
コードをコピーしました
別のブラウザを使用してください
def run_cli(args, tag):
print("\n" + "#"*80 + f"\n# {tag}\n# $ " + " ".join(args) + "\n" + "#"*80)
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
buf = []
for line in p.stdout:
print(line, end=""); buf.append(line)
p.wait(); return "".join(buf)
def parse_acc(txt):
m = re.search(r"Results:\s*hard=([\d.]+)\s+soft=([\d.]+)", txt)
if m: return {"hard": float(m.group(1)), "soft": float(m.group(2))}
g = re.findall(r"hard=([\d.]+)", txt)
return {"hard": float(g[-1]), "soft": None} if g else None
seed = "skillopt/envs/searchqa/skills/initial.md"
if not pathlib.Path(seed).exists():
seed = "baseline_skill.md"; pathlib.Path(seed).write_text("You answer questions from the given context.\n")
base_out = run_cli(["python","scripts/eval_only.py","--config",CFG,
"--skill",seed,"--split","valid_unseen","--split_dir",SPLIT,
"--target_model",TARGET_MODEL,*COMMON,
"env.workers=1",f"env.limit={LIMIT}"],
"BASELINE EVAL (env seed skill, no training)")
base = parse_acc(base_out)
我々は、SkillOpt コマンドを実行し、出力から評価精度を抽出するためのヘルパー関数を定義します。次に、SearchQA 環境で使用される初期シードスキル(seed skill)の場所を確認し、未見の検証分割(validation split)上でこれを評価します。これにより、最適化やトレーニングが何ら行われる前のベースライン結果を得ることができます。
トレーニングと可視化
コードをコピーしました
別のブラウザを使用してください
k = RUN_KNOBS
train_out = run_cli(["python","scripts/train.py","--config",CFG,"--split_dir",SPLIT,
"--optimizer_model",OPTIMIZER_MODEL,"--target_model",TARGET_MODEL,"--out_root",RUN,
*COMMON,
"train.train_size=0",
f"train.num_epochs={k['num_epochs']}", f"train.batch_size={k['batch_size']}",
f"gradient.minibatch_size={k['minibatch']}", f"gradient.merge_batch_size={k['merge_batch']}",
f"gradient.analyst_workers={k['workers']}",
f"optimizer.learning_rate={k['lr']}", f"optimizer.lr_scheduler={k['lr_sched']}",
"optimizer.use_slow_update=true", "optimizer.use_meta_skill=true",
f"env.workers={k['workers']}", f"env.limit={k['limit']}"],
"TRAIN (rollout->reflect->aggregate->select->update->gate; slow-update + meta-skill)")
import pandas as pd, matplotlib.pyplot as plt
hist = json.loads(pathlib.Path(f"{RUN}/history.json").read_text())
df = pd.json_normalize(hist)
print("\nhistory.json columns:", list(df.columns))
def col(*cands):
for c in cands:
for actual in df.columns:
if c in actual.lower(): return actual
return None
c_step = col("step")
x = df[c_step] if c_step else range(len(df))
c_tr, c_va = col("train_acc","train_hard","train"), col("val_acc","val_hard","valid","val")
c_lr, c_tok = col("edit_budget","lr","learning_rate","budget"), col("token","cost")
fig, ax = plt.subplots(1, 3, figsize=(16,4))
if c_tr: ax[0].plot(x, df[c_tr], "o-", label="train acc")
if c_va: ax[0].plot(x, df[c_va], "s-", label="val acc (gate)")
if base and base["hard"] is not None: ax[0].axhline(base["hard"], ls="--", c="grey", label="baseline (seed)")
ax[0].set_title("Skill accuracy over steps"); ax[0].set_xlabel("step"); ax[0].legend(); ax[0].grid(alpha=.3)
if c_lr: ax[1].plot(x, df[c_lr], "d-", c="purple")
ax[1].set_title("Edit-budget / LR schedule (cosine)"); ax[1].set_xlabel("step"); ax[1].grid(alpha=.3)
if c_tok: ax[2].plot(x, pd.to_numeric(df[c_tok],errors="coerce").cumsum(), c="darkorange")
ax[2].set_title("Cumulative token usage"); ax[2].set_xlabel("step"); ax[2].grid(alpha=.3)
plt.tight_layout(); plt.savefig(f"{RUN}/training_dashboard.png", dpi=120); plt.show()
選択したオプティマイザとターゲットモデルを用いて、主要な SkillOpt 学習ループを実行します。エポック数、バッチサイズ、ミニバッチサイズ、学習率、スローアップデート、メタスキル、データ制限など、重要な学習設定を構成します。その後、トレーニング履歴を読み込み、ダッシュボード上で精度、編集予算の挙動、累積トークン使用量を可視化します。
Skill の進化を検証する
コードをコピーしました
別のブラウザを使用してください
snaps = sorted(glob.glob(f"{RUN}/skills/skill_v*.md"))
best = pathlib.Path(f"{RUN}/best_skill.md").read_text()
print("\n" + "="*80 + f"\nSKILL EVOLUTION: {len(snaps)} snapshots; diff v0 -> best_skill\n" + "="*80)
if snaps:
diff = difflib.unified_diff(pathlib.Path(snaps[0]).read_text().splitlines(),
best.splitlines(), snaps[0].split('/')[-1], "best_skill.md", lineterm="")
print("\n".join(list(diff)[:120]) or "(no textual diff captured)")
prot = re.search(r"(SLOW_UPDATE.*?)$", best, re.S)
print("\n--- protected SLOW_UPDATE block ---\n",
prot.group(1)[:1500] if prot else "(none — appears after an epoch boundary)")
patch = (sorted(glob.glob(f"{RUN}/steps/step_*/patches/*.json")) or [None])[0]
analy = (sorted(glob.glob(f"{RUN}/steps/step_*/analysis/*")) or [None])[0]
print("\n" + "="*80 + "\nTEXTUAL GRADIENT — one aggregated patch (clipped to edit budget):\n" + "="*80)
print(pathlib.Path(patch).read_text()[:1500] if patch else "(no patch files)")
print("\n--- one raw Reflect-stage analysis ---\n",
pathlib.Path(analy).read_text()[:1000] if analy else "(no analysis files)")
for name in ("slow_update", "meta_skill"):
files = sorted(glob.glob(f"{RUN}/{name}/epoch_*/*"))
print(f"\n[{name}] {len(files)} artifact(s):", [pathlib.Path(f).name for f in files[:6]])
スキルが最適化プロセス中にどのように進化するかを検証します。最初に保存されたスキルのスナップショットと最終的な最良のスキルを比較し、保護された低速更新ブロックが出現しているかを確認し、生成されたパッチと反省分析の 1 つずつを見直します。また、エポックレベルのトレーニング中に作成された低速更新およびメタスキルのアーティファクトもリストアップします。
最終評価比較
コードをコピーしました(コピー済み)
異なるブラウザを使用してください
best_out = run_cli(["python","scripts/eval_only.py","--config",CFG,
"--skill",f"{RUN}/best_skill.md","--split","valid_unseen","--split_dir",SPLIT,
"--target_model",TARGET_MODEL,*COMMON,"env.workers=1",f"env.limit={LIMIT}"],
"FINAL TEST EVAL (best_skill)")
trained = parse_acc(best_out)
print("\n" + "="*80 + "\nRESULT (hard = exact match, the gated metric)\n" + "="*80)
print(f"baseline seed skill : {base}")
print(f"trained best_skill : {trained}")
if base and trained:
print(f"hard-match lift : {trained['hard'] - base['hard']:+.4f}")
print(f"\nDeployable artifact: {RUN}/best_skill.md ({len(best)} chars)")
最終的に最適化された best_skill.md ファイルを、未見の検証スプリット上で評価します。トレーニング済みのスキルのハードマッチスコアと元のベースラインスコアを比較して改善度を測定し、最終的なリフト値とデプロイ可能な最適化済みスキルアーティファクトへのパスを出力して完了します。
結論
結論として、単にトレーニングコマンドを実行するだけでなく、完全な SkillOpt 実験を構築しました。ベースラインとなるシードスキルを測定し、より強力なモデルをオプティマイザーとして、より小さなモデルを対象エージェントとして用いて最適化を行いました。また、保存されたスナップショット、パッチ、リフレクション、スローアップデート、メタスキルアーティファクトを通じて、トレーニングステップ全体にわたるスキルの進化を検証しました。さらに、最適化プロセスがパフォーマンスを向上させているか、実行中にトークン使用量がどのように蓄積するかを理解するためのトレーニングダッシュボードも生成しました。最終的には、デプロイ可能な best_skill.md ファイル、未見の検証スプリットに対する最終評価、および元のスキルと最適化されたスキルの明確な比較結果が得られました。
ノートブック付きの完全なコードをチェックしてください。また、Twitter でフォローすることもお気軽にどうぞ。15 万人以上の ML サブレッドに参加し、ニュースレターを購読することを忘れないでください。待ってください!Telegram をご利用ですか?今なら Telegram でも私たちに参加できます。
GitHub リポジトリや Hugging Face ページ、製品リリース、ウェビナーなどのプロモーションのためにパートナーシップをご検討の場合は、ぜひご連絡ください。
本記事「計測型プロンプト最適化、スキル進化分析、およびベースライン比較における Microsoft SkillOpt のコーディング実装」は、MarkTechPost で最初に公開されました。
原文を表示
In this tutorial, we implement an instrumented workflow for Microsoft SkillOpt. We set up the SkillOpt repository, connect it to OpenAI-compatible model access, configure the optimizer and target models, and run the SearchQA optimization pipeline with a controlled sample limit to keep costs manageable. We first evaluate the original seed skill as a baseline, then run a real optimization loop in which SkillOpt improves the skill through rollout, reflection, aggregation, selection, updating, and validation-based gating. Along the way, we inspect the training history, visualize changes in accuracy, review edit-budget behavior, monitor cumulative token usage, and compare the evolved skill with the original baseline.
SkillOpt Environment Setup
Copy CodeCopiedUse a different Browser
import os, re, json, glob, subprocess, pathlib, difflib
try:
from google.colab import userdata
OPENAI_KEY = userdata.get("OPENAI_API_KEY")
except Exception:
OPENAI_KEY = os.environ.get("OPENAI_API_KEY", "")
OPENAI_KEY = OPENAI_KEY or "sk-PASTE-YOUR-KEY-HERE"
assert OPENAI_KEY.startswith("sk-"), "Set a real OpenAI key (Colab Secrets -> OPENAI_API_KEY)."
OPTIMIZER_MODEL = "gpt-4o"
TARGET_MODEL = "gpt-4o-mini"
RUN = "outputs/searchqa_adv"
LIMIT = 24
RUN_KNOBS = dict(num_epochs=2, batch_size=8, minibatch=4, merge_batch=4,
workers=2, lr=4, lr_sched="cosine", limit=LIMIT)
if not pathlib.Path("/content/SkillOpt/scripts/train.py").exists():
subprocess.run("git clone --depth 1 https://github.com/microsoft/SkillOpt.git",
shell=True, cwd="/content")
subprocess.run('pip -q install -e . && pip -q install "openai>=1.0" pandas matplotlib',
shell=True, cwd="/content/SkillOpt")
os.chdir("/content/SkillOpt")
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://api.openai.com/v1"
os.environ["AZURE_OPENAI_API_KEY"] = OPENAI_KEY
os.environ["AZURE_OPENAI_AUTH_MODE"] = "openai_compatible"
SPLIT = "data/searchqa_id_split"
CFG = "configs/searchqa/default.yaml"
COMMON = ["--azure_openai_endpoint","https://api.openai.com/v1",
"--cfg-options","model.backend=azure_openai",
"model.azure_openai_auth_mode=openai_compatible"]
We prepare the full Colab environment for running SkillOpt. We load the OpenAI API key, define the optimizer and target models, clone the SkillOpt repository, and install the required dependencies. We also configure the OpenAI-compatible backend so the SkillOpt scripts can communicate with the selected models.
Baseline Skill Evaluation
Copy CodeCopiedUse a different Browser
def run_cli(args, tag):
print("\n" + "#"*80 + f"\n# {tag}\n# $ " + " ".join(args) + "\n" + "#"*80)
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
buf = []
for line in p.stdout:
print(line, end=""); buf.append(line)
p.wait(); return "".join(buf)
def parse_acc(txt):
m = re.search(r"Results:\s*hard=([\d.]+)\s+soft=([\d.]+)", txt)
if m: return {"hard": float(m.group(1)), "soft": float(m.group(2))}
g = re.findall(r"hard=([\d.]+)", txt)
return {"hard": float(g[-1]), "soft": None} if g else None
seed = "skillopt/envs/searchqa/skills/initial.md"
if not pathlib.Path(seed).exists():
seed = "baseline_skill.md"; pathlib.Path(seed).write_text("You answer questions from the given context.\n")
base_out = run_cli(["python","scripts/eval_only.py","--config",CFG,
"--skill",seed,"--split","valid_unseen","--split_dir",SPLIT,
"--target_model",TARGET_MODEL,*COMMON,
"env.workers=1",f"env.limit={LIMIT}"],
"BASELINE EVAL (env seed skill, no training)")
base = parse_acc(base_out)
We define helper functions to run SkillOpt commands and extract evaluation accuracy from the output. We then locate the initial seed skill used by the SearchQA environment and evaluate it on the unseen validation split. This gives us a baseline result before any optimization or training takes place.
Training And Visualization
Copy CodeCopiedUse a different Browser
k = RUN_KNOBS
train_out = run_cli(["python","scripts/train.py","--config",CFG,"--split_dir",SPLIT,
"--optimizer_model",OPTIMIZER_MODEL,"--target_model",TARGET_MODEL,"--out_root",RUN,
*COMMON,
"train.train_size=0",
f"train.num_epochs={k['num_epochs']}", f"train.batch_size={k['batch_size']}",
f"gradient.minibatch_size={k['minibatch']}", f"gradient.merge_batch_size={k['merge_batch']}",
f"gradient.analyst_workers={k['workers']}",
f"optimizer.learning_rate={k['lr']}", f"optimizer.lr_scheduler={k['lr_sched']}",
"optimizer.use_slow_update=true", "optimizer.use_meta_skill=true",
f"env.workers={k['workers']}", f"env.limit={k['limit']}"],
"TRAIN (rollout->reflect->aggregate->select->update->gate; slow-update + meta-skill)")
import pandas as pd, matplotlib.pyplot as plt
hist = json.loads(pathlib.Path(f"{RUN}/history.json").read_text())
df = pd.json_normalize(hist)
print("\nhistory.json columns:", list(df.columns))
def col(*cands):
for c in cands:
for actual in df.columns:
if c in actual.lower(): return actual
return None
c_step = col("step")
x = df[c_step] if c_step else range(len(df))
c_tr, c_va = col("train_acc","train_hard","train"), col("val_acc","val_hard","valid","val")
c_lr, c_tok = col("edit_budget","lr","learning_rate","budget"), col("token","cost")
fig, ax = plt.subplots(1, 3, figsize=(16,4))
if c_tr: ax[0].plot(x, df[c_tr], "o-", label="train acc")
if c_va: ax[0].plot(x, df[c_va], "s-", label="val acc (gate)")
if base and base["hard"] is not None: ax[0].axhline(base["hard"], ls="--", c="grey", label="baseline (seed)")
ax[0].set_title("Skill accuracy over steps"); ax[0].set_xlabel("step"); ax[0].legend(); ax[0].grid(alpha=.3)
if c_lr: ax[1].plot(x, df[c_lr], "d-", c="purple")
ax[1].set_title("Edit-budget / LR schedule (cosine)"); ax[1].set_xlabel("step"); ax[1].grid(alpha=.3)
if c_tok: ax[2].plot(x, pd.to_numeric(df[c_tok],errors="coerce").cumsum(), c="darkorange")
ax[2].set_title("Cumulative token usage"); ax[2].set_xlabel("step"); ax[2].grid(alpha=.3)
plt.tight_layout(); plt.savefig(f"{RUN}/training_dashboard.png", dpi=120); plt.show()
We run the main SkillOpt training loop with the selected optimizer and target models. We configure important training settings such as epochs, batch size, minibatch size, learning rate, slow update, meta-skill, and data limit. We then read the training history, visualize accuracy, edit-budget behavior, and cumulative token usage on a dashboard.
Inspecting Skill Evolution
Copy CodeCopiedUse a different Browser
snaps = sorted(glob.glob(f"{RUN}/skills/skill_v*.md"))
best = pathlib.Path(f"{RUN}/best_skill.md").read_text()
print("\n" + "="*80 + f"\nSKILL EVOLUTION: {len(snaps)} snapshots; diff v0 -> best_skill\n" + "="*80)
if snaps:
diff = difflib.unified_diff(pathlib.Path(snaps[0]).read_text().splitlines(),
best.splitlines(), snaps[0].split('/')[-1], "best_skill.md", lineterm="")
print("\n".join(list(diff)[:120]) or "(no textual diff captured)")
prot = re.search(r"(SLOW_UPDATE.*?)$", best, re.S)
print("\n--- protected SLOW_UPDATE block ---\n",
prot.group(1)[:1500] if prot else "(none — appears after an epoch boundary)")
patch = (sorted(glob.glob(f"{RUN}/steps/step_*/patches/*.json")) or [None])[0]
analy = (sorted(glob.glob(f"{RUN}/steps/step_*/analysis/*")) or [None])[0]
print("\n" + "="*80 + "\nTEXTUAL GRADIENT — one aggregated patch (clipped to edit budget):\n" + "="*80)
print(pathlib.Path(patch).read_text()[:1500] if patch else "(no patch files)")
print("\n--- one raw Reflect-stage analysis ---\n",
pathlib.Path(analy).read_text()[:1000] if analy else "(no analysis files)")
for name in ("slow_update", "meta_skill"):
files = sorted(glob.glob(f"{RUN}/{name}/epoch_*/*"))
print(f"\n[{name}] {len(files)} artifact(s):", [pathlib.Path(f).name for f in files[:6]])
We inspect how the skill evolves during the optimization process. We compare the first saved skill snapshot with the final best skill, check whether a protected slow-update block appears, and review one generated patch and one reflection analysis. We also list the slow-update and meta-skill artifacts created during epoch-level training.
Final Evaluation Comparison
Copy CodeCopiedUse a different Browser
best_out = run_cli(["python","scripts/eval_only.py","--config",CFG,
"--skill",f"{RUN}/best_skill.md","--split","valid_unseen","--split_dir",SPLIT,
"--target_model",TARGET_MODEL,*COMMON,"env.workers=1",f"env.limit={LIMIT}"],
"FINAL TEST EVAL (best_skill)")
trained = parse_acc(best_out)
print("\n" + "="*80 + "\nRESULT (hard = exact match, the gated metric)\n" + "="*80)
print(f"baseline seed skill : {base}")
print(f"trained best_skill : {trained}")
if base and trained:
print(f"hard-match lift : {trained['hard'] - base['hard']:+.4f}")
print(f"\nDeployable artifact: {RUN}/best_skill.md ({len(best)} chars)")
We evaluate the final optimized best_skill.md file on the unseen validation split. We compare the trained skill’s hard-match score with the original baseline score to measure the improvement. We finish by printing the final lift and the path to the deployable optimized skill artifact.
Conclusion
In conclusion, we built a complete SkillOpt experiment that goes beyond simply starting a training command. We measured the baseline seed skill, optimized it using a stronger model as the optimizer and a smaller model as the target agent, and inspected how the skill evolved across training steps through saved snapshots, patches, reflections, slow updates, and meta-skill artifacts. We also generated a training dashboard that helps us understand whether the optimization process is improving performance and how much token usage accumulates during the run. By the end, we have a deployable best_skill.md file, a final evaluation on the unseen validation split, and a clear comparison between the original and optimized skills.
Check out the Full Codes with Notebook. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? Connect with us
The post A Coding Implementation on Microsoft SkillOpt for Instrumented Prompt Optimization, Skill Evolution Analysis, and Baseline Comparison appeared first on MarkTechPost.
関連記事
AI と作る LP エディタ EGP Code を支える 4 つの仕組み
メルペイのフロントエンドエンジニアが、ランディングページを AI で作成する社内ツール「EGP Code」を支える 4 つの仕組みについて解説している。
GEPA を用いた反射的プロンプト最適化:多要素プロンプト、構造化フィードバック、検証手法の構築
MarkTechPost は、言語モデルが算数文章題を解く能力を向上させるため、GEPA という反射的プロンプト進化フレームワークの使用法を紹介している。同記事では、弱いシードプロンプトから始め、決定論的なベンチマークと構造化評価器を定義し、候補プロンプトの失敗理由を理解できる実行可能なフィードバックを提供する手法を解説している。また、指示フィールドと出力フォーマット規則が同時に進化するように設計された多要素プロンプト構成も採用されている。
Claude Code の構築から学んだこと:スキル活用方法について
Anthropic は、Claude Code の開発過程で得た教訓を共有し、同ツールがどのように「スキル」機能を活用しているかを解説した。
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み