Unable to supress occurance of ** for headings in GPT 4o responses

I am getting response for queries using API that might have headings in answers for GPT 4o. Like below:
Heading:\n - Details on the heading…

But I donot want these headings within astericks or any other formatting.
I have tried lots of prompts like -

  1. Please ensure that all headers are formatted without any asterisks. Use simple, plain text for headers. For example Do not give Heading: , Heading- , etc as header, instead give Heading: , Heading- , etc in response.
  2. Please generate a response using plain text only. Do not use any special characters such as asterisks, underscores, or any other symbols for headers, emphasis or formatting. Ensure all text is in standard, unformatted form.
  3. Do not provide text1, text2 i.e. words within special symbols in response. Always provide response as text1, text2 without any special symbols and in plain text format only.

and many other prompts.

Also tried suppressing it in code using logit_bias
logit_bias = {
334: -100, # “**”
3146: -100, # " **"
}

Neither is working. The asterick formatting is not getting removed.

is it not possible to remove these astericks in GPT 4o? If yes kindly suggest the solution.
Thanks in advance.

Welcome back to the Forum!

The models are predominantly trained on data in Markdown and therefore inherently tends to return responses in Markdown as well.

There have been lots of discussions and opinions on how to deal with this :slight_smile: Bottom line however is that the easiest way is to programmatically remove Markdown as part of your post-processing step. Personally I use this approach as well and have found it to be the most straightforward solution.

The following thread is an example of a recent discussion on the topic and includes some concrete suggestions on how to deal with this:

I hope this helps!

2 Likes