RL エージェントのスキルを活用した自己研究ワークフローの実行方法と NVIDIA NeMo の活用
NVIDIA は、Andrej Karpathy の「Autoresearch」プロジェクトを基盤に、RL エージェントと NeMo を組み合わせた自律的な研究ワークフローの実装方法を詳述し、AI 開発の自動化と効率化への具体的な道筋を示した。
キーポイント
自律型 RL エージェントによる研究自動化
コード作成から実験実行、メトリクス分析までを自律的に行うエージェントが、ハイレベルの目標から仮説を立てて実装し、研究者に結果を返すワークフローを構築可能である。
NVIDIA NeMo と Brev インフラの活用
Codex や GPT-5.5 などの最先端コーディングエージェントを NVIDIA NeMo RL、NeMo Gym、および Brev GPU インスタンス上で動作させ、リソース管理やデバッグを自動化する実証例が示された。
フルスタック自律性とゴール指向の実行
依存関係の解決から GPU メモリ管理、実験の立ち上げ・監視までを自動で行う「フルスタック自律性」と、ベースラインのプロファイリングから仮説検証へ至る「ゴール指向」の 2 つの主要機能を備えている。
論文からコードへの実装支援
AI エージェントが研究論文を読み込み、その内容を理解して具体的な実装計画を策定し、コードベースを編集・テストする「Paper-to-code」機能の実現性が示された。
Paper-to-code ワークフローの自動化
RL エージェントは論文の読解から実装計画、コード変換、テスト追加、検証トレーニング開始までを自動で行うことができる。
NeMo RL と NeMo Gym の役割分担
NeMo RL は GRPO や DPO などの学習ワークフローをスケーラブルに実行し、NeMo Gym はモデルがタスクを実行して報酬を受け取る環境を提供する。
研究者とエージェントの役割分担
自動研究の目的は研究者を排除することではなく、反復的なセットアップ作業をエージェントに任せることで、研究者は目標設定や戦略決定に集中できる。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェントが単なるツールから自律的な研究パートナーへと進化することを示す重要なマイルストーンであり、特に強化学習(RL)分野における実験の自動化と再現性向上に大きな影響を与える。NVIDIA のエコシステム(NeMo, Brev)を統合した具体的な実装例を提供することで、企業や研究機関が即座に導入可能なフレームワークを示し、AI 開発のパラダイムシフトを加速させる。
編集コメント
NVIDIA が提供する NeMo と Brev を活用し、最先端のコード生成モデルを自律的な研究エージェントとして運用する具体的な手法が示されており、RL 分野の開発効率化に即座に応用可能な内容です。
コーディング AI エージェントは、長期にわたる機械学習(ML)ワークフローを実行する実用的なオペレーターとして台頭しています。これらのエージェントはリポジトリの調査から実行環境の構築、ビルド問題の解決、実験の実行、実行状況の監視、メトリクスの分析、そして結果の要約までを担うことができます。
強化学習(RL)研究においてこれが重要視されるのは、有意義なメトリクスが得られるのは、必要な実験インフラが整ってからである場合が多いためです。『Autoresearch』は、アンドレイ・カルパティ氏によるオープンソースの Python プロジェクトで、AI や ML モデルのトレーニングを自動化するものです。
このアプローチでは、自律型 AI エージェントが高レベルな目標を仮説へと変換し、実際のコードベースを編集・検証しながら、メトリクスの改善につながるアイデアを保持します。そして最終結果を人間のリサーチャーに報告します。これにより、チームは NVIDIA Nemotron などの高性能なオープンモデルを出発点として、専門分野に特化したドメインエージェントを構築できるようになります。さらに、データや知的財産(IP)、デプロイ、トレーニングワークフローの制御権を維持したまま、測定可能なドメインタスクに対する強化学習を通じてモデルを改善していくことが可能になります。
本記事では、ユーザー側でコードを記述する必要がない軽量なスキルベースの自動研究ワークフローの実行方法について解説します。このワークフローは、NVIDIA NeMo RL と NVIDIA NeMo Gym を用いた最先端のコーディングエージェント(Codex with GPT 5.5)で検証されており、NVIDIA Brev の GPU インスタンス上で動作します。
自律型 RL 研究ワークフローの構築
本ワークフローは、以下の 3 つのエージェント能力を実証するものです。
- フルスタックの自律性: ソフトウェアスタックのセットアップ、依存関係の解決、GPU メモリやディスク容量、チェックポイントの管理、実験の実行、実行状況のモニタリング、およびデバッグ作業をすべて自動化します。
- 目標指向型の自動研究: ベースラインのプロファイリング、仮説の提案または検証、実験の実行、メトリクスの分析を行い、研究目的に向かって反復的に改善を重ねます。
- 論文からコードへ: 論文を読み込み、実装計画を立案し、アルゴリズムを実装コードに変換。テストを追加して検証トレーニングを開始します。
本記事の例では、Codex がまずビジョン言語モデル(VLM)を用いた強化学習(RL)トレーニングの動作確認テストのために、NeMo RL と NeMo Gym のスタック全体を構築します。その後、ゼロから独自に「視覚的数え上げ環境」を考案・実装し、Qwen3-VL-2B-Instruct モデルを学習させることで、タスクの精度を 25.0% から 96.9% に引き上げました。最後に、研究論文に記載されたオフポリシー強化学習アルゴリズムを実装し、10 時間にわたる検証トレーニングを開始します。
自動研究(autoresearch)の目的は研究者をプロセスから排除することではなく、反復的な環境構築や試行錯誤といった作業をエージェントに任せることにあります。研究者には依然として目標の設定、マイルストーンのレビュー、戦略の方向付け、そして最終判断という重要な役割が求められます。
*動画 1: エージェント主導の強化学習研究ワークフローの構築方法を学ぶ(エージェントスキルを活用)*
自動研究における NeMo RL、NeMo Gym、およびエージェントスキルの活用
NeMo RL と NeMo Gym は、NVIDIA NeMo framework を構成するオープンソースライブラリです。NeMo RL は、LLM や VLM のポストトレーニングに AutoModel、Megatron-Bridge、vLLM を基盤とし、Ray によってオーケストレーションされています。GRPO、DPO、SFT、報酬モデルの学習といったワークフローに対応し、小規模な検証から分散トレーニングまで、レシピベースの設定でスケーラブルに実行可能です。一方、NeMo Gym は、モデルがタスクと対話し、報酬を受け取り、生成された生データを通じて学習できる環境を提供します。
この 2 つを組み合わせることで、エージェント主導の強化学習研究を支える強力な基盤が構築されます。エージェントは同じリポジトリ内でレシピを検索し、新しい環境を接続し、ベースラインを実行し、トレーニングパラメータを調整して結果を比較できます。
Codex with GPT 5.5 は推論能力やコードナビゲーション、ツール利用において優れた性能を発揮しますが、ローカルの運用慣習を自動的にすべて把握しているわけではありません。チェックポイントの保存場所や、どの指標が信頼できるか、長時間のセッションやコンテキスト圧縮、接続切断後にキャンペーン目標をどう回復させるかなどについては、事前知識がない可能性があります。
そのため、以下の 3 つの補完的な agent skills も併用しました:
- Brev-etiquette:NVIDIA Brev GPU インスタンスの運用ガイドです。リポジトリをクリーンに保ち、チェックポイントやキャッシュなどの大容量アーティファクトを意図したボリュームに保存し、シークレット情報を安全に扱います。
- Session-memory:長時間実行される作業のための永続的なセッション記録です。全体の目標、サブタスク、読み込まれたスキル、重要なファイル、意思決定、進捗状況、引き継ぎメモなどを記録します。
- Autoresearch:実験ループそのものです。ユーザーの目的を保持し、ベースラインを設定し、各仮説ごとにブランチを作成し、試行を台帳にログ記録し、停止ルールを監視し、結果を要約して人間のレビューに供します。
これらのスキルは構造化された再利用可能なワークフロー指示として機能します。エージェントが研究ループをより再現性高く実行できるよう、運用コンテキストと組織の知見をエンコードしています。
前提条件
このチュートリアルでは以下の環境を使用します。
- Visual Studio Code
- GPT 5.5 モデルを搭載した Codex プラグイン
- NVIDIA L40S 48 GB GPU を 1 基搭載した Brev インスタンス
- NeMo RL リポジトリ(Brev の実行可能用。
/home/ubuntu/RLに事前にクローン済み)
- 認証が必要なモデル、データセット、またはログ記録を扱う場合に必要となる Hugging Face および Weights & Biases の認証情報
以下のセクションでは、3 つのエージェント機能を検証します。まずマシンを設定してスタックを検証し、次に目標駆動型の自動研究キャンペーンを実行します。最後に、同じエージェントワークフローを用いて研究論文の実装を行い、より長期間の検証トレーニングを開始します。
フルスタック自律性
このセクションでは、エージェントがハードウェアとソフトウェアの両スタックを自動的に管理する能力を実証します。自動研究ループを開始する前に、マシン、リポジトリ、依存関係、モデルへのアクセス、そしてトレーニングループがエンドツーエンドで正常に動作するかを確認してください。このセットアップ検証は、より長期間のエージェント主導の研究実行の基盤となります。
ステップ 1: Brev インスタンスを起動する
NeMo-RL Autoresearch Launchable を使用して、NVIDIA L40S 48 GB GPU 1 基を搭載した Brev インスタンスを起動します。
ステップ 2: VS Code からリモートインスタンスに接続する
Windows の場合は、SSH 設定ファイル(通常は C:\Users\<YOUR_USER_NAME>\.ssh\config にあります)を開き、以下を追加してください。
Host Brev-Ubuntu
HostName <BREV_IP_ADDRESS>
User ubuntu
IdentityFile C:/Users/<YOUR_USER_NAME>/.brev/brev.pem<BREV_IP_ADDRESS> は、Brev インスタンスページの上部に表示されている IP アドレスを指定してください。VS Code では「ホストに接続」を選択し、設定した Brev-Ubuntu などのホスト名を選びます。macOS や Linux の場合は、Brev キーは通常 ~/.brev/brev.pem にあり、SSH 設定も同様です。
ステップ 3: Codex をインストールして設定する
VS Code から /home/ubuntu/RL ディレクトリ内の NeMo RL リポジトリを開きます。その後、VS Code の拡張機能マーケットプレイスから「Codex IDE」をインストールしてください。インストールが完了すると、チャットウィンドウに Codex が表示されます。API キーまたは ChatGPT アカウントを使用してサインインします。
Codex は「Default(デフォルト)」「Auto-Review(自動レビュー)」「Full Access(フルアクセス)」の 3 つの権限モードで動作します。今回のワークフローでは、まずは Auto-Review モードから始めるのが現実的です。この設定だと、サンドボックス内でコマンドを実行できる一方で、特権を必要とするアクションにはレビュープロセスが追加されます。一方、Full Access はインスタンス全体への制御範囲を広げますが、セキュリティ設定に十分自信がある場合のみ利用すべきです。
ステップ 4:NeMo RL ワークスペースの準備
VS Code のターミナルで /home/ubuntu/RL ディレクトリを開きます。必要に応じて、認証情報を格納する .env ファイルを作成してください。
export WANDB_API_KEY=wandb_v1xxx
export HF_TOKEN=hf_mqyyy
次に、Brev 環境の概要を把握しておきましょう。例えば df -h コマンドを実行して、仮想インスタンス上のストレージ構成を確認します。
ステップ 5:NeMo RL の動作確認テスト(スモークテスト)
これで Codex に NeMo RL のセットアップと、小規模な RL 学習の動作確認テストの実行を指示できます。
/goal ./skills ディレクトリ内の「nemo-rl-brev-etiquette」スキルを使用して、Qwen3-VL-2B-Instruct モデルで RL 学習のスモークテストを実行する
この /goal コマンドは、Codex が達成すべき永続的な目標を設定します。今回の実行では、Codex は Brev の運用スキルを読み込み、不足している NeMo RL のサブモジュールを初期化し、Hugging Face から Qwen3-VL モデルをダウンロードします。さらに、Hugging Face、Torch、Triton、uv、Ray、ログ、ワーカーキャッシュといった大容量の資産は /ephemeral ディレクトリへ転送し、依存関係や設定の問題が解消されて学習ステップが完了するまで対応します。
所要時間は約 40 分から 1 時間程度です。今回の目的は、最も最適化された NeMo RL 環境を構築することではなく、リポジトリのセットアップからモデルへのアクセス、依存関係の解決、そしてトレーニング実行に至るまでの検証済みのエンドツーエンドのパスを確認することにあります。
ステップ 6: セッションメモリで設定を保存する
スタックが正常に動作し始めたら、以下のプロンプトを使って設定状態をセッションメモリに保存してください。
./skills ディレクトリにある nemo-rl-session-memory スキルを使用して、このセットアップ情報を永続化してください。ネットワークの切断や VS Code の再起動後に作業を再開する際は、以下のプロンプトで最新のセッションを読み込んでください。
./skills ディレクトリにある nemo-rl-session-memory スキルを使用し、最新セッションを読み込んで、その要約を提供してください。これにより、Codex は継続する前に「過去の目標」「環境の前提条件」「読み込まれたスキル」「重要なパス」「直近のコマンド実行結果」などの情報を把握した状態になります。
目的駆動型オートリサーチ
スタックの検証が完了したら、次はセットアップから「目的駆動型のキャンペーン」へと移行します。このモードでは、人間が目標と予算を提示し、Codex が以下のループを管理します:ベースラインの確立、仮説の立案、実験の実行、指標の評価、そして要約。
ステップ 7: 新しい NeMo Gym 環境を作成する
キャンペーンを開始する前に、Codex に新しい RL(強化学習)環境の実装を依頼してください。以下の例では、VLM(視覚言語モデル)向けの「視覚的数え上げタスク」を実装する方法を示しています。
/goal
Nemo gym の circle click 環境を参考にして、
キャンバス上の異なる色の星の数を数えることを学習させる
新しい Gym 環境「star count」を実装してください。異なる解像度での例をいくつか示してください。
生成された環境は、キャンバスサイズを変えて色付きの星画像を作成し、モデルに色の種類ごとの星の数を数えさせるタスクを提供します。
image*図 1. Codex が設定した新しい「星の数え」トレーニング環境の例*
ステップ 8: オートリサーチキャンペーンの実行
次に、以下のプロンプトを使用して時間制限付きのキャンペーンを開始します。
"素晴らしい。/goal ./skills ディレクトリにある nemo-rl-autoresearch と nemo-rl-session-memory スキルを使って新しいオートリサーチセッションを開始してください。目的は、SFT アルゴリズムを用いて星数え Gym 環境で Qwen3-VL-2B-Instruct モデルを高精度に訓練することです。まずは、デフォルト設定でのモデルの初期精度をプロファイリングすることから始めます。時間予算:5 時間"
このプロンプトには、目的・手法・タスク環境・ベースライン要件・時間予算が含まれている必要があります。オートリサーチスキルはこれらの情報を解析し、測定可能な停止条件と実験記録(エクスペリメント・レジャー)を備えたキャンペーンとして具体化します。
今回の実行では、Codex が星数え環境から生成された合成データ synthetically generated data を NeMo RL の SFT パスに接続しました。ここでは SFT(Supervised Fine-Tuning)が採用されています。これは、過去のオートリサーチセッションで GRPO がこのタスクの精度向上に寄与しなかったことが判明しており、その後 Codex が提案した SFT 経由のアプローチが有効であることが確認されたためです。
ある実験では、Codex は 1 時間未満で最良の結果を達成しました。簡潔な要約を求めた際の Codex の最終レポートは以下の通りです。
この Star_Count SFT キャンペーンでは、新しい NeMo Gym の視覚カウント環境を用いて、Qwen/Qwen3-VL-2B-Instruct モデルに LoRA による SFT(Supervised Fine-Tuning)を適用しました。まず、既存のモデルをそのまま固定された 64 例の評価セットでプロファイリングしたところ、正確率は 25.0%、平均報酬は 0.705208 でした。
その後、環境設定、データ生成、評価器、そして SFT のレシピを整備し、最初の LoRA スモークテスト(簡易検証)を実行すると、正確率は 78.125% に向上しました。
SFT データ量とトレーニングステップ数をスケールさせたことで、主要な性能向上が実現されました。2048 訓練用・256 検証用データで 160 ステップのランでは正確率が 95.3125% に達し、さらに最適化された 4096 訓練用・512 検証用データで 320 ステップのランでは、正確率 96.875%(平均報酬 0.992188)を記録しました。最も優れたチェックポイントは step_240 で、最終チェックポイントと正確率は同等でしたが、部分的な正解に対する報酬ではわずかに上回りました。
全体として、正確率は 25.0% から 96.875% へと 71.875 ポイント向上しました。残った誤りはフォーマット失敗ではなく、個々の色における「1 つ違い」のミスでした。これは、密集したシーンや視覚的に曖昧なケースに対して、重点的なハードケース拡張(データ増強)を行うことが次の改善策として最適であることを示唆しています。
残存する誤りは、個々の色の数え間違いが 1 つずれるという「一歩手前」のミスでした。この結果から、次回の実験では密集したシーンや視覚的に曖昧なケースに対するターゲット型のハードケース拡張を行うべきであると考えられます。
これが、エージェント主導の研究ループにおける核心的な価値です。具体的には、Codex は単に 1 つのコマンドを実行しただけではありません。ベースラインのプロファイリングから環境とデータパスの構築、検証実験の実行、データ量と学習ステップのスケーリング、チェックポイントの評価、エラー分析、そして人間によるレビューのための妥当な次の方向性の提案まで、一連の作業を完遂しました。
Paper-to-code(論文からコードへ)
「Paper-to-code」とは、OpenAI が PaperBench で提唱したアイデアで、研究論文に記載されたアイデアを自動的に実装する仕組みです。このプロセスを加速させるため、Codex は論文を読み込み、実装計画を立案し、コードの記述とテストを行い、最後にトレーニングを開始します。
ステップ 9: Codex に論文と実装目標を与える
今回の例では、対象となる論文は LLMs Can Learn to Reason via Off-Policy RL です。この論文では、OAPL(Optimal Advantage-based Policy Optimization with Lagged Inference policy)という手法が紹介されています。これは、長いラグを持つオフポリシー強化学習(RL)の一種です。
従来のアプローチでは、トレーニングと推論におけるポリシーの不整合を解消すべきバグとして扱いましたが、OAPL はこの「ラグのある生成ポリシー」を目的関数の一部として積極的に活用します。これにより、トレーニングモデルと生成モデルが大幅に同期していない状況でも、安定かつ効率的な学習が可能になります。
これは有用なテストケースです。なぜなら、アルゴリズムの実装だけでなく、システムレベルでの判断も求められるからです。損失計算の仕方が変わり、長いラグの設定は、トレーニングと生成の調整方法にも影響を及ぼすためです。
コンポジットプロンプト(複合プロンプト)は以下の通りです:
/goal 新しいセッションを開始するには、./skills ディレクトリ配下に nemo-rl-session-memory スキルを起動してください。まずは資料を読み込みます。
その後、単体テスト(ユニットテスト)を実行して合格し、ドキュメントを作成します。その上で、nemo-rl-autoresearch スキルを使って新しい自動研究セッションを開始しましょう。このアルゴリズムを用いて Qwen3-1.7B モデルを DAPO-math-17K データセットで学習させます。所要時間は 10 時間以内です。
Codex はこのリクエストを以下の段階に分解します。
- PDF の読み込み
- アルゴリズムの抽出
- NeMo RL のフックポイント(実装箇所)の確認
- 実装計画の策定
- アルゴリズムからコードへの変換
- ユニットテストの追加
- ドキュメント作成
- Qwen3-1.7B モデルを用いた DAPO-math-17K データセットでの検証キャンペーン開始
このプロンプトは意図的に難易度が高く設定されています。実際の運用では、より安全なワークフローとして段階を踏むのが推奨されます。まず Codex に資料の読み込みと計画立案を行わせ、人間がレビューして承認した上で、実装・ドキュメント作成・ユニットテストを進めます。その後にのみ、時間のかかる自動研究による検証キャンペーンを開始します。
追加の検証手法としては、自己一貫性の確認(Codex が別々のブランチでアルゴリズムを 2 回実装し、判断結果を比較する)や、エージェント間の相互チェック(別の最先端コード生成エージェントが論文・実装・テスト・結果をレビューする)などが挙げられます。
image*図 2. エージェント間の相互チェック検証レポートは、Codex の実装が論文の数式やユニットテストと整合しているかを比較しています*
ステップ 10: 学習の検証と次の研究課題
図 3 は、Qwen3-1.7B モデルと DAPO-math-17K データセットを用いた OAPL アルゴリズムの学習進行状況を示しています。ここでは、OAPL と GRPO の派生手法である DAPO を比較しています。
image*図 3. Codex が生成した OAPL アルゴリズムの学習検証結果*
今回の実験では、OAPL は DAPO より少ない学習ステップで高い精度を達成しました。これは論文が主張する「効果的な長ラグオフポリシー学習」の一貫性を裏付ける結果です。また右側のグラフからは、OAPL が DAPO よりもはるかに多くのトークンを消費していることがわかります。ここから自然に浮かび上がる次の研究課題は、「なぜ OAPL はより冗長になるのか」、そして「精度を損なわずに簡潔さを促すためのアルゴリズム上の改良点は何か」という点です。
オートリサーチワークフローのヒントとベストプラクティス
近年、エージェントの能力は飛躍的に向上していますが、依然として注意すべき失敗モードがいくつか存在します。
- コンテキストのズレ: 長時間のセッションでは、複数のコンテキスト圧縮サイクルを通過することがあります。永続的な記憶機能がない場合、エージェントは目的や読み込まれたスキル、停止ルールなどを忘れてしまう可能性があります。
- ローカル環境の整理: ログ、チェックポイント、データセット、キャッシュなどがファイルシステム上に散在しないよう、マシン固有のエチケット(運用ルール)を明確に定義しておく必要があります。
- ステアリングのズレ: 実行中の指示は有用ですが、その後の質問がオートリサーチセッションを逸脱させ、早期終了につながるケースがあります。
低信号ループに注意しましょう。Codex が試行錯誤のループにはまってしまうケースがあります。例えば、学習ステップ数が少なすぎたりバッチサイズが極端に小さかったりして、十分な学習シグナルが得られない場合です。こうした非生産的な行動は、人間のリサーチャーならすぐに察知し、Codex を適切な方向へ誘導できるはずです。
NeMo RL や NeMo Gym の自動研究スキルを構築・検証する過程で、特に有用だと感じた実践方法をいくつか紹介します。
まず、自動研究スキルは「進化していくワークフローの指示書」と捉えてください。Codex は時間とともにこれらを更新し、組織内の慣習やベストプラクティス、過去の試行から得られた教訓を反映させることができます。
Codex はリソースに恵まれ、非常に有用な存在ですが、困難な研究課題に対しては、依然として人間の指導と判断が不可欠です。
長時間実行される自動研究フェーズに入る前に、アイデアの妥当性を検証するための明示的なブレインストーミングと計画プロセスを経ることは有益です。
Codex を「有能なインターン」や「若手同僚」と見なすのが良いでしょう。これは、人間のリサーチャーがすべての実装を一行コードレベルで深く理解する必要はないことを意味しますが、それでも確信を持って作業を進めるためには、適切な検証手法を持っている必要があります。
長時間の自動研究セッションを開始する前には、明確な予算制約を設定してください。例えば、実行時間の上限や GPU 使用時間の予算、あるいは実験回数の最大値などです。これにより、エージェントは最も価値の高い仮説に集中でき、広範すぎる実験範囲を避けることができます。
自動研究の始め方
エージェントは研究者を代替するものではなく、生産的な役割分担を支える存在です。エージェントが担当するのは環境構築の多く、デバッグ、ログ管理、実験ループの実行に加え、次のステップへの洞察や提案です。一方、研究者は目標を設定し、専門的な判断を下し、キャンペーン全体を舵取り、どの結果が意味を持つのかを決定します。
NeMo RL、NeMo Gym、Brev、Codex、そして限られた数の運用スキルを活用すれば、研究者は環境構築やデバッグ、反復実験の実行に費やす時間と計算コストを大幅に削減できます。これにより、ワークフローの重心は「次にどの実験を実行すべきか」の判断や、「結果をどう解釈するか」という部分へとシフトします。
強化学習における自動研究(autoresearch)を始めるには、以下の関連リソースをご参照ください:
- Brev の Launchable を使ってチュートリアルの環境を試す
- NVIDIA が検証したエージェントスキルのドキュメントを確認し、NeMo RL 用自動研究スキルを含む NVIDIA/skills GitHub リポジトリを閲覧する
- 強化学習のトレーニングやジム環境には NVIDIA NeMo RL と NVIDIA NeMo Gym を活用する
原文を表示
Coding AI agents are becoming practical operators for long-running machine learning (ML) workflows. They can inspect repositories, set up runtimes, resolve build issues, launch experiments, monitor execution, analyze metrics, and summarize results.
For reinforcement learning (RL) research, this matters because meaningful metrics often appear only after the essential experiment infrastructure is in place. Autoresearch is an open source Python project by Andrej Karpathy for automating AI and ML model training.
With this approach, autonomous AI agents translate high-level goals into hypotheses, edit and test a real codebase, keep metric-improving ideas, and hand results back to the human researcher. This enables teams to build specialized domain agents starting from a performant open model, such as NVIDIA Nemotron, then improve it with RL against measurable domain tasks while maintaining control over data, IP, deployment, and the training workflow.
This post walks through how to run a lightweight, no-code-from-the-user-side, skill-based autoresearch workflow. It was tested using a frontier coding agent (Codex with GPT 5.5) on NVIDIA NeMo RL and NVIDIA NeMo Gym, using an NVIDIA Brev GPU instance.
Building an autonomous RL research workflow
The workflow demonstrates the following three agent capabilities:
- Full-stack autonomy: Setting up the software stack; resolving dependencies; managing GPU memory, disk space, and checkpoints; launching experiments; monitoring runs; and debugging issues.
- Goal-driven autoresearch: Profiling a baseline, proposing or following hypotheses, launching experiments, analyzing metrics, and iterating toward a research objective.
- Paper-to-code: Reading a paper, forming an implementation plan, translating the algorithm into code, adding tests, and starting validation training.
In the examples provided in this post, Codex first brings up a full NeMo RL and NeMo Gym stack for a vision language model (VLM) RL training smoke test. It then conceptualizes and creates a novel NeMo Gym visual counting environment from scratch, and trains the Qwen3-VL-2B-Instruct model, increasing its accuracy from 25.0% to 96.9% on the task. Finally, it implements an off-policy RL algorithm from a research paper and begins a 10-hour validation training campaign.
The goal of autoresearch is not to remove the researcher from the loop, but instead to hand off the repetitive setup and iteration work to the agent. Researchers are still responsible for setting goals, reviewing milestones, steering strategy, and making the final decision.
Using NeMo RL, NeMo Gym, and agent skills for autoresearch
NeMo RL and NeMo Gym are open source libraries that are part of the NVIDIA NeMo framework. NeMo RL is built on AutoModel, Megatron-Bridge, and vLLM for post-training LLMs and VLMs, orchestrated by Ray. It supports workflows such as GRPO, DPO, SFT, and reward model training, with recipe-driven configuration that can scale from small validation runs to distributed training. NeMo Gym provides environments where models can interact with tasks, receive rewards, and learn through live-generated experience.
Together, NeMo RL and NeMo Gym provide a useful substrate for agent-led RL research. An agent can inspect recipes, wire up a new environment, run a baseline, adjust training parameters, and compare results in the same repository.
Codex with GPT 5.5 offers strong reasoning, code navigation, and tool-use capabilities, but it does not automatically know every local operating convention. It may not know where checkpoints should live, which metrics are authoritative, or how to recover the campaign objective after a long session, context compaction, or disconnect.
For this reason, three complementary agent skills were also used:
- Brev-etiquette: Operating guidance for NVIDIA Brev GPU instances. It keeps the repository clean, stores large artifacts such as checkpoints and caches on the intended volume, and handles secrets safely.
- Session-memory: A durable session diary for long-running work. It records the overall goal, subtasks, loaded skills, important files, decisions, progress, and handoff notes.
- Autoresearch: The experiment loop. It preserves the user’s objective, establishes baselines, creates a branch for each hypothesis, logs attempts in a ledger, monitors stop rules, and summarizes results for human review.
These skills act as structured, reusable workflow instructions. They encode operating context and institutional knowledge so the agent can execute the research loop more reproducibly.
Prerequisites
This walkthrough uses the following setup:
- Visual Studio Code
- Codex plugin with the GPT 5.5 model
- A Brev instance with one NVIDIA L40S 48 GB GPU
- NeMo RL repository (for the Brev launchable; precloned under /home/ubuntu/RL)
- Hugging Face and Weights & Biases credentials, if the workflow requires authenticated model, dataset, or logging access
The following sections validate the three agent capabilities. First, set up the machine and validate the stack. Next, run a goal-driven autoresearch campaign. Finally, use the same agent workflow to implement a research paper and begin a longer validation training run.
Full-stack autonomy
This section demonstrates the agent’s ability to automanage the full hardware and software stack. Before starting an autoresearch loop, first validate that the machine, repository, dependencies, model access, and training loop work end to end. This setup validation is the foundation for longer agent-led research runs.
Step 1: Launch a Brev instance
Launch a Brev instance with one NVIDIA L40S 48 GB GPU using the NeMo-RL Autoresearch Launchable.
Step 2: Connect VS Code to the remote instance
On Windows, open the SSH config file, typically under C:\Users\<YOUR_USER_NAME>\.ssh\config, and add the following:
Host Brev-Ubuntu
HostName <BREV_IP_ADDRESS>
User ubuntu
IdentityFile C:/Users/<YOUR_USER_NAME>/.brev/brev.pem
Find BREV_IP_ADDRESS listed at the top of the Brev instance page. In VS Code, select Connect to Host and choose the configured host name, such as Brev-Ubuntu. On macOS and Linux, the Brev key is typically under ~/.brev/brev.pem, and the SSH configuration is similar.
Step 3: Install and configure Codex
From VS Code, open the NeMo RL directory under /home/ubuntu/RL. Then install the Codex IDE extension from the VS Code extensions marketplace. After installation, Codex appears in the chat window. Sign in using an API key or ChatGPT account.
Codex can run in several permission modes: Default, Auto-Review, and Full Access. For this workflow, Auto-Review is a reasonable starting point. It allows Codex to run sandboxed commands while adding review for elevated actions. Full access gives broader control over the instance and should only be used when you are comfortable with the security settings.
Step 4: Prepare the NeMo RL workspace
Open a VS Code terminal in /home/ubuntu/RL. If needed, create a .env file for credentials:
export WANDB_API_KEY=wandb_v1xxx
export HF_TOKEN=hf_mqyyy
Familiarize yourself with the Brev environment. For example, type df -h to find out more about the storage configuration on the virtual instance.
Step 5: Run a NeMo RL smoke test
Now prompt Codex to set up NeMo RL and run a small RL training smoke test:
/goal Use the nemo-rl-brev-etiquette skill under ./skills, set up NemoRL to
do a smoke test RL training of the Qwen3-VL-2B-Instruct model
The /goal command sets a persistent objective for Codex to work toward. In this run, Codex should load the Brev operating skill, initialize missing NeMo RL submodules, download the Qwen3-VL model from Hugging Face, route large assets such as Hugging Face, Torch, Triton, uv, Ray, logs, and worker caches to /ephemeral, and resolve dependency or configuration issues until a training step completes.
The elapsed time is approximately 40 minutes to an hour. The goal is not the most optimized NeMo RL setup, but a validated end-to-end path through repository setup, model access, dependency resolution, and training execution.
Step 6: Persist the setup with session memory
After the stack is working, persist the setup state with the following prompt:
Now use the nemo-rl-session-memory skill under ./skills, persist this setup information
To resume after a network disconnect or VS Code restart, you can load the latest session with the following prompt:
Use the nemo-rl-session-memory skill under ./skills, load the latest session, and provide me with a summary
This provides Codex with the previous goal, environment assumptions, loaded skills, important paths, and recent command outcomes before continuing.
Goal-driven autoresearch
With the stack validated, the next step is to move from setup to a goal-driven campaign. In this mode, the human provides the objective and budget, and Codex manages the loop: baseline, hypotheses, experiments, metrics, and summary.
Step 7: Create a new NeMo Gym environment
Before launching the campaign, ask Codex to implement a new RL environment. The example below creates a visual counting task for a VLM:
/goal Now using the Nemo gym circle click environment as a reference,
implement a new Gym environment named "star count", that teaches
a model to count the number of stars of different colors on a canvas of
different resolutions. Show me several examples
The resulting environment generates images with colored stars at varying canvas resolutions and asks the model to count the number of stars by color.

