TL;DR

  • Prose forces the LLM to guess your rules. Structure makes them explicit.
  • Lists for rules, tables for mappings, Mermaid for flows.
  • Measurable effect: up to 40% variation depending on format for GPT-3.5 (He et al., 2024).
  • But no format wins everywhere. Test on your own model.
  • Info buried in the middle of a long prompt often gets ignored.
  • A diagram hands over the graph ready-made: the model translates instead of inferring.

You've probably been there while vibe coding: you write a detailed 15-line paragraph describing a feature, hit Enter… and the LLM forgets the security rule you mentioned in the middle, invents a JSON field that doesn't exist, and breaks an edge case that seemed obvious.

The usual reflex is to blame the model. In reality, the problem often comes from the format of the input.

Structuring your prompts with bullet lists, tables and diagrams (Mermaid-style) is not just about looks. Format changes what the model "sees": the distance between related pieces of information, the number of noise tokens, and the type of document it thinks it is completing.

This article goes level by level:

  1. Level 1 (Practical): the immediate impact on your prompts, with a concrete before/after.
  2. Level 2 (Structural): going from 1D to 2D and switching on "Engineer mode".
  3. Level 3 (Under the hood): 5 Transformer mechanisms that (partly) explain the effect.
  4. What the research says: the empirical evidence, and its limits.

Level 1: Stop making the LLM do your parsing

Imagine you're briefing a senior developer before handing them a critical module. Would you rather send them:

  • the raw transcript of a 3-minute voice note full of "so then we should probably check that..."?
  • or a one-page spec with a checklist, a routes table and a flow diagram?

An LLM reacts in a similar way. With free-form prose, part of the work consists of reconstructing your intent from the grammar. By structuring your prompt, you do that parsing work for it, and you reduce the chances of misinterpretation.

What each format is for

Format Mechanical role Real-world analogy Best used in vibe coding for…
Bullet lists Atomization: isolates each rule as a distinct logical unit. A pilot's pre-flight checklist. Business rules, edge cases, tech stack, constraints.
Tables Strict mapping (Key → Value): ties an entity to its properties without ambiguity. A SQL table vs. meeting minutes. API endpoints, permissions (RBAC), UI states, data schemas.
Diagrams (Mermaid) Topological encoding: describes a graph as a list of edges. An architect's blueprint or a wiring diagram. Auth flows, state machines, component architecture.

A concrete example: Before / After

❌ The prose prompt (ambiguous and buried in noise)

I want an API route to create an order. The user must be logged in with a JWT, unless it's an admin who can create an order for someone else. If stock is insufficient, return a 409 error, but before that, validate the cart with Zod and return a 400 if it's not valid. If everything passes, decrement the stock and return a 201.

Read the second sentence again: "logged in with a JWT, unless it's an admin" can be read as "an admin doesn't need a JWT". That is exactly the kind of ambiguity prose lets slip through.

✅ The structured prompt (ready to be "compiled" by the LLM)

Here is the prompt as it looks once rendered. In your editor or chat, write it in raw Markdown: ### headings, dashes, a table with | and a mermaid code block.

Context

Implement the order creation endpoint in TypeScript (Next.js App Router + Zod).

Business rules

  • Authentication required via the Authorization: Bearer <JWT> header, for all roles.
  • USER role: can only create an order for their own userId.
  • ADMIN role: can specify a different targetUserId.
  • Stock decrement and order creation must be atomic (DB transaction).

HTTP response matrix

Condition Code Payload / Behavior
Missing or invalid JWT 401 { error: "UNAUTHORIZED" }
Invalid Zod payload 400 { error: "VALIDATION_ERROR", details }
USER with a different targetUserId 403 { error: "FORBIDDEN" }
Insufficient stock 409 { error: "OUT_OF_STOCK", itemId }
Success 201 { orderId, status: "CONFIRMED" }

Execution flow

flowchart LR Req[POST /orders] --> Auth{Valid JWT?} Auth -- No --> E401[401] Auth -- Yes --> Zod{Zod schema OK?} Zod -- No --> E400[400] Zod -- Yes --> Role{USER with targetUserId?} Role -- Yes --> E403[403] Role -- No --> Stock{Enough stock?} Stock -- No --> E409[409] Stock -- Yes --> TX[DB transaction] --> OK[201]

With the second version, the order of checks and the error format no longer have to be guessed.

To be fair: the structured version also contains more information (the 401, the 403, the transaction, the payloads). Part of the gain comes from the format, part from simply being exhaustive. The good news: structure forces you to be exhaustive. An empty table row stands out; a missing sentence doesn't.

Level 2: From 1D to 2D, and "Engineer mode"

Before diving into the math, two effects already explain a good part of the gap between these two prompts.

1. Code is a graph (2D), prose is a line (1D)

Human language is sequential: one word after another. Code, on the other hand, is a network of dependencies, conditions and loops.

