What cause the rubbish data output from GPT4 API calls response in arabic?

I’ve been using GPT4 API and i thought before the problem from my application. after while i’ve used to be member of Voila browser extenstion that offer GPT4 API. the problem with arabic outputs in voila response same as the one happened to me before which is output a wierd rubbish data in arabic that damage the whole response.

It’s not happening sometimes, it’s hapeening ALWAYS when there’s a long response like articles or web results.

here’s example when the rubbish data starts and i should turn it off immeditly because it’s cause some visual problems:

If using the chat completions endpoint, you should use the top_p and the temperature sampling parameters to reduce the unexpected tokens on world languages with less AI training data.

temperature = 0.4, top_p = 0.4, for both parameters is a good start.

A single “wrong” token can turn the AI output into an ongoing production of nonsense.

gpt-4-0613 will be higher quality than the (price and everything reduced) turbo preview model, which will also have problems calling functions with correct language characters.

Especially don’t attempt “assistants” with “retrieval” at this time, requiring the preview model, because you have no sampling parameter control, flawed function output, and uncontrolled looping on errors within the agent.