本文へスキップ

コード生成

自然言語の説明から動くコードを書く

入力テキストコード

本ページの本文は英語で提供されています。タイトルと導入は日本語化されています。

この能力とは何か

Takes a description — write a function that reads a CSV into a list of dicts and skips blank lines — and outputs the corresponding source. Unlike code completion it targets a new feature or a whole piece of logic, usually written from scratch; unlike reasoning the deliverable is compilable, runnable code rather than a textual conclusion.

技術的にどう実現するか

The base is a language model pre-trained on large code corpora; strict syntax makes code easier to verify by execution than prose, so unit-test pass signals work well as reward for reinforcement learning or rejection-sampling fine-tuning. Training and evaluation use problems with test cases such as HumanEval and MBPP, and generation can sample several candidates and discard the ones that fail.

代表的な製品

11

OpenAI

GPT-4o

ネイティブにマルチモーダルな汎用モデル。テキスト・画像・音声をひとつの入口で扱う

4能力
モデル クローズド
テキスト画像音声テキスト音声
2024

Anthropic

Claude

長い文脈と安全性の調整で知られる汎用対話モデル

4能力
モデル クローズド
テキスト画像テキスト
2023

DeepSeek

DeepSeek-V3

総パラメータ 671B、1 トークンあたり 37B だけを活性化するオープンウェイト MoE

4能力
モデル オープンウェイト
テキストテキスト
2024

Alibaba (Qwen)

Qwen

多様な規模とマルチモーダル版を備えたオープンウェイトのモデル群

4能力
モデル オープンウェイト
テキスト画像テキスト
2023

Google DeepMind

Gemini

ネイティブにマルチモーダルで、超長文脈を扱う汎用モデル

4能力
モデル クローズド
テキスト画像音声動画テキスト
2023

Microsoft

GitHub Copilot

エディタ上で文脈に沿ってコードを補完・改写する

2能力
ツール フリーミアム
テキストコードコード
2021

OpenAI

o3

答える前に長い推論を重ね、推論時の計算で正答率を上げる

3能力
モデル クローズド
テキスト画像テキスト
2025

Anthropic

Claude Code

ターミナルから多段のコーディング作業をこなすエージェント

3能力
ツール クローズド
テキストコードコード
2025

DeepSeek

DeepSeek-R1

強化学習で推論の連鎖を訓練し、MIT ライセンスで重みを公開した推論モデル

4能力
モデル オープンウェイト
テキストテキスト
2025

Cognition (Devin)

Devin

シェル・エディタ・ブラウザを備えた自律型コーディングエージェント

4能力
アプリ クローズド
テキストコードコード
2024

Anysphere (Cursor)

Cursor

リポジトリ全体を文脈にするデスクトップコードエディタ

3能力
アプリ フリーミアム
テキストコードコード
2023

関連する組織

代表的な用途

  • New features and utility scripts
  • Data cleaning and transformation scripts
  • Test cases and project scaffolding
  • Porting code across languages and frameworks

どう評価するか

pass@k
Share of problems with at least one sample passing all tests out of k
Benchmark pass rate
Pass rate on fixed sets such as HumanEval
Compile and lint pass rate
Whether generated code passes the compiler and type checks as-is

限界と難しさ

  • It invents libraries or methods, producing plausible interfaces that do not exist
  • Code can pass unit tests yet leave holes in edge cases, error handling and security
  • Multi-file changes are inconsistent, with call sites disagreeing with definitions

背景にある概念

自然言語処理と大規模言語モデル

Transformer アーキテクチャ中級

「一語ずつの伝言」を「全員が同時に話す会議」に置き換え、長距離依存を一跳で届かせる

4関連
図解 2 · データ 2

自然言語処理と大規模言語モデル

事前学習とファインチューニング中級

大量のラベルなしテキストで言語を学び、少量データで専門化する。現代 AI で最もデータ効率のよい范式

5関連
図解 1 · データ 1