Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Developer Message Role and Optional Markdown Formatting in o3-mini #609

Open
Inkbottle007 opened this issue Feb 5, 2025 · 11 comments
Labels
enhancement New feature or request

Comments

@Inkbottle007
Copy link

Recent updates to OpenAI's reasoning models have resulted in two important changes that affect o3-mini:

  1. Markdown Formatting Disabled by Default
  • Responses no longer include markdown formatting. This means that instead of standard Markdown bullets, you may see UTF‑8 characters (for example, "EM SPACE + BULLET + EM SPACE") and "smart" opening/closing quotes.
  • Code is no longer automatically identified and formatted as code blocks.

Markdown formatting: Starting with o1-2024-12-17, reasoning models in the API will avoid generating responses with markdown formatting. To signal to the model when you do want markdown formatting in the response, include the string formatting re-enabled on the first line of your developer message.
(Source: Reasoning models - OpenAI API)

  1. Developer Messages Replace System Messages

Developer messages are the new system messages: Starting with o1-2024-12-17, reasoning models support developer messages rather than system messages, to align with the chain of command behavior described in the model spec.
(Source: Reasoning models - OpenAI API)

  1. Here is what it looks like in cURL:
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
  "model": "o3-mini",
  "messages": [
    {
      "role": "developer",
      "content": [
        {
          "type": "text",
          "text": "Formatting re-enabled"
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Please say \"hello\"."
        }
      ]
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "Hello!"
        }
      ]
    }
  ],
  "response_format": {
    "type": "text"
  },
  "reasoning_effort": "medium"
}'
  1. The improvement would be to support developer message.
@Inkbottle007 Inkbottle007 added the enhancement New feature or request label Feb 5, 2025
@Inkbottle007
Copy link
Author

Please format your answers using markdown formatting. Do this for the entire conversation. Also, whenever there is a "plain" version of a character as well as a "smart" version, please use the "plain" version.

I tried asking nicely, as above, and it had a positive effect, though maybe not as effective as the real thing.

At least it was much easier to read than it was originally.

@karthink
Copy link
Owner

karthink commented Feb 5, 2025

Is there any functional difference between a system message and a developer message?

@Inkbottle007
Copy link
Author

Inkbottle007 commented Feb 5, 2025

@karthink

This comment has been minimized.

@karthink

This comment has been minimized.

@karthink

This comment has been minimized.

@Inkbottle007

This comment has been minimized.

@Inkbottle007

This comment has been minimized.

@Inkbottle007
Copy link
Author

I wanted to follow up on my issue regarding the support for developer messages with o3-mini. The default behavior (i.e., no markdown formatting) is causing significant inconvenience, having the option to enable formatting via a developer message would be extremely helpful.

@syberkitten
Copy link

Reading this thread only one question comes to mind, Why?

Seems like all the models have a standard of rendering code blocks or code fences as they are also called, why change that "mid race"?

seems like a bug or a bad call, why do we need to spend time fixing this when it's already a standard? adding a string to re enable it is just a hack.

@Inkbottle007
Copy link
Author

Reading this thread only one question comes to mind, Why?

Seems like all the models have a standard of rendering code blocks or code fences as they are also called, why change that "mid race"?

seems like a bug or a bad call, why do we need to spend time fixing this when it's already a standard? adding a string to re enable it is just a hack.

From https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/reasoning?tabs=python-secure#markdown-output (The article is dated February 20, 2025.)

Markdown output

By default the o3-mini and o1 models will not attempt to produce output that includes markdown formatting. A common use case where this behavior is undesirable is when you want the model to output code contained within a markdown code block. When the model generates output without markdown formatting you lose features like syntax highlighting, and copyable code blocks in interactive playground experiences. To override this new default behavior and encourage markdown inclusion in model responses, add the string Formatting re-enabled to the beginning of your developer message.

Adding Formatting re-enabled to the beginning of your developer message does not guarantee that the model will include markdown formatting in its response, it only increases the likelihood. We have found from internal testing that Formatting re-enabled is less effective by itself with the o1 model than with o3-mini.

To improve the performance of Formatting re-enabled you can further augment the beginning of the developer message which will often result in the desired output. Rather than just adding Formatting re-enabled to the beginning of your developer message, you can experiment with adding a more descriptive initial instruction like one of the examples below:

Formatting re-enabled - please enclose code blocks with appropriate markdown tags.
Formatting re-enabled - code output should be wrapped in markdown.

The new developer message feature replaces system prompt and restores the functionality of system prompt in o1 and o3-mini. It can be used to try to bring back Markdown formatting, among other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants