Home

Working with Compliance Teams

AML, KYC, and the intersection of regulation and machine learning

Machine learning engineers who build models for regulated industries quickly learn a hard truth: the technical work is the easy part. The real challenge is understanding how compliance teams think, what they need, and why they seem allergic to the very innovation you are trying to deliver.

This is not a cultural mismatch. It is a structural one. Compliance teams operate under regulatory frameworks where mistakes carry existential risk. Their job is to prevent the bank from being fined, the company from losing its license, or executives from facing criminal liability. Your job is to build systems that make their work faster, more accurate, or more scalable. These goals are not opposed, but they require translation.

If you have worked on AML systems, fraud detection, or KYC automation, you have likely encountered this: a model that achieves 95% precision is rejected because the 5% error rate is unacceptable. A clustering algorithm that saves hundreds of analyst hours is shelved because it lacks audit trails. A neural network that outperforms rule-based systems is dismissed because no one can explain its decisions to a regulator.

This essay is a guide to navigating that gap. It covers the compliance mindset, the regulatory constraints on ML, and the practical steps required to build systems that pass legal review. If you are building models for financial services, healthcare, or other regulated industries, this is the context you need.

The Compliance Mindset

Compliance teams are risk-averse by design. Their performance is measured by what does not happen: fines avoided, audits passed, regulatory scrutiny deflected. They do not get promoted for innovation. They get fired for missing red flags. This creates an asymmetric incentive structure. A compliance officer who approves a new ML system takes on personal risk. If the system works, they get no credit. If it fails, they are responsible. This is why default answers are often "no".

This creates a culture that values defensibility over efficiency. Compliance teams prefer systems that are auditable, explainable, and aligned with regulatory guidance, even if those systems are slower or less accurate than modern alternatives. A rule-based system that takes two weeks to review is preferable to a neural network that takes two hours but cannot justify its decisions.

For ML engineers, this can feel like obstruction. Why would anyone prefer manual review when automation exists? Why prioritize explainability over performance? The answer is that compliance teams are not optimizing for speed or accuracy. They are optimizing for regulatory defensibility. If a regulator asks why a decision was made, the system must have an answer. If an audit trail is incomplete, the company faces penalties. If a model cannot explain its reasoning, it is a liability.

Understanding this mindset is the first step to productive collaboration. Compliance teams are not opposed to ML. They are opposed to ML that increases their risk. Your job is to show that your system reduces risk, not just improves performance.

AML and KYC Basics for ML Engineers

Anti-Money Laundering and Know Your Customer regulations are the foundation of financial compliance. AML systems detect suspicious transactions: large cash deposits, rapid fund transfers, payments to high-risk jurisdictions. KYC systems verify customer identities: document checks, address verification, sanctions screening.

Both domains are heavily regulated. Banks must file Suspicious Activity Reports for transactions that meet certain criteria. They must screen customers against sanctions lists and politically exposed persons databases. They must maintain audit trails for every decision, including false positives. Failure to comply results in fines that range from millions to billions of dollars.

ML engineers entering this space often underestimate the complexity. AML is not just anomaly detection. It is anomaly detection with regulatory definitions of what constitutes an anomaly, legal requirements for how those anomalies are investigated, and mandatory reporting timelines. KYC is not just identity verification. It is identity verification with document standards, risk-based due diligence requirements, and ongoing monitoring obligations.

The technical challenges are non-trivial. Transaction data is messy: misspelled names, inconsistent addresses, missing fields. Sanctions lists are incomplete and updated irregularly. False positive rates are high: a typical AML system flags 95% alerts that are ultimately cleared. Reducing false positives without missing true positives is the core problem.

For ML engineers, this means understanding the regulatory constraints before designing the model. A clustering algorithm that groups similar transactions is useful only if it aligns with regulatory definitions of suspicious activity. A name-matching system that reduces false positives is valuable only if it maintains 100% recall on sanctioned entities. Performance metrics must reflect regulatory requirements, not just statistical accuracy.

Model Explainability Requirements

Explainability is not optional in regulated industries. Regulators require that institutions justify their decisions. If a customer is denied an account, the bank must explain why. If a transaction is flagged as suspicious, the analyst must document the reasoning. If a model is used in that process, the model must be explainable.

This creates a problem for modern ML. Deep neural networks, ensemble methods, and large language models are effective but opaque. A random forest with 500 trees can make accurate predictions, but asking it to explain why a specific transaction was flagged is difficult. A transformer-based NER model can extract entities from unstructured text, but explaining which features drove the extraction is non-trivial.

