Skip to content

Non-Reproducible Results Despite Fixed Parameters in Azure OpenAI API #40136

Open
@Aleksandra-Gr

Description

@Aleksandra-Gr

I am experiencing non-reproducible results when using the Azure OpenAI API, even when setting parameters explicitly to ensure deterministic behavior. My goal is to get identical outputs when running the same prompt under the same conditions. What I do is:

  1. Set up the API connection by default, which is 2024-02-01. Fix the azure_openai_endpoint, and pf_deployment is gpt-4o-mini.

  2. Run the prompt with the following fixed parameters:

{
"temperature": 0,
"top_p": str(top_p), # Changing from 0 to 1 in a loop to check if problem existis for all those values
"seed": 42,
"max_tokens": 100,
"frequency_penalty": 0,
"presence_penalty": 0,
"stream": false
}

  1. Repeat the request 10 times per top_p value.

  2. Observe the output variance.

Expected Behavior:

With temperature = 0 and a fixed seed, I expect deterministic outputs—meaning the same response should be returned each time for identical inputs.

Observed Behavior:

Despite fixing temperature = 0, seed = 42, and all other parameters, the responses vary.
Sometimes, all responses are different (in summaries outputs) for the same prompt.

This issue persists across multiple API versions, including this default 2024-02-01 and 2025-02-01-preview.

Image

Metadata

Metadata

Assignees

Labels

OpenAIServiceThis issue points to a problem in the service.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions