Best LLMs for Markdown Newline Repair
Re-inserts blank lines into a markdown document whose line breaks were stripped (headings, separators, and paragraphs collapsed onto one line). Must not modify any non-whitespace character — pure whitespace restoration.
Run this task on Fronset — request an invitation
Models
Frontier on this task: MiniMax M3 at 9.12 / 10. Score needed at the Balanced step: 8.21.
point-estimate floor (CI low) · upper CI (less certain) · Bars sorted by blended cost; best-value model first. Greyed rows are MEDIUM+ models whose point estimate does not clear the bar.
| Model | Quality score | CI low | Cost / 1k runs | vs best value |
|---|---|---|---|---|
| MiniMax M3 | 9.12 / 10 | 8.70 | $21.65 | best value |
| Qwen 3.7 Plus | 7.64 / 10 | 7.52 | $24.40 | 1.1x more expensive |
| Thinking Machines Inkling | 7.41 / 10 | 6.93 | $92.50 | 4.3x more expensive |
Cost breakdown
| Model | Quality | Confidence | Cost / 1k runs | Overpay | Mode |
|---|---|---|---|---|---|
| MiniMax M3 ★ best OpenRouter | 9.12 / 10 CI [8.70, 9.54] | MEDIUM | $21.65 | best value | batch |
Overpay shows how much more you pay than the best-value model that meets the quality step (marked ★) — the best-value good-enough option. "16x" means you overpay 16× — 16× that reference for no quality benefit the step asks for. Typical call shape for this task: 5852 input tokens → 16331 output tokens, EMA-tracked from production traffic. Cost is the observed, all-in $ per 1,000 task runs: each model's own measured usage on this task — output verbosity, thinking/reasoning tokens, cache reads and writes, and the spend on its billed failures — priced at current list rates and adjusted by the billing overhead we actually reconcile against provider invoices. Models that answer tersely cost what they actually cost; models that think at length pay for it. Not comparable to providers' advertised $/1M list rates — this is what running the task costs, not a per-token price.
Evaluation rubric
Judge structural plausibility, readability, correct Markdown block boundaries, and minimality. Any changed, added, removed, or reordered non-whitespace character is a critical failure; exact preservation should also be checked deterministically.
Output schema
Every answer on this task is checked against this JSON Schema, whichever model wrote it. An answer that doesn't fit counts as a model failure, and the call is retried on another model.
{
"properties": {
"report_markdown": {
"description": "The full synthesized report formatted in Markdown.",
"title": "Report Markdown",
"type": "string"
}
},
"required": [
"report_markdown"
],
"title": "SynthesizedOutputMarkdownOnly",
"type": "object"
}Prompt templates
The published template for this task.
default ·
MARKDOWN_NEWLINE_REPAIR_SYSTEM_PROMPT +
MARKDOWN_NEWLINE_REPAIR_USER_PROMPT
(2876 calls in window)
System prompt
You receive a markdown document whose line breaks were stripped, so headings, separators, and paragraphs run together on one line.
Your job is to re-insert blank lines so the markdown renders correctly. You must NOT modify any non-whitespace character.
Required reformatting:
- Put each heading marker (`##`, `###`, `####`) on its own line, with a blank line before AND after.
- Put each `---` separator on its own line, with a blank line before AND after.
- For headings whose text was concatenated with following body text (e.g., `### The Strategic Context The present conflict in the Persian Gulf has entered...`): keep ONLY the actual heading title on the heading line, and start a new paragraph for the body. Heading titles are typically 2-12 words, do not contain sentence-ending punctuation, and end at the boundary where running prose begins.
- Insert paragraph breaks (blank lines) between distinct paragraphs in body prose. A paragraph break belongs where a topic shifts or where the original author would have started a new paragraph. Sentences that elaborate the same point stay together.
- Preserve existing italic/bold markers like `*Author:*`, `**bold**`, `*emphasis*`. If the metadata line at the top concatenates `*Author:* X *Subject:* Y *Topic:* Z`, put each on its own line.
- Preserve list markers (`- `, `* `, `1. `). If a list runs inline, put each list item on its own line.
Hard constraints:
- Do NOT add, remove, or change any letter, digit, punctuation, citation marker (`[^21]`, `[^21][^43]`), URL, or other non-whitespace character.
- Do NOT rephrase, summarize, expand, or "fix" any wording.
- Do NOT insert headings, lists, or markers that were not already there.
- Do NOT remove headings, separators, or markers that were there.
- Output the entire input verbatim except for whitespace insertions.
If you cannot satisfy the no-content-change rule for any reason, return the input unchanged rather than producing a modified version.
## Required Output Format
Your response MUST be a single, valid JSON object conforming to this schema:
```json
{schema_json_string}
```User prompt
Reflow this markdown by inserting blank lines and paragraph breaks. Do not change any non-whitespace character.
Markdown text:
{markdown_text}
Return the reflowed markdown matching this schema:
The required JSON output schema is provided in the system prompt.