다음을 통해 공유


Azure OpenAI 추론 모델

Azure OpenAI 추론 모델은 더욱 향상된 집중력과 기능으로 추론 및 문제 해결 작업을 처리하도록 설계되었습니다. 이러한 모델은 사용자의 요청을 처리하고 이해하는 데 더 많은 시간을 할애하여 이전 반복에 비해 과학, 코딩 및 수학과 같은 영역에서 매우 강력합니다.

추론 모델의 주요 기능:

  • 복잡한 코드 생성: 개발자를 지원하기 위해 알고리즘을 생성하고 고급 코딩 작업을 처리할 수 있습니다.
  • 고급 문제 해결: 포괄적인 브레인스토밍 세션 및 다각적인 문제 해결에 이상적입니다.
  • 복잡한 문서 비교: 계약, 사례 파일 또는 법적 문서를 분석하여 미묘한 차이를 식별하는 데 적합합니다.
  • 지침 따르기 및 워크플로 관리: 더 짧은 컨텍스트가 필요한 워크플로를 관리하는 데 특히 효과적입니다.

가용도

지역 가용성

모델 지역 제한된 액세스
gpt-5 미국 동부2 및 스웨덴 중부(글로벌 표준 및 데이터 영역) 액세스 요청: gpt-5 제한된 액세스 모델 애플리케이션. 이미 o3 access가 있는 경우 요청이 필요하지 않습니다.
gpt-5-mini 미국 동부2 및 스웨덴 중부(글로벌 표준 및 데이터 영역) 액세스 요청이 필요하지 않습니다.
gpt-5-nano 미국 동부2 및 스웨덴 중부(글로벌 표준 및 데이터 영역) 액세스 요청이 필요하지 않습니다.
o3-pro 미국 동부2 및 스웨덴 중부(글로벌 표준) 액세스 요청: o3 제한된 액세스 모델 애플리케이션. 이미 o3 access가 있는 경우 요청이 필요하지 않습니다.
codex-mini 미국 동부2 및 스웨덴 중부(글로벌 표준) 액세스 요청이 필요하지 않습니다.
o4-mini 모델 가용성 이 모델의 핵심 기능을 사용하는 데 필요한 액세스 요청이 없습니다.

액세스 요청: o4-mini 추론 요약 기능
o3 모델 가용성 액세스 요청: o3 제한된 액세스 모델 애플리케이션
o3-mini 모델 가용성. 이 모델에 대한 액세스가 더 이상 제한되지 않습니다.
o1 모델 가용성. 이 모델에 대한 액세스가 더 이상 제한되지 않습니다.
o1-mini 모델 가용성. 전역 표준 배포에 필요한 액세스 요청이 없습니다.

표준(지역) 배포는 o1-preview 릴리스의 일환으로 이전에 액세스 권한을 받은 특정 고객만 현재 사용할 수 있습니다.

API 및 기능 지원

특징 gpt-5, 2025-08-07 gpt-5-mini, 2025-08-07 gpt-5-nano, 2025-08-07
API 버전 v1 v1 v1
개발자 메시지
구조적 출력
컨텍스트 창 400,000

입력: 272,000
출력: 128,000
400,000

입력: 272,000
출력: 128,000
400,000

입력: 272,000
출력: 128,000
추론 노력
이미지 입력
채팅 완료 API
응답 API
함수/도구
병렬 도구 호출1
max_completion_tokens 2
시스템 메시지 3
추론 요약
스트리밍

1reasoning_effortminimal로 설정된 경우 병렬 도구 호출이 지원되지 않습니다.

2 추론 모델은 채팅 완료 API를 max_completion_tokens 사용하는 경우에만 매개 변수에서 작동합니다. 사용할 때 응답 API와 함께 max_output_tokens를 사용하십시오.

3 최신 추론 모델은 마이그레이션을 보다 쉽게 만들기 위해 시스템 메시지를 지원합니다. 동일한 API 요청에서 개발자 메시지와 시스템 메시지를 모두 사용하면 안 됩니다.

새로운 GPT-5 추론 기능

특징 설명
reasoning_effort minimal은 이제 GPT-5 시리즈 추론 모델에서 지원됩니다.

옵션: minimal, low, medium, high
verbosity 모델 출력의 간결성을 더욱 세부적으로 제어할 수 있는 새로운 매개 변수입니다.

옵션:low, medium, high.
preamble GPT-5 시리즈 추론 모델은 함수/도구 호출을 실행하기 전에 추가 시간을 "생각"하는 데 할애할 수 있습니다.

이러한 계획이 발생하면 모델은 preamble 개체라는 새 개체를 통해 모델 응답의 계획 단계에 대한 인사이트를 제공할 수 있습니다.

모델 응답에서 프리앰블 생성은 보장되지 않지만 instructions 매개 변수를 사용하고 "함수 호출 전에 반드시 광범위하게 계획을 세워야 합니다. 함수를 호출하기 전에 항상 사용자에게 계획을 출력합니다"와 같은 콘텐츠를 전달하여 모델을 활성화할 수 있습니다.
허용된 도구 tool_choice에 도구 하나만 지정하는 대신 여러 도구를 지정할 수 있습니다.
사용자 지정 도구 형식 원시 텍스트(비 JSON) 출력 사용
lark_tool 모델 응답을 보다 유연하게 제한하기 위해 Python lark의 일부 기능을 사용할 수 있습니다.

자세한 내용은 OpenAI의 GPT-5 프롬프트 작성 쿡북 가이드GPT-5 기능 가이드를 읽어보시기 바랍니다.

비고

  • 시간 제한을 방지하려면 백그라운드 모드 를 사용하는 o3-pro것이 좋습니다.
  • o3-pro 는 현재 이미지 생성을 지원하지 않습니다.

지원되지 않음

다음은 현재 추론 모델에서 지원되지 않습니다.

  • temperature, top_p, presence_penalty, frequency_penalty, logprobs, top_logprobs, logit_biasmax_tokens

사용법

이러한 모델은 현재 채팅 완료 API를 사용하는 다른 모델과 동일한 매개 변수 집합을 지원하지 않습니다 .

다음과 같은 max_completion_tokens새 매개 변수를 활용하려면 OpenAI Python 라이브러리의 버전을 업그레이드해야 할 수 있습니다.

pip install openai --upgrade
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("AZURE_OPENAI_API_KEY"),
    base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
)

response = client.chat.completions.create(
    model="gpt-5-mini", # replace with the model deployment name of your o1 deployment.
    messages=[
        {"role": "user", "content": "What steps should I think about when writing my first Python API?"},
    ],
    max_completion_tokens = 5000

)

print(response.model_dump_json(indent=2))

Python 출력:

{
  "id": "chatcmpl-AEj7pKFoiTqDPHuxOcirA9KIvf3yz",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": "Writing your first Python API is an exciting step in developing software that can communicate with other applications. An API (Application Programming Interface) allows different software systems to interact with each other, enabling data exchange and functionality sharing. Here are the steps you should consider when creating your first Python API...truncated for brevity.",
        "refusal": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null
      },
      "content_filter_results": {
        "hate": {
          "filtered": false,
          "severity": "safe"
        },
        "protected_material_code": {
          "filtered": false,
          "detected": false
        },
        "protected_material_text": {
          "filtered": false,
          "detected": false
        },
        "self_harm": {
          "filtered": false,
          "severity": "safe"
        },
        "sexual": {
          "filtered": false,
          "severity": "safe"
        },
        "violence": {
          "filtered": false,
          "severity": "safe"
        }
      }
    }
  ],
  "created": 1728073417,
  "model": "o1-2024-12-17",
  "object": "chat.completion",
  "service_tier": null,
  "system_fingerprint": "fp_503a95a7d8",
  "usage": {
    "completion_tokens": 1843,
    "prompt_tokens": 20,
    "total_tokens": 1863,
    "completion_tokens_details": {
      "audio_tokens": null,
      "reasoning_tokens": 448
    },
    "prompt_tokens_details": {
      "audio_tokens": null,
      "cached_tokens": 0
    }
  },
  "prompt_filter_results": [
    {
      "prompt_index": 0,
      "content_filter_results": {
        "custom_blocklists": {
          "filtered": false
        },
        "hate": {
          "filtered": false,
          "severity": "safe"
        },
        "jailbreak": {
          "filtered": false,
          "detected": false
        },
        "self_harm": {
          "filtered": false,
          "severity": "safe"
        },
        "sexual": {
          "filtered": false,
          "severity": "safe"
        },
        "violence": {
          "filtered": false,
          "severity": "safe"
        }
      }
    }
  ]
}

추론 노력

비고