The regulatory standard is not statistical interpretability. It is human interpretability. A compliance analyst must be able to read the model output, understand the reasoning, and defend it to a regulator. This means that SHAP values, feature importance scores, and attention weights are often insufficient. What is needed is natural language explanations that map to regulatory criteria. Some teams solve this by building two-tier systems: a complex model for prediction and a simpler model for explanation. The complex model identifies candidates, and the simpler model provides justification. This adds engineering overhead but satisfies regulatory requirements.

In practice, this often means hybrid systems. Use ML to score transactions, but use rule-based logic to generate explanations. Use NER to extract entities, but use deterministic matching to validate sanctions hits. Use clustering to group cases, but require analysts to document the final decision. The ML model improves efficiency, but the audit trail remains human-readable.

For engineers, this means designing for transparency from the start. Log input features, intermediate predictions, and final outputs. Generate human-readable explanations at each step. Ensure that every decision can be traced back to specific data points. Explainability is not a post-processing step. It is a system requirement.

Documentation Standards for Regulated Industries

Documentation is not a formality. It is a legal requirement. Regulators audit systems based on documentation. If the documentation is incomplete, the system is considered non-compliant, regardless of its technical performance.

The baseline requirement is model risk management documentation. This includes model development documentation, validation reports, performance monitoring, and change logs. Every model must have a documented rationale: why it was built, what it predicts, how it was validated, and how it is monitored. This documentation must be updated whenever the model changes.

For ML systems, this means documenting the entire pipeline. Data sources: where the data comes from, how it is validated, what preprocessing is applied. Feature engineering: which features are used, why they were selected, how they are calculated. Model training: which algorithms were tested, why the final model was chosen, what hyperparameters were used. Validation: what metrics were used, what test sets were evaluated, what performance thresholds were met.

This level of detail is tedious, but it is necessary. A regulator reviewing your system will ask: Why did you choose this algorithm? How do you know it is accurate? What happens if the data distribution changes? If the answers are not documented, the model is not compliant.

In practice, this means treating documentation as part of the development process. Use version control for documentation as well as code. Maintain a model registry that tracks every deployed model, its version, and its validation status. Automate documentation generation where possible: log training parameters, save evaluation metrics, generate validation reports programmatically. The goal is to make documentation a byproduct of engineering, not a separate task.

False Positive Tolerance in Compliance

In most ML applications, false positives are a nuisance. In compliance, they are a cost center. Every false positive requires analyst review, which means labor hours, operational overhead, and delayed decisions. But false negatives are worse. A missed sanctions hit can result in fines, reputational damage, and regulatory action. This creates an asymmetric optimization problem: minimize false positives, but never at the expense of recall.

The practical result is that compliance systems operate at high recall, often 99% or higher. This is non-negotiable. A model that achieves 98% recall might miss 2% of true positives, which could include sanctioned entities, money laundering activity, or fraudulent transactions. That 2% is unacceptable. This is why precision-recall tradeoffs are different in compliance than in other domains. In recommendation systems, missing a relevant item is tolerable. In fraud detection, missing a fraudulent transaction is not. The cost of false negatives is orders of magnitude higher than the cost of false positives.

For ML engineers, this means designing systems where recall is the primary constraint. Start with 100% recall and work backward. Use rule-based systems as a baseline: they may have high false positive rates, but they have known recall. Then introduce ML to reduce false positives without degrading recall. Validate that the ML system catches every case the rule-based system caught, and ideally more.

This also means being transparent about failure modes. If your model has 99.5% recall, document the 0.5% it missed. Analyze those cases: are they edge cases, data quality issues, or systematic failures? If the model is deployed, ensure that fallback mechanisms exist. Use ensemble methods, anomaly detection, or human review to catch cases the primary model missed.

The goal is not perfection. It is defensibility. If a regulator asks why a case was missed, you must have an answer. If the answer is "the model failed," that is insufficient. If the answer is "the model missed an edge case, which we have since documented and addressed," that is acceptable.

Working with Legal and Compliance Stakeholders

Legal and compliance teams are gatekeepers. They have final approval on whether a system is deployed. This means that technical excellence is not sufficient. The system must also meet legal and regulatory standards, which are often non-technical and sometimes ambiguous.

Productive collaboration requires understanding their constraints. Legal teams are concerned with liability: if the system fails, who is responsible? Compliance teams are concerned with audit trails: if a regulator asks for justification, what documentation exists? Both teams are risk-averse, and both have veto power. Your job is to address their concerns before they become blockers.

