Last year at DevDay, we introduced JSON mode—a useful building block for developers looking to build reliable applications with our models. While JSON mode improves model reliability for generating valid JSON outputs, it does not guarantee that the model's response will conform to a particular schema. Today we're introducing Structured Outputs in the API, a new feature designed to ensure model-generated outputs will exactly match JSON Schemas provided by developers.
Generating structured data from unstructured inputs is one of the core use cases for AI in today's applications. Developers use the OpenAI API to build powerful assistants that have the ability to fetch data and answer questions via function calling(opens in a new window), extract structured data for data entry, and build multi-step agentic workflows that allow LLMs to take actions. Developers have long been working around the limitations of LLMs in this area via open source tooling, prompting, and retrying requests repeatedly to ensure that model outputs match the formats needed to interoperate with their systems. Structured Outputs solves this problem by constraining OpenAI models to match developer-supplied schemas and by training our models to better understand complicated schemas.
On our evals of complex JSON schema following, our new model gpt-4o-2024-08-06 with Structured Outputs scores a perfect 100%. In comparison, gpt-4-0613 scores less than 40%.
昨年のDevDayで、JSONモードを紹介しました。これは、当社のモデルを使用して信頼性の高いアプリケーションを構築する開発者にとって有用なビルディングブロックです。JSONモードは正しいJSON出力を生成するためにモデルの信頼性を高めますが、モデルの応答が特定のスキーマに従うことを保証するわけではありません。本日、APIで構造化出力機能を導入し、開発者が提供するJSONスキーマと完全に一致するようにモデル生成の出力を確認するための新機能を紹介します。
非構造化入力から構造化データを生成することは、今日のアプリケーションで人工知能の主要な用途の1つです。開発者はOpenAI APIを使用して、データ入力のための構造化データの抽出、関数呼び出しを介したデータの取得と質問の回答、LLMsがアクションを実行できるマルチステップエージェントワークフローの構築など、強力なアシスタントを構築しています。開発者は、オープンソースツール、プロンプト、リトライを使用して、LLMsの制限に取り組むことが長い間ありました。これは、モデルの出力がシステムと相互運用するために必要な形式に一致するように、リクエストを繰り返し試行することを意味します。構造化出力は、OpenAIモデルを開発者が提供するスキーマに合わせるように制限し、複雑なスキーマを理解するためにモデルのトレーニングを改善することで、この問題を解決します。
複雑なJSONスキーマの評価において、構造化出力を搭載した新しいモデルgpt-4o-2024-08-06は、完璧な100%のスコアを獲得しています。一方、gpt-4-0613は40%未満のスコアを獲得しています。