Apply to my task
arXiv:2510.26238 ★ 85 Oct 30, 2025

QASU: How Data Format and Prompting Affect the Way LLMs Handle Tables

Key result

Finding: LLMs recognize a table's structure differently depending on the upload format: HTML vs plain text makes up to an 8.8% difference in accuracy, and without visual separators between sections the model loses 16-24% accuracy. The QASU method lets you extract data precisely from survey CSVs and spreadsheets: find respondents by criteria, compute aggregates, pull out specific answers. Three independent principles work together: (1) pick the format for the task type (HTML for finding specific answers, plain text for logical filters), (2) a one-shot example before the question gives +10-25% accuracy, (3) self-augmented prompting (first ask the model to describe the table's structure) adds another +3-4%.

01

TL;DR

When you work with tabular data, the upload format and the prompt affect LLM accuracy more than you might think. QASU is a study that tested how GPT, Gemini and other models handle CSV files of surveys, questionnaires and spreadsheets in six different formats (HTML, JSON, XML, Markdown, plain text, Turtle). Accuracy was measured on six typical tasks: find a specific person's answer, count respondents, find everyone who answered a certain way, apply logical filters.

The main finding: the choice of data format swings accuracy by up to 8.8%. HTML markup works best for looking up answers; plain text is good for logical operations. Remove the visual separators between sections and you lose 16-24% accuracy. Models "see" structure differently depending on how you presented the table: with tags, indentation, separators or just plain text.

Two key principles improve the result: (1) One-shot prompting: a single example answer boosts accuracy by 10-25% compared to a "cold" question; (2) Self-augmented prompting: first ask the model to describe the table's structure in its own words, then ask your question about the data. That adds another +3-4% accuracy, especially when you need to find people by criteria or aggregate concepts.


Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Principles Blueprint

This isn't a step-by-step method but three independent principles that work together:

PRINCIPLE 1: Data format

  • HTML table → better for precise answer lookups (+8.8% vs Turtle)
  • Plain text with separators → better for logic and filters
  • Visual separators between sections → mandatory (-16-24% without them)

PRINCIPLE 2: One-shot example

  • One example answer before the question → +10-25% accuracy
  • Especially critical for multi-step questions (up to +25%)

PRINCIPLE 3: Self-augmented prompting (optional)

  • Step 1: "Describe the structure of this table" → the model outputs its understanding
  • Step 2: Question about the data + the answer from step 1 → +3-4% accuracy

03

Example in Action

The task: You have a CSV with the results of a customer survey for an online school: 200 rows, 15 questions. You need to find everyone who rated the course 4-5 points AND plans to buy more courses.

Prompt (applying all three principles):

Here is a table with a customer survey. Each row is one person.

<table>
<tr><th>ID</th><th>Course rating</th><th>Future plans</th><th>NPS</th></tr>
<tr><td>001</td><td>5</td><td>Will buy more</td><td>9</td></tr>
<tr><td>002</td><td>3</td><td>Not sure</td><td>6</td></tr>
<!-- ... remaining rows ... -->
</table>

=== EXAMPLE QUESTION AND ANSWER ===

Question: How many people rated the course 5?
Answer: 78

=== YOUR QUESTION ===

Find everyone who rated the course 4 or 5 points AND plans to buy more courses. 
Give me a comma-separated list of IDs.

Result: The model will return an exact list of customer IDs that meet both conditions. Without the one-shot example, accuracy drops by ~15-20%; without the HTML markup, by another 5-8%.

If you need maximum accuracy, add self-augmented prompting:

Step 1: Describe the structure of this table: how many rows, which columns, what values each one holds.

[the model will describe: "200 rows, 15 columns, rating from 1 to 5, plans in 4 categories..." and so on]

Step 2: Using that description, find everyone who rated the course 4-5 AND plans to buy more.

04

Why It Works

The LLM's weakness: models process text sequentially, left to right. Tabular data is a two-dimensional structure (rows × columns) that has to be "read" correctly. If the format isn't obvious, the model mixes up where one row ends and the next begins, and which values belong to which person.