Step 8: Start the autoresearch campaign
Next, start a time-bounded campaign using the following prompt:
Great. /goal Now use the nemo-rl-autoresearch and nemo-rl-session-memory skill under ./skills, start a new
auto research session, goal: Train the Qwen3-VL-2B-Instruct model to high accuracy, using SFT algorithm
on the star count gym environment. Start with profiling the model out of the box accuracy. Time budget: 5h
The prompt must contain the objective, method, task environment, baseline requirement, and time budget. The autoresearch skill translates these into a campaign with measurable stop rules and an experiment ledger.
In this run, Codex wires up the synthetically generated data from the star count environment into the NeMo RL SFT path. SFT is used in this case because a prior autoresearch session found that GRPO did not improve accuracy on this task, while the Codex proposed SFT route later proved effective.
In one experiment, Codex achieved the best result in under an hour. The Codex final report when prompted to provide a brief summary is shown below:
The star_count SFT campaign trained Qwen/Qwen3-VL-2B-Instruct on the new NeMo Gym visual
counting environment using LoRA SFT. We first profiled the model out of the box on a fixed 64-example
held-out eval split, where it reached 25.0% exact accuracy with mean reward 0.705208. After setting up the
environment, data generation, evaluator, and SFT recipe, the first LoRA smoke run improved accuracy to 78.125%.
Scaling the SFT data and training steps produced the main gains. A 2048-train / 256-val, 160-step run
reached 95.3125% exact accuracy, and the best 4096-train / 512-val, 320-step run reached 96.875% exact
accuracy with mean reward 0.992188. The best checkpoint was step_240, which slightly beat the final checkpoint
on partial-credit reward while tying exact accuracy.
Overall, accuracy improved from 25.0% to 96.875%, a gain of 71.875 percentage points. The remaining errors
were not formatting failures; they were near-miss off-by-one count mistakes on individual colors, suggesting the
next best improvement would be targeted hard-case augmentation for dense or visually ambiguous scenes.
The remaining errors were near-miss off-by-one count mistakes on individual colors. This suggests targeted hard-case augmentation for dense or visually ambiguous scenes as the next experiment.
This captures the core value of the agent-led research loop. Specifically, Codex did not run only one command. Instead, it profiled a baseline, built the environment and data path, ran a validation experiment, scaled data and training steps, evaluated checkpoints, analyzed errors, and proposed a plausible next direction for human review.
Paper-to-code
Paper-to-code is an idea pioneered by OpenAI PaperBench to auto-implement research ideas from papers. Speeding this process, Codex reads a paper, derives an implementation plan, writes and tests the code, and then kicks off training.
Step 9: Give Codex a paper and an implementation target
For this example, the target paper is LLMs Can Learn to Reason via Off-Policy RL. The paper introduces Optimal Advantage-based Policy Optimization with Lagged Inference policy (OAPL), a long-lag off-policy RL method. Instead of treating the training-inference policy mismatch as a bug to eliminate, OAPL uses the lagged generation policy as part of the objective, enabling stable and efficient training even when the training and generation models are substantially out of sync.
This is a useful test case because it requires both algorithmic implementation and system-level judgment. The loss computation changes, and the long-lag setup also affects how training and generation are coordinated.
The composite prompt is:
/goal Start a new session with nemo-rl-session-memory skill under ./skills. First, read
Write and run unit tests to satisfaction. Write document. Then start a new autoresearch
session with the nemo-rl-autoresearch skill, train a Qwen3-1.7B model with this algorithm
on the DAPO-math-17K dataset. Time budget: 10h
Codex breaks the request into the following stages:
- Read the PDF
- Extract the algorithm
- Inspect NeMo RL hook points
- Produce an implementation plan
- Translate the algorithm into code
- Add unit tests
- Write documentation
- Start a validation campaign on Qwen3-1.7B with DAPO-math-17K dataset
This prompt is intentionally demanding. In practice, the safer workflow is staged. First use Codex for reading and planning with human review, then approve implementation, documentation, and unit tests, and only then start a longer autoresearch validation campaign.
Additional validation can include self-consistency, where Codex implements the algorithm twice on separate branches and compares decisions, or an agentic cross-check, where another frontier coding agent reviews the paper, implementation, tests, and results.

