生成AI支援コーディングによるKaggleコンペ優勝
本記事は、2026年3月のKaggleコンペで複数のLLMエージェントとGPUライブラリを組み合わせ、60万行以上のコード生成と850回の実験を自動化して1位を獲得した事例を分析している。
キーポイント
LLMエージェントとGPUの相乗効果
コード生成のボトルネックをLLMエージェントが解決し、GPUアクセラレーションと組み合わさることで実験ループが大幅に圧縮されている。
Kaggleチーラン予測コンペの勝利戦略
AUCを最適化する4段階スタック構造を採用し、850個のモデル候補から150個を選別する大規模な探索・選定プロセスを自動化した。
反復実験のスケール拡大
従来の手動コーディングと実行の制約を超え、LLMによる自動コード生成が実験回数を指数関数的に増加させ、高性能な予測モデルの発見を可能にした。
LLMエージェントによる反復型EDAの実現
大規模言語モデル(LLM)エージェントがデータ探索(EDA)のためにコードを自動生成し、実行するプロセスを繰り返すことで、効率的なデータ理解と特徴量エンジニアリングを実現している。
LLMエージェントによる反復型特徴量エンジニアリング
LLMエージェントが新しい特徴量の生成とモデル評価を自律的に繰り返すサイクルを構築し、モデル性能の継続的な向上を実現している。
自動化された探索と評価パイプライン
人間の介入を最小限に抑え、特徴量エンジニアリングからモデル評価までをAIエージェントが一元管理する開発フローを確立している。
影響分析・編集コメントを表示
影響分析
本記事は、LLMエージェントがML開発の「コード記述」段階を自動化し、GPUアクセラレーションと連携することで実験サイクルを劇的に短縮できることを示している。このアプローチは学術・産業問わず、ハイパーパラメータ探索やモデルアーキテクチャの自動最適化を標準化する可能性があり、AI開発リソースの配分と生産性革命に直結する。
編集コメント
LLMが単なる開発補助から「自律的な実験設計者」へ進化している兆候であり、今後はコンペティションだけでなく実務のモデル開発パイプラインでも標準化が進むと予想される。
2026年3月、3つのLLMエージェント(Large Language Model agents)が60万行以上のコードを生成し、850回の実験を実行し、Kaggleのプレイグラウンドコンペティションで1位入賞を果たすのを支援しました。
現代の機械学習コンペティションにおける成功は、いかに迅速にアイデアを生成し、テストし、反復できるかによって定義されつつあります。LLMエージェントとGPUアクセラレーション(GPU acceleration)を組み合わせることで、このループは劇的に圧縮されます。
歴史的に、この実験を制限してきた2つのボトルネックがあります。
- 新しい実験のためのコードをいかに迅速に記述できるか。
- それらの実験をいかに迅速に実行できるか。
GPUやNVIDIA cuDF、NVIDIA cuML、XGBoost、PyTorchなどのライブラリは、2番目の問題をほぼ解決しました。LLMエージェントが現在1番目の問題に対応しており、これにより迅速な反復実験の新たな規模が可能になります。
本ブログ記事では、最も高性能な表形式データ予測ソリューションの発見を加速するためにLLMエージェントをどのように使用したかを説明します。
ケーススタディ:Kaggleプレイグラウンドの顧客離脱予測
2026年3月のKaggleプレイグラウンドコンペティションでは、参加者に電信顧客の離脱予測に挑戦してもらい、パフォーマンスは曲線下面積(area under the curve, AUC)で測定されました。最も正確なソリューションが勝利します。
1位ソリューションは、850個の中から選抜された150モデルによる4層のスタックです。
image*図1. 150モデルが勝利を収める4層スタックにどのように組み合わされるかを示す図*
ガイド付きLLMエージェントのワークフロー
この表形式データコンペティションでは、以前のブログ記事で説明されているKaggleグランドマスターのプレイブックに従うよう、LLMエージェントを誘導しました。
具体的には、LLMエージェントは以下のワークフローに従います。探索的データ分析(exploratory data analysis, EDA)から始まり、ベースラインの構築、特徴量エンジニアリング(feature engineering)、そして最後にヒルクライミング(hill climbing)とスタッキング(stacking)によるモデルの結合です。
このソリューションは、ヒューマン・イン・ザ・ループ(human-in-the-loop)ワークフローにおいて、複数のLLMエージェント(GPT-5.4 Pro、Gemini 3.1 Pro、Claude Opus 4.6)を使用しました。
ステップ1:LLMエージェントによるEDAの実行
LLMエージェントは、完全なパイプラインを生成する前にデータ構造を理解する必要があります。
重要な質問には以下が含まれます。
- 学習セットとテストセットには、それぞれどのくらいの行数と列数がありますか?
- 目的変数(ターゲット)の列はどれで、どのようにフォーマットされていますか?
- このタスクは分類問題ですか、回帰問題ですか?
- 利用可能な特徴量はどれで、どのようにフォーマットされていますか?
- どの特徴量がカテゴリカル(カテゴリ)変数または数値変数ですか?
- 欠損データはありますか?
この情報は事前に提供するか、EDAを通じて自動的に推論することができます。
image*図2. LLMエージェントは、EDAコードを繰り返し記述して実行することでデータを探索します*
チャットウィンドウでLLMを使用する場合、以下のようにプロンプトします。
「train.csvとtest.csvというCSVファイルを検索・探索するための探索的データ分析(EDA)コードを書いてください。私がそのコードを実行し、プロット結果やテキストをあなたに共有します。」
Claude Codeのようなコード実行機能付きの大規模言語モデル(LLM)を使用する場合、データ理解のためにLLMに自身のコードの作成と実行を依頼できます。
「train.csvとtest.csvというCSVファイルを理解するための探索的データ分析(EDA)コードを作成し、実行してください」
ステップ2:LLMエージェントがベースラインを構築する
LLMがデータ、具体的には特徴量カラムとターゲットカラムを理解したら、特定のモデルをLLMに依頼してkfold(k分割交差検証)モデルを学習する最初の完全なパイプラインを作成する時が来ました。
「train.csvとtest.csvを読み込み、kfold XGBoostモデルを学習する完全なコードパイプラインを書いてください。OOF(fold外予測値)とTest PREDSをNumpyファイルとしてディスクに保存してください。各foldおよび全体のメトリクススコアを表示します。」
出力されたコードをコピーしてコードベースに貼り付けます。コマンドラインまたはIDEエージェントを使用している場合は、PythonファイルやJupyter Notebookを直接作成させるようにします。
コードを実行して、最初のCV(交差検証)メトリクススコア、OOFファイル、Test PREDファイルを入手します。
GBDT(勾配ブースティング決定木)、NN(ニューラルネットワーク)、ML(機械学習)モデルなど、さまざまなベースラインの構築をLLMに依頼できます。各実験ではCVスコアが報告され、予測値は「train_oof_[MODEL]_[VERSION].npy」と「test_preds_[MODEL]_[VERSION].npy」という形式でディスクに保存されます。
これらのファイルは重要であり、後ほど使用します。
ステップ3:LLMエージェントが特徴量エンジニアリングを実行する
現在、多様なモデルのコレクションがあり、それらのベースラインとなるCVメトリクススコアが分かっています。特徴量エンジニアリングやモデルのチューニング・改善によって、各モデルを向上させることができます。特徴量エンジニアリングは、モデルがより多くのシグナル(有用な情報)を抽出できるようにデータを変換することに焦点を当てています。一方、モデルのチューニング・改善は、より多くのシグナルを抽出するためにモデル自体を変更することに焦点を当てています。LLMエージェントはこれらのタスクの両方に優れています。
実験を反復的に実行し、モデルを改善するすべてのアイデアを採用し続けることで、より優れたモデルが生まれます。実験の結果が良かろうが悪かろうが、常にOOFとテスト予測値をディスクに保存してください。
image*Figure 3. LLM Agents improve models by repeatedly exploring feature engineering and evaluating the new model*
LLMエージェントは、必要な速度でコードを記述できます。サイクルを加速するために、cuDF、cuML、勾配ブースティング決定木(GBDT)用のGPUライブラリ、PyTorch GPUなど、常にGPUおよびGPU対応ライブラリを使用して、各実験を可能な限り高速に実行します。
新しいアイデアを生成するには、私たちが提案するか、LLMに生成させるかのいずれかです。LLMにアイデアを生成させるための効果的な方法には、以下のようなものがあります:
- 関連する研究論文を探して読むようLLMに依頼する。
- 関連フォーラムや公開されているコードを読むようLLMに依頼する。
- 特徴量エンジニアリングのために、特徴量とターゲットの関係を特定する探索的データ分析(EDA)を実行させる。
- 現在のナレッジベースに基づいてLLMにアイデアを依頼する。
- 人間がLLMとブレインストーミングを行い、一緒にアイデアを創出する。
私たちのアイデアの1つを使用して、LLMエージェントに既存のコードから新しいコードを作成させることができます:
「以下のコードの代わりに、ABC の代わりに XYZ を使用する完全な置換コードを書いてください」
これで、新しい実験を実行する準備が整いました!
ステップ 4:LLM エージェントがモデルを組み合わせる
ここまでで、それぞれが独自のモデルと異なる特徴量エンジニアリング(feature engineering)を備えた多数の実験結果が存在し、それらは Python スクリプトまたは Jupyter Notebook に保存されています。LLM エージェントはこれらのモデルやアイデアを組み合わせることに優れており、以下のような多様な方法で私たちのすべてのモデルを活用・管理するのを助けてくれます。
- すべてのモデルタイプと特徴量エンジニアリングを要約する。
- 異なるモデルや特徴量エンジニアリングのアイデアを組み合わせて、より強力な単一モデルを構築する。
- 異なるモデルからアンサンブル(ensembles)を構築する。
- 他のモデルの上にスタック(stacking)モデルを構築する。
- 一部のモデルを使用して疑似ラベル付け(pseudo-labeling)や知識蒸留(knowledge distillation)を行い、より強力な単一モデルに適用する。
私が最初にやるべき有用なことのひとつは、LLM エージェントにすべての実験を要約させることです。チャットウィンドウにファイルをドラッグ&ドロップするか、Claude Code などの LLM コマンドラインエージェントを使用して、複数のファイルにわたる結果を読み取り集約できます。これにより、データと問題の理解が深まり、何が機能しているかが明確になります。
強力な手法のひとつは、LLM エージェントに複数のアイデアやモデルを単一モデルに組み合わせさせることです。
「これらの IPYNB ファイルをすべて読み取り、すべてのアイデアを活用して、これらすべてのモデルよりも強力な新しい単一 XGBoost モデルを学習する完全なコードを書いてもらえますか?」
もう一つの手法は、一部のモデルまたはすべてのモデルから知識を単一モデルに転移させることです。私たちは OOF(Out-of-Fold:交差検証外予測)およびテスト予測値(これらは本質的に疑似ラベルです)を使用して、知識をより強力な単一モデルに転移させます。
「すべての OOF および Test PREDs から知識蒸留を用いて新しい単一 NN(ニューラルネットワーク)または GBDT(勾配ブースト決定木)を学習し、高性能な新しい単一モデルを作成してもらえますか?」
上記の両方の手法は、新しい実験と新しい OOF およびテスト予測ファイルを生み出します。新しい特徴量エンジニアリングやモデル改善を施した各ベースラインモデルと実験には、対応する OOF およびテスト予測ファイルが関連付けられています。数百ものファイルが存在するのは珍しくありません。ここで、LLM にヒルクライミング(hill climbing)やスタッキング(stacking)を用いた組み合わせを依頼できます。
「すべての OOF および Test PREDs を、さまざまなメタモデル(meta models)を用いて組み合わせる試行をしてもらえますか?ヒルクライミング、リッジ/ロジスティック回帰(Ridge/Logistic regression)、NN、GBDT スタッカーを試してください。よろしくお願いします」
結果
上記の 4 つのステップを踏むことで、多様なモデルセットを作成します。その後、各モデルのパフォーマンスを向上させます。最後に、すべてを強力なソリューションに組み合わせます。この手法の利点は、GPU 加速されたモデル実行と LLM エージェントによる高速なコード記述により、多くのアイデアを迅速に探索できる点にあります。誰もが、テーブルデータ予測タスクにおいて最もパフォーマンスの高いソリューションを探す際に、これらの手法を活用できます。
はじめに
結果を加速させる準備はできましたか?まずは、cuDF(CUDA DataFrames)および cuML(CUDA Machine Learning)ライブラリ、そして CUDA-X for data science(データサイエンス向けCUDA-X)について探索することから始めてみてください。
さらに深く掘り下げるには、DLI workshop on feature engineering(機能エンジニアリングに関するDLIワークショップ)でスキルを磨いてください。また、The Kaggle Grandmasters Playbook: 7 Battle-Tested Modeling Techniques for Tabular Data(カググル・グランマスターズプレイブック:表形式データのための7つの実証済みモデリング手法)という記事から、プロフェッショナルな戦略を学んでみてください。
原文を表示
In March 2026, three LLM agents generated over 600,000 lines of code, ran 850 experiments, and helped secure a first-place finish in a Kaggle playground competition.
Success in modern machine learning competitions is increasingly defined by how quickly you can generate, test, and iterate on ideas. LLM agents, combined with GPU acceleration, dramatically compress this loop.
Historically, two bottlenecks have limited this experimentation:
- How quickly you can write code for new experiments.
- How quickly you can execute those experiments.
GPUs and libraries like NVIDIA cuDF, NVIDIA cuML, XGBoost, and PyTorch have largely solved the second problem. LLM agents now address the first problem—unlocking a new scale of rapid, iterative experimentation.
This blog post describes how I used LLM agents to accelerate the discovery of the most performant tabular data prediction solutions.
Case study: Kaggle Playground churn prediction
The March 2026 Kaggle Playground competition challenged participants to predict telecom customer churn with performance measured by area under the curve (AUC)—where the most accurate solution wins.
The first-place solution is a four-level stack of 150 models, selected from 850.