The LLM's strength: models are excellent at recognizing patterns and structural markers. HTML tags like <tr> and <td> explicitly mark cell boundaries. Visual separators like === clearly mark sections. A one-shot example provides a template for what a correct answer should look like.

How the methods exploit this:

  • HTML format + separators = explicit structure, no ambiguity
  • One-shot example = the model sees "this is how to answer" and copies the pattern
  • Self-augmented prompting = the model first talks through the structure for itself, like "making a plan before solving", which reduces interpretation errors

Control levers:

  • Data format → try HTML vs Markdown vs plain text for your specific task
  • Separators → add === between sections for complex tables
  • Number of examples → one is enough for simple tasks, 2-3 for complex patterns
  • Self-augmented step → drop it for simple tasks (saves tokens), add it for critical ones

05

Prompt Template

Basic (format + one-shot)

Here is a table: {data description}

{your_data_in_HTML_or_Markdown}

=== EXAMPLE ===

Question: {example_question}
Answer: {example_answer}

=== YOUR QUESTION ===

{your_question}

Give the answer as {answer_format: "a list of IDs", "a number", "a table", etc.}

Placeholders:

  • {data description} — one sentence on what's in the table (for example: "Survey of 200 coding-bootcamp customers, 15 questions")
  • {your_data_in_HTML_or_Markdown} — the table itself
  • {example_question/answer} — one simple question-and-answer pair based on the same data
  • {your_question} — what you want to find out
  • {answer_format} — state explicitly how to deliver the result

Advanced (+ self-augmented)

Step 1: Study this table and describe its structure in 3-5 sentences: how many rows, which columns, what types of values, whether there are any patterns.

{your_data}

---

Step 2: Using the structure description from Step 1, answer the question:

{your_question}

🚀 Quick start: paste this into the chat:

Here's the QASU research on working with tables. Adapt the template to my task: 
[describe your task: what the data is, what you need to find/count].

[paste the template above]

The LLM will ask what format your data is in (CSV, Excel, Google Sheets), what exactly you want to know from the data, and whether you need maximum accuracy (self-augmented) or the basic version is enough. It will take the structure from the template and plug in your data.


06

Limitations

