OpenAI launches Structured Outputs to enhance the precision of AI-generated outputs. OpenAI has introduced a significant update to its API called Structured Outputs, designed to address challenges in generating consistent and valid JSON outputs for AI applications. This feature ensures 100% adherence to developer-supplied JSON schemas, which is crucial for seamless integration with existing systems.
OpenAI has introduced its latest multimodal model, GPT-4o, which stands out as the most advanced model from the company to date. GPT-4o offers faster performance and stronger vision capabilities compared to previous versions, including GPT-4 Turbo. As of August 6, 2024, Now, GPT-4o is available at a significantly reduced cost—$2.50 per 1 million input tokens and $10.00 per 1 million output tokens. This represents a 50% reduction in the cost for input tokens and a 33% decrease for output tokens compared to the previous model, GPT-4o-2024-05-13.
What are Structured Outputs?
Structured Outputs operate through a technique known as dynamic constrained decoding, which transforms JSON schemas into context-free grammars. This allows the AI to handle complex and recursive data structures more efficiently.
OpenAI has updated its Python and Node SDKs to natively support Structured Outputs. This feature is available across multiple models, including gpt-4o, gpt-4o-mini, gpt-4-0613, gpt-3.5-turbo-0613, and any fine-tuned models that support function calling. Structured Outputs can be utilized in the Chat Completions API, Assistants API, and Batch API, even when handling vision inputs.
The feature is available in two main forms:
-
Function Calling:
Developers can enforce strict schema adherence for tool definitions by setting ”strict: true” within function definitions. This applies to models starting from GPT-3.5-turbo-0613 and GPT-4-0613.
-
Response Format Option:
The new “json_schema” parameter allows models to generate structured responses that match the provided schema, even outside of function calls. This is currently available for the latest GPT-4o models, including the newly released GPT-4o-2024-08-06.
Competitive Landscape
By lowering its pricing, OpenAI now undercuts its competition, with the Gemini 1.5 Pro model from Google currently priced at $3.50 per 1 million input tokens and $10.50 per 1 million output tokens. This price reduction is expected to intensify the ongoing competition between OpenAI and Google, benefiting developers through increased access to advanced AI models at more affordable rates.
The recent pricing adjustments by OpenAI, coupled with innovations like Structured Outputs, signal a promising shift in the AI industry. As the competition between major players like OpenAI and Google heats up, developers can expect access to increasingly powerful and affordable large language models, driving innovation and expanding the capabilities of AI technology.
Despite the advancements, OpenAI acknowledges some limitations, such as support for only a subset of JSON Schema and potential additional latency for first-time schema preprocessing. However, these issues are expected to diminish with subsequent requests.
Advancements in JSON and Structured Outputs
With the latest update, OpenAI launches Structured Outputs for improved JSON compatibility. During DevDay 2023, OpenAI initially introduced a JSON mode that allows models to generate valid JSON outputs without conforming to specific schemas. Building on this, OpenAI has now unveiled Structured Outputs, a feature that ensures model-generated outputs align precisely with JSON Schemas provided by developers. This capability is now available in OpenAI’s API.
OpenAI has also enhanced its Python and Node SDKs to support Structured Outputs, making it easier for developers to implement and handle these structured responses.
Moreover, OpenAI has released a new model, GPT-4o-2024-08-06, which excels in following complex JSON schemas and comes with significant cost reductions, making it more accessible for developers.
OpenAI launches Structured Outputs, a feature now available across multiple models including GPT-4o. Structured Outputs with specific response formats are available on the latest GPT-4o models, including gpt-4o-mini and gpt-4o-2024-08-06, as well as any fine-tuned models based on these. These capabilities can be used across various APIs. However, JSON Schemas supplied with Structured Outputs will not be eligible for Zero Data Retention.
Also Read: Missed Chances: OpenAI Sought Intel’s Investment 7 Years Ago.