LLM-Powered Data Classification System for Enterprise-Scale Metadata Generation

grab · Tech · 2023 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Enterprise data governance and metadata classification

Grab needed to classify petabyte-scale data entities for sensitive information and PII so access controls, discovery, ABAC, and masking could operate at finer granularity than manual schema-level tagging allowed.

Constraints:

Architecture

Grab integrated GPT-3.5-style LLM classification into Gemini, its existing data-classification orchestration service. Data platforms submit classification requests, Gemini groups them into mini-batches through a message queue, rate-limits provider calls, prompts the LLM as a column tag generator with few-shot examples and a default None tag, publishes predictions to Kafka, and asks users to verify tags weekly so prompts can improve and downstream ABAC and Dynamic Data Masking can consume the classifications.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Data_platforms["Data platforms"] --> Gemini["Gemini orchestration service"]
  Gemini --> Message_queue["Message queue batching"]
  Message_queue --> Rate_limiter["Workflow rate limiter"]
  Rate_limiter --> Cloud_APIs["Cloud provider APIs"]
  Cloud_APIs --> LLM_tags["LLM column tag generator"]
  Prompt_controls["Prompt engineering controls"] --> LLM_tags
  LLM_tags --> Kafka_queue["Kafka prediction queue"]
  Kafka_queue --> User_verification["User verification workflow"]
  User_verification --> Prompt_analytics["Prompt analytics pipeline"]
  Kafka_queue --> Data_platforms
  Data_platforms --> ABAC_masking["ABAC and masking consumers"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Data platforms Systems that request metadata classification for database, stream, and data lake entities. Gemini orchestration service, Kafka prediction queue
Gemini orchestration service Schedules, groups, and orchestrates data classification requests. Data platforms, Message queue batching, Workflow rate limiter, LLM column tag generator
Message queue batching Aggregates classification requests into mini-batches at fixed intervals. Gemini orchestration service, Workflow rate limiter
Workflow rate limiter Controls calls to cloud provider APIs to avoid throttling. Message queue batching, Cloud provider APIs
Cloud provider APIs Hosted LLM endpoint used for classification. Workflow rate limiter, LLM column tag generator
LLM column tag generator Language model prompted to assign the most appropriate tag to each column. Gemini orchestration service, Prompt engineering controls, Kafka prediction queue
Prompt engineering controls Few-shot examples, fixed format, and default None tag that make outputs processable and safe when uncertain. LLM column tag generator, Prompt analytics pipeline
Kafka prediction queue Publishes unverified LLM tag predictions to downstream platforms. LLM column tag generator, User verification workflow, Data platforms
User verification workflow Weekly review loop where users verify classified tags and feed prompt improvement. Kafka prediction queue, Prompt analytics pipeline
Prompt analytics pipeline Metrics pipeline planned to quantify prompt effectiveness and support iteration. Prompt engineering controls, User verification workflow
ABAC and masking consumers Downstream access-control and Dynamic Data Masking use cases that consume classified tags. Data platforms

Data flow

A data platform sends data-entity classification requests to Gemini. Gemini schedules and groups requests into mini-batches, uses a workflow-level rate limiter to call cloud LLM APIs, prompts the model to assign column tags in a fixed output format, publishes predictions to Kafka, and downstream platforms ask users to verify tags weekly for correctness and prompt iteration.

3 supporting quotes
“Our orchestration service, Gemini, manages the data classification requests from data platforms.”article, stated
“When the orchestration service receives requests, it helps aggregate the requests into reasonable mini-batches.”article, stated
“The predictions are published to the Kafka queue to downstream data platforms. The platforms inform respective users weekly to verify the classified tags”article, stated

Why this architecture

Grab used an orchestration service around the LLM because classification had to run at data-platform scale, preserve structured downstream outputs, avoid provider throttling, and stay operable by governance teams through natural-language prompts instead of custom model-training cycles.

3 supporting quotes
“The LLM naturally solves the mentioned pain points as it provides a natural language interface for data governance personnel.”article, stated
“Due to this nature, prompt engineering is a crucial component to make sure downstream workflows can process the LLM’s output.”article, stated
“a rate limiter is attached at the workflow level. It allows the service to call the Cloud Provider APIs with respective rates”article, stated

Models used: GPT-3.5 · LLM column tag generator · few-shot prompting

Scale

Alternatives considered (roads not taken)

Manual schema/table classification campaigns

Rejected because: Manual work could not keep up with the volume, velocity, and variety of table-level data classification.

“The volume, velocity, and variety of data had skyrocketed within the organisation, so it took significantly more time to classify at table level compared to schema level.”article, stated

In-house custom classifiers

Rejected because: Custom models would require a dedicated data science team, governance-rule learning, and manually labeled training data.

“Building in-house classifiers would require a dedicated data science team to train a customised model.”article, stated
“prepare datasets with manually labelled training data.”article, stated

Free-text LLM output

Rejected because: Downstream workflows needed fixed-format tags rather than unconstrained prose.

“The output of the language model is typically in free text format, however, we want the output in a fixed format for downstream processing.”article, stated

Always requiring user verification

Rejected because: Grab plans to reduce mandatory verification once accuracy and confidence become high enough.

“we plan to remove the verification mandate for users once the accuracy reaches a certain level.”article, stated

Patterns

tool-use-orchestration (workflow)

Gemini orchestrates batching, rate limiting, cloud LLM calls, Kafka publishing, and downstream user verification around the classifier.

“Gemini: This orchestration service communicates with data platforms, schedules and groups data classification requests.”article, stated
“The predictions are published to the Kafka queue to downstream data platforms.”article, stated

structured-output-contract (output control)

Prompt engineering constrains the LLM to return fixed-format column tags suitable for downstream processing.

“we want the output in a fixed format for downstream processing. Due to this nature, prompt engineering is a crucial component”article, stated

prompt-chaining (prompting)

The prompt uses task instructions, examples, and a None fallback to improve classification behavior without training a custom model.

“By showing the example of interaction, models understand how they should respond.”article, stated
“the LLM is instructed to output the default <None> tag when it cannot make a decision or is confused.”article, stated

human-in-the-loop-gate (quality)

Users verify classified tags weekly, improving correctness and enabling iterative prompt improvement before verification can be relaxed.

“The platforms inform respective users weekly to verify the classified tags to improve the model’s correctness and to enable iterative prompt improvement.”article, stated

eval-driven-development (operations)

Grab is building analytical pipelines to measure prompt-version effectiveness and iterate prompts faster.

“we are building analytical pipelines to calculate the metrics of each version of the prompt. This will help the team better quantify the effectiveness of prompts”article, stated

Tradeoffs

Use LLM classification instead of building custom classifiers

Chose natural-language prompt-driven classification over dedicated in-house classifier training.

Rationale: Governance personnel could express requirements through prompts without a full ML training and labeling program.

“They can express governance requirements through text prompts, and the LLM can be customised effortlessly without code or model training.”article, stated

Keep users in the verification loop initially

Chose weekly tag verification by respective users over immediate fully automated trust in predictions.

Rationale: Predictions are unverified model outputs until users validate correctness and provide feedback for prompt improvement.

“Prediction: Refers to the model’s output given a data entity, unverified manually.”article, stated
“The platforms inform respective users weekly to verify the classified tags to improve the model’s correctness”article, stated

Use a default None output for uncertainty

Chose explicit confusion fallback over forcing a sensitivity tag for every column.

Rationale: A default tag reduces overconfident classifications when the model cannot decide.

“Allow for confusion: In our prompt we specifically added a default tag – the LLM is instructed to output the default <None> tag when it cannot make a decision or is confused.”article, stated

Build on the existing Gemini orchestration service

Chose integrate LLM classification into current data-classification orchestration over standalone LLM calls outside the governance workflow.

Rationale: Gemini already handled platform communication, scheduling, grouping, and downstream integration needs.

“This prompted the inception of the project, which aimed to integrate LLM classification into our existing service.”article, stated

Gotchas (what bit them)

Schema-level sensitivity labels over-restricted non-sensitive data.

Root cause: A single Tier 1 table caused an entire schema with hundreds of tables to inherit strict access controls.

Resolution: Move toward finer-grained table/entity classification powered by automated LLM tagging.

“The presence of a single Tier 1 table in a schema with hundreds of tables justifies classifying the entire schema as Tier 1.”article, stated
“Shifting access controls from the schema-level to the table-level could not be done safely due to the lack of table classification in the data lake.”article, stated

Manual classification did not scale with Grab's data growth.

Root cause: The volume, velocity, and variety of data increased the cost of table-level classification beyond manual campaigns.

Resolution: Use a programmatic LLM classification service with batching and rate limiting.

“The volume, velocity, and variety of data had skyrocketed within the organisation, so it took significantly more time to classify at table level”article, stated

Unstructured LLM output would break downstream workflows.

Root cause: Language models typically emit free text, while data platforms need predictable tags.

Resolution: Use prompt engineering, few-shot examples, and a fixed output format with a default None tag.

“The output of the language model is typically in free text format, however, we want the output in a fixed format for downstream processing.”article, stated

Cloud provider LLM calls can be throttled under batch classification load.

Root cause: Classification requests arrive from data platforms and are grouped into service-provider API calls.

Resolution: Attach a rate limiter at workflow level to call cloud provider APIs at their respective rates.

“a rate limiter is attached at the workflow level. It allows the service to call the Cloud Provider APIs with respective rates to prevent the potential throttling”article, stated

Evaluation

Grab evaluated the rollout using user tag-change behavior, an internal survey, throughput after rollout, and planned prompt-version analytics.

Metrics: average user tag changes · 80% survey helpfulness · 20,000+ entities scanned in one month · 300-400 entities per day · prompt-version metrics pipeline

3 supporting quotes
“For acknowledged tables, users on average change less than one tag.”article, stated
“80% reported that this new tagging process helped them in tagging their data entities.”article, stated
“we are building analytical pipelines to calculate the metrics of each version of the prompt.”article, stated

Outcomes

The production load covers petabyte-level data and hundreds of daily entity classifications at current rollout scale.

3 supporting quotes
“Within a month since its rollout, we have scanned more than 20,000 data entities, averaging around 300-400 entities per day.”article, stated
“we are saving approximately 360 man-days per year for the company.”article, stated
“enable us to determine the sensitivity tier of data entities, which in turn will be leveraged for enforcing the Attribute-based Access Control (ABAC) policies”article, stated