Most production databases are undocumented. Primary keys are missing or wrong. Foreign key constraints were dropped for performance. Column names are cryptic abbreviations from a developer who left years ago. Entity-relationship diagrams, if they ever existed, describe a schema three migrations old.
Nagarajan and Altman (arXiv:2603.23050) build DBAutoDoc, a system that infers documentation from the database itself. The method combines statistical analysis of actual data (column distributions, value overlaps between tables, cardinality patterns) with LLM-driven semantic interpretation, iterated across the schema's dependency graph.
The key design: schema understanding as backpropagation on a graph. Each table and column gets an initial description from the LLM based on names and data samples. Then semantic corrections propagate through the graph — if table A has a column that statistically matches table B's primary key, and table B's description changes, table A's description updates accordingly. The propagation iterates until descriptions converge. The LLM doesn't understand the database in isolation — it understands it through the structure of relationships.
The results: 96.1% weighted scores across Gemini and Claude on benchmark databases. A 23-point F1 improvement over LLM-only foreign key detection, confirming that the statistical analysis contributes substantially beyond what the language model knows from pre-training. The LLM's prior knowledge of common schema patterns is useful but insufficient — the actual data contains constraints that schema names alone don't reveal.
The practical value is obvious: every organization has legacy databases that nobody fully understands. But the conceptual insight is about the direction of documentation. Traditional documentation is top-down: the designer writes the spec, and the database implements it. DBAutoDoc works bottom-up: the data reveals the structure, and the documentation describes what actually exists. The gap between these two — between intended design and actual implementation — is what makes undocumented databases hard. The system doesn't reconstruct the designer's intent; it infers the structure from the artifact.