⚠️ Data size: Works for tables up to ~1000-2000 rows (depends on the model's context window). For larger data, the model will ask you to sample it or split it into chunks.

⚠️ Data cleanliness: The methods assume the table has no critical gaps. If half the cells are empty, accuracy drops: the model can't tell whether that means "no answer" or "formatting error".

⚠️ Data type: Best for structured surveys/questionnaires with a fixed set of questions. Arbitrary tables with complex nesting may need extra work.

⚠️ Format VS task: HTML is top for looking up specific people's answers, but plain text may be better for conceptual aggregation. There's no universal "best format"; it depends on the type of question.


07

How They Studied It

The team gathered 5 real survey datasets from different fields: hospital discharge records (Healthcare), psychological well-being (Mental-health), wearable-device usability (SUS-UTA7), the Stack Overflow developer survey, and medical-student assessments (ISBAR). They took 200-500 rows from each and mixed in different question types: multiple choice, Likert scales, open-ended answers.

The clever bit of the design: they tested the same questions in six formats: HTML, JSON, XML, Markdown, plain text, Turtle. That isolated the effect of the format from the effect of the data itself. Questions were standardized using templates (see the table in the original paper) to remove the influence of wording.

They measured exact match accuracy: either the answer matched the ground truth exactly, or it didn't. No "almost right". They tested GPT-5-mini, Gemini-2.5-Flash, Qwen3-32B, Llama3-70B and Amazon Nova Lite, spanning commercial to open-source.

The most interesting part: the gap between formats turned out to be bigger than the gap between models. HTML gave +8.8% accuracy vs Turtle on the task of finding a specific person's answer. Removing the === separators between sections cost 16-24% accuracy on counting tasks. In other words, HOW you feed in the data matters more than WHICH model you use.

One-shot vs zero-shot made a 10-25% difference in accuracy, with the biggest gap on multi-step questions (the "find everyone who is X AND Y" type). Without an example, the model simply didn't understand what format to answer in: sometimes a number, sometimes a list, sometimes prose.

Self-augmented prompting was tested in three variants: asking the model to (1) explain the table's format, (2) highlight critical values and ranges, (3) describe the structure and patterns. All three helped, but the best was "describe the structure" (+3.1% on Mental-health, +1.7% on SO-2022 for GPT-5-mini).

Practical takeaway: don't hunt for the "best model" for table work. Fix the data format and the prompt first; that pays off more.


08

Adaptations and Extrapolations

💡 Adaptation for CRM data

The QASU principles work not just for surveys but for any tabular data: a CRM export, a Google Sheet of customers, a QuickBooks export.

Here is a quarterly customer export from HubSpot.

<table>
<tr><th>ID</th><th>Company</th><th>Deal amount</th><th>Status</th><th>Rep</th></tr>
<tr><td>1001</td><td>Northwind Industries Inc.</td><td>45000</td><td>Closed won</td><td>Miller</td></tr>
<!-- ... -->
</table>

=== EXAMPLE ===
Question: How many deals did Miller close?
Answer: 12

=== QUESTION ===
Find all customers with deals of $50k or more that are managed by Johnson. List of IDs.

The payoff: you save time on filters in Excel or your CRM and can ask questions in plain language.

🔧 Technique: drop the one-shot to save tokens → only suitable for simple questions

If the question is trivial ("how many rows are in the table?"), you can skip the one-shot. But for any filters or conditions, always include it.

🔧 Technique: state data types explicitly → more accurate for numeric operations

Column descriptions:
- Deal amount: number (US dollars)
- Close date: format MM/DD/YYYY
- Status: text (one of: "Open", "Closed won", "Closed lost")

{then the table and the question}

This cuts down confusion: the model knows that "45000" is a number, not text, so it can compare values.


09

Resources

QASU: Questionnaire Analysis and Structural Understanding — Duc-Hai Nguyen, Vijayakumar Nanjappan, Barry O'Sullivan, Hoang D. Nguyen (University College Cork, Ireland).

The benchmark is available on GitHub: ReML-AI/QASU.

The paper was published at Conference'17, Washington, DC, USA.


Research digest

Key result

Finding: LLMs recognize a table's structure differently depending on the upload format: HTML vs plain text makes up to an 8.8% difference in accuracy, and without visual separators between sections the model loses 16-24% accuracy. The QASU method lets you extract data precisely from survey CSVs and spreadsheets: find respondents by criteria, compute aggregates, pull out specific answers. Three independent principles work together: (1) pick the format for the task type (HTML for finding specific answers, plain text for logical filters), (2) a one-shot example before the question gives +10-25% accuracy, (3) self-augmented prompting (first ask the model to describe the table's structure) adds another +3-4%.

Principle

An LLM reads text sequentially, left to right. A table is a two-dimensional structure (rows × columns) that has to be parsed correctly. Without explicit markers, the model mixes up where a row ends and which values belong to which person. HTML tags ``, `` explicitly mark cell boundaries. Visual separators `===` clearly mark sections. A one-shot example provides a template: the model sees "this is how to answer" and copies the pattern. Self-augmented prompting makes the model talk through the structure for itself first. It's like making a plan before solving, and it cuts interpretation errors by 3-4%.

Why it works

Models are excellent at recognizing patterns and structural markers, but they struggle with implicit structure. Explicit markup (HTML tags, separators) removes ambiguity: the model stops guessing where the boundaries are and starts following clear markers. A one-shot example works through pattern copying: the model sees the format of a correct answer and reproduces it. Self-augmented prompting exploits the fact that a model works better with its own words: having described the structure itself, it applies that description to the question more accurately. The numbers: HTML gives +8.8% vs the Turtle format, and one question-answer example adds 10-25% accuracy, which is especially critical for multi-step questions (up to +25%).

When to apply

