Inconsistent Structured Output with GPT-4o Despite temperature=0 and top_p=0 (AzureChatOpenAI) #31264
Unanswered
dip9811111
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
Hi all,
I'm currently using AzureChatOpenAI with the GPT-4o model and aiming to obtain structured output. To ensure deterministic behavior, I’ve explicitly set both
temperature=0
andtop_p=0
. I've also fixedseed=42
. However, I’ve noticed that the output is not always consistent.Sometimes the variations are minor—for example, if the document clearly lists "John Doe" and "Jane Smith" as contact people, the model might correctly extract both names in one run, but in another run, it might only return "John Doe", or even re-order the names. While these differences are relatively subtle, they still suggest some nondeterminism. However, in other cases, the discrepancies are more significant—for instance, I’ve seen the model extract entirely unrelated names from elsewhere in the document, such as "Michael Brown", who is not listed as a contact person at all. This kind of inconsistent behavior is especially confusing given that the input and parameters and context remain unchanged.
Has anyone else observed this behavior with GPT-4o on Azure?
I'd love to understand:
Thanks in advance for any insights!
System Info
azure-ai-documentintelligence==1.0.2
azure-ai-evaluation==1.5.0
azure-core==1.33.0
gradio==5.15.0
langchain==0.3.25
langchain-chroma==0.2.3
langchain-community==0.3.5
langchain-huggingface==0.1.2
langchain-ollama==0.2.3
langchain-openai==0.3.16
langgraph==0.2.71
marker-pdf==1.6.1
nltk==3.9.1
openpyxl==3.1.5
pydantic==2.9.2
python-docx==1.1.2
python-docx-replace==0.4.4
rank_bm25==0.2.2
weasyprint==65.0
Beta Was this translation helpful? Give feedback.
All reactions