You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/reproducible-output.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
title: 'How to generate reproducible output with Azure OpenAI Service'
3
3
titleSuffix: Azure OpenAI
4
-
description: Learn how to generate reproducible output (preview) with Azure OpenAI Service
4
+
description: Learn how to generate reproducible output (preview) with Azure OpenAI Service.
5
5
services: cognitive-services
6
6
manager: nitinme
7
7
ms.service: azure-ai-openai
8
8
ms.topic: how-to
9
-
ms.date: 11/17/2023
9
+
ms.date: 04/09/2024
10
10
author: mrbullwinkle
11
11
ms.author: mbullwin
12
12
recommendations: false
@@ -15,20 +15,22 @@ recommendations: false
15
15
16
16
# Learn how to use reproducible output (preview)
17
17
18
-
By default if you ask an Azure OpenAI Chat Completion model the same question multiple times you are likely to get a different response. The responses are therefore considered to be non-deterministic. Reproducible output is a new preview feature that allows you to selectively change the default behavior towards producing more deterministic outputs.
18
+
By default if you ask an Azure OpenAI Chat Completion model the same question multiple times you're likely to get a different response. The responses are therefore considered to be non-deterministic. Reproducible output is a new preview feature that allows you to selectively change the default behavior to help product more deterministic outputs.
19
19
20
20
## Reproducible output support
21
21
22
22
Reproducible output is only currently supported with the following:
Support for reproducible output was first added in API version [`2023-12-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.json)
32
34
33
35
## Example
34
36
@@ -43,14 +45,14 @@ from openai import AzureOpenAI
model="gpt-4-1106-preview", # Model = should match the deployment name you chose for your 1106-preview model deployment
167
+
model="gpt-35-turbo-0125", # Model = should match the deployment name you chose for your 0125-preview model deployment
166
168
seed=42,
167
169
temperature=0.7,
168
170
max_tokens=200,
@@ -184,7 +186,7 @@ for i in range(3):
184
186
$openai = @{
185
187
api_key = $Env:AZURE_OPENAI_API_KEY
186
188
api_base = $Env:AZURE_OPENAI_ENDPOINT # like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
187
-
api_version = '2023-12-01-preview' # may change in the future
189
+
api_version = '2024-02-01' # may change in the future
188
190
name = 'YOUR-DEPLOYMENT-NAME-HERE' # name you chose for your deployment
189
191
}
190
192
@@ -250,7 +252,10 @@ Matter coalesced into the simplest elements, hydrogen and helium, which later fo
250
252
---
251
253
```
252
254
253
-
By using the same `seed` parameter of 42 for each of our three requests we're able to produce much more consistent (in this case identical) results.
255
+
By using the same `seed` parameter of 42 for each of our three requests, while keeping all other parameters the same, we're able to produce much more consistent results.
256
+
257
+
> [!IMPORTANT]
258
+
> Determinism is not guaranteed with reproducible output. Even in cases where the seed parameter and `system_fingerprint` are the same across API calls it is not currently uncommon to still observe a degree of response variability.
0 commit comments