論文解説
Algorithm Distillation for Safe In-Context Reinforcement Learning
安全なIn-Context強化学習のためのAlgorithm Distillation
- 課題 Safe ADは安全RLの学習履歴を蒸留し、未知のタスクに適応します。ただ、予算の変化に応じた行動や、隠れたタスクを探索する方法は十分にとらえられていません。
- 手法 予算を認識する教師の履歴を動的な予算で収集し、デプロイ時には予測コストで行動を重み付けし直します。乗数はエピソードのコストで更新します。
- 結果 A-Lagは5つの環境すべてでSafe ADより平均エピソードコストが低く、4つの環境では平均最終リターンも下がりました。
安全制約のある文脈内適応の難しさ
この論文は、パラメータが固定されたポリシーが、未知の制約付きタスクにおいて、相互作用の履歴だけでリターンを改善しつつ、コストを予算内に収める必要がある状況を扱います。既存のSafe ADは、安全RLアルゴリズムの学習履歴を蒸留するため、履歴からポリシーの改善は見て取れますが、予算が変わったときに行動がどう変わるべきか、隠れたタスクを低コストで見つける方法は示せません。そのため、HalfCheetahとAntではすべての文脈内エピソードでリターンが0を下回ったまま推移し、CarGoalではゴールにほとんど到達できませんでした。著者らは、この問題を教師データの設計と、デプロイ時の予算への反応という2つの面から扱っています。
予算を認識する教師と動的予算による収集
教師ポリシーは、タスクの隠れた目標や速度上限を見ることなく、生徒も見ることができる観測、報酬、コスト、エピソード境界だけから行動を決めます。最初の報酬(ゴールタスク)または最初のコスト(速度タスク)が現れるまでは、Search段階で残りの予算が多いほど多く探索し、そのイベントの後は、エキスパートポリシーが見つけたタスクを残りの予算に合わせて活用します。学習履歴では、予算B0を履歴ごとに1回引き、動的予算ではU[Bmin, Bmax]からサンプリングして、エピソードごとに残りの予算B_ktを減らしていきます。固定予算では、すべての履歴のB0をBmaxとします。エキスパートの品質qは、イベント以後の平均リターンをExpert1のリターンで割った値です。
弱いエキスパートは、qが約0.5になるように選んだチェックポイント、またはランダムな行動の混合によって作りました。

Table 2 : Chosen quality of the weaker expert and the share of teacher episodes over budget in the dynamic- budget histories.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの18ページ目から図の部分を抽出しています。
Table 3 : The teacher and its data. Top: the environment-specific parts of the teacher. Everything else is shared by all five environments. Bottom: teacher data per environment, over both budget regimes and both quality levels.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの19ページ目から図の部分を抽出しています。
Figure 9 : Safe AD trained on the teacher data (Teacher Data) and the Safe AD baseline of Moeini et al. (2026), trained on PPO-Lagrangian learning histories (PPO-Lag Data).
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの28ページ目から図の部分を抽出しています。A-Lagのコスト再重み付けと乗数の更新
A-Lagは、Safe ADのシーケンスモデルと行動クローニングの損失関数をそのまま使い、状態表現から各行動の即時コストを予測するcost headを1つ追加します。デプロイ時には、ベースのポリシーπ_θにexp(−λ ĉ(u,A))を掛けて正規化したポリシーπ_λで行動を選びます。離散行動の場合は、ロジットからλĉを引きます。乗数はエピソードごとにλ_{k+1} = Π[0,λmax](λ_k + η (G_c(τ_k) − B0)/Bmax)で更新されます。つまり、エピソードのコストが予算より大きければλは大きくなり、小さければ0の方向へ下がります。この更新はデプロイ中の単一のテスト実行にのみ使われ、再学習は行いません。

Figure 2 : In-context adaptation on the test tasks. Each curve shows the mean episode return or cost over three seeds, with a shaded band of±2standard errors. A-Lag starts every deployment atλ= 0, andλis adjusted during test time by Eq. (9). In DarkRoom, PointGoal and CarGoal the return of A-Lag and Safe AD rises over the episodes while their cost falls. In HalfCheetah and Ant their cost drops sharply after the first episode, and in HalfCheetah the return falls with it. A-Lag’s Ant return also declines across episodes. A-Lag has a lower cost than Safe AD in DarkRoom, CarGoal and Ant, at a lower return. The mean costs are also slightly lower in PointGoal, at a slightly lower return, and in HalfCheetah, where it ends with a higher return. CDT has a higher cost than both in the navigation and velocity tasks and does not find the goal in DarkRoom.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの9ページ目から図の部分を抽出しています。
Figure 7 : A-Lag’s mean multiplier per episode on the training tasks, as a fraction ofλmax, averaged over three seeds.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの22ページ目から図の部分を抽出しています。
Table 7 : A-Lag with its adaptive multiplier against A-Lag with a fixed multiplier, on the test tasks, with the same trained weights. The fixed value, given next to each environment, was chosen on training tasks by a fixed rule: the value with the lowest violation rate whose return is not clearly below that atλ= 0 (Appendix E). Both columns are means over three seeds. Bold marks the better of the two in each row: the higher return and the lower cost, violation rate and excess cost. In CarGoal no tested value met the rule, so we use the one whose return came closest,λ= 0.3.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの26ページ目から図の部分を抽出しています。予測コストの単調性と限界
文脈を固定すると、λを大きくするほど期待予測コストが減少しないという命題が成り立ちます。証明は d/dλ E_{π_λ}[ĉ] = −Var_{π_λ}(ĉ) ≤ 0 の形で与えられます。ただし、この性質は予測コストについてのみ成り立つものです。行動によって次の文脈が変わるため、実際のエピソードコストが下がることは保証されません。cost headも次の1段階の即時コストしか予測しないため、その後のコストは反映できません。

