The Chunking Problem That Kills Spreadsheet Q&A

When someone asks a language model a question about a spreadsheet, the standard pipeline chunks the sheet into pieces, retrieves the most relevant ones, and generates an answer from them. The first step determines everything downstream. If the chunk carries the right context, the model can interpret the value. If not, it gets a bare number with no idea what it means.

Zofia Smoleń from the Polish Academy of Sciences demonstrates that the way real-world spreadsheets are chunked is fundamentally broken for RAG systems. Existing tools either cut XML into pieces that strip values of their structural context, or assume every sheet has a flat header-on-top layout. The paper proposes annotating each cell with one of 13 semantic roles and using those roles to build chunks that preserve the header hierarchy. On a benchmark of 480 questions, chunks built from learned cell roles beat the strongest state-of-the-art chunker by +0.45 points on human-rated answer quality (3.88 vs. 3.43). But the paper also identifies a hard ceiling: even perfect human-annotated roles reach only 4.01 of 5, suggesting that cell classification alone cannot solve the problem.

Why Spreadsheets Break Standard Chunking

Chunking text is straightforward. Split on periods, paragraph boundaries, or fixed character counts. The sequential structure of language provides natural cut points. Spreadsheets have no such structure. They are two-dimensional, with values whose meaning depends on which row and column they sit in, which headers name those dimensions, and how those headers nest. A single cell containing "51.5" is meaningless without knowing it represents the Short position under Total Credit, Buyside, in February.

The paper surveyed 59 active practitioner discussions on machine-learning forums and found that the most-cited failure mode was loss of context during chunking (59% of threads), followed by complex or nested headers (37%) and messy, sparse layouts (29%). Practitioners report a fragmented toolchain: 49% iterate rows with Pandas, 32% use Text-to-SQL agents, 25% resort to vision LLMs, 22% use Docling, 17% use Unstructured.io, and 12% parse HTML with BeautifulSoup. None of these reliably preserves the header-to-value hierarchy that carries most of the context.

The two leading academic approaches have specific weaknesses. SpreadsheetLLM compresses sheets about 25 times by keeping only rows and columns where something changes and replacing number runs with summary notes. This produces a map with no numbers, which cannot answer questions. Its Chain of Spreadsheet retrieval then asks an LLM to point at the right region and extracts the real data, but this assumes you already know which file to look in. STC (Structure-aware Table Chunking) treats the first populated row as the header and emits one key-value block per data row. This works for flat tables but breaks on nested headers, cross-tabs, and multi-table sheets, which is where the real difficulty lies.

Learning Cell Roles with Two Families of Models

The paper trains six neural networks from two families to predict 13 cell-role classes. The roles are designed around one question: what does a cell contribute to a chunk? The two dominant classes are value (49% of cells) and empty (45%). The rest include column and row headers at three nesting depths, aggregations (formula-derived totals), metadata, comments, sheet-level headers, and junk cells (placeholder text, decorative fragments).

Node classifiers take table membership as given and predict roles within tables. An MLP with three linear blocks serves as the non-relational baseline. A GCN with three GCNConv layers and LayerNorm residuals passes messages between neighboring cells. A GAT with three GATConv layers adds a learned edge encoder. Graph learners additionally learn the sheet's structure itself, predicting cell-to-cell links alongside roles. An AdjTransformer uses a TransformerEncoder with four bilinear adjacency heads. A DualModalityGNN builds separate content and format encoders fused over a learned k-NN graph. A SpatialEdgeTransformer uses spatial-bias attention with a typed edge scorer.

All six models consume the same 857-dimensional per-cell feature vector built from content, formatting, formula, and neighborhood signals. Training uses focal loss with inverse-frequency weights over the 13 classes, plus binary cross-entropy on predicted adjacency for graph learners. Five-fold cross-validation at the sheet level with three seeds produces 90 runs total.

The results are clear: every graph learner outperforms every node classifier. The best model, DualModalityGNN, reaches macro-F1 of 0.75 compared to the MLP's 0.58. Graph learners lead on the majority of classes with lower variance. The gap is largest on rare classes like deeper header levels, where a handful of sheets can swing the score. Learning cell relationships transfers across layouts better than classifying each cell in isolation.

Why Roles Help Generation, Not Retrieval

