Documenting AI Systems
Introduction
AI system documentation is the technical and organizational practice of creating comprehensive, accurate, and maintainable records of how an AI system is built, how it behaves, what it is intended to do, what its limitations are, and how it should be governed. Without adequate documentation, AI systems become organizational liabilities: difficult to audit, impossible to maintain reliably, and dangerous when deployed beyond their validated scope.
This chapter treats AI system documentation as a professional discipline with distinct scope and methods. It covers both the technical dimensions (architecture, model behavior, data flows) and the governance dimensions (intended use, limitations, accountability, and review processes) that together constitute complete AI documentation.
Why AI System Documentation Fails in Practice
Three patterns dominate AI documentation failures:
- Documentation lag: Documentation is written after the system is built, from memory, by people under pressure to move to the next project. The result is incomplete, inaccurate, and quickly outdated.
- Audience mismatch: Developers write documentation for developers. Business stakeholders cannot use it. Compliance teams cannot audit from it. When a non-technical question arises, no document answers it.
- Documentation decay: Even good initial documentation becomes stale as systems evolve. Models are retrained, data sources change, use cases expand, but documentation is not updated because it is not treated as a system component.
Addressing these failure patterns requires treating documentation as an ongoing engineering responsibility, not a project completion task.
Core Concepts
The AI Documentation Stack
Complete AI system documentation consists of seven layers, each serving different purposes and audiences:
- System Overview: A 1-2 page executive-level description of what the AI system does, why it was built, who uses it, and what business problem it solves. Non-technical. Updated annually or at major scope changes.
- Architecture Documentation: Data flow diagrams, component diagrams, integration points, infrastructure dependencies. Technical audience. Updated when architecture changes.
- Data Documentation: Data sources, data quality assessments, preprocessing pipelines, feature engineering rationale, data lineage. Critical for reproducibility and bias auditing.
- Model Card: Standardized documentation of model characteristics: intended use, out-of-scope uses, performance metrics (overall and by demographic/segment), limitations, and ethical considerations. Introduced by Google's model card framework; now widely adopted.
- Operational Runbook: Step-by-step procedures for deploying, monitoring, alerting, rolling back, and incident-responding to the AI system. Written for on-call engineers.
- Governance Record: Decision log for key design choices, risk assessment documentation, approval records for major deployments, and documentation of human oversight mechanisms.
- User Guide: Plain-language documentation for end users explaining how to use the AI system, how to interpret its outputs, when to rely on it, and when to escalate to human judgment.
The Model Card Standard
A model card is the most important single documentation artifact for an AI system. A complete model card includes:
- *Model details*: Name, version, type (classification, generation, regression, etc.), training date, and contact information
- *Intended use*: Primary use cases and intended users; explicitly list out-of-scope uses
- *Training data*: Data sources, size, demographic composition, collection methodology, known biases
- *Evaluation results*: Performance metrics reported for overall population AND for relevant subgroups (gender, age, geography, etc.)
- *Ethical considerations*: Known fairness concerns, mitigation approaches, residual risks
- *Limitations and caveats*: Conditions under which the model performs poorly, edge cases, environmental dependencies
- *Recommendations*: Specific guidance for responsible use and monitoring
Practical Techniques and Methods
Method 1: Documentation-as-Code
Documentation-as-code (DaC) treats documentation as a software artifact: version-controlled, automatically validated, and deployed alongside the system it describes. This approach solves documentation drift by making documentation updates a required part of every code review and deployment.
Implementation steps:
1. Store all documentation in a version control system (Git) alongside the system's code
2. Create documentation templates that require specific sections to be completed before a pull request is merged
3. Use automated checks (linters, completeness validators) that fail CI/CD pipelines if documentation requirements are unmet
4. Include documentation review in the code review checklist
The operational discipline: "No deploy without docs", as strict as "no deploy without tests."
Method 2: Structured Data Documentation with Data Cards
Borrowing from Google's Data Cards framework, structured data documentation captures:
- Dataset name, version, and creation date
- Collection methodology and data sources
- Size, format, and update frequency
- Known quality issues and data gaps
- Preprocessing steps applied
- Sensitive information handling procedures
- License and usage restrictions
- Known demographic or geographic gaps
Maintaining data cards alongside model cards gives auditors and compliance reviewers a complete picture of the evidence base on which the AI system was trained and validated.
Method 3: The Living Governance Record
AI governance documentation must be a living record, not a static artifact. A governance record template for each AI system includes:
*Section 1: System profile*, Use case, business owner, technical owner, data owner, compliance classification (high-risk, limited-risk, minimal-risk per applicable frameworks)
*Section 2: Risk assessment*, Identified risks (accuracy, bias, security, privacy, dependency), likelihood and impact ratings, mitigations in place, residual risks accepted and by whom
*Section 3: Approval history*, Who approved deployment at each stage, what evidence they reviewed, what conditions were placed on approval
*Section 4: Incident log*, Record of system failures, anomalous outputs, or misuse incidents with dates, descriptions, responses, and lessons learned
*Section 5: Review schedule*, Mandatory review dates (every 12 months at minimum, or upon triggering events such as model retraining, scope expansion, or adverse incident)
Method 4: User-Centered Documentation Testing
Documentation is only valuable if intended audiences can use it. Test user-facing documentation by asking 2-3 representative users to attempt a specific task using only the documentation (e.g., "Using this documentation, determine whether you should use the AI system for [specific edge case]"). Where users struggle or make incorrect inferences, the documentation is failing its purpose regardless of how well-written it appears to the authors.
Organizational Context
Documentation Culture: From Burden to Practice
The primary obstacle to AI documentation quality is cultural: documentation is perceived as overhead that slows delivery, produces documents no one reads, and consumes time better spent building. This perception is self-fulfilling: when documentation is written reluctantly and minimally, it is indeed useless, which confirms that it is not worth doing.
Building a documentation culture requires making documentation visibly useful:
- Reference existing documentation in meetings ("Let's check the model card on this") to demonstrate that it informs decisions
- Credit documentation contributors in project retrospectives
- Use documentation to resolve debates quickly ("The governance record shows this design choice was made because of X, does that reason still apply?")
- Make poor documentation a visible blocker: when an audit question cannot be answered because documentation is absent, report it at the management level
Compliance and Regulatory Context
AI documentation requirements are increasing across industries:
*Financial services*: SR 11-7 model risk management guidance from the Federal Reserve requires model documentation for any model used in a credit, risk, or pricing decision. This has been the standard for over a decade; AI systems fall under it.
*Healthcare*: FDA 21st Century Cures Act and subsequent guidance requires AI/ML-based Software as a Medical Device to maintain documentation of design, training data, and validation evidence.
*EU AI Act (2024-2027 implementation)*: High-risk AI systems require technical documentation including system description, training data details, performance metrics, and conformity assessment records.
*Government and public sector*: Executive Order 14110 (US) and equivalent national policies increasingly require federal agencies to document AI systems used in consequential decisions.
Even organizations not subject to these specific regulations benefit from documentation aligned with these standards, as they represent emerging best practice and provide a defensible governance posture.
Addressing Common Challenges
Challenge 1: Undocumentable Black Boxes
Some AI systems, particularly large neural networks, have internal representations that are genuinely difficult to explain. This does not make documentation impossible; it requires shifting the documentation focus from internal mechanics to external behavior characterization.
Behavior-focused documentation records:
- Performance metrics across use case categories and demographic groups
- Known failure modes with specific examples
- Conditions that trigger anomalous or low-confidence outputs
- Results from interpretability tools (SHAP values, LIME explanations, attention visualizations) with caveats about their reliability
- Human evaluation studies that characterize output quality
This approach is more useful for most audiences than pseudoscientific claims of explainability that cannot withstand scrutiny.
Challenge 2: Documentation for Vendor-Provided AI
Organizations increasingly deploy AI systems built by third-party vendors (SaaS AI tools, API-accessed models, embedded AI in enterprise software). You cannot document the internal workings because you do not have access. Documentation responsibility shifts to:
- Documenting how the vendor's system is configured and integrated
- Recording the business decisions made in implementation (which fields are inputs, what thresholds trigger which actions)
- Capturing vendor-provided documentation in your governance record
- Documenting your validation testing results and conditions of acceptable use
- Creating a vendor dependency log that tracks what would happen if the vendor discontinued, changed, or degraded the AI service
Challenge 3: Keeping Documentation Current
Systems change; documentation does not. The solution is not more discipline. It is structural enforcement:
- Require documentation review as part of every model retraining or significant system update
- Include documentation review in quarterly system performance reviews
- Assign a documentation owner (a named individual) for each AI system in production
- Create a "documentation debt" tracker visible to management, similar to technical debt tracking
What Comes Next
Complete, current, and audience-appropriate AI system documentation is a prerequisite for the next communication challenge: presenting AI systems and their capabilities to different audiences, from technical peers to executives to external auditors. The next chapter, Handling Difficult Conversations, covers the communication skills needed when documentation alone is insufficient: when stakeholders challenge AI decisions, when incidents require transparent explanation, and when governance reviews surface difficult questions about system performance or fairness.
Skill.re