추론 모델은 모델 응답의 reasoning_tokens의 일부로 completion_tokens_details를 갖습니다. 이러한 토큰은 메시지 응답 콘텐츠의 일부로 반환되지 않지만 모델에 의해 요청에 대한 최종 답변을 생성하는 데 사용되는 숨겨진 토큰입니다. reasoning_effortlow를 제외한 모든 추론 모델에 대해 medium, high 또는 o1-mini로 설정될 수 있습니다. GPT-5 추론 모델은 reasoning_effort의 새로운 minimal 설정을 지원합니다. 작업 설정이 높을수록 모델이 요청을 처리하는 데 더 오래 소비하게 되므로 일반적으로 더 많은 수의 reasoning_tokens작업이 발생합니다.

개발자 메시지

기능적으로 개발자 메시지는 "role": "developer" 시스템 메시지와 동일합니다.

이전 코드 예제에 개발자 메시지를 추가하면 다음과 같이 표시됩니다.

다음과 같은 max_completion_tokens새 매개 변수를 활용하려면 OpenAI Python 라이브러리의 버전을 업그레이드해야 할 수 있습니다.

pip install openai --upgrade
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("AZURE_OPENAI_API_KEY"),
    base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
)

response = client.chat.completions.create(
    model="gpt-5-mini", # replace with the model deployment name of your o1 deployment.
    messages=[
        {"role": "developer","content": "You are a helpful assistant."}, # optional equivalent to a system message for reasoning models 
        {"role": "user", "content": "What steps should I think about when writing my first Python API?"},
    ],
    max_completion_tokens = 5000,
    reasoning_effort = "medium" # low, medium, or high
)

print(response.model_dump_json(indent=2))

추론 요약

응답 API와 함께 최신 추론 모델을 사용하는 경우 추론 요약 매개 변수를 사용하여 모델의 생각의 사슬 추론에 대한 요약을 받을 수 있습니다.

비고

사용하도록 설정하더라도 모든 단계/요청에 대해 추론 요약이 생성되지는 않습니다. 이는 예상되는 동작입니다.

최신 매개 변수에 액세스하려면 OpenAI 클라이언트 라이브러리를 업그레이드해야 합니다.

pip install openai --upgrade
import os
from openai import OpenAI

client = OpenAI(  
  base_url = "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
  api_key=os.getenv("AZURE_OPENAI_API_KEY")  
)

response = client.responses.create(
    input="Tell me about the curious case of neural text degeneration",
    model="gpt-5", # replace with model deployment name
    reasoning={
        "effort": "medium",
        "summary": "auto" # auto, concise, or detailed, gpt-5 series do not support concise 
    },
    text={
        "verbosity": "low" # New with GPT-5 models
    }
)