Guided LLM agent workflow
In this tabular data competition, I guided LLM agents to follow the Kaggle Grandmaster playbook described in a previous blog post.
Specifically, LLM agents follow a workflow: starting with exploratory data analysis (EDA), then building baselines, followed by feature engineering, and finally combining models through hill climbing and stacking.
The solution used multiple LLM agents—GPT-5.4 Pro, Gemini 3.1 Pro, Claude Opus 4.6— in a human-in-the-loop workflow.
Step 1: LLM agents perform EDA
An LLM agent must understand data structure before generating a full pipeline.
Key questions include:
- How many rows and columns are in the training and test sets?
- What’s the target column, and how is it formatted?
- Is the task classification or regression?
- What features are available and how are they formatted?
- Which features are categorical or numeric?
- Is there missing data?
This information can be provided upfront or inferred automatically through EDA.

If using LLM in a chat window, prompt with:
“Please write EDA code to explore the CSV file train.csv and test.csv. I will run the code and share the plots and text back with you.”
If using LLM with code execution like Claude Code, then you can ask the LLM to write and run its own code to understand the data.
“Please write and run EDA code to understand the CSV files train.csv and test.csv”
Step 2: LLM agents build baselines
Once the LLM understands the data, specifically the feature columns and target column, it’s time to write the first full pipeline to train a kfold model by asking the LLM for a specific model.
“Please write full code pipeline to read train.csv and test.csv and train a kfold XGBoost model. Save the OOF (out of fold predictions) and the Test PREDS to disk as Numpy files. Display the metric score each fold and overall.”
Copy and paste the output code into your codebase. When using a command-line or IDE agent, have it create a Python or Jupyter Notebook directly.
Run the code to obtain your first CV metric score, OOF, and Test PRED files.
You can ask the LLM to build a variety of baselines, including GBDT, NN, and ML models. Each experiment reports a CV score and saves predictions to disk as: “train_oof_[MODEL]_[VERSION].npy” and “test_preds_[MODEL]_[VERSION].npy”.
These files are important, and we’ll use them later.
Step 3: LLM agents perform feature engineering
We now have a collection of diverse models and know their baseline CV metric scores. We can improve each model with feature engineering and/or model tuning/improvements. Feature engineering focuses on transforming the data so our models can extract more signal. And model tuning/improvements focus on modifying the model to extract more signal. LLM agents excel at both of these tasks.
Iteratively running experiments and keeping all ideas that improve the models leads to better and better models. For each experiment, good or bad, always save the OOF and test prediction to disk.

