Preparing your design workspace

Loading the problem and your latest saved attempt…

Design LLM-Based Business Industry Classification

Use an LLM to label millions of messy business records with an industry from a fixed taxonomy, serve the labels to other products, send unsure cases to reviewers, and re-label safely when the taxonomy or model changes.

Problem statement

A company holds records for many businesses: a name, an address and a few other details. It wants every business classified into an industry, such as banking, technology, healthcare or pharmaceuticals, and it wants to use a large language model (LLM) to do it.

The question is open-ended: design the system that produces, stores and maintains these labels.

For this exercise, assume the industries come from a fixed two-level taxonomy owned by a small team of taxonomists: about 25 sectors split into about 250 industries, each with a code, a name and a short description. The taxonomy changes a few times a year and every change is a new version.

Each business record has a business ID, a legal or trading name, a postal address and, when known, a website domain and a free-text description; records are messy, with abbreviations, typos and missing fields. Classification uses only the record's own fields; crawling the web is out of scope.

Other products read a business's current label by business ID, for example to group businesses in reports or tailor what they show, and a reader may ask for a specific taxonomy version.

For this exercise, also assume each label stores an industry code (or no match), a confidence, a one-sentence reason, whether it came from the model or a reviewer, and the taxonomy and model versions that produced it.

A label below a confidence threshold, or a record that fits no industry, goes to human reviewers, and a reviewer's decision always wins over the model. Records that fit no industry should be grouped so the taxonomists can see which new categories may be missing.

The LLM is an external service with a request quota and a cost per call. Building or fine-tuning the model itself, and the reviewers' tool interface, are outside scope.

What to build

  1. For this exercise, every business record gets an industry label from the current taxonomy, with a confidence and a short reason; new and changed records are labeled within one hour and all existing records are labeled once at launch.
  2. For this exercise, other products can read a business's current label, with its taxonomy version, by business ID.
  3. For this exercise, low-confidence and no-match records go to human reviewers, a reviewer's decision replaces the model's label, and unmatched records are grouped for the taxonomists.
  4. For this exercise, when the taxonomy or the model or prompt changes, affected records are re-labeled and the change is checked against reviewed labels before readers see it.

At scale

  • For this exercise, assume 50 million existing business records, and about 200,000 new or changed records a day with peaks of 20 per second.
  • For this exercise, assume the shared LLM quota is 300 requests per second, a call takes 1 to 3 seconds, and every call has a cost, so the one-time labeling of existing records must finish within about a week without starving daily traffic.
  • For this exercise, assume reading a business's label takes under 50 milliseconds at up to 5,000 reads per second.
  • For this exercise, assume a reviewed sample of 5,000 records is available to measure accuracy, and reviewers can handle about 2,000 records a day.