print(response.model_dump_json(indent=2))
{
  "id": "resp_689a0a3090808190b418acf12b5cc40e0fc1c31bc69d8719",
  "created_at": 1754925616.0,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "metadata": {},
  "model": "gpt-5",
  "object": "response",
  "output": [
    {
      "id": "rs_689a0a329298819095d90c34dc9b80db0fc1c31bc69d8719",
      "summary": [],
      "type": "reasoning",
      "encrypted_content": null,
      "status": null
    },
    {
      "id": "msg_689a0a33009881909fe0fcf57cba30200fc1c31bc69d8719",
      "content": [
        {
          "annotations": [],
          "text": "Neural text degeneration refers to the ways language models produce low-quality, repetitive, or vacuous text, especially when generating long outputs. It’s “curious” because models trained to imitate fluent text can still spiral into unnatural patterns. Key aspects:\n\n- Repetition and loops: The model repeats phrases or sentences (“I’m sorry, but...”), often due to high-confidence tokens reinforcing themselves.\n- Loss of specificity: Vague, generic, agreeable text that avoids concrete details.\n- Drift and contradiction: The output gradually departs from context or contradicts itself over long spans.\n- Exposure bias: During training, models see gold-standard prefixes; at inference, they must condition on their own imperfect outputs, compounding errors.\n- Likelihood vs. quality mismatch: Maximizing token-level likelihood doesn’t align with human preferences for diversity, coherence, or factuality.\n- Token over-optimization: Frequent, safe tokens get overused; certain phrases become attractors.\n- Entropy collapse: With greedy or low-temperature decoding, the distribution narrows too much, causing repetitive, low-entropy text.\n- Length and beam search issues: Larger beams or long generations can favor bland, repetitive sequences (the “likelihood trap”).\n\nCommon mitigations:\n\n- Decoding strategies:\n  - Top-k, nucleus (top-p), or temperature sampling to keep sufficient entropy.\n  - Typical sampling and locally typical sampling to avoid dull but high-probability tokens.\n  - Repetition penalties, presence/frequency penalties, no-repeat n-grams.\n  - Contrastive decoding (and variants like DoLa) to filter generic continuations.\n  - Min/max length, stop sequences, and beam search with diversity/penalties.\n\n- Training and alignment:\n  - RLHF/DPO to better match human preferences for non-repetitive, helpful text.\n  - Supervised fine-tuning on high-quality, diverse data; instruction tuning.\n  - Debiasing objectives (unlikelihood training) to penalize repetition and banned patterns.\n  - Mixture-of-denoisers or latent planning to improve long-range coherence.\n\n- Architectural and planning aids:\n  - Retrieval-augmented generation to ground outputs.\n  - Tool use and structured prompting to constrain drift.\n  - Memory and planning modules, hierarchical decoding, or sentence-level control.\n\n- Prompting tips:\n  - Ask for concise answers, set token limits, and specify structure.\n  - Provide concrete constraints or content to reduce generic filler.\n  - Use “say nothing if uncertain” style instructions to avoid vacuity.\n\nRepresentative papers/terms to search:\n- Holtzman et al., “The Curious Case of Neural Text Degeneration” (2020): nucleus sampling.\n- Welleck et al., “Neural Text Degeneration with Unlikelihood Training.”\n- Li et al., “A Contrastive Framework for Decoding.”\n- Su et al., “DoLa: Decoding by Contrasting Layers.”\n- Meister et al., “Typical Decoding.”\n- Ouyang et al., “Training language models to follow instructions with human feedback.”\n\nIn short, degeneration arises from a mismatch between next-token likelihood and human preferences plus decoding choices; careful decoding, training objectives, and grounding help prevent it.",
          "type": "output_text",
          "logprobs": null
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "parallel_tool_calls": true,
  "temperature": 1.0,
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "background": false,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "previous_response_id": null,
  "prompt": null,
  "prompt_cache_key": null,
  "reasoning": {
    "effort": "minimal",
    "generate_summary": null,
    "summary": "detailed"
  },
  "safety_identifier": null,
  "service_tier": "default",
  "status": "completed",
  "text": {
    "format": {
      "type": "text"
    }
  },
  "top_logprobs": null,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 16,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 657,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 673
  },
  "user": null,
  "content_filters": null,
  "store": true
}

Python lark

GPT-5 시리즈 추론 모델은 custom_tool이라는 새로운 lark_tool을 호출할 수 있는 기능을 가지고 있습니다. 이 도구는 Python lark를 기반으로 하며 모델 출력을 보다 유연하게 제한하는 데 사용할 수 있습니다.

응답 API

{
  "model": "gpt-5-2025-08-07",
  "input": "please calculate the area of a circle with radius equal to the number of 'r's in strawberry",
  "tools": [
    {
      "type": "custom",
      "name": "lark_tool",
      "format": {
        "type": "grammar",
        "syntax": "lark",
        "definition": "start: QUESTION NEWLINE ANSWER\nQUESTION: /[^\\n?]{1,200}\\?/\nNEWLINE: /\\n/\nANSWER: /[^\\n!]{1,200}!/"
      }
    }
  ],
  "tool_choice": "required"
}
import os
from openai import OpenAI

client = OpenAI(  
  base_url = "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
  api_key=os.getenv("AZURE_OPENAI_API_KEY")  
)

response = client.responses.create(  
    model="gpt-5",  # replace with your model deployment name  
    tools=[  
        {  
            "type": "custom",
            "name": "lark_tool",
            "format": {
                "type": "grammar",
                "syntax": "lark",
                "definition": "start: QUESTION NEWLINE ANSWER\nQUESTION: /[^\\n?]{1,200}\\?/\nNEWLINE: /\\n/\nANSWER: /[^\\n!]{1,200}!/"
            }
        }  
    ],  
    input=[{"role": "user", "content": "Please calculate the area of a circle with radius equal to the number of 'r's in strawberry"}],  
)  

print(response.model_dump_json(indent=2))  
  

출력:

{
  "id": "resp_689a0cf927408190b8875915747667ad01c936c6ffb9d0d3",
  "created_at": 1754926332.0,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "metadata": {},
  "model": "gpt-5",
  "object": "response",
  "output": [
    {
      "id": "rs_689a0cfd1c888190a2a67057f471b5cc01c936c6ffb9d0d3",
      "summary": [],
      "type": "reasoning",
      "encrypted_content": null,
      "status": null
    },
    {
      "id": "msg_689a0d00e60c81908964e5e9b2d6eeb501c936c6ffb9d0d3",
      "content": [
        {
          "annotations": [],
          "text": "“strawberry” has 3 r’s, so the radius is 3.\nArea = πr² = π × 3² = 9π ≈ 28.27 square units.",
          "type": "output_text",
          "logprobs": null
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "parallel_tool_calls": true,
  "temperature": 1.0,
  "tool_choice": "auto",
  "tools": [
    {
      "name": "lark_tool",
      "parameters": null,
      "strict": null,
      "type": "custom",
      "description": null,
      "format": {
        "type": "grammar",
        "definition": "start: QUESTION NEWLINE ANSWER\nQUESTION: /[^\\n?]{1,200}\\?/\nNEWLINE: /\\n/\nANSWER: /[^\\n!]{1,200}!/",
        "syntax": "lark"
      }
    }
  ],
  "top_p": 1.0,
  "background": false,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "previous_response_id": null,
  "prompt": null,
  "prompt_cache_key": null,
  "reasoning": {
    "effort": "medium",
    "generate_summary": null,
    "summary": null
  },
  "safety_identifier": null,
  "service_tier": "default",
  "status": "completed",
  "text": {
    "format": {
      "type": "text"
    }
  },
  "top_logprobs": null,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 139,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 240,
    "output_tokens_details": {
      "reasoning_tokens": 192
    },
    "total_tokens": 379
  },
  "user": null,
  "content_filters": null,
  "store": true
}

채팅 완료

{
  "messages": [
    {
      "role": "user",
      "content": "Which one is larger, 42 or 0?"
    }
  ],
  "tools": [
    {
      "type": "custom",
      "name": "custom_tool",
      "custom": {
        "name": "lark_tool",
        "format": {
          "type": "grammar",
          "grammar": {
            "syntax": "lark",
            "definition": "start: QUESTION NEWLINE ANSWER\nQUESTION: /[^\\n?]{1,200}\\?/\nNEWLINE: /\\n/\nANSWER: /[^\\n!]{1,200}!/"
          }
        }
      }
    }
  ],
  "tool_choice": "required",
  "model": "gpt-5-2025-08-07"
}

Markdown 출력

기본적으로 o3-mini 모델과 o1 모델은 markdown 서식을 포함하는 출력을 생성하려고 시도하지 않습니다. 이 동작이 바람직하지 않은 일반적인 사용 사례는 모델이 markdown 코드 블록 내에 포함된 코드를 출력하려는 경우입니다. 모델이 markdown 서식 지정 없이 출력을 생성하면 구문 강조 표시와 같은 기능과 대화형 플레이그라운드 환경에서 복사 가능한 코드 블록이 손실됩니다. 이 새로운 기본 동작을 재정의하고 모델 응답에 markdown을 포함하도록 하려면 개발자 메시지의 시작 부분에 문자열 Formatting re-enabled 을 추가합니다.

개발자 메시지의 시작 부분에 추가 Formatting re-enabled 해도 모델에 응답에 markdown 서식이 포함된다는 보장은 없으며 가능성만 높아집니다. 우리는 내부 테스트에서 Formatting re-enabled 모델 자체 o1 에 비해 o3-mini덜 효과적인 것을 발견했습니다.

성능을 Formatting re-enabled 향상시키려면 개발자 메시지의 시작을 더욱 확대하여 원하는 출력을 생성할 수 있습니다. 개발자 메시지의 시작 부분에 추가하는 Formatting re-enabled 대신 아래 예제 중 하나와 같이 보다 설명적인 초기 명령을 추가하는 방법을 실험해 볼 수 있습니다.

  • Formatting re-enabled - please enclose code blocks with appropriate markdown tags.
  • Formatting re-enabled - code output should be wrapped in markdown.

예상 출력에 따라 특정 사용 사례를 대상으로 하려면 초기 개발자 메시지를 추가로 사용자 지정해야 할 수 있습니다.