PROSE (Linear - 1D) [Word]─[Word]─[Rule A]─[Noise]─[Noise]─[Rule B]─[Exception] └──── The LLM has to rebuild the tree mentally ────┘ STRUCTURED (Tabular - 2D) ┌──────────────┬────────────────────┬──────────────────┐ │ Entity │ Condition │ Result │ ├──────────────┼────────────────────┼──────────────────┤ │ Anonymous │ No JWT │ 401 Unauthorized │ │ Logged in │ Insufficient stock │ 409 Conflict │ └──────────────┴────────────────────┴──────────────────┘ └──── Relationships explicit at first read ────┘ 

A caveat: to the model, a table is still a sequence of tokens (1D). But it is a regular sequence, where every row repeats the same pattern, which makes relationships much easier to retrieve than in free-form prose.

When you describe business logic in prose, the model has to turn a line into a logical tree before writing a single line of code. That translation step is where inverted conditions and forgotten cases come from.

2. Switching on "Engineer mode" (Training distribution)

An LLM is still a conditional prediction engine: it generates the most likely continuation given the style of what came before.

  • In training data, conversational prose mostly sits alongside forums, chats and opinion posts.
  • Structured Markdown (tables, rigorous lists, typed code blocks, Mermaid) mostly shows up in RFCs, official documentation and GitHub repositories.

This is a reasonable hypothesis rather than a measured result: by formatting your prompt like a technical spec, you bring the context closer to the engineering documents the model has seen, and the continuation it predicts tends to pick up their rigor.

Level 3: Under the hood — what happens in the tensors

To go further, we need to go down to the Self-Attention mechanism and mechanistic interpretability. Here are 5 mechanisms that help explain the effect.

Disclaimer: these are candidate explanations, not a proof. Nobody has yet traced end to end, in a production model, why a table produces better code than a paragraph.

1. Softmax is a zero-sum game (Attention dilution)

In each attention head, the way the token currently being generated (the Query Q) looks at the tokens in the context (the Keys K) is computed with this equation:

Attention(Q,K,V)=softmax(dk​​QKT​)V

Softmax forces the attention weights of a Query over the whole context to add up to exactly 1. For each head, at each layer, the budget is finite.

Every token added to the context gets a strictly positive weight, however small. The more filler tokens there are ("ideally we should also think about the fact that..."), the more they can take a share of that budget away from your constraints. This is called attention dilution.

ATTENTION BUDGET OF ONE HEAD = 100% (Softmax) (proportions are purely illustrative) In prose (attention shared with noise): [Filler words ████████][Specs ███████████] └─ Rules buried in the middle In a list / table (less noise): [Syntax ██][Specs ██████████████████] └─ Focus on the rules 

Three important caveats:

  • Heads don't spread attention uniformly: they learn to ignore noise, and many put a large share of their attention on a few "sink" tokens (often the first token), regardless of content.
  • A Markdown table is not necessarily shorter: |, - and spaces cost tokens too. The gain comes mainly from removing useless sentences, not from the delimiters.
  • The numbers in the diagram above are there to illustrate the idea, not taken from a measurement.

2. Induction Heads and Markdown delimiters

Mechanistic interpretability research from Anthropic (Elhage et al., 2021; Olsson et al., 2022) identified specialized circuits: Induction Heads.

What they do: spot a pattern like [A][B] ... [A] and predict [B], i.e. copy what followed the previous occurrence of a token. These circuits are considered one of the drivers of in-context learning.

A Markdown table is extremely repetitive text: every row repeats the same sequence of | and the same structure. It is ideal ground for copy-and-align mechanisms.

Header : | Route | Auth | 401 Error | ▲ │ (column alignment: │ a hypothesis, not a circuit │ identified in the literature) Row 4 : | /api/pay | JWT | ... ▲ └─ Token being generated 

Don't over-interpret this. Published work describes Induction Heads as pattern-copying mechanisms. The idea that they "count columns" or use | as "memory pointers" back to the header is an appealing hypothesis, not a demonstrated result. What we can say: a regular format makes the job easier for attention mechanisms that exploit repetition.

3. RoPE and long-term decay

Many open-weight LLMs (Llama, Qwen, Mistral, DeepSeek…) use RoPE (Rotary Position Embedding, Su et al., 2021) to encode the relative position of tokens by applying a rotation to the Q and K vectors. Proprietary models like Claude or GPT don't publish their architecture, so we can't say what they use.

The RoPE authors show a long-term decay property: an upper bound on the interaction between two tokens decreases as their relative distance grows. It is an average trend, not a strict rule, and it is weak over a few dozen tokens. Context-extension techniques (NTK scaling, YaRN…) also change it.

The stronger argument is therefore empirical rather than geometric: the Lost in the Middle study (Liu et al., 2023) shows that models make much worse use of information placed in the middle of a long context than at the beginning or end. Exactly the symptom described in the intro.

Criterion In plain prose In a structured table / list
Distance between an entity and its rule Variable, sometimes several sentences Same row, a few tokens
Risk of confusion Rules mixed in the same paragraph One rule per row
Interference in the context Polluting sentences in between Clean row-by-row isolation