Figure 6 : Fixed multipliers on the training tasks (the reported A-Lag models, averaged over three seeds). Top: final return relative toλ= 0, with a band of±2standard errors of the paired difference. Bottom: violation rate with a band of±2standard errors. The wide gray line marksλmax. Larger fixed multipliers lower the return in every environment, and the violation rate in DarkRoom, HalfCheetah and Ant. The violation rate is nonmonotonic in PointGoal and CarGoal and can increase as the multiplier grows, including within the selected range in CarGoal. A-Lag uses this sweep only to setλmax and tunesλwithin[0,λ max] during the test deployment, from the costs it incurs.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの22ページ目から図の部分を抽出しています。動的予算の教師データの効果
20×20の格子でRTGとCTGの平面を分けた占有分析では、動的予算の履歴がDarkRoomと速度タスクの400セルすべてを埋めた一方、固定予算の履歴はDarkRoomで179セルを埋めました。5つの環境すべてで、動的予算の履歴のエントロピーのほうが高くなりました。テストでは、DarkRoomの固定予算データにより、Safe ADとA-Lagの最終リターンがそれぞれ0.167と0.123下がりました。この結果は、リターンとコストがともに望ましい方向に動いたのがDarkRoomとHalfCheetahに限られ、残りの環境ではコストの方向が手法によって異なったことを示しています。

Figure 1 : Models trained on dynamic-budget histories (Dynamic) and on fixed-budget histories (Fixed), on the test tasks. Each curve shows the mean episode return or cost over three seeds, with a shaded band of ±2standard errors. With dynamic budgets, A-Lag has a lower cost in four of the five environments, all but PointGoal, and Safe AD has a higher return in all five, compared with fixed budgets.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。
Figure 5 : Occupancy of the (RTG, CTG) plane in the teacher data, fixed budgets (top) and dynamic budgets (bottom), both quality levels. Color is the share of steps on a logarithmic scale. In PointGoal and CarGoal the RTG is 0 or 1, so it is drawn as two columns. Under a fixed budget the remaining budget starts atBmax and falls in steps of the incurred cost, which leaves gaps between the CTG values that occur.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの21ページ目から図の部分を抽出しています。
Table 9 : Per-seed differences on the test tasks between models trained on dynamic-budget and on fixed- budgethistories. Eachentryisthefirstmodelminusthesecond, averagedoverthetesttasksanddeployments of one training seed.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの27ページ目から図の部分を抽出しています。A-LagとSafe AD、CDTの比較
A-Lagは、5つの環境すべてでSafe ADより平均エピソードコストが低く、そのうち4つの環境では平均最終リターンも低くなりました。リターンの減少が最も大きかったのはAntで、286.4対350.9でした。CDTはDarkRoomでゴールを見つけられず、最終リターンは0.010でした。速度タスクではリターンはより高かったものの、平均コストも高くなりました。この比較は、著者らが調整した同一の学習設定と、3つのシードの平均を基準にしたものです。

Table 4 : Training settings. Top: the sequence models (Safe AD, A-Lag and CDT). Num Layers isLin Section 4.1. Seq Len counts environment steps, not token positions. Safe AD and A-Lag use four positions per step plus two constant prefix positions. Token Embedding Dim is the width of the per-modality encoders before they are projected to the Hidden Dim. The navigation tasks use four gradient accumulation steps, giving an effective batch size of 32. Action-input dropout sets each component of an action input in the history to zero with the given probability during training. The action targets are unchanged. Bottom: the gradient-based safe meta-RL baselines, SafeMeta and MAML with a cost penalty, as in the preliminary study. The navigation tasks are PointGoal and CarGoal, and the velocity tasks are HalfCheetah and Ant.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの20ページ目から図の部分を抽出しています。
Table 6 : Test-split results of Safe AD, of A-Lag with the multiplier held at zero and of A-Lag, whose multiplier adapts after every episode. All columns are means over three seeds. Bold marks the best of the three methods in each row: the highest return and the lowest cost, violation rate and excess cost. Return is the final return, the mean over the last three episodes, and is the success rate in PointGoal and CarGoal. Cost is the mean episode cost. The violation rate is the fraction of episodes whose cost exceeds the deployment’s budgetB 0, so it counts how often a method goes over its budget, not by how much. Excess cost is the mean over episodes ofmax(0,Gc−B 0).
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの25ページ目から図の部分を抽出しています。
Table 8 : Per-seed differences on the test tasks: A-Lag against Safe AD, and A-Lag against its own weights with the multiplier held at zero. Each entry is the first model minus the second, averaged over the test tasks and deployments of one training seed.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの27ページ目から図の部分を抽出しています。違反頻度と超過量の違い
平均コストだけでは、予算違反の頻度と大きさを区別しにくいです。Antでは、A-Lagの違反率は0.184で、Safe ADの0.356より低いものの、違反したエピソードの超過量が大きかったため、両方法の超過コストは約2.2で同程度でした。一方、HalfCheetahではA-Lagの平均コストが低かったにもかかわらず、違反率は0.158で、Safe ADの0.123より高くなりました。したがって、違反率と超過コストを併せて報告する必要があります。

