Start with a real decision, not an algorithm
Imagine a university wants to help students who may struggle in an introductory programming course. Someone suggests, “We need artificial intelligence.” That does not yet describe a solvable problem. What decision must the university make? Perhaps an advisor needs to identify students who would benefit from additional tutoring before the next assessment.
That distinction changes everything. The useful output might be a list of students for human review, not an automated decision about anyone’s future. The input might consist of early assignments and attendance records available before the assessment. The intended result might be to offer support rather than to label students as incapable.
Now we can ask testable questions: Are the records suitable and collected with appropriate safeguards? Does a simple rule, such as “offer help to everyone missing two assignments,” perform sufficiently well? If a predictive model is justified, what error is more harmful: failing to identify someone who needs support or unnecessarily offering someone tutoring?
The aim of problem formulation is to make those choices explicit before training a model. Otherwise, a team can build an accurate predictor that solves the wrong problem.
Building an artificial intelligence system begins with a question, not a model. A business might want to reduce subscription cancellations, a hospital might want to prioritize medical images for review, or a factory might want to detect defective products. Each goal must be translated into a computational task before it becomes possible to select data, choose an algorithm, or measure success.
AI problem formulation is the process of converting a real-world objective into a precisely specified task that a computational system can attempt, test, and improve. It establishes what the system receives, what it produces, what counts as a correct or useful result, and what limitations it must respect.
This process applies to rule-based AI, machine learning, and applications that use pretrained generative models. It also helps determine when AI is unnecessary.
1. Distinguish the real-world goal from the AI task
A real-world goal describes a desired outcome. An AI task describes the computation a system will perform to support that outcome. They are related but are not interchangeable.
| Real-world goal | Possible AI task | Output |
|---|---|---|
| Reduce customer cancellations | Predict the probability that an active customer will cancel soon | Cancellation risk score |
| Make a help center easier to use | Retrieve and rank relevant support articles | Ordered list of documents |
| Inspect manufactured components | Detect visible defects in product photographs | Defect label or location |
| Plan efficient delivery routes | Search for a feasible route under time and capacity constraints | Ordered route |
| Help staff answer policy questions | Retrieve policy passages and generate an answer grounded in them | Answer with evidence |
The task is only one part of the solution. A cancellation prediction cannot reduce cancellations unless there is also an appropriate intervention, such as an improved service experience. Similarly, a defect detector becomes useful only when its results are integrated into an inspection workflow.
A technically accurate model can therefore fail to deliver the intended benefit if the wrong task was formulated.
2. Identify the decision and the user
Begin by identifying who needs the output and what they will do with it.
Ask the following questions:
- Who uses the result? A customer, operator, analyst, clinician, or another software component?
- What action follows the result? Review a case, send an alert, recommend an item, or approve a request?
- When is the decision made? In real time, once per day, or only when someone submits a query?
- What happens if the system is wrong? A minor inconvenience, unnecessary work, lost revenue, or a safety concern?
- Can a person review the output? Some systems should assist a human rather than act autonomously.
For example, “predict fraud” is incomplete. A better goal is “assign a risk score to each online payment before authorization so that unusually risky payments can be sent for additional review.” That statement identifies the prediction unit, timing, output, and operational action.
3. Define inputs, outputs, and the prediction unit
An AI task needs a clear boundary around the information it consumes and the result it returns.
3.1 Inputs
An input is information provided to a system when it performs the task. In machine learning, measurable input variables are often called features.
Inputs may include numerical records, text, images, audio, sensor readings, or structured information retrieved from external sources. An input must be available at the time the system is supposed to operate. Data that only becomes available afterward cannot legitimately be used to make an earlier prediction.
3.2 Outputs
An output is the system’s response to an input. It may be a category, number, ranking, sequence of actions, or generated content.
Examples include:
- Category:
spamornot spam. - Numerical prediction: Expected electricity demand in kilowatt-hours.
- Probability or score: Estimated risk of cancellation within 30 days.
- Ranking: Support documents sorted by relevance.
- Generated content: A draft explanation based on supplied documents.
- Action: A proposed movement for a robot or a delivery route.
Outputs should be defined precisely enough that different developers would implement the same intended task.
3.3 Prediction unit and timing
The prediction unit identifies what one result describes: one customer, transaction, image, document, device, or event. Its associated decision time identifies when inputs are observed and an output is required.
For a cancellation model, one example might represent one customer on one particular date, rather than the customer’s entire history. That distinction becomes essential when labels are created and data is split for evaluation.
4. Recognize the type of AI problem
Different tasks require different approaches. A useful first classification is based on the desired output.
| Task type | Definition | Example |
|---|---|---|
| Classification | Assign an input to one or more categories | Detect spam |
| Regression | Predict a continuous numerical value | Estimate electricity demand |
| Clustering | Group observations using patterns of similarity | Explore customer segments |
| Ranking | Order candidates by estimated relevance or utility | Rank search results |
| Recommendation | Select items likely to be useful to a user | Recommend courses |
| Anomaly detection | Identify observations that differ from expected patterns | Flag unusual sensor activity |
| Forecasting | Predict future values or events using available history | Forecast next week’s demand |
| Generation | Produce new content conditional on instructions or context | Draft a policy-based answer |
| Planning or decision-making | Choose actions that pursue an objective under constraints | Plan a delivery route |
These are problem categories, not mutually exclusive technologies. For example, forecasting can use regression models, and recommendation systems frequently combine retrieval, ranking, and classification.
The next PlainCS article, Classification, Regression, Clustering, and Other AI Tasks, examines these categories in more detail.
5. Specify the target and the source of truth
For a supervised-learning task, the target (or label) is the outcome the model is trained to predict. A clear target definition must answer what is being measured, how it is observed, and when it becomes known.
Consider a subscription service. The phrase “customer will churn” leaves several questions unresolved:
- Does churn mean canceling an account, failing to renew, or becoming inactive?
- Is the prediction horizon seven days, 30 days, or one year?
- Are paused subscriptions counted as canceled?
- Are customers who already canceled excluded?
- Which records determine the authoritative outcome?
A more precise target might be:
For each subscription active at midnight on the prediction date, assign a target of
1if the subscription is canceled during the following 30 days and0otherwise, using the billing system’s cancellation status as the recorded outcome.
This is a proposed business definition, not a universal definition of churn. Domain experts must decide whether it represents the real problem.
For tasks without supervised labels, specify an alternative basis for evaluation. A clustering project, for example, needs criteria for whether the discovered groups are stable, interpretable, and useful to the intended workflow.
6. Establish what data is available at decision time
A model should not depend on information that will be unknown when it is used.
This rule prevents target leakage, in which training or evaluation uses information that would not exist at inference time. Leakage often produces misleadingly strong test results.
Data availability also involves practical concerns: permission to collect information, reliable timestamps, quality of labels, privacy restrictions, sampling bias, and whether the production system can access the same inputs consistently.
See Data Types and Data Collection for AI and Data Splitting, Labeling, and Leakage.
7. Choose success metrics that reflect the task
A metric is a quantitative measure used to assess performance. The metric should match both the computational output and the operational consequences of mistakes.
7.1 Model-level metrics
| Task | Common metrics | What they help evaluate |
|---|---|---|
| Classification | Precision, recall, F1-score, ROC-AUC | Detection quality and class discrimination |
| Regression | MAE, RMSE | Size of numerical prediction errors |
| Ranking | Precision@K, NDCG | Relevance of top-ranked items |
| Forecasting | MAE, RMSE, horizon-specific errors | Predictive accuracy over time |
| Generation | Groundedness, factual correctness, task success | Reliability and usefulness of generated output |
A metric is not automatically appropriate just because it is common. Accuracy, for example, can be misleading when a classification dataset contains very few positive cases.
7.2 Operational metrics
Real-world value often requires additional measures:
- Time saved per task.
- Number of useful cases detected.
- Unnecessary reviews or interventions.
- User satisfaction or successful task completion.
- Response latency and infrastructure cost.
- Safety, fairness, and privacy constraints.
An AI system may improve a statistical score yet make the operational process worse. Keep model-level and operational metrics distinct, and assess both.
8. Account for the cost of different mistakes
A classification system may produce four types of outcomes.
| Actual condition | Predicted positive | Predicted negative |
|---|---|---|
| Positive | True positive (TP) | False negative (FN) |
| Negative | False positive (FP) | True negative (TN) |
False positives and false negatives may have very different costs. A fraud-screening system that flags too many legitimate payments can disrupt customers. A system that misses fraudulent payments can cause financial losses.
Suppose an application assigns each transaction a risk score. The score must be converted into an action, such as “send for review,” using a decision threshold. A lower threshold usually catches more potentially risky payments but may increase unnecessary reviews. The preferred threshold depends on operational capacity, expected costs, and any safety or legal requirements.
Problem formulation should establish these trade-offs before tuning a model.
9. Define a baseline before choosing an advanced model
A baseline is a simple method used as a reference for judging whether a more complex approach provides meaningful improvement.
Possible baselines include:
- Predict the majority class for classification.
- Predict a historical mean or median for numerical values.
- Use a deterministic business rule.
- Search documents by keywords rather than embeddings.
- Use an existing workflow without AI.
The comparison must use the same appropriate evaluation conditions. For example, a demand forecaster should be compared with a simple seasonal forecast, not just with a poorly chosen constant prediction.
Not every problem needs machine learning. If a task consists of checking whether a student’s exam score is at least the published passing mark, an ordinary conditional statement provides the answer directly. Training a model to imitate that rule would add complexity without improving the underlying computation.
Similarly, a well-defined route-planning task may be better served by classical search or optimization than by a learned predictive model. Traditional algorithms can themselves be part of AI, depending on the problem and system design.
10. Identify practical and responsible constraints
Good problem definitions describe requirements beyond predictive performance.
| Constraint | Question to resolve |
|---|---|
| Latency | How quickly must a prediction or response arrive? |
| Cost | What is the acceptable cost per request or per day? |
| Data availability | Can required inputs be collected reliably at inference time? |
| Privacy | Is collection and processing of the information appropriate and authorized? |
| Explainability | Must the system provide understandable reasons for decisions? |
| Reliability | What happens during outages, missing data, or unexpected inputs? |
| Fairness | Could errors disproportionately harm particular groups? |
| Human oversight | Which decisions require human review or approval? |
| Maintenance | How will performance be monitored after deployment? |
These constraints may rule out a seemingly attractive model. For a battery-powered edge device, for instance, memory and energy requirements may matter more than a small improvement in benchmark accuracy.
11. Worked example: formulate customer cancellation prediction
Consider a subscription-learning platform that wants to prioritize outreach to customers at risk of cancellation.
Step 1: State the objective
Business objective: Reduce preventable cancellations through timely, appropriate customer support.
Proposed AI contribution: Estimate which active subscriptions are more likely to cancel soon so that staff can prioritize review and outreach.
A prediction alone does not show that outreach prevents cancellation. Whether the intervention works must be evaluated separately.
Step 2: Specify the prediction contract
| Element | Specification |
|---|---|
| Prediction unit | One active subscription on one prediction date |
| Available inputs | Billing and product-usage records available before the cutoff |
| Output | A score estimating cancellation risk over the next 30 days |
| Target | Cancellation recorded in the subsequent 30 days |
| Delivery | Batch scoring once each day |
| Human workflow | Staff review prioritized subscriptions before contacting customers |
| Constraints | Authorized data only; no future information in features |
Step 3: Establish a simple baseline
A reasonable initial baseline might rank customers using an explicitly defined rule, such as recent usage decline combined with unresolved support requests. This baseline should be specified before comparing learning algorithms.
Step 4: Plan the evaluation
Because the system will predict future behavior, use a chronological evaluation in which later dates are held out. Ensure that all features reflect information available at each prediction cutoff. If multiple records belong to the same customer, account for the dependence between them.
Report predictive metrics that match the prioritization problem, such as precision among the highest-risk cases and recall at the number of cases staff can realistically review. Compare the model with the baseline.
Step 5: Test the actual intervention
Measure whether the overall support workflow improves an appropriate outcome, not merely whether the scores correlate with cancellation. For example, a controlled experiment may help determine whether the outreach program reduces cancellation rates compared with existing practices.
This final step separates predicting an outcome from causing a better outcome.
12. Write a problem specification
Before implementation, record the agreed task in a short, testable document. The following Python dictionary illustrates a machine-readable version of the cancellation example. It records requirements; it does not train a model.
problem_specification = {
"objective": "Prioritize subscriptions for support review",
"prediction_unit": "active subscription on a scoring date",
"task_type": "binary classification / risk ranking",
"prediction_horizon_days": 30,
"target_definition": "canceled within the next 30 days",
"feature_cutoff": "scoring date",
"output": "estimated cancellation risk score",
"baseline": "predefined usage and support rule",
"evaluation": ["precision_at_k", "recall_at_k"],
"constraints": [
"use authorized data",
"exclude future information",
"require staff review before outreach",
],
}
for field, value in problem_specification.items():
print(f"{field}: {value}")
This representation can guide later decisions about dataset construction, model selection, APIs, and testing. It should be reviewed with the people responsible for the real-world process.
13. Common formulation mistakes
| Mistake | Why it causes problems | Better approach |
|---|---|---|
| Starting with a model name | The chosen technique may not fit the task | Define the decision and output first |
| Using a vague target | Different teams may label examples differently | Specify an observable outcome and time horizon |
| Ignoring prediction time | Future data may leak into inputs | Set an explicit cutoff for every example |
| Selecting only accuracy | Important error types may be hidden | Choose task-appropriate metrics and error costs |
| Skipping a baseline | Complexity may bring no measurable benefit | Compare with a simple reliable alternative |
| Ignoring deployment constraints | A working prototype may be unusable | Specify latency, cost, access, and oversight |
| Assuming prediction creates impact | Correct predictions may not improve decisions | Evaluate the downstream action separately |
| Treating all data as usable | Privacy and authorization problems may result | Define permitted data sources and handling rules |
14. Check your understanding
- A university wants to identify students who may need academic support. What decision will staff make from the output, and what information will actually be available beforehand?
- Why is “predict customer churn” not yet a complete problem statement?
- How could a classifier with high accuracy still be unsuitable for a fraud-screening workflow?
- What baseline would you compare against an AI system that retrieves answers from institutional documents?
- Why should a team evaluate the effect of an intervention separately from the accuracy of a risk model?
Show suggested answers
- Identify the intended support action and timing, define student-level inputs available before the decision, and use authorized records. Establish appropriate oversight and fairness safeguards.
- The definition of churn, prediction unit, prediction date, horizon, inputs, and intended response are unspecified.
- Fraud may be rare, making majority-class predictions highly accurate while missing most fraud. Error costs and review capacity matter.
- A conventional keyword-search system or an existing staff workflow is a useful baseline, evaluated on the same queries and criteria.
- A score can predict who is at risk without showing that an intervention improves outcomes. A separate evaluation can test that effect.
Related PlainCS concepts
- AI Systems, Models, Training, and Inference explains how computational models differ from complete AI systems.
- Data Types and Data Collection for AI covers sources and representations of input information.
- Data Splitting, Labeling, and Leakage examines labels, time boundaries, and evaluation splits.
- Classification, Regression, Clustering, and Other AI Tasks develops the taxonomy of AI tasks.
- Machine Learning Paradigms connects task formulation with different learning approaches.
- Evaluating Machine Learning Models expands on performance metrics and reliable assessment.
- AI Knowledge Map shows the overall learning sequence.
References and further reading
- Google Machine Learning Crash Course — introductory material on data, problem framing, model evaluation, and ML development.
- NIST AI Risk Management Framework — guidance for identifying and managing AI-system risks across the lifecycle.
- scikit-learn: Model evaluation — documentation of supervised-learning metrics and scoring methods.
- scikit-learn: Cross-validation and model selection — practical guidance on evaluating predictive models.
Related articles in
- AI Agents and Tool-Using Workflows — Learn agent goals, tool invocation, planning, state, permissions, and how to evaluate multi-step AI workflows.
- AI Development Tools: Git, Jupyter, and APIs — Learn how Git, Jupyter notebooks, Python environments, and APIs fit together in reproducible, secure artificial intelligence workflows.
- How AI Is Changing Theoretical Computer Science — AI is beginning to help researchers explore algorithms, mathematical structures, and formal proofs. Here is what it can do, what still needs human judgment, and why verification matters.