The paper deploys 16 checkpoints spanning a wide range of role quality and measures both retrieval and answer quality on the same 480 questions. The finding is clean: answer quality rises with role quality, gaining +0.56 rating points per unit of macro-F1. Retrieval does not depend on role quality at all, with regression slopes near zero.

The reason is straightforward. A chunk matches a query lexically and semantically whether or not its cell roles were recognized correctly. The word "51.5" matches "What was the Short position?" regardless of whether the chunk labels it correctly. But for the LLM to interpret the value, it needs to know what the value means: which column names it, which row it belongs to, which header hierarchy gives it units and scope. That context can only be packed into a chunk if the cell roles are recognized correctly.

This is illustrated by the paper's opening example. Three chunks carry the same answer cell from a nested-header sheet. Unstructured emits bare rows with headers detached from values. STC maps values to generic first-row column labels that name nothing. The proposed Row chunk spells out the full context: sheet title, row header, and the complete column-header path. Only the last lets the generator tell which counterparty, which date, and which position a number belongs to.

Which Roles Matter and Where

An ablation study removes one role class at a time from gold-role chunks and measures the drop in answer quality. Primary column headers cost 1.40 rating points when removed, an order of magnitude more than any other role, because a value whose column is unnamed is just a number. Deeper column headers cost 0.30, deeper row headers 0.22, primary row headers 0.13, and sheet-level titles 0.12. Aggregation and metadata have negligible effect.

The benefit concentrates on non-standard tables. On nested-header sheets, perfect roles are worth +1.15 points over STC. On matrix and cross-tab sheets, +0.36. On multi-table sheets, +0.36. On simple flat tables, the entire effect disappears: the ceiling shrinks to +0.10 and the best learned method to -0.01. On a simple flat table, the first row already names every column, so a plain first-row heuristic recovers all the structure there is. Cell role annotation is not a general-purpose booster. It is a targeted fix for exactly the tables that existing tools read wrong.

The Hard Ceiling and the Path Forward

Even chunks built from perfect human-annotated roles reach only 4.01 of 5. The ceiling sits on the same regression curve as learned roles, so the gap between learned and perfect roles is accounted for. But the gap between perfect roles and a perfect score is not. The paper argues this ceiling exists because spreadsheets are fundamentally two-dimensional unstructured data with continuous relationships and infinite potential cell roles. Classification models are restricted to finite, pre-defined classes and cannot capture this structural nuance, even with human-level annotation.

The authors propose that addressing the spreadsheet-to-LLM bottleneck requires moving beyond discrete cell classification. Instead, the field must develop dimensionality-reduction techniques to directly flatten 2D unstructured spreadsheets into 1D unstructured text. Text chunks would be easier for downstream RAG to interpret and generate from. This could mean learned, structure-conditioned rendering of sheets into natural-language sentences, adapting to each sheet's layout rather than committing to a fixed geometry.

What It Means in Practice

For teams building spreadsheet Q&A systems, the paper provides a practical framework with modular components: the role annotator and the chunk geometry are independent. The best configurations pair the GAT or DualModalityGNN annotator with row-based chunk assembly. The released framework, training code, and the 480-question benchmark with gold role annotations make this immediately testable.

The finding that roles help generation but not retrieval has practical implications. If your retrieval is already good but your answers are poor, improving the chunking to include more structural context will help more than improving the embedding model. If your retrieval is bad, improving chunking will not fix it, and you should focus on the retrieval step instead.

The paper's survey of practitioner discussions reveals a toolchain fragmentation that the research community should take seriously. The most popular tools (BeautifulSoup, Unstructured, Pandas) are not designed for spreadsheet structure. The academic tools (STC, SpreadsheetLLM) make strong assumptions about layout. The gap between what practitioners need and what the research provides is large, and this paper narrows it substantially while being honest about where the ceiling lies.

The suggestion that the next step is dimensionality reduction from 2D to 1D is provocative. Spreadsheets are not text, and treating them as text loses information. But the paper demonstrates that the current approach of annotating cells with discrete roles and assembling chunks from those annotations has diminishing returns. The hard cases, where spreadsheets have complex nested structures and the value of context is highest, are exactly where the discrete classification approach struggles most. A learned flattening that preserves the relationships between cells while producing text that language models can naturally interpret is the natural next step, and this paper provides the evaluation infrastructure to measure progress toward it.

Read the paper on arXiv