Creating a bespoke LLM for AI-generated documentation

Matthew Hayes, Hongyi Zhang, Tao Feng, Jan van der Vegt, Zaheera Valani, Reynold Xin21 Nov 2023

Problem

Most tables in a data platform have no description, so people cannot find the data they need and AI agents cannot pick datasets for a question. Databricks prototyped automatic documentation on a hosted (SaaS) LLM, and users wanted it at once. At launch scale three things broke. The only quality lever was prompting, and quality sometimes dropped with no change on their side (the authors suspect vendor updates). The API quota was too small for organizations with millions of tables. The cost made the feature viable only as a paid add-on.

Example from the article: Databricks Unity Catalog suggests descriptions for tables and columns from their schema, and users accept, bulk-accept or edit them.

Solution in brief

Treat the feature as an applied ML task: fine-tune a small open model on about 3,600 synthetic examples. A double-blind rating by four employees on 62 unseen tables showed the 7B model matched the pricier SaaS model. It runs on cheap A10 GPUs at one tenth of the inference cost.

Questions this case answers
  • How to replace a general-purpose hosted LLM with a small fine-tuned model for one narrow generation task while keeping the quality, when API quota, cost and unannounced model updates block scaling
  • How to compare two text generators in an unbiased way before launch when there is no production feedback and no labeled test set
  • How to generate descriptions for thousands of undocumented tables and columns without paying for a large SaaS LLM?
  • How to evaluate a small fine-tuned LLM against a SaaS model before launch when no production metrics exist yet?

Tools and methods

  • Synthetic training data — CREATE TABLE statements built from NAICS codes and internal use-case taxonomies, sample descriptions written by another LLM
  • Supervised fine-tuning of MPT-7B — one-line CLI run, about 15 minutes
  • Double-blind evaluation — evaluators vote on randomized pairs of outputs
  • Unity Catalog, Delta Sharing, optimized LLM serving — model registry with lineage, distribution to regions, serving
Continue reading — it's free

Google or a one-time email code. No password.