Apply to my task
arXiv:2510.21034 ★ 84 Oct 23, 2025

Structuring Data for LLMs: How Input Format Cuts Errors by 65%

Key result

Models stumble not because they're dumb but because of the format. Feed them a data mush and you get wrong numbers, mixed-up names, made-up facts. A study on NBA games showed that structured input (JSON with atomic fields) cuts factual errors by 65-69%, which beats switching to a more powerful model. The method lets you get accurate summaries from complex data (hundreds of rows of transactions, events, records) without hallucinations or swapped facts. The trick: break the data into atomic fields — one column for "player," another for "action," a third for "score." The model stops guessing where a name ends and a number begins; it reads from a specific field. JSON cut errors from 13.2 to 4.1 per 100 events for Llama-3.1-70B.

01

TL;DR

The input data format has a critical impact on the accuracy of LLM summaries. Researchers at the University of Aberdeen compared three ways of feeding NBA game data to models: unstructured text (raw play-by-play), a table (rows with clear columns: player, action, score, time), and hierarchical JSON (nested fields: event → player → action → result). The JSON format cut factual errors by 69% for Llama-3.1-70B and by 65% for Qwen2.5-72B compared to plain text. The table format works too: minus 54% for Llama and 51% for Qwen.

LLMs make numerical errors (a score of 130-129 instead of 123-123, "a couple of threes" instead of one), mix up names (crediting an action to the wrong player, sometimes even to players who weren't in that game), and swap events ("two shots" instead of "a dunk and a free throw," "a timeout" instead of "a turnover"). In unstructured text, models lose atomicity: when one phrase mixes player, action, distance, score, and time, they struggle to separate the facts. For example, "L. James makes 3-pt jump shot from 25 ft" blurs into a single description where it's easy to confuse who did what and when.

Structured input breaks data into atomic fields: one column for the player's name, another for the shot type, a third for distance, a fourth for the score. JSON goes further and creates a hierarchy: details are nested inside the event (player → primary/secondary, action → type → outcome → distance). This removes ambiguity: the model knows exactly WHERE to look for the name, WHERE the score is, WHERE the time is. ANOVA showed that input structure explains 80%+ of the variation in errors, which affects accuracy more than the choice of model.

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

How to Apply It

STEP 1: Structure the data Unstructured data → a table/JSON with atomic fields (one fact = one field)

STEP 2: Use hierarchy for relationships Nest related data (an event contains the player, action, result)

STEP 3: Feed it to the LLM with a prompt Point out the structure: "here's a table with columns X, Y, Z" or "here's JSON where..."

All in one request. You can ask the LLM itself to structure the data first, then work with the structured version.

03

Example

Task: You're analyzing sales for a US online store, a file with a month of transaction data. You need a report by region: where sales are growing, where they're tanking, which products are selling. The data arrived as a mess, with every line looking like "12/05/2024 Chicago Sneakers Nike Air $129.99 paid by card shipped via UPS".

Prompt:

Convert this transaction data into JSON with these fields:
- date (date)
- region (region)
- product_category (product category)
- product_name (name)
- price (price)
- payment_method (payment method)
- delivery_service (shipping carrier)

Then analyze: which regions show sales growth, which categories lead, and whether there are patterns by payment method.

[transaction data]

Result:

The model will first show structured JSON with clear fields for every transaction. Then it gives an analysis with no mix-ups: exact figures by region (it won't confuse Chicago with the Chicago suburbs), correct product counts by category (it won't lump Nike in with Adidas), and the right leaders. Without structuring, the model might misparse "$129.99" (taking it for a SKU), assign a product to the wrong region, or confuse the payment method with the shipping method.

04

Why It Works

LLMs process sequences of tokens: to them, "12/05/2024 Chicago Sneakers Nike Air $129.99" is just a string of words with no explicit structure. The model has to infer on its own that "12/05/2024" is a date, "Chicago" is a region, and "$129.99" is a price. Ambiguities pile up: does "Air" belong to the product or to the shipping? Is "129.99" a price or a SKU? The more complex the data (450+ rows in a basketball game, thousands of transactions on a marketplace), the more contextual dependencies there are: the model "remembers" the score was 123, but 50 tokens later it may forget and write 130.

LLMs work well with explicit structure: tables, JSON, and XML provide boundary markers. Here's the "price" field, here's the "region" field, here's the nested "event.player.name" field. The model doesn't guess; it reads from a specific spot. Atomic fields stop things from blending: one field holds only the player's name, another only the shot type, so there's no need to parse "LeBron James makes 3-pt jump shot" and pull out the pieces. JSON's hierarchy creates semantic links: an event contains players, play_details, and score, so the model understands WHAT belongs to WHAT.

Control knobs: If the data is simple (10-20 rows), a table is enough. If there are complex relationships (player → team → action → result → score), JSON is more effective. If the data is already in JSON, don't flatten it into text; feed it as is. If you got unstructured text, ask the LLM to structure it first, then work with the structure.

05

Prompt Template

Basic (for tabular data):

Here's a table of data: {table_description}

Columns: {list_column_names_and_what_they_contain}

{analysis_task}

Be precise with the facts — use only the data from the table, don't fill in gaps.

For JSON (hierarchical data):

Here's the data in JSON format:

{your_JSON}

Structure: {briefly_describe_the_hierarchy}

{analysis_task}

Rely strictly on the fields provided. Don't infer information that isn't in the data.

Two-step (if the data is unstructured):

STEP 1: Convert this unstructured data into a {table/JSON} with these fields:
- {field_1}: {what_it_contains}
- {field_2}: {what_it_contains}
...

{data}

STEP 2: Using the structured data, {analysis_task}

Placeholder notes:

  • {table_description} — what the data is (sales, games, orders)
  • {list_column_names_and_what_they_contain} — "date, region, product, price, status"
  • {analysis_task} — what you need back (report, summary, insights)
  • {your_JSON} — paste the full JSON
  • {briefly_describe_the_hierarchy} — "each event contains a player, action, result"
  • {field_N} — field names for structuring

🚀 Quick start — paste into your chat:

I have some unstructured data. Help me structure it in the best way for accurate analysis. Ask me questions about the data and the task, then suggest a format (a table or JSON with fields).

[describe your data and what you need to do with it]

The LLM will ask which fields there are, how the data is related, whether you need a hierarchy, and what kind of analysis you're planning, because the best structure depends on that. It'll suggest a concrete format for your task.

06

Limitations

⚠️ An extra step: You have to structure the data first. If there's a lot of it and it's complex, that can take time or require the LLM's help.

⚠️ Not everything structures easily: For qualitative data (reviews, comments, articles), structuring can lose important nuances. The method is for factual data where accuracy is critical.

⚠️ Format know-how: Even though an LLM can help with structuring, a basic understanding of JSON/tables is useful for checking the result.

⚠️ Tokens: Structured data takes up more space. In the study, JSON weighed in at 70-80k tokens vs 13k for unstructured text, so for large datasets you may hit context limits.

07

How They Tested It

The University of Aberdeen team took 30 NBA games from December 2024 – January 2025 (to avoid data contamination: the models hadn't seen these games in training). They picked games stratified by score margin: 7-8 games from each range (≤3 points, 4-9, 10-19, ≥20), so there were both nail-biters and blowouts.

They took raw play-by-play logs from Basketball Reference and turned them into three formats: (1) the original text — "L. James makes 3-pt jump shot from 25 ft", (2) a table with columns: time, period, team, player, action, event type, outcome, distance, score, (3) hierarchical JSON where each event is nested: {time: {...}, team: "Lakers", play_details: {event: {...}, players: {...}}, score: {...}}.

They ran these through Llama-3.1-70B and Qwen2.5-72B (both predating the 2024-25 season) with the same prompt, asking for a 450-word game summary. That gave 180 texts (30 games × 2 models × 3 formats). Then they hand-annotated every error — 3,312 of them! They grouped them into categories: numerical (score, counts), names (players, teams), objective wording (confusing a "shot" with a "dunk"), subjective phrases ("the decisive moment"), and contextual (mentioning a player who wasn't in that game).

Why did the results come out this way? A two-way ANOVA (input format × model) showed that format explains 80%+ of the variation in errors, which is huge! So it's not the model's fault (though Llama is slightly more accurate with JSON and Qwen slightly more careful with names); it's HOW you feed the data. Post-hoc tests (Tukey HSD) confirmed that each step down (JSON → table → text) significantly hurts accuracy (all p < 0.05).

The surprise: Even a simple table cuts errors in half versus text. JSON adds another 30%, but the gap between JSON and a table is smaller than between a table and text. Practical takeaway: you don't have to build elaborate JSON; even a basic table structure already helps a lot. If the data isn't deeply nested, a table will do.

An interesting detail: Llama made more numerical errors (it tried to tally runs and add up points, and got them wrong), while Qwen made more name errors (with unstructured input it sometimes hallucinated players from a different game entirely, like "Christian Wood," who didn't play that season at all). The errors aren't random; they're systematic and tied to how models handle sparse information in text.

08

Original from the Paper

Prompt from the experiment:

You are a professional basketball reporter hired by my company to cover NBA games. You are provided with a hierarchical JSON play-by-play dataset, which includes structured team information and a chronological list of plays. Each play entry contains key details such as time remaining, the team involved, play description, event type, player names, and score updates.

Your task is to analyse the data and identify the four most significant moments in each quarter, key scoring plays, momentum shifts, lead changes, game ties, and clutch performances. Prioritise impactful events such as three-pointers, layups, dunks, free throws, and possessions immediately following turnovers or rebounds. Ignore minor plays that do not significantly influence the game's flow.

Write a fluent, engaging, and objective game summary of exactly 450 words, structured around these defining moments. The narrative should clearly convey why these moments were significant, seamlessly integrating them into the game's overall storyline. It should flow naturally from start to finish, capturing the game's pace and intensity.

Mention the final score and quarter-ending scores for context, but do not rigidly structure the summary by time. Discuss key players in relation to the game-defining plays, without calculating total points. Maintain a smooth, journalistic writing style. Do not write in bullet points, lists, or unnecessary formatting. The summary must be factually accurate, strictly based on the provided data, and completely free from external assumptions, while maintaining a compelling and professional tone.

Quarter-End Context: Mention the total score contextually within the narrative as each quarter concludes. DO NOT list the quarter scores separately at the very end of the summary.

Context: The researchers used this prompt for every generation, swapping the "hierarchical JSON" wording for each format (row-structured table, unstructured text). Note the instructions: (1) "exactly 450 words" to normalize length for error counting, (2) "without calculating total points" to avoid arithmetic, (3) "strictly based on the provided data" as an attempt to reduce hallucinations.

09

Adaptations and Extrapolations

💡 Adaptation for financial data:

The principle works for any factual data. For example, analyzing bank transactions:

Convert the statement into JSON:
{
  "date": "2025-01-15",
  "transaction": {
    "type": "payment",
    "category": "groceries",
    "merchant": "Trader Joe's",
    "amount": 42.50,
    "payment_method": "card_ending_4321"
  },
  "balance": {
    "before": 1250.00,
    "after": 1207.50
  }
}

Analyze spending by category for the month. Be precise with the amounts.

💡 Adaptation for medical records:

Symptom journal → structured log:

Structure these wellness notes into JSON:
{
  "date": "2025-01-03",
  "symptoms": [
    {"name": "headache", "severity": 7, "duration_hours": 3},
    {"name": "fatigue", "severity": 5, "duration_hours": null}
  ],
  "triggers": ["not enough sleep", "stress at work"],
  "relief_actions": ["ibuprofen 400mg", "2 hours of rest"]
}

Find patterns: which triggers most often lead to symptoms, and what helps.

💡 Adaptation for event logs:

Server/app logs → structured analysis:

Convert the error logs into a table:

| timestamp | error_type | service | user_id | error_message | resolved |
|-----------|-----------|---------|---------|---------------|----------|

Determine: which errors are most frequent, in which services, and whether there are time-based patterns.

🔧 Technique: progressive drill-down → token savings

If there's a LOT of data (thousands of rows), use a two-level structure:

STEP 1: Aggregate the data into a summary table
[large dataset]

STEP 2: Work with the summary for the overall analysis

STEP 3: If you need details for a specific period/category,
request a structured slice of the source data

This lets you: (1) stay within the context limit, (2) get both an overview and details on demand, (3) keep accuracy, since aggregation happens explicitly, not "in the model's head."

10

Resources

Input Matters: Evaluating Input Structure's Impact on LLM Summaries of Sports Play-by-Play
Barkavi Sundararajan, Somayajulu Sripada, Ehud Reiter
Department of Computing Science, University of Aberdeen
Datasets (row-structured and JSON NBA play-by-play): https://github.com/BarkaviSJ/nba-input-matters


Research digest

Key result

Models stumble not because they're dumb but because of the format. Feed them a data mush and you get wrong numbers, mixed-up names, made-up facts. A study on NBA games showed that structured input (JSON with atomic fields) cuts factual errors by 65-69%, which beats switching to a more powerful model. The method lets you get accurate summaries from complex data (hundreds of rows of transactions, events, records) without hallucinations or swapped facts. The trick: break the data into atomic fields — one column for "player," another for "action," a third for "score." The model stops guessing where a name ends and a number begins; it reads from a specific field. JSON cut errors from 13.2 to 4.1 per 100 events for Llama-3.1-70B.

Principle

In unstructured text everything is jumbled: "12/05/2024 Chicago Sneakers Nike Air $129.99 paid by card" is one long string. The model has to infer on its own that "$129.99" is the price, not a SKU, and that "Air" belongs to the product, not the shipping. Structured input creates boundaries: the "price" field = 129.99, the "region" field = Chicago, the "product" field = Nike Air. The model doesn't parse; it takes what's ready. For related data, use a hierarchy: event → player → action → result. JSON nests one inside another, so the model sees what belongs to what.

Why it works

LLMs process sequences of tokens. To them, "LeBron James makes 3-pt jump shot from 25 ft (123-120, 5:32)" is just a string of words with no structure. The model holds context "in its head": it read the score 123-120, but 50 tokens later it may forget and write 130-129. Atomic fields remove the guesswork: the model knows exactly WHERE to look for the number. In a table, the "score" column always holds the score. In JSON, the "event.score" field is always there. ANOVA showed that input structure explains 80%+ of the variation in errors, which matters more than choosing between Llama and Qwen. The more complex the data (450 events in a game, thousands of transactions), the more contextual dependencies there are, and the model loses the thread. Structure creates anchors.

When to apply

Working with factual data → especially when you need precision in numbers, names, events. Specifically for: transaction analysis, summaries of meetings/games/reports, log processing, pulling insights from CRM records. NOT a fit for qualitative data where the nuances of wording matter (reviews, literary texts, creative content): structuring will kill the meaning.

Mini recipe

1. Define atomic fields: one fact = one field. Date separate, region separate, price separate. Don't mix them in one line. 2. Pick a format: Simple data (a shopping list) → a table with columns. Related data (an order contains a customer, products, shipping) → JSON with nesting. 3. Structure the data: Do it by hand or ask the LLM: `Convert this data into JSON with fields: date, region, product, price...` 4. Feed it with an instruction: Point out the structure in the prompt: `Here's a table with columns X, Y, Z` or `Here's JSON where each event contains...`. Set the analysis task. Add: `Rely strictly on the data in the fields, don't fill in gaps`.

Examples

[BAD]: `Analyze the sales: "12/05 Chicago Nike $129.99 card, 12/06 Boston Adidas $85 cash, 12/07 Chicago Puma $150 card..." and give insights by region` The model may mix up prices, confuse cities with products, and misparse dates. [GOOD]: `Convert this data into JSON: {date, region, brand, price, payment_method}. Then analyze: which regions lead in revenue, which brands are popular, and whether there are patterns by payment method. Rely only on the JSON fields.` The model first builds a clear structure, then gives an accurate analysis with no confusion in numbers or facts.

In plain words

Language models aren't magic oracles; they're souped-up word calculators that botch things badly when you feed them a raw data mush. Drop a plain-text log of a basketball game or a sales export into a model, and it starts tripping over numbers and names simply because it doesn't grasp the hierarchy of meaning. To the model, plain text is a flat sheet where the date, a player's last name, and the game score all carry equal weight. So it loses the thread and starts "hallucinating," crediting points to the wrong teams or scrambling the timing of events.

It's like trying to assemble an IKEA wardrobe when instead of clear picture instructions you're handed a novel that describes the assembly in metaphors. Technically the information is there, but to figure out which screw goes where, you have to wade through tons of extra words. At some point you'll inevitably slip up, simply because your brain is overloaded decoding the context instead of doing the actual work. Same story with LLMs: when data comes in a heap, the model spends its effort guessing the structure instead of analyzing the substance.

The researchers proved that tidy data works wonders: hierarchical JSON cuts factual nonsense by 69%. If instead of the text line "Player A hit a three in the 5th minute" you give the model a clear structure with "event", "player", and "result" fields, accuracy goes through the roof. Even a simple table gives a big boost, cutting errors in half. Models like Llama-3.1 or Qwen2.5 "see" the connections between objects far better when they're neatly sorted than when they're tossed in a text blender.

This principle is universal and works well beyond sports. Whether you're analyzing marketplace transactions, server logs, or medical records, structure is everything. If the data comes in as a mess like "12/05/2024 Chicago Sneakers $129.99", the model may decide 129.99 is a SKU or a ZIP code. But wrap it in JSON and the model stops guessing and turns into the ideal analyst. Input format matters more than model size, because even the smartest algorithm is helpless against chaos in its context.

Bottom line: stop feeding models "text noise" and hoping for a miracle. If you want a sane summary without fabrications, first structure the incoming stream into JSON or tables. It's the cheapest, fastest way to get AI working properly without endless edits and fact-checks. JSON is a cheat code for accuracy, and ignoring it in 2024 means knowingly accepting that your model will confidently spout nonsense.

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 Structuring Data for LLMs: How Input Format Cuts Errors by 65% arXiv:2510.21034

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