Table Serialization Determines Which Relations Language Models Preserve
Organizations: University of Toronto
Abstract
We study how text serialization affects table lookup in instruction-tuned language models. Our diagnostic asks the model to find the row containing a specified value under one named column, then return the value under another named column in that same row. We render the same synthetic 256-cell tables in row-major form and in column-major form with each header placed beside its values, while varying the table aspect ratio across five shapes. Across three models, the better format changes with table shape: row-major performs better on tall tables, whereas column-major performs better on wide tables. At 64 x 4, row-major leads by 42.3-54.0 percentage points; at 4 x 64, column-major leads by 35.0-59.0 points. Mapping wrong answers back to their source cells reveals a complementary error pattern: row-major tends to preserve the correct row but lose the target column, while column-major tends to preserve the correct column but lose the row. We use the term relational locality to describe this pattern: serialization keeps one relation locally available while making the other depend on positional alignment. A separate non-tabular ordering experiment supports this interpretation. Thus, apparent width-related failures in text-serialized tables depend on linearization, not table shape alone.
Figures & tables
| Row-major | Column-major with local headers |
| Column order: Employee | Department | Salary Grouping: rows Alice | Sales | 72000 Bob | Engineering | 95000 Carla | Finance | 83000 | Grouping: columns Column Employee: Alice | Bob | Carla Column Department: Sales | Engineering | Finance Column Salary: 72000 | 95000 | 83000 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | |||
|---|---|---|---|
| Qwen Coder 3B | -42.3 [-48.7, -36.0] | -1.3 [-7.3, +5.0] | +39.3 [+33.7, +45.0] |
| Qwen 3B | -51.7 [-57.7, -46.0] | -6.0 [-12.7, +0.7] | +35.0 [+29.0, +41.0] |
| Phi-3.5 Mini | -54.0 [-59.7, -48.0] | +17.7 [+10.7, +24.7] | +59.0 [+53.3, +64.7] |
| Representation | Rows OR | Columns OR |
|---|---|---|
| Row-major, global headers | 0.80 [0.74, 0.87] | 0.41 [0.37, 0.44] |
| Column-major, global headers | 0.65 [0.55, 0.77] | 0.48 [0.40, 0.58] |
| Column-major, local headers | 0.41 [0.37, 0.45] | 0.71 [0.65, 0.77] |