LLM agents can write code as fast as we want. To accelerate the cycle, we run each experiment as fast as possible by always using GPUs and GPU libraries such as cuDF, cuML, gradient boosting decision tree GPUs, and PyTorch GPUs.
To generate new ideas, we can either propose them or have LLMs generate them. There are many effective ways to encourage LLMs to generate ideas, such as:
- Ask LLMs to find and read research papers on the topic.
- Ask LLMs to read forums and publicly shared code on the topic.
- Have LLMs perform EDA to determine relationships between features and targets for feature engineering.
- Ask LLMs for ideas based on the current knowledge base.
- Have humans brainstorm with LLMs and create ideas together.
Using one of our ideas, we can ask an LLM agent to create new code from our old code:
“Please write me a complete replacement code for the code below that uses XYZ instead of ABC”.
We now have a new experiment to run!
Step 4: LLM agents combine models
At this point, we have lots of experiment results, each with its own model and different feature engineering saved in a Python script or Jupyter Notebook. LLM agents excel at combining all these models and ideas and can help us use and manage all our models in various ways, like:
- Summarize all model types and feature engineering.
- Combine ideas from different models and feature engineering to build new, stronger single models.
- Build ensembles from different models.
- Stack models over other models.
- Use some models to pseudo-label / knowledge distill into new, stronger single models.
One of the most useful first things I like to do is ask an LLM agent to summarize all our experiments. We can drag and drop files into a chat window, or use an LLM command-line agent (like Claude Code) to read and aggregate results across multiple files. This helps us better understand the data and problem, showing us what is working.
One powerful technique is to ask the LLM agent to combine multiple ideas/models into a single model.
“Can you read all these IPYNB files and use all these ideas to write full code to train a new single XGBoost model which is stronger than all of these models?”
Another technique is to transfer the knowledge from some or all of our models into a single model. We use our OOF and test predictions (which are essentially pseudo-labels) to transfer knowledge into a new, stronger single model.
“Can you please train a new single NN or GBDT using knowledge distillation from all our OOF and Test PREDs and make a new high performing single model?”
Both techniques above produce new experiments and new OOF and test prediction files. Each baseline model and experiment with new feature engineering and/or model improvements has an associated OOF and test prediction file. It’s common to have hundreds of files. We can now ask LLMs to combine using hill climbing and/or stacking.
“Can you please try combining all our OOF and Test PREDs using various meta models? Please try Hill Climbing, Ridge/Logistic regression, NN, and GBDT stackers. Thanks”
Results
Following the four steps above, we create a diverse set of models. Then we improve each model’s performance. Finally, we combine everything into a powerful solution. The advantage lies in exploring many ideas quickly with GPU-accelerated model execution and LLM agents to write code faster. Everyone can employ these techniques when searching for the most performant solution to their tabular data prediction tasks.
Get started
Ready to accelerate your results? Get started by exploring the cuDF and cuML libraries and CUDA-X for data science.
For a deeper dive, sharpen your skills with a DLI workshop on feature engineering. Pick up professional strategies from the post The Kaggle Grandmasters Playbook: 7 Battle-Tested Modeling Techniques for Tabular Data.
関連記事
自動化
OpenAIはCodexにスケジュールとトリガーによる自動実行機能を追加した。Codexはこれにより、ユーザーの指示を待たずに定期的にタスクを自動実行する。
AIはいつ手を引くべきか?:人間が介入を望むタイミングをエージェントに教える
CMUなどの研究者が、AIエージェントが人間の介入を必要とする状況を学習する手法を提案した。この研究は、AIと人間の協調作業における信頼性と効率性の向上を目指している。
あなたのハーネス、あなたの記憶
AIエージェントのハーネスはエージェント構築の主流となり、エージェントの記憶と密接に関連している。クローズドなハーネスを使用すると、エージェントの記憶制御を第三者に委ねることになる。記憶は優れたエージェント体験の構築に極めて重要である。