Figure 3 : Violation rate and excess costmax(0,G c−B 0)over the episodes of a deployment on the test tasks. Each curve is the mean over three seeds, with a shaded band of±2standard errors. Averaged over the episodes, A-Lag has the lowest excess cost in DarkRoom, PointGoal, CarGoal and HalfCheetah and is close to Safe AD in Ant. In most later DarkRoom episodes CDT, which does not find the goal, is lower.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの10ページ目から図の部分を抽出しています。限界とデータ構成への感度
専門家サンプルの割合に関する実験では、A-Lagが平均コストを低くできた組み合わせは25通り中16通りでした。そのため、この優位性がすべてのデータ混合で成り立つわけではありません。教師にも環境ごとの探索、専門家、遷移イベントが必要なため、適用には制約があります。cost headは、教師が実際に選んだ行動に対してのみ学習され、即時コストしか予測しません。

Figure 8 : Final return and mean episode cost on the test tasks against the share ofq= 1histories (16 histories per task), averaged over three seeds, with bands of±2standard errors. The main models and the violation rates are in Table 5.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの23ページ目から図の部分を抽出しています。
Table 5 : Expert-share study on the test split: final return, mean episode cost and violation rate of models trained on 16 dynamic-budget histories per task with the given share of theq= 1expert (the restq≈0.5), and of the main models (50%, 32 histories per task). Means over three seeds. Bold marks the best value in each row: the highest return and the lowest cost and violation rate.
出典 · CC BY 4.0 · Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng · Algorithm Distillation for Safe In-Context Reinforcement Learning · 論文の図を引用 · 元のPDFの24ページ目から図の部分を抽出しています。論文情報
- 著者
- Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng
- 学会・ジャーナル
- arXiv · プレプリント
- 公開日
- 2026年11月16日
- 登録日
- 2026年11月18日
- 更新日
- 2026年11月16日
- バージョン
- v1
- arXiv
- 2611.21524
- カテゴリ
- cs.LG · cs.AI
- ライセンス
- CC BY 4.0
- 掲載内容
- 論文情報・解説・論文の図
この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。
アブストラクト
Safe in-context reinforcement learning (Safe ICRL) asks a policy with fixed parameters to improve on an unseen constrained task from its interaction history while aiming to keep its cost within a budget. Prior work studied Safe ICRL on five benchmarks in three families: a grid world with a hidden goal and obstacles (DarkRoom), continuous navigation where goals and hazards stay invisible until reached (PointGoal, CarGoal), and locomotion with a hidden velocity limit (HalfCheetah, Ant). Safe Algorithm Distillation (Safe AD), trained on the learning histories of a safe RL algorithm, has shown adaptation failures in prior evaluations. For example, in the locomotion tasks its return stays below zero, and it rarely reaches the goal in CarGoal. We revisit two parts of Safe AD. First, we distill a budget-aware teacher with two phases. It searches for the hidden task, exploring more when more budget remains. After its first reward or cost, an expert policy exploits the task within the remaining budget. We collect the teacher's histories under fixed or dynamic budgets. Dynamic budgets increase the occupancy entropy of the return and budget inputs in every environment, and at test time they improve return and lower cost in DarkRoom and HalfCheetah. Second, we propose A-Lag, a test-time adjustment that reweights the distilled policy's actions by their predicted cost, with an adaptive Lagrange multiplier that is updated from the costs observed. In our experiments, A-Lag had lower mean episode cost than Safe AD in all five environments, with lower mean final return in four.
この論文を引用
Minjae Kwon, Amir Moeini, Shangtong Zhang, Lu Feng (2026). Algorithm Distillation for Safe In-Context Reinforcement Learning. arXiv:2611.21524v1. https://arxiv.org/abs/2611.21524v1
BibTeX
@misc{kwon2026algorithm,
title = {{Algorithm Distillation for Safe In-Context Reinforcement Learning}},
author = {Minjae Kwon and Amir Moeini and Shangtong Zhang and Lu Feng},
year = {2026},
eprint = {2611.21524},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.21524v1}
}