Matters
The story behind Matters AI's funding journey
Data Classification at Scale: Why One-Size AI Does Not Fit All
Product & Technology

Data Classification at Scale: Why One-Size AI Does Not Fit All

Anish Pawar avatar

Anish Pawar, ML Scientist, Matters.AI

Harsh Sahu avatar

Harsh Sahu, CTO & Co-Founder, Matters.AI

JUNE 2026

Data classification looks incredibly easy in a sandbox. You pull a handful of customer support tickets or messy text blocks into a demo, the Large Language Model effortlessly picks out the sensitive data, and everything works perfectly.
 The engineering hangover happens when you deploy that exact model-centric approach into a live production environment. When you are scanning hundreds of millions of files scattered across S3 buckets, cloud drives, and structured databases, traditional classification engines don’t just slow down, they completely blindside your compliance and engineering teams. It isn’t a failure of the LLM’s capability it is a brutal reality of unit economics and throughput constraints. Running an enterprise data pipeline where an expensive, high-latency LLM evaluates every single routine file simply does not scale.

If you are processing data at real enterprise volume, you don’t need a more powerful model; you need a smarter routing strategy. This post breaks down how we approach classification differently through a tiered architecture we call the Hybrid Intelligence Pipeline and why separating fast, deterministic processing from heavy semantic reasoning is the only way to balance cost, speed, and accuracy at scale.

The Limitations of Scale: Traditional Pattern Matching

For decades, enterprise data classification relied entirely on Regular Expressions (Regex) and rigid pattern matching. While this deterministic approach is fast and computationally cheap, it is fundamentally blind to context. It operates on a simple, flawed assumption: if a string matches a specific format, it must be sensitive data.
In a complex enterprise environment, this rigid logic falls apart completely. Here is where traditional Regex and pattern matching approaches create critical bottlenecks:

  • The “False Positive” Nightmare: A RegEx pattern designed to find 9-digit Social Security Numbers (SSNs) will blindly flag internal part numbers, serial numbers, and tracking codes. Compliance teams end up drowning in thousands of daily alerts that are nothing more than digital noise.
  • Context-Blind Collisions: A rules engine cannot differentiate between identical formats. The 5-digit number “84721” looks exactly the same to a Regex engine whether it is a medical Patient ID or a routine logistics zip code.
  • The Unstructured Text Black Box: Traditional engines struggle with semantic ambiguity. If an employee writes an email saying, “The blueprint for Project X is attached, don’t leak this,” a traditional pattern matching engine sees absolutely nothing sensitive. There are no credit card formats or SSNs to flag, yet a massive intellectual property leak just slipped past your perimeter.

The Problem with Using Single-Model Approaches

Large Language Models (LLMs) change the game because they introduce genuine contextual understanding, something traditional engines simply cannot do. An LLM doesn’t just scan for string matches; it understands intent, nuance, and proximity. It can read a messy, unstructured chat log and correctly identify sensitive data based on the surrounding conversation. This capability is the only way to accurately flag high-risk, ambiguous data and eliminate the false-positive nightmares that have plagued teams for years.
But the mistake isn’t using semantic reasoning, it’s wasting it. When an architecture forces an LLM to evaluate every single routine byte of data flowing through an enterprise, it treats this advanced intelligence layer like standard infrastructure plumbing. At enterprise scale, dumping raw volume directly into a single-model pipeline creates major operational bottlenecks:

  1. The Truncation Blindspot: Because massive enterprise files have to be broken down into chunks to be processed efficiently by a model, you introduce a structural blindspot, sensitive context that happens to bridge a chunk boundary gets truncated and dropped. You end up exhausting your compute resources on the easy stuff, only to miss the deep, complex edge cases that semantic reasoning was actually meant to catch.
  2. The Unit Economics Fail at Scale: LLMs are built for deep reasoning, and they charge per token. Routing hundreds of millions of routine documents through a model causes infrastructure costs to skyrocket linearly with your data volume, making continuous scanning completely budget-prohibitive.
  3. The Latency Bottleneck: Deep reasoning takes time. Real-time data pipelines that require classification decisions in milliseconds cannot absorb the round-trip latency of a model call for every trivial file.
  4. Misallocating the Intelligence: The vast majority of enterprise data detections simply do not require semantic processing. A credit card number follows a known format and satisfies a specific mathematical check called the Luhn algorithm. Running that check takes microseconds and produces a definitive result. Using a heavy language model to validate a straightforward, deterministic string adds cost and latency without improving accuracy by a fraction of a percent.