Putting an entity and its constraint on the same row brings them closer. The flip side: in a big table, the header drifts away from the last rows. Prefer several small tables over one giant table.

4. Entropy collapse on the logits

For each generated token, the model outputs a vector of raw scores (logits) over its whole vocabulary, converted into probabilities. The entropy H(X) of that distribution measures its "hesitation":

H(X)=−i∑​P(xi​)logP(xi​)
  • Vague prompt = higher entropy. Several architectures or field names are plausible. The distribution is "flat". With a temperature above zero, the model can veer off into an inconsistent choice halfway through a file.
  • Constrained prompt = lower entropy. Explicit constraints make invalid paths very unlikely. Probability concentrates on a narrow peak.
Vague prompt (High entropy) Constrained prompt (Low entropy) Prob. Prob. ^ ^ ██ │ ▄ ▄ ▄ │ ██ │ ▄ █ ▄ █ ▄ █ ▄ │ ██ │ █ █ █ █ █ █ █ │ ▄ ██ ▄ └─────────────────→ Tokens └─────────────────→ Tokens Model hesitates Near-deterministic path (hallucinations, omissions) (code faithful to the spec) 

Caveat: what lowers entropy is the precision of the constraints, not the format itself. Very precise prose can do as well as a table. Structured formats help mainly because they make imprecision visible.

5. Working around the Transformer's fixed depth with Mermaid

This is probably the most underrated argument.

A Transformer has a fixed depth: a set number of layers L (80 for Llama 3 70B, for example). To produce each token, the computation goes through those L layers, no more, no less. The amount of "serial" reasoning possible in a single pass is therefore bounded.

If you describe a complex business flow in prose (OAuth2 authentication, refresh token, revocation, network fallback), the model has to, within that budget:

  1. rebuild the topology of the logical graph from your sentences;
  2. write syntactically and semantically valid code.

The representations of your prompt are computed once and then cached (KV cache), so the reconstruction isn't redone for every token. But it is still limited by the same depth. If the graph is deeply nested, the model may not have enough "computational depth" to work out all its implications.

WITHOUT A DIAGRAM (Prose): Vague text ──→ [Layers 1..L: Infer the graph + Code] ──→ Logic bugs WITH A DIAGRAM (Mermaid): Edge list ──→ [Layers 1..L: Transpile to code] ──→ More reliable code 

A Mermaid block puts the graph's edge list directly into the context. You move part of the topological computation out of the network: the model no longer has to infer the architecture, only to transpile it.

It's the same principle as chain-of-thought and "reasoning" models: writing intermediate steps into the context gets around the depth limit. With Mermaid, you write those steps in advance.

What the research says

Prompt format has a measurable effect, but not always in the direction you'd expect:

  • Sclar et al. (2023) showed that simple formatting changes (separators, casing, spacing) can shift the accuracy of some open-source models by tens of points on the same task.
  • He et al. (Microsoft, 2024) compared plain text, Markdown, YAML and JSON on GPT models. GPT-3.5-turbo's performance varies by up to 40% depending on format on a code translation task, while GPT-4 is more robust. And no format wins everywhere: on one of their tasks, JSON beats Markdown by 42%.
  • Liu et al. (2023) (Lost in the Middle): information placed in the middle of a long context is used less well.

Practical takeaway: structure helps, but the best format depends on the model and the task. Recent models are less sensitive than older ones. If a prompt is critical, test two or three variants rather than relying on a universal rule. Model vendors also publish their own recommendations (Anthropic, for example, recommends XML tags to separate the sections of a prompt).

The golden rule for your next session

No need to write a 20-page spec before every prompt. Just keep this separation of concerns in mind:

  • Prose explains the why (the product context in 2 or 3 sentences).
  • Bullet lists lock down the rules and edge cases.
  • Tables define the mappings (routes, states, types, permissions).
  • Mermaid describes flows and transitions.

Effective vibe coding isn't about talking to an AI like a human over coffee: it's about giving it structures that make your intent impossible to misread.

Sources

  • Vaswani et al. (2017), Attention Is All You Need — arXiv:1706.03762
  • Elhage et al. (2021), A Mathematical Framework for Transformer Circuits — transformer-circuits.pub
  • Olsson et al. (2022), In-context Learning and Induction Heads — transformer-circuits.pub
  • Su et al. (2021), RoFormer: Enhanced Transformer with Rotary Position Embedding — arXiv:2104.09864
  • Liu et al. (2023), Lost in the Middle: How Language Models Use Long Contexts — arXiv:2307.03172
  • Sclar et al. (2023), Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design — arXiv:2310.11324
  • He et al. (2024), Does Prompt Formatting Have Any Impact on LLM Performance? — arXiv:2411.10541
  • Xiao et al. (2023), Efficient Streaming Language Models with Attention Sinks — arXiv:2309.17453