Framing the Core Problem
I've been deconstructing the central question. The core lies in framing the requirements engineering challenge within the specific context of AI/ML systems. I'm focusing on the interplay between RE practices and the unique characteristics of these systems. The aim is to establish a strong, foundational understanding.
Refining the Framework
I'm now diving deeper into the nuances of AI/ML systems. I've pinpointed key differences from traditional software: the non-deterministic output, the focus on performance metrics, and the critical role of data quality. I've begun to sketch out core themes, from data to ethics, framing them as distinct phases in the requirements process. The structuring approach is falling into place, starting with problem definition and data needs.
Structuring the Content
I'm now outlining each section of the proposed framework. I'm focusing on "Shall vs. Probably" for the introduction. Problem definition will focus on the heuristic nature, and the early definition of "Acceptance Criterion." Data requirements are being fleshed out, including "Big Data V's" and the concept of "Data Drift." I'm also starting on functional requirements, emphasizing performance metrics over simple accuracy. I'm moving toward a more complete picture.
Elaborating Key Aspects
I'm now focusing on specifics: failure modes and a "fall-back" plan when confidence is low. I'm also fleshing out non-functional requirements like explainability and robustness. I'm incorporating aspects of fairness and latency, and thinking about "emergent behavior" control. Input/output filters, monitoring, and feedback loops are my key tools. I'm now structuring the iterative process, acknowledging the inadequacy of the Waterfall model. I've also been double-checking that I've answered all of the prompt's key points.
Clarifying Key Metrics
I'm realizing that focusing on model accuracy is a trap. The real requirement isn't just accuracy; it's linked to business key performance indicators, like reducing fraud or improving efficiency. My framework is shifting to put business value first. I've now structured the framework in a similar way to my output, which is a great sign!
Approaching requirements engineering (RE) for AI and Machine Learning (ML) requires a fundamental paradigm shift.
In traditional software, requirements are deductive (you write the rule, the system follows it). In AI/ML, requirements are inductive (the system learns the rules from data). Because the system is probabilistic rather than deterministic, you cannot specify "correctness" in binary terms.
Here is a structured approach to handling the unpredictability and emergent nature of AI systems during the requirements phase.
1. Shift from "Pass/Fail" to "Acceptable Thresholds"
You cannot write a requirement that says, “The system shall always identify a cat correctly.” The model will inevitably fail at some point.
- Stochastic Requirements: Replace absolute requirements with probabilistic ones.
- Bad: "The system must recognize faces."
- Good: "The system must achieve a True Positive Rate of 95% with a False Positive Rate under 1% on the validation dataset."
- Business KPIs vs. Model Metrics: Map technical metrics (Accuracy, F1-Score, RMSE) strictly to business outcomes. If the model is 90% accurate, does that translate to cost savings, or does the 10% error rate cause catastrophic legal liability?
2. Data as a Requirement (The "New Code")
In ML, data is the specification. If the data changes, the system's behavior changes. Therefore, RE must focus heavily on data governance.
- Data Scope and Distributions: Define the "Operational Design Domain" (ODD). What does the input data look like in the real world? Lighting conditions? Accents? Image resolution?
- Bias and Fairness Constraints: Explicitly define what constitutes unfair bias.
- Requirement: "The error rate difference between demographic Group A and Group B must not exceed 2%."
- Labeling Quality: Specify the requirements for the ground truth. Who labels the data? How is disagreement between human labelers resolved?
3. Define "Guardrails" for Emergent Behavior
Since you cannot predict exactly what the model will generate (especially with Generative AI or LLMs), you must build a standard software "cage" around the unpredictable model.
- Input Guardrails: Requirements that filter data before it hits the model.
- Example: "If the user input contains PII (Personally Identifiable Information), block the request before sending to the LLM."
- Output Guardrails: Requirements that filter the model's prediction.
- Example: "If the confidence score is below 70%, the system shall not display the prediction and instead route to a human agent."
- Syntactic Constraints: For generative AI, ensure the output fits the technical structure required (e.g., valid JSON format, specific length).
4. Non-Functional Requirements (NFRs) become Critical
NFRs in AI are often more difficult to satisfy than functional ones.
- Explainability (XAI): Does the user need to know why a decision was made?
- Requirement: "The system must provide feature attribution (e.g., SHAP values) for every loan rejection."
- Robustness & Security: How does the system handle adversarial attacks or "garbage" input?
- Requirement: "The model accuracy must not degrade by more than 5% when subjected to gaussian noise."
- Freshness & Drift: How fast does the knowledge become obsolete?
- Requirement: "The system must detect data drift (distribution shift) and trigger a retraining alert within 24 hours."
5. The "User-in-the-Loop" Requirements
Because the AI will make mistakes, the requirements must define how the human interaction handles failure.
- Feedback Loops: The system must have a mechanism for users to correct the AI. These corrections are strict requirements because they generate the data for future improvements.
- The "Fail Gracefully" Condition: When the AI fails, it shouldn't crash processing; it should have a fallback (heuristic rules or human escalation).
6. Iterative Feasibility (The "PoC" Phase)
Unlike traditional software where you gather all requirements up front, AI RE is experimental.
- The Feasibility Check: Before finalizing requirements, demand a Proof of Concept.
- Question: "Is there enough signal in our data to predict this outcome?"
- If the data doesn't support the requirement, the requirement must change, or the project must be killed.
Summary Checklist for AI Requirements
To practicalize this, I use a modified requirements template:
- Objective: What is the heuristic problem we are solving?
- Performance Metric: What is the lowest acceptable accuracy/precision/recall?
- Data Requirements: What is the source, volume, and required distribution of training data?
- Risk/Safety: What represent "never-events" (e.g., offensive language, dangerous advice)?
- Explainability: Who needs to understand the decision (auditors, users, devs)?
- Feedback: How does the system learn from its inevitable mistakes?
The Golden Rule: Treat the AI model as an untrustworthy component. Write requirements for the system that ensure reliability, even when the model behaves unpredictably.