GPT 4.1 breaks/bugs-out and spams space characters when generating markdown tables

GPT 4.1 consistently generating empty space characters when attempting a markdown table. It happens after trying to make the first two columns. For example:

|Col1        |Col2

Then it proceeds to appear to freeze because it is spamming space/whitespace characters until it fills the Max Tokens value. I can’t share my system or input prompts, but the parameters I am using are temperature = 0.1 and max_completion_tokens = 16_000. No json_mode as I have seen the other models have had issues similar issues to this when using json_mode but I am not in this case.

It is also consistently reproducible in the playground, even when adjusting temperature.

4 Likes

Prompting can be the key, especially when new models require you to “turn on markdown” now, in varying degrees. An O3 call is the highest amount of new behavior: having its own ideas about tables.

# Responses

Markdown output: Enabled, CommonMark compliant

Example markdown table response, without whitespace or alignment:

| Model | Instruction-Following |
| --- | --- |
| GPT-4.1 | Excellent |
...

The benefit is also saving you a few tokens here or there..

1 Like

You can prompt the model to return CSV or JSON list instead of the markdown table.

1 Like