Practical Interpretability
Auditing
Read aloud is unavailable in this browser.
Verification, Validation, and Accountability
Documentation claims, stakeholder promises, and regulatory commitments are only as good as the mechanisms that verify them. Auditing provides systematic, evidence-based evaluation of ML systems against requirements, standards, and expectations. It transforms aspirational statements into verified facts.
ML auditing has emerged as a critical practice for several reasons:
- Regulatory mandates: Laws increasingly require third-party assessments of AI systems
- Trust requirements: Stakeholders demand verification beyond self-reporting
- Complexity: ML systems are difficult to assess through traditional testing
- Evolving behavior: Models that passed initial testing may degrade or develop problems over time
- High stakes: Errors in ML systems can harm individuals and organizations at scale
This page examines auditing comprehensively: frameworks and methodologies, internal and external audit practices, technical auditing approaches, fairness-specific auditing, and the role of continuous monitoring as ongoing audit.
By the end of this page, you will understand ML auditing frameworks and methodologies, how to conduct and support effective audits, technical approaches for auditing model behavior, fairness audit requirements and methods, and how continuous monitoring extends audit into operations.
Auditing Fundamentals
What is ML Auditing?
ML auditing is the systematic evaluation of machine learning systems to assess:
- Compliance: Does the system meet legal and regulatory requirements?
- Performance: Does the system meet stated performance claims?
- Fairness: Does the system treat different groups equitably?
- Safety: Does the system avoid unacceptable harms?
- Documentation: Is the system adequately documented?
- Governance: Are appropriate controls and oversight in place?
Types of AI/ML Audits:
| Audit Type | Focus | Conducted By | Typical Trigger |
|---|---|---|---|
| Internal Audit | Process compliance, risk management | Internal audit function | Periodic schedule, risk-based |
| Technical Review | Model quality, performance, limitations | ML platform team, peer review | Pre-deployment, major changes |
| Ethics Review | Ethical implications, societal impact | Ethics board, review committee | New applications, high-risk uses |
| Regulatory Audit | Legal compliance, industry standards | Regulators, accredited third parties | Regulatory mandate, incident |
| Fairness Audit | Bias, discrimination, disparate impact | Internal team or external experts | Legal requirement (NYC LL144), voluntary |
| External Assessment | Independent verification of claims | Third-party auditors, researchers | Customer requirement, certification |
| Incident Investigation | Root cause of failures or harms | Incident team, external investigators | Post-incident |
The Audit Cycle:
Effective auditing follows a systematic cycle:
1. PLAN → Define scope, criteria, methodology
↓
2. GATHER → Collect evidence (documentation, testing, interviews)
↓
3. ANALYZE → Evaluate evidence against criteria
↓
4. REPORT → Document findings, severity, recommendations
↓
5. REMEDIATE → Address identified issues
↓
6. FOLLOW-UP → Verify remediation effectiveness
↓
[Return to 1. PLAN for next cycle]
Audit Independence:
Audit value depends heavily on independence:
| Independence Level | Description | Use Case |
|---|---|---|
| Self-Assessment | Team audits own work | Quick checks, development-time review |
| Internal Audit | Separate internal function | Organizational assurance, compliance |
| Related Third Party | Contracted external auditor | Customer assurance, detailed review |
| Independent Third Party | Fully independent, no conflicts | Regulatory compliance, public trust |
| Regulatory Audit | Government regulator | Legal mandate, enforcement |
Self-assessment has inherent limitations: blind spots, incentive to minimize issues, and confirmation bias. Organizations should view self-assessment as preparation for independent review, not a substitute for it. Independent audits provide credibility that self-assessment cannot.
Audit Frameworks and Standards
Several frameworks provide structure for ML auditing. Understanding these enables systematic assessment and alignment with industry practices.
NIST AI Risk Management Framework
The National Institute of Standards and Technology (NIST) AI Risk Management Framework provides a comprehensive structure for managing AI risks:
Core Functions:
1. GOVERN
- Establish policies and processes for AI risk management
- Define roles and responsibilities
- Cultivate organizational culture of responsible AI
Audit Questions:
- Is there an AI governance structure?
- Are roles and accountabilities defined?
- Is organizational risk tolerance established?
2. MAP
- Identify and categorize AI systems
- Understand context and potential impacts
- Characterize risks through stakeholder engagement
Audit Questions:
- Are AI systems inventoried?
- Are use cases and impacts documented?
- Were stakeholders consulted?
3. MEASURE
- Analyze risks using appropriate methods
- Evaluate AI system performance and behavior
- Track risks over time
Audit Questions:
- Are performance metrics defined and tracked?
- Is fairness evaluated across relevant groups?
- Are models monitored for drift?
4. MANAGE
- Prioritize and act on risks
- Develop response strategies
- Allocate resources for risk management
Audit Questions:
- Are risks prioritized and addressed?
- Are mitigation strategies implemented?
- Is there an incident response process?
NIST AI RMF Profiles: Organizations can create profiles tailored to their context by prioritizing relevant subcategories and defining implementation levels.
Conducting ML Audits
Whether conducting or supporting an audit, understanding the audit process enables effective participation.
Pre-Audit Phase:
- •Scope Definition: What systems? What aspects? What time period? Define boundaries clearly.
- •Criteria Selection: What standards, requirements, or benchmarks apply? Agreement on criteria prevents disputes later.
- •Resource Allocation: Who from the audited team will support? What access is required? What timeline?
- •Documentation Request: List of documents to be provided upfront. Gives audit team baseline before deep dive.
- •Logistics: Access credentials, interview scheduling, secure data transfer methods.
Evidence Gathering:
ML audits rely on multiple evidence types:
| Evidence Type | What It Demonstrates | Example |
|---|---|---|
| Documentation | What was claimed/intended | Model cards, technical specs, runbooks |
| System Testing | How the system actually behaves | Performance testing, bias testing |
| Data Analysis | Data quality and characteristics | Training data review, evaluation data analysis |
| Interviews | Process understanding, decision rationale | Developer interviews, stakeholder interviews |
| Log Review | Historical behavior, monitoring | Prediction logs, incident records |
| Observation | How system is used in practice | Watching user interactions, process observation |
| Code Review | Implementation correctness | Review of model code, preprocessing code |
The Evidence Triangle:
Strong audits triangulate evidence—claims should be verified through multiple sources:
Documentation
/
/
/
/
Interviews ---- Testing
If documentation says one thing, testing shows another, and interviews reveal a third, something is wrong. Convergence increases confidence; divergence demands investigation.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
# ML Fairness Audit Plan: Credit Decisioning System ## 1. Scope- **System:** Consumer credit scoring model v3.2- **Audit Period:** Q4 2023 (Oct 1 - Dec 31)- **Aspects:** Disparate impact assessment per ECOA requirements- **Protected Classes:** Race, sex, age, national origin ## 2. Criteria- **Primary Standard:** ECOA/Regulation B adverse action requirements- **Threshold:** Adverse impact ratio > 0.8 (80% rule)- **Secondary:** Internal fairness policy requirements ## 3. Evidence Collection ### 3.1 Documentation Review (Week 1)- [ ] Model card and technical specification- [ ] Training data documentation- [ ] Feature definitions and importance- [ ] Historical fairness analyses- [ ] Adverse action reason code mapping ### 3.2 Data Collection (Week 1-2)- [ ] Prediction scores for audit period (n=~500,000)- [ ] Decision outcomes (approve/deny)- [ ] Applicant demographic proxies (where available)- [ ] Adverse action reasons provided- [ ] BISG proxy race estimation (if direct unavailable) ### 3.3 Quantitative Analysis (Week 2-3)- [ ] Approval rates by protected class- [ ] Adverse impact ratio calculations - Overall approval rate disparities - By credit tier - By product type- [ ] Intersectional analysis (e.g., race × sex)- [ ] Statistical significance testing- [ ] Marginal effect analysis for suspicious features ### 3.4 Qualitative Analysis (Week 3)- [ ] Feature review for proxy discrimination risk- [ ] Interview: Model development team- [ ] Interview: Fair lending officer- [ ] Process review: How adverse actions are communicated- [ ] Review: Compliance monitoring procedures ### 3.5 Testing (Week 2-3)- [ ] Synthetic applicant testing for specific scenarios- [ ] Sensitivity analysis: How much would proxy features affect scores? ## 4. Reporting- Draft findings: Week 4- Management response period: 1 week- Final report: Week 5 ## 5. Deliverables- Executive summary (2 pages)- Detailed findings report- Statistical methodology appendix- Remediation recommendations- Risk rating (High/Medium/Low) ## 6. Team- Lead Auditor: [Name], Certified Model Validator- Statistical Analyst: [Name]- Legal Advisor: [Name], Fair Lending Counsel- Auditee Liaison: [Name], Model OwnerInterviews often reveal information documentation misses: "Oh, we don't actually use that feature anymore," or "There was a bug in that data pipeline for a month." Interview both developers (who know how things work) and users (who know how things are actually used).
Technical Auditing Methods
Technical auditing evaluates the actual behavior of ML systems through systematic testing, analysis, and review.
Performance Auditing:
- •Holdout Validation: Test on fresh, independent data not used in training or previous validation. Prevents overfitting to historical test sets.
- •Temporal Validation: Test on data from time period after training. Ensures model generalizes forward in time.
- •Subgroup Analysis: Disaggregated performance across relevant segments. Reveals disparities hidden by aggregate metrics.
- •Calibration Assessment: Verify predicted probabilities match actual outcome frequencies. Critical for risk-based decisions.
- •Threshold Analysis: Evaluate performance at different decision thresholds. Ensures threshold choice is understood.
- •Stability Testing: Assess sensitivity to input perturbations. Reveals fragility to minor data changes.
- •Adversarial Testing: Test against deliberately challenging or malicious inputs. Identifies exploitation vulnerabilities.
Fairness Auditing (Detailed):
Fairness auditing requires systematic analysis across protected groups:
Step 1: Define Protected Groups
- Legal protected classes (race, sex, age, etc.)
- Groups relevant to specific domain
- Intersections of groups (race × sex)
Step 2: Obtain Group Information
- Direct data (if legally collected)
- Proxy estimation (BISG for race, first name for sex)
- Synthetic testing (create matched test cases)
Step 3: Calculate Disparities
| Metric | Formula | Threshold | Interpretation |
|---|---|---|---|
| Adverse Impact Ratio | Selection_Rate_Minority / Selection_Rate_Majority | 0.80 | 80% rule; below suggests disparate impact |
| Demographic Parity Difference | |P(Ŷ=1|A=0) - P(Ŷ=1|A=1)| | < 0.10 | Difference in positive outcome rates |
| Equalized Odds (TPR) | |TPR_A=0 - TPR_A=1| | < 0.10 | Difference in true positive rates |
| Equalized Odds (FPR) | |FPR_A=0 - FPR_A=1| | < 0.10 | Difference in false positive rates |
| Calibration by Group | |P(Y=1|S=s,A=0) - P(Y=1|S=s,A=1)| | < 0.05 | Same score should mean same probability across groups |
Step 4: Investigate Causes
- Feature analysis: Which features drive group differences?
- Proxy feature investigation: Are features proxies for protected attributes?
- Data bias analysis: Does training data reflect historical discrimination?
- Labeling bias analysis: Were labels created fairly across groups?
Step 5: Document and Report
- Metrics and statistical significance
- Comparison to industry benchmarks
- Root cause hypotheses
- Remediation recommendations
- Residual risk assessment
Code Review Auditing:
Code review catches implementation errors that testing might miss:
- Preprocessing Logic: Is preprocessing applied consistently to training and inference data?
- Feature Engineering: Are features calculated correctly? Any leakage?
- Model Loading: Is the deployed model the validated version?
- Threshold Implementation: Is the decision threshold applied correctly?
- Error Handling: What happens when inputs are unexpected?
- Logging: Is sufficient information logged for monitoring and audit?
Models often behave differently in production than in testing. Production data may differ from test data. Preprocessing may diverge. System integration introduces new failure modes. Strong audits include production observation, not just offline testing.
Audit Findings and Remediation
Audit findings must be clearly communicated, appropriately classified, and systematically remediated.
Finding Classification:
| Severity | Definition | Response Required | Timeline |
|---|---|---|---|
| Critical | Fundamental failure; regulatory violation; immediate harm risk | Immediate escalation; consider system suspension | 24-48 hours |
| High | Significant deficiency; material risk; policy violation | Management attention; formal remediation plan | 30 days |
| Medium | Moderate deficiency; opportunity for harm; best practice deviation | Remediation required; tracked to closure | 90 days |
| Low | Minor issue; improvement opportunity; documentation gap | Remediation recommended; tracked | 180 days |
| Observation | Not a deficiency; suggestion for consideration | Consider during next review cycle | Discretionary |
Finding Report Structure:
## Finding F-2024-042: Disparate Impact in Model Scoring
**Severity:** High
**System:** Credit scoring model v3.2
**Criteria:** ECOA/Reg B adverse impact ratio > 0.80
### Condition (What We Found)
Analysis of Q4 2023 decisions shows approval rate for Hispanic applicants
(67.2%) is 76.3% of approval rate for non-Hispanic white applicants (88.1%),
yielding an adverse impact ratio of 0.76. This falls below the 0.80 threshold
generally considered evidence of disparate impact.
### Cause (Why It Exists)
Feature analysis indicates that geographic features (ZIP code density,
median home value) contribute 23% of model score variance and correlate
strongly with ethnicity due to historical residential segregation patterns.
### Effect (Why It Matters)
- Potential violation of ECOA/Reg B fair lending requirements
- Risk of regulatory enforcement action
- Harm to Hispanic applicants receiving disproportionate denials
- Reputational risk if disparity becomes public
### Recommendation
1. Immediate: Conduct legal review of disparate impact finding
2. Short-term: Evaluate removal or modification of geographic features
3. Medium-term: Retrain model with fairness constraints
4. Ongoing: Implement continuous fair lending monitoring
### Management Response
[To be completed by management]
Remediation Tracking:
remediation should be tracked to closure:
- •Management Response: Owner acknowledges finding, assigns responsibility, commits to timeline
- •Remediation Plan: Detailed plan with milestones and success criteria
- •Implementation: Execute remediation plan
- •Validation: Independent verification that remediation addresses the finding
- •Closure: Finding officially closed when validation confirms resolution
- •Follow-Up: Subsequent audit verifies issue hasn't recurred
Effective remediation addresses root causes, not just observed symptoms. If the finding reflects a systemic process failure, fixing only the specific model still leaves other models vulnerable. Ask: "What allowed this to happen? How do we prevent similar issues?"
External and Third-Party Audits
External audits provide independence and credibility that internal audits cannot. They're increasingly required by regulation and expected by stakeholders.
When External Audits Are Required/Appropriate:
- •Regulatory Mandate: Laws require third-party assessment (NYC LL144 bias audits, certain EU AI Act conformity assessments)
- •Certification Requirement: Seeking ISO or industry certification
- •Customer Contractual Requirement: B2B customers require independent audit of AI systems
- •High-Risk Application: Voluntary external review for applications affecting life, liberty, or livelihoods
- •Post-Incident: Independent investigation of AI-related harm or failure
- •Public Trust: Voluntary transparency to build stakeholder confidence
Engaging External Auditors:
Selection Criteria:
| Factor | Importance | Considerations |
|---|---|---|
| Expertise | High | ML technical knowledge; domain experience; fairness methodology |
| Independence | High | No conflicts of interest; no prior involvement with system |
| Reputation | Medium-High | Track record; recognized in industry; regulatory acceptance |
| Methodology | High | Rigorous, documented approach; transparency about methods |
| Insurance | Medium | Professional liability coverage for audit work |
| Communication | Medium | Clear reporting; accessible to non-technical stakeholders |
Due Diligence Questions:
- What is your experience auditing similar systems/industries?
- What methodology do you follow? Is it documented?
- Who will perform the audit (specific individuals and their qualifications)?
- What access and data do you require?
- What assurances/certifications do your findings provide?
- What is your policy on conflicts of interest?
- What professional liability coverage do you carry?
Managing External Audits:
- •Provide complete, accurate information
- •Respond promptly to requests
- •Explain context auditors may not understand
- •Treat auditors as partners in improvement
- •Address findings constructively
- •Learn from the audit process
- •Withhold relevant information
- •Provide misleading explanations
- •Treat auditors as adversaries
- •Dispute findings without evidence
- •Attempt to influence audit outcome
- •Fail to implement agreed remediation
Seeking auditors likely to provide favorable findings or firing auditors who raise issues undermines the purpose of external audit. Stakeholders and regulators can detect this pattern—it damages rather than builds trust. Engage auditors for their rigor, not their leniency.
Continuous Monitoring as Ongoing Audit
Point-in-time audits are insufficient for ML systems that evolve and operate continuously. Continuous monitoring extends audit into day-to-day operations.
The Monitoring Audit Loop:
┌─────────────┐
┌────────────>│ Deploy │
│ └──────┬──────┘
│ │
│ v
│ ┌─────────────┐
│ │ Monitor │───> Dashboards, Alerts
│ └──────┬──────┘
│ │
Remediate v
│ ┌─────────────┐
│ │ Analyze │───> Drift, Performance, Fairness
│ └──────┬──────┘
│ │
│ v
│ ┌─────────────┐
└─────────────│ Report │───> Periodic Review, Escalation
└─────────────┘
What to Monitor:
| Dimension | Metrics | Alert Thresholds | Review Frequency |
|---|---|---|---|
| Input Stability | Feature distributions, missing value rates | PSI > 0.1; missing > baseline+5% | Daily automated, weekly human |
| Output Stability | Prediction distributions, average score | Score drift > 0.1 SD from baseline | Daily automated, weekly human |
| Performance | Accuracy, precision, recall (when labels available) | 5%+ degradation from validation | As labels become available |
| Fairness | Approval rates by group, AIR, TPR/FPR parity | AIR < 0.80; TPR difference > 10% | Weekly to monthly |
| Operational | Latency, error rate, throughput | SLA breaches; error rate > threshold | Real-time automated |
| Usage Patterns | Request sources, query patterns, edge cases | Unusual sources; out-of-distribution inputs | Weekly review |
Drift Detection:
Models can degrade through drift even without code changes:
Data Drift: Input distributions shift from training distribution
- Population changes (customer base evolves)
- Feature meaning changes (economy affects income patterns)
- Data collection changes (new forms, new sources)
Detection: Statistical tests (KS test, PSI), distance metrics
Concept Drift: Relationship between inputs and outputs changes
- Environment changes (pandemic changes fraud patterns)
- User behavior changes (new shopping habits)
- Regulatory changes (new lending rules)
Detection: Performance monitoring on labeled samples, challenge datasets
Upstream Data Drift: Changes in systems feeding model inputs
- Pipeline changes (new ETL, different preprocessing)
- Source system changes (new database schema)
- Data quality changes (vendor data quality issues)
Detection: Schema checks, value range checks, freshness checks
Fairness Drift: Disparities emerge or worsen over time
- Population shifts (demographic changes in applicants)
- Economic changes (differential impact across groups)
- Model degradation differs by group
Detection: Regular disaggregated analysis, automated fairness metric calculation
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
# Model Monitoring Dashboard Configuration dashboards: - name: "Credit Model Daily Operations" refresh: 1h panels: # Operational Health - type: timeseries title: "Prediction Latency (p50, p95, p99)" query: model_latency_seconds{quantile=~"0.5|0.95|0.99"} - type: gauge title: "Error Rate (Last 24h)" query: sum(rate(prediction_errors[24h])) / sum(rate(predictions_total[24h])) thresholds: [0.001, 0.01, 0.05] # Input Stability - type: timeseries title: "Feature PSI (Top Features)" query: feature_psi{feature=~"income|debt_ratio|credit_history"} alert: psi > 0.1 - type: heatmap title: "Missing Value Rates by Feature" query: feature_missing_rate # Output Stability - type: histogram title: "Score Distribution (Today vs Baseline)" query: prediction_score_bucket overlay: baseline_score_distribution - type: timeseries title: "Approval Rate (30-day Rolling)" query: avg_over_time(approval_rate[30d]) # Fairness Monitoring - type: bar title: "Approval Rate by Demographic Group" query: approval_rate by (demographic_group) - type: gauge title: "Adverse Impact Ratio (30-day)" query: min_approval_rate / max_approval_rate by (demographic_group) thresholds: [0.7, 0.8, 0.9] alerts: - name: HighDrift condition: feature_psi > 0.15 severity: warning message: "Significant drift detected in {{.feature}}" - name: FairnessAlert condition: adverse_impact_ratio < 0.8 severity: critical message: "Adverse impact ratio below threshold: {{.value}}"Automated monitoring catches anomalies, but human review catches patterns. Establish regular review cadence: weekly operational review, monthly fairness review, quarterly comprehensive review. Dashboards that no one looks at provide no audit value.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.