Imagine you are reading an instruction written as a single block of text without paragraphs, lists, or tables. Hard to navigate, right? LLMs experience similar difficulties when data is presented “without structure.”
Modern language models handle formats fairly well — but only if you provide them correctly. In this lesson, we’ll explore how exactly LLMs interpret structured data — and how to ensure they understand it the same way you do.
🔍 What You’ll Learn
- How models “see” tabular and formatted data
- Why Markdown and JSON are better understood than plain text
- How to provide data to avoid parsing errors
- How to ask LLMs to return results in a structured format
- How to present CSV and tables for reliable recognition
🧩 Key Terms
- Markdown — a lightweight markup language for structuring text: headings, lists, tables, and code blocks.
- JSON — a data exchange format with a clear key–value structure. Convenient for storing, transmitting, and parsing data.
- CSV — a tabular data format where:
- rows are separated by
\\n, - columns — by
,or;. Used for import/export from spreadsheets.
- rows are separated by
- Tokenization — the process of splitting text into tokens — minimal units (words, symbols, marks) analyzed by the model. The more complex the structure, the more tokens it requires.
🤖 How LLMs See Structured Data
An LLM is not Excel, a web browser, or an IDE. It does not “see” visual structure — no columns, cells, or rows in the usual sense. Instead, it recognizes textual patterns perfectly if the structure is clearly marked with symbols.
Think of an LLM as a perfectionist reader: it doesn’t care how it looks on screen but cares about format predictability. The cleaner and more consistent the structure, the better it will understand.
📋 Tables = neatly aligned text
LLMs interpret a table as a sequence of rows where:
- each row = one record,
- each column = part of the row,
- separators (
|, spaces,,) = signals that “one cell ends and another begins.”
| Product | Price | In Stock |
|------------|-------|----------|
| T-shirt | 1299 | Yes |
| Shorts | 1599 | No |
📚 Analogy: for an LLM, this is like a neatly typed student list on paper — if it’s aligned, it’s easy to read.
Important: if rows are misaligned, spaces uneven, or characters inconsistent, the model may “go blind” — treating the table as plain text.
✅ Better:
- Use Markdown tables (
|+—), - Align columns,
- Avoid mixed formats in one table.
📦 JSON = structure with a clear skeleton
JSON is the ideal format when you need strict nesting and logic:
{
"user": {
"name": "John",
"role": "manager"
},
"active": true
}
LLMs “like” JSON because it is:
- predictable,
- valid for parsing,
- great for generation and conversion.
🧠 Analogy: JSON is like a neatly filled-out form. Each question has its answer, everything is in order.
Tips:
- Use
"key": value— no shortcuts or extra formatting. - Don’t mix JSON with regular text — put it in a separate block.
🗂 Lists = step-by-step instructions
LLMs handle:
- numbered lists (
1.,2.) — indicate sequence, - bulleted lists (, ) — simple enumeration.
1. Receive the order
2. Pack it
3. Ship to the customer
🧭 Analogy: the model sees such a list as a checklist or step-by-step guide. It can:
- continue it,
- rewrite it in another style,
- extract the key actions.
Recommendations:
- Don’t interrupt lists with unrelated inserts.
- Keep structure consistent (don’t mix
1., then , then—).
📐 How to Improve Model Perception
LLMs may be smart, but they’re not mind readers. The clearer and more structured your data, the better and more accurate the result. Think of it as writing instructions for a robot assistant: it has no eyes but excellent memory and logic — it needs clarity, not beauty.
1. Use Markdown formatting
LLMs “understand” Markdown much like humans view a formatted doc in Google Docs or Notion:
# Headingsseparate content blocks.|+—tables make data analysis-friendly.- Code blocks ````` preserve exact formatting — without distortions.
✅ Example:
Here are the orders:
| ID | Client Name | Amount |
|----|-------------|--------|
| 1 | Smith | 320 $ |
| 2 | Wood | 450 $ |
📌 Analogy: Markdown = a neatly structured doc for a colleague. No styles or graphics, but with clear structure, headings, and tables.
👉 In response, the model easily calculates: "Average order: 385 $"
2. Don’t break format with long strings
LLMs don’t like “walls” of text — when structured data is packed into one line. This prevents them from spotting repeating patterns.
❌ Bad:
{name: "Anna", age: 30, city: "Paris"} {name: "Mark", age: 28, city: "Hamburg"}
The model may treat it as plain text and fail to parse.
✅ Good:
[
{ "name": "Anna", "age": 30, "city": "Paris" },
{ "name": "Igor", "age": 28, "city": "Hamburg" }
]
📌 Analogy: a long string is like a shopping list without commas: “milkbreadcheeseapples.” Formatting adds spaces and punctuation so it’s clear.
3. Ask for a specific output format
The model can return data in any form — but defaults to free text. If you need a table — say so. Want JSON — specify it.
Examples:
✅ “Make a Markdown table”
✅ “Return the answer in JSON format: name, age, city”
✅ “List items as bullets, not a paragraph”
📌 Analogy: like ordering in a restaurant. If you don’t say which side dish — the chef will choose. Better to specify: “With rice, please.”
🧪 Guide: “Teach AI to Read Your CSV”
CSV is simple but tricky. It looks like plain text but encodes table structure.
Name,Age,Score
Alice,24,88
Bob,27,91
💡 To ensure correct parsing:
- Wrap CSV in a code block (to preserve format).
- Watch commas — if inside text, wrap the value in quotes:
Name,Comment
Alice,"Good, but not perfect"
What models can do with CSV:
- Calculate averages
- Find records by condition
- Convert to JSON
- Transform into a Markdown table
💡 Prompt Example:
“Analyze the following CSV and output the average score. Return the result as a Markdown table.”
📌 Analogy: CSV for a model = a notepad table with neat rows. If it’s tidy — it works. If messy — it confuses.
✅ Prompt Examples
| Goal | Prompt | Expected Format |
|---|---|---|
| Data analysis | “Here is an order table (Markdown). Calculate the total amount.” | Number or text with explanation |
| Generate JSON | “Create a product card. Return JSON with fields: name, price, tags” | JSON |
| Extract from list | “Here is a client list. Show those with orders over 500 $” | List or table |
| Convert CSV | “Convert the CSV below into a Markdown table” | Markdown table |
❌ Common Mistakes
-
Mistake: No formatting
Looks like: data runs together, table collapses
Fix: wrap tables or JSON in code blocks (`````) and use Markdown
-
Mistake: Bad CSV
Looks like: merged rows, broken quotes, extra commas
Fix: check CSV structure, escape commas inside text (wrap in quotes)
-
Mistake: No format request
Looks like: you ask “give product list” — get plain text paragraph
Fix: explicitly state: “Make a Markdown table” or “Return result in JSON”
-
Mistake: Manual spacing
Looks like: table aligned by spaces but uneven, text “drifts”
Fix: use Markdown tables with
|and--, or code blocks with monospace font
❓ FAQs
Q: Must I always use Markdown or JSON?
A: Not always, but it helps. Markdown and JSON make structure clearer and reduce parsing errors.
Q: Why does the model get confused with my table?
A: Likely because it was plain text without clear markup. Use Markdown tables or code blocks.
Q: Can I paste Google Sheets or Excel directly?
A: No, but you can:
- copy data as a table and format in Markdown;
- export to CSV and paste as a code block;
- or describe the table structure manually.
Q: What if the table is too large?
A: Cut it down to 3–5 rows or use samples. The model cares more about pattern than full data.
Q: What to choose — JSON, list, or table?
A: Depends on your goal:
- for machine processing → JSON,
- for visual analysis → Markdown table,
- for brief output → bulleted list.
📌 Summary
- LLMs understand tables, lists, and JSON only if you provide them correctly
- Use Markdown and code blocks — universal structuring methods
- Specify the format you want the answer in — the model will adapt
- Even simple CSVs can be analyzed if formatted clearly
- The clearer the structure, the more reliable the result
In the next lesson, we’ll discuss prompt quality metrics — how to evaluate whether the model “did well” and manage results more objectively.