Non-deterministic embedding results using text-embedding-ada-002

I think it’s worth to separate the python precision issue discussed in Discrepancy in embeddings precision - #7 by RonaldGRuckus from the issue of the OpenAI API returning slightly different embeddings for the same exact input. Instead of using python, let’s use curl directly:

curl https://api.openai.com/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "input": "<TEXT>",
    "model": "text-embedding-ada-002"
  }' | jq '.data[0].embedding[0]'

Make sure to set your OPENAI_API_KEY, the jq command will return the 1st number from the embeddings, if you run this a couple of times, you will see that the numbers can be slight different, in my case for example: -0.026714837, -0.026664866 (difference of about 5e-05).

1 Like