This means involving legal and compliance early. Do not build a system and then ask for approval. Instead, propose the system, explain the technical approach, and ask for feedback. What documentation is required? What explainability standards must be met? What validation processes are expected? Get answers upfront, and design the system accordingly.

It also means speaking their language. Compliance teams do not care about F1 scores or AUC. They care about false negative rates, audit trail completeness, and regulatory alignment. Legal teams do not care about model architecture. They care about liability, data privacy, and contractual obligations. Translate technical concepts into their terms: instead of "our model achieves 98% precision," say "our model reduces analyst workload by 80% while maintaining full regulatory compliance."

Finally, expect iteration. Legal and compliance review is not a one-time approval. It is an ongoing process. Regulations change, systems evolve, and new risks emerge. Build systems that can adapt: modular architectures, versioned models, automated validation. The goal is not to get approval once. It is to maintain approval continuously.

Regulatory Constraints on ML

Model risk management is the regulatory framework that governs ML in financial services. It requires that models be validated, monitored, and documented. Validation means independent review: a team that did not build the model must verify its accuracy, robustness, and compliance. Monitoring means ongoing performance tracking: if the model degrades, it must be retrained or retired. Documentation means maintaining records of every decision, change, and validation.

These requirements are not suggestions. They are regulatory mandates. Banks that deploy unvalidated models face fines. Systems that lack audit trails are considered non-compliant. Models that degrade without detection are grounds for enforcement action.

For ML engineers, this means designing systems that support validation and monitoring. Use holdout test sets that reflect production data. Log predictions and ground truth for ongoing evaluation. Implement drift detection to identify distribution shifts. Maintain version control for models, data, and code. Ensure that every change is documented and approved.

It also means accepting that some ML techniques are not viable. Models that cannot be validated are not deployable. Models that lack explainability are not approvable. Models that require frequent retraining without clear triggers are not maintainable. The regulatory framework constrains the design space. Work within those constraints, or the system will not go live.

The practical result is that production ML in regulated industries looks different from academic ML. Models are simpler, pipelines are more rigid, and documentation is extensive. This is not because the engineers are less skilled. It is because the regulatory requirements are more stringent.

Building Trust with Non-Technical Compliance Teams

Trust is earned through transparency, reliability, and responsiveness. Compliance teams will trust your system if they understand how it works, if it performs as expected, and if you address their concerns quickly.

Transparency means clear communication. Explain the model in non-technical terms. Provide visual dashboards that show performance metrics. Generate audit reports that map predictions to regulatory criteria. The goal is to demystify the ML system, not to impress with technical complexity.

Reliability means consistent performance. If the model claims 99% recall, it must achieve 99% recall in production. If the system flags high-risk cases, those cases must be genuinely high-risk. If the documentation says the model was validated, the validation must be thorough. Overpromising and underdelivering destroys trust. Deliver what you promise, and document what you deliver.

Responsiveness means addressing concerns quickly. If a compliance analyst finds a false negative, investigate immediately. If a regulator asks for documentation, provide it within hours, not days. If a model fails in production, acknowledge the failure, diagnose the cause, and implement a fix. Compliance teams need to know that you take their concerns seriously.

Finally, involve compliance teams in the development process. Run user testing with analysts. Get feedback on model outputs. Iterate based on their input. The goal is not to build a system for compliance teams. It is to build a system with compliance teams. Collaboration builds trust. Trust enables deployment.

Conclusion

Building ML systems for compliance is not just a technical challenge. It is a regulatory, legal, and organizational challenge. The models must be accurate, but they must also be explainable, auditable, and defensible. The systems must improve efficiency, but they must also satisfy legal review and regulatory scrutiny.

This requires a different mindset than most ML work. Performance metrics are constrained by regulatory requirements. Model architectures are constrained by explainability standards. Deployment timelines are constrained by validation processes. Success is not measured by F1 scores. It is measured by regulatory compliance, analyst adoption, and audit outcomes.

If you are building ML for regulated industries, invest in understanding the compliance mindset. Learn the regulatory frameworks. Design for transparency and documentation. Build trust through reliability and responsiveness. The technical work is table stakes. The real differentiator is your ability to navigate the intersection of regulation and machine learning.

The systems that succeed are not the most accurate or the most sophisticated. They are the ones that pass legal review, satisfy regulators, and earn the trust of compliance teams. Build for that outcome, and the technical performance will follow.