Working with CSVs of surveys, questionnaires and spreadsheets → specifically for finding respondents by criteria ("find everyone who rated 4-5 and plans to buy more"), computing aggregates ("how many people answered X"), and extracting specific answers ("what did user 042 answer on question 7"). Especially when the table has 100-2000 rows and 10-50 columns: manual analysis takes too long, SQL queries are overkill, and an LLM handles it in seconds. NOT suited for tables with critical gaps (half the cells empty): the model can't tell "no answer" from "formatting error". For data over 2000 rows, you need to sample or split it into chunks because of context window limits.

Mini recipe

1. Pick the format for the task: HTML for precise lookups of specific people's answers ("what did ID 042 answer"), plain text with separators for logical filters ("find everyone who is X and Y"). Markdown is a middle ground for simple tasks. 2. Add visual separators: put `===` or `---` between sections of the table. That's worth 16-24% accuracy. Add a separator between the data and the question too. 3. Give a one-shot example: before your question, show one simple question-and-answer pair based on the same data: `Question: How many people rated it 5? Answer: 78`. That's +10-25% accuracy. 4. For complex tasks, add self-augmented prompting: Step 1: `Describe the structure of this table: how many rows, columns, what values`. Step 2: ask your question about the data + use the description from step 1. Gives +3-4%, critical for tasks that aggregate concepts.

Examples

[BAD]: Upload a CSV with a survey of 200 online-school customers and write `Find everyone who rated the course 4-5 and plans to buy more courses`. Without formatting, the model confuses row boundaries; without an example, it doesn't understand the answer format; accuracy drops by 20-30%. [GOOD]: Convert the CSV into an HTML table with ``, `` tags. Add `===` separators between blocks. Give a one-shot example before the question: `Here is a table with a customer survey. Each row is one person.

IDCourse ratingPlans
0015Will buy more
0023Not sure
=== EXAMPLE === Question: How many people rated it 5? Answer: 78 === YOUR QUESTION === Find everyone who rated the course 4-5 AND plans to buy more courses. Give me a comma-separated list of IDs.` The model will return an exact list of IDs. For maximum accuracy, add the self-augmented step: first ask `Describe the structure of this table`, then use that description in your question.

In plain words

Models don't perceive tables the way we do: they don't see a grid, they read a continuous stream of characters. When you feed a model a questionnaire or a customer database, it turns into a linear maze where it has to rebuild the links between names, numbers and headers on the fly. The QASU study proved that answer accuracy depends not on how "smart" the model is, but on how conveniently the data was sliced for it. If the format is sloppy, even a top-tier GPT gets lost in the weeds, pinning one respondent's answer on another person.

It's like trying to read a newspaper through a narrow gap in a fence while sliding along the lines. You see fragments of text, but to understand which column a headline belongs to, you have to keep the whole page layout in your head. If the layout is off, you'll inevitably tie the price of bread to news about space. Models do the same thing: they lose the context of the two-dimensional structure when they try to digest it as a single stream, and end up delivering confident but completely false information.

The researchers ran models through six formats and found that Markdown and HTML are the baseline where AI messes up least. These formats have clear boundary markers that help the model keep track of the table's "vertical". If you use plain text or something exotic like Turtle, brace for failure: accuracy drops when the model has to do logical filtering or a simple count. It just stops understanding where one respondent ends and the next begins, turning the data into mush.

This principle applies to any data work, whether it's log analysis, order lists or test results. It was tested on questionnaires, but the structural barrier is universal: if the table in your prompt looks like a muddled heap of commas, the AI turns into a fortune-teller. To get the most out of ChatGPT or Gemini, forget about "just copy-paste from Excel" and use structured markup that explicitly separates entities from each other.

Bottom line: data format in a prompt isn't a matter of aesthetics, it's a matter of meaning surviving. If you want the AI to find every customer who rated you 5 and is ready to buy, don't make it guess its way through a raw CSV. Convert the data to Markdown or JSON, or you'll get hallucinations instead of analytics. Format is everything, and ignoring it means signing up for errors in every other request.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on QASU: How Data Format and Prompting Affect the Way LLMs Handle Tables arXiv:2510.26238

Sign in to apply this study New accounts get 50 free credits.