CleverMemory

Part 8 of Foundations: document geometry, and why the layout of a page is evidence rather than decoration.

Open almost any invoice and you will find the same number more than once. It is a line amount in one row, part of a subtotal in another, and the contract total at the bottom. Three appearances, three different claims, one identical string.

Most pipelines that read documents begin by throwing away the very thing that distinguishes them. Text extraction gets treated as a cleanup step: pull the words out, drop the table borders, drop the column headers, drop the page furniture, and hand a flat string to whatever comes next. By the time the interesting work starts, the only signal left is proximity. And proximity cannot tell you which of the three numbers answers "what is the contract total?"

Position is a claim, not a style#

To be fair to the instinct: stripping layout comes from a reasonable place. For a long time, layout genuinely was presentation. A bold heading meant somebody wanted it to look important, and inferring meaning from font weight was a losing game.

Structured documents are different, because the structure is load-bearing. A cell in a table is not a string that happens to sit near other strings. Its row identifies what it describes; its column identifies what kind of measurement it is. Neither of those facts appears anywhere in the cell's own text. Take the cell out of the grid and you have not simplified the data. You have deleted two thirds of it.

The same holds well past tables, and it is worth walking through slowly. A clause under "Definitions" establishes what a term means for the rest of the document. The identical figure on a row struck through as a historical summary establishes what used to be counted. A figure in a footnote qualifies a figure in the body. A signature block attributes everything above it. In each case the surrounding structure is doing work that the text alone does not do.

This field figured most of it out decades ago#

I want to be careful here, because it would be easy to present this as a neglected problem. It is not neglected. It is well studied, in a community that most of the rest of this series never talks to.

Document image analysis has drawn this distinction since at least George Nagy and Sharad Seth's 1984 work on hierarchical representations of scanned documents, which separated the geometric structure of a page from its logical structure: where the marks sit versus what role they play. That split is the whole ballgame. A row is a geometric fact. "This row is the total" is a logical one, and getting from the first to the second is an inference with evidence behind it.

The table literature took it further. Roberto Zanibbi, Dorothea Blostein and James Cordy's 2004 survey frames table recognition as an interaction of models, observations, transformations and inferences, which is a far more careful account than "parse the grid." And Matthew Hurst's 2000 Edinburgh thesis, The Interpretation of Tables in Texts, went directly at the question this article is circling: what does a cell actually claim, such that a downstream system could use it the way it would use a sentence?

So the knowledge exists. What has not happened is delivery. The formalisms in parts 3 through 7 of this series were, almost without exception, designed for propositions or for linear text. They assume something upstream already decided what the claims are. Meanwhile the document-analysis community spent decades working out how to recover logical structure from a page, and the semantic machinery that most needs that output was built as though the output were not available.

That is a gap between fields rather than a gap in any one of them. It is a recurring theme in this series, and it is the subject of the next part.

As the document has it Description Amount Install, phase 1 48,000 Support, year 1 48,000 Contract total 96,000 The row says what the figure is. The column says what kind of thing it measures. Flattened to text Description Amount Install, phase 1 48,000 Support, year 1 48,000 Contract total 96,000 Which one is the total? Nothing here says. Word order is all that survives, and word order was never carrying the meaning. Where a figure appears is part of what the figure claims.
An illustrative extract, not a product screenshot. The point is the asymmetry: the flattened version contains every word of the original and none of what made the words interpretable.

Why "just prompt around it" is unsatisfying#

There is an obvious objection, and it deserves a straight answer. Modern models read tables in context reasonably well, so why treat position as a first-class part of the record instead of handing the whole page to a reader and asking?

Two reasons, and only the second is about accuracy.

The first is that "reasonably well" is not a property you can point at when someone challenges an answer. If a total was chosen because a model inferred the table structure at read time, the justification for that choice does not exist anywhere afterward. You can rerun the model and hope for the same result, but hope is not an audit trail.

The second is that the failure mode is quiet. A system that misreads a table does not return an error. It returns a number, in the right format, of the right magnitude, and it is wrong in a way that looks exactly like being right. Of the mistakes a document system can make, this is close to the worst, because nothing about the output invites the scrutiny that would catch it.

Keeping position attached to the record does not make the reading step infallible. It makes the reading step's conclusion inspectable, which is a different and more achievable goal.

Where this gets hard#

I do not want to make this sound tidier than it is.

Document structure is frequently ambiguous. Merged cells, nested headers, tables that continue across a page break, spreadsheets exported to PDF with the grid discarded, scanned pages where the columns are visual rather than encoded: all of these make "which row is this in" a judgment call rather than a lookup. Any honest treatment of geometry has to represent uncertainty about geometry, which is a harder problem than representing geometry.

There is also a scoping question I have not fully settled. Position is meaningful relative to a document, and documents get split, merged, and quoted inside other documents. A clause's position in the agreement it came from is durable. Its position in a bundle somebody assembled last Tuesday is not, and the two need to be distinguishable.

What I am confident about is the direction. Layout was discarded because it used to be presentation, and in the documents businesses actually run on, it stopped being presentation a long time ago. A memory system that wants to show its work cannot begin by deleting the evidence.

Next: what happens when you try to hold this part and the previous seven together at once, and discover they were not built to fit.

↑ Back to top

Follow the project

Get one email when the first public release is ready, and first notice when the invitation-only demo opens. Nothing else. If you would rather talk before then, a technical briefing goes deeper than this site does and is the fastest way to test whether the approach fits your workflow.

One release notice and one demo notice only. See the privacy policy.