本文へスキップ

構造化出力

決められた schema どおりの JSON を出させる

入力テキスト表

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

この能力とは何か

Takes natural language plus a target structure — field names, types, required flags — and outputs text that strictly conforms, such as JSON, XML or a table. Unlike information extraction the structure is supplied by the caller rather than inferred from the text; unlike tool use it produces the data itself, not a request to invoke some interface.

技術的にどう実現するか

The basic approach puts the schema and examples in the prompt and asks the model to fill them; more reliable is constrained decoding, which at each step allows only tokens that keep the structure valid, ruling out syntax errors during generation. Fine-tuning on many text-to-structure pairs familiarises the model with common field naming and type conventions. Large schemas can be split across several calls or filled in layers.

代表的な製品

5

OpenAI

GPT-4o

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

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

Anthropic

Claude

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

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

Google DeepMind

Gemini

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

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

Alibaba (Qwen)

Qwen

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

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

Tencent (Hunyuan)

Hunyuan

開放ウェイト版を含むテンセントの汎用モデル群

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

関連する組織

代表的な用途

  • Converting natural language into API payloads
  • Auto-filling forms and order fields
  • Data cleaning and normalisation pipelines
  • Passing structured messages between agents

どう評価するか

Schema validity rate
Share of outputs that parse and satisfy the schema
Field exact match
Share of field values matching the reference
Value-level F1
Scores elements in lists and nested structures

限界と難しさ

  • With many fields or long enums it drops fields, picks the wrong value or invents new ones
  • Deep nesting and complex types such as unions or nullable arrays produce type errors
  • Tight format constraints squeeze reasoning, and the same model reasons less well under them

背景にある概念

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

Transformer アーキテクチャ中級

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

4関連
図解 2 · データ 2

AI エンジニアリング・安全性・倫理

エージェントとツール利用中級

モデルに「答える」だけでなく、調べ、API を呼び、コードを走らせる力を持たせ、その結果から次の一手を決めさせる

4関連
図解 1 · データ 1