The Hybrid Intelligence Pipeline: Three Layers That Work Together

The core principle is straightforward: handle the easy cases cheaply, and only route to more expensive tools when the situation genuinely requires it. Each layer passes forward what it cannot confidently resolve, so the next layer only sees the cases that actually need its attention. The objective across all three layers is to maintain high recall, meaning catching every instance of sensitive data that matters, while keeping false positives low enough that compliance teams continue to trust the results.

Hybrid intelligence

Layer 1: Deterministic Pattern Engine The first layer runs pattern matching across more than 100 categories of sensitive data, including Social Security Numbers, passport numbers, international bank account numbers (IBANs), tax IDs, and medical record numbers. Beyond format matching, it also runs structural validators. For credit card numbers, for example, it checks whether the number passes the Luhn algorithm before flagging it, which eliminates a large class of false positives immediately. This layer is deterministic, extremely fast, and resolves the majority of detections before any machine learning model gets involved. Anything it cannot resolve with confidence gets passed to the next layer.

Layer 2: Adaptive Context Classifier Pattern matching has a fundamental limitation: identical number formats can represent entirely different things depending on where they appear. The number “84721” could be a patient ID inside a medical record or an order ID inside a logistics spreadsheet. A rules engine cannot distinguish between them because it has no understanding of the surrounding text. A context-aware model can, because it reads the sentence and paragraph around the detected value before making a decision. This layer also handles new categories of sensitive data without requiring a full model retraining cycle. When a regulatory change introduces a new data category that needs to be detected, the system can accept a plain-language description of that category and begin detecting it immediately, without needing labeled training examples.

Layer 3: Secure LLM Synthesis The LLM in this pipeline has one specific job: confirm or reject the detections that the first two layers flagged but could not resolve with high confidence. Rather than receiving the full text of a document, the model receives a structured input package that contains a document summary, the file name, the storage location, the column name for structured data, a description of the relevant sensitive data category, and the specific detection under review. It returns one of two outputs: confirmed or rejected. This constrained input design keeps the model focused. It cannot drift into unrelated tasks because there is nothing in the input that invites that. Verification latency stays predictable, and precision on edge cases stays high. Our finding in production showed that this specific architecture reduced verification latency by more than half, achieved 98% precision on edge cases, and cut LLM API costs by 85% compared to single-model alternatives.

LayerSpeedCostPrimary JobWhere It Falls Short
Deterministic Pattern EngineVery fastVery lowHigh recall across known categoriesLower precision on ambiguous patterns
Adaptive Context ClassifierFastLow to mediumResolving ambiguity using surrounding contextNeeds examples for entirely new domains
Secure LLM SynthesisModerateMediumEdge-case precisionLatency increases at very high volume

Enterprise Data Privacy and Governance

When running a high-volume data classification pipeline, security is not an afterthought. The Hybrid Intelligence Pipeline is engineered so that customer data remains completely isolated within your secure perimeter, and our base models are trained in-house without ever utilizing customer data. Customers can opt out of any training telemetry entirely. For the Secure LLM Synthesis layer, the system generates a structured bundle instead of forwarding raw text, which ensures that no protected health information (PHI) or raw text is ever transmitted to external third-party LLM providers. All inference runs directly within your dedicated environment, which allows your organization to maintain complete data sovereignty while still benefiting from advanced intelligence.

Structured and Unstructured Data Require Different Strategies

Running structured and unstructured data through the same pipeline is one of the most common classification design mistakes. These two data types have different characteristics, different compute requirements, and different sources of error, so they warrant different treatment.

Structured data, such as databases, spreadsheets, and CSV files, arrives with a schema. Column headers, declared data types, and a sample of values give the classifier enough signal to make a confident decision at the column level, without scanning every individual row. This approach is fast and accurate when schemas are well-labeled.

Unstructured data, such as documents, contracts, and free-text fields, has no schema. The classifier must parse the full content of the file and rely on contextual signals instead of structural ones. This produces higher compute cost in exchange for greater depth of understanding. Free-text content also generates more false positives because context is harder to constrain than a column header.

Structured DataUnstructured Data
Processing approachColumn-level inferenceFull document parsing
Key signalsColumn headers, data types, sampled valuesFree text, layout, contextual structure
Compute costLowHigher
Primary source of false positivesType collisions between similar fieldsAmbiguous surrounding context

Document-Level Classification

Detecting specific sensitive fields