Step 10: Training validation and follow-up research question
Figure 3 shows the training progress of the OAPL algorithm compared with a GRPO variant, DAPO, on the Qwen3-1.7B model and the DAPO-math-17K dataset.

In this run, OAPL reached higher accuracy with fewer training steps, consistent with the paper’s central claim about effective long-lag off-policy training. The right panel also shows that OAPL used significantly more tokens than DAPO, which creates a natural follow-up research question: Why does OAPL become more verbose, and what algorithmic changes could promote brevity without sacrificing accuracy?
Tips and best practices for autoresearch workflows
While increasingly powerful, frontier agents still exhibit a few failure modes to watch out for, including:
- Context drift: Long sessions can pass through multiple context compaction cycles. Without durable memory, the agent may forget the objective, loaded skills, or stop rules.
- Local housekeeping: Logs, checkpoints, datasets, and caches can scatter across the filesystem unless the machine-specific etiquette is explicit.
- Steering drift: Mid-run instructions are useful, but follow-up questions sometimes derail an autoresearch session, leading to early termination.
- Low-signal loops: Sometimes Codex gets stuck in a trial loop. For example, training for a small number of steps and/or using a tiny batch, which cannot provide enough signal. A human researcher should easily spot this unproductive behavior and steer Codex away.
Several practices we have found useful during the building and testing of the autoresearch skills for NeMo RL and NeMo Gym include the following:
- Treat autoresearch skills as evolving workflow instructions. Codex can help update them over time to reflect institutional conventions, best practices, and lessons learned from previous runs.
- While Codex is resourceful and helpful, for tough research questions, human guidance and judgment are still mission-critical.
- It’s useful to go through an explicit brainstorming and planning process to validate ideas before a long-running autoresearch execution phase.
- Think of Codex as a capable intern or junior colleague. This implies that the human researcher doesn’t necessarily need to maintain a deep, single-line-of-code-level understanding of every implementation, but still has methodologies to validate to be confident in the work carried out.
- Set explicit budget constraints before starting a long-running autoresearch session, such as a time limit, GPU-hour budget, or maximum number of experiments. This keeps the agent focused on the highest-value hypotheses and prevents overly broad experiment sweeps.
Get started with autoresearch
Agents are not replacing researchers, but rather supporting a productive division of labor. The agent handles much of the setup, debugging, logging, and experiment loop while also providing insights and proposals for the next steps. The researcher defines the goal, provides domain judgment, steers the campaign, and decides which results are meaningful.
With NeMo RL, NeMo Gym, Brev, Codex, and a small set of operating skills, researchers can reduce the time and compute cost spent on setup, debugging, and repeated experiment execution. This shifts more of the workflow toward deciding which experiments are worth running next and how to interpret the results.
To get started with autoresearch for reinforcement learning, check out these related resources:
- Try the environment from the tutorial with the Brev Launchable.
- Review the NVIDIA-verified Agent Skills documentation and browse the NVIDIA/skills GitHub repo, including the NeMo RL Auto Research skill.
- Explore NVIDIA NeMo RL and NVIDIA NeMo Gym for RL training and gym environments.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み