[論文レビュー] InterCode: Standardizing and Benchmarking Interactive Coding with Execution Feedback
InterCodeは実行フィードバックを伴う対話的コード生成の軽量なDockerベースのフレームワークを提供し、Bash、SQL、Python環境をデモンストレーションして、さまざまな prompting 戦略下で最先端のLLMをベンチマークします。
Humans write code in a fundamentally interactive manner and rely on constant execution feedback to correct errors, resolve ambiguities, and decompose tasks. While LLMs have recently exhibited promising coding capabilities, current coding benchmarks mostly consider a static instruction-to-code sequence transduction process, which has the potential for error propagation and a disconnect between the generated code and its final execution environment. To address this gap, we introduce InterCode, a lightweight, flexible, and easy-to-use framework of interactive coding as a standard reinforcement learning (RL) environment, with code as actions and execution feedback as observations. Our framework is language and platform agnostic, uses self-contained Docker environments to provide safe and reproducible execution, and is compatible out-of-the-box with traditional seq2seq coding methods, while enabling the development of new methods for interactive code generation. We use InterCode to create three interactive code environments with Bash, SQL, and Python as action spaces, leveraging data from the static NL2Bash, Spider, and MBPP datasets. We demonstrate InterCode's viability as a testbed by evaluating multiple state-of-the-art LLMs configured with different prompting strategies such as ReAct and Plan & Solve. Our results showcase the benefits of interactive code generation and demonstrate that InterCode can serve as a challenging benchmark for advancing code understanding and generation capabilities. InterCode is designed to be easily extensible and can even be used to create new tasks such as Capture the Flag, a popular coding puzzle that is inherently multi-step and involves multiple programming languages. Project site with code and data: https://intercode-benchmark.github.io
研究の動機と目的
- 人間の書く・実行する・テストするデバッグを模倣して、実行フィードバックを伴うコード生成を改善する。
- Dockerコンテナを介して拡張可能で安全、環境に依存しない対話型コーディングフレームワークを提供する。
- 既存の静的データセットを対話タスクへグラウンド化し、反復的な改良と評価を可能にする。
- 複数のLLMと prompting戦略を評価して、コーディングタスクにおけるインタラクションの利点を定量化する。
- 新しい対話型コーディングのベンチマークとデータセットを作成するための拡張可能なタスク構築パイプラインを提案する。
提案手法
- InterCodeを指示空間・状態・行動・観測・報酬信号を含む部分的に観測可能マルコフ決定過程(POMDP)として定義する。
- Dockerベースの実行サンドボックスを実装して、Bash・SQL・Python環境を行動空間としてホストする。
- 静的なNL-to-codeデータセット(NL2Bash、Spider、MBPP)を、実行可能な環境へ命令とゴールド応答をグラウンド化して対話タスクへ転換する。
- 実行ベースの報酬(厳密一致とIoU/Kendall基準の variante)を用い、カスタム信号用の報酬関数エンドポイントを提供する。
- 複数の prompting戦略(Single Turn、Try Again、ReAct、Plan & Solve)下で、幅広いモデル(OpenAI、PaLM-2、Open Source)を評価する。
- 既存データセットをInterCodeタスクへ変換し、ユニットテストで安全性を検証するモジュラーなデータ収集・環境構築パイプラインを提供する。
実験結果
リサーチクエスチョン
- RQ1対話的なコーディングは実行フィードバックを伴うと、静的なseq2seqベンチマークよりコード生成を改善できるか。
- RQ2Bash・SQL・Pythonタスクにおいて、異なる prompting戦略は対話的コーディングの有効性にどのような影響を与えるか。
- RQ3長時間の対話型コーディングにおける現行LLMの課題と限界は何か、そしてInterCodeはどのように改善を促進できるか。
- RQ4既存のNL-to-codeデータセットを、安全な実行環境を備えた柔軟な対話タスクへどう変換できるか。
- RQ5InterCodeはCTF風の多言語パズルなど新しいタスクをサポートする拡張性を十分に備えているか。
主な発見
- 対話的なコーディングは、マルチターンの対話を用いることでタスクとモデル間のパフォーマンスを向上させる。
- GPT-4はTry Again promptingでInterCode-SQLにおいて最大73.7%の成功を達成し、対話からの大きな利益を示した。
- 明示的な推論を促す prompting戦略(ReAct、Plan & Solve)は、単純なアプローチより成功率が高く、ターン数が少なくても適合性が向上する傾向がある。
- モデルは計画とモジュール化された問題解決を示し、観測を用いて高次の行動を構成し、以前に解決されたサブ問題を活用して多段階タスクに取り組む。
- InterCodeは対話的コード生成を評価する安全で拡張可能なベンチマークとして機能し、Dockerベースの環境を通じて新しいデータセットやタスクをグラウンド化するために利用できる。
- フレームワークは多様なタスク設定(Bash、SQL、Python)をサポートし、さらなる言語やCTF風のようなより複雑なタスクへ拡張可能である。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。