Detecting specific sensitive fields within a document answers one question: does this file contain a Social Security Number? Document-level classification answers a different and equally important question: what kind of document is this, and what does that mean for how it should be handled? Knowing that a document contains a Social Security Number is useful. Knowing that the document is a W-2 tax form places that detection into a specific compliance category with its own retention requirements, access controls, and audit obligations. For example, once a file is identified as a W-2, your compliance team can automatically trigger an HR-category retention policy and restrict access controls to authorized payroll personnel only. Those two pieces of information come from different classification processes and serve different downstream purposes. Document-level classification utilizes an LLM-enhanced path that analyzes a dense, compressed document context alongside any detected PII, PHI, or PCI to make context- and sensitivity-aware decisions. It produces a document type label, a data sensitivity classification, and a category tag that downstream policy systems can act on to determine who may access the file, how long it should be retained, and whether it requires additional review. This path runs in parallel to the field-level detection pipeline and complements it rather than replacing it.

Classifying Images, PDFs, and Nested Files

Every traditional classification engine processes text. That was a reasonable design assumption when most enterprise data was text-based. It is no longer accurate.

Consider what actually lands in a typical enterprise storage environment today:

  • A chest X-ray stored in a cloud bucket with no embedded text metadata
  • A scanned patient intake form where all the information exists as image pixels rather than machine-readable characters
  • A PDF that contains an embedded Excel spreadsheet with financial records nested inside it
  • An Excel workbook with hidden sheets that contain personally identifiable information

A text-only pipeline scans each of these files and finds nothing meaningful to classify. The sensitive data is present in every case, but it is not in a form the engine was built to read. The multimodal classification layer is built to address this gap. For image-native files like X-rays and scanned forms, the classifier reads the visual content of the file directly. It identifies the file as a medical imaging document, recognizes the nature of the content within it, and assigns a sensitivity classification based on what the image actually shows rather than what the filename or metadata says.

For nested and compound files, the pipeline decomposes the container structure before classifying. An Excel workbook with hidden sheets gets fully unpacked before scanning. A PDF with an embedded spreadsheet gets each layer classified independently. The final sensitivity classification reflects the most sensitive content found anywhere within the document, including inside embedded files that a surface-level scan would never reach.

In production on mixed-media document sets, text-only classification missed the majority of PHI embedded in image-native files. The multimodal classification layer identified those files and produced accurate sensitivity labels without requiring any embedded text.

The compliance exposure from ignoring non-text data is real and it grows as enterprise storage diversifies. Images, scanned forms, and nested compound documents are not edge cases in modern enterprise environments. They are a standard and growing share of what organizations actually hold, and leaving them unclassified is a deliberate choice with regulatory consequences.

Adding New Sensitive Data Categories Without Rebuilding the Pipeline

Compliance requirements do not stay fixed. New regulations introduce new categories of data that need to be detected, and a classification pipeline that can only find what it was originally trained on becomes a liability as the regulatory landscape evolves. The Hybrid Intelligence Pipeline is designed to grow with your compliance obligations, not against them. Adding a new sensitive data category does not require rebuilding the pipeline, retraining a model, or waiting on an engineering sprint. New entity types can be onboarded quickly, reach full detection coverage incrementally, and slot into the existing pipeline without disrupting detection of the categories already in production. As the regulatory landscape shifts, the system adapts alongside it rather than requiring a new deployment to keep pace.

What This Means in Practice

The right classification architecture is not the one with the most powerful individual component. It is the one that assigns each tool to the problem that tool is actually designed to solve and demonstrates why a one-size AI approach does not fit all.

The Deterministic Pattern Engine handles volume and speed. The Adaptive Context Classifier resolves the ambiguity that patterns alone cannot. The Secure LLM Synthesis layer handles the edge cases that neither of the first two layers can decide with confidence. Structured and unstructured data take separate processing paths because treating them the same produces worse results for both. The multimodal layer ensures that data which exists in visual or nested form gets classified with the same accuracy as plain text.

Together, these components make it possible to classify hundreds of millions of files in a system that is fast enough, accurate enough, and cost-efficient enough to run as a continuous production process.

The difference between a classification demo and a classification system that holds up at enterprise scale is an architecture problem. The Hybrid Intelligence Pipeline is the architecture we built to solve it. To see how the Hybrid Intelligence Pipeline can scale within your own environment, request a custom architecture demo or read our technical white paper on high-throughput data classification.

You may also like

MCP for Data Security: Talk to your Data Security from any AI assistant
Product & Technology

MCP for Data Security: Talk to your Data Security from any AI assistant

Arrow Right