Artificial Intelligence • AI Problem Formulation • 17 min read

How to Formulate an AI Problem

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 goalPossible AI taskOutput
Reduce customer cancellationsPredict the probability that an active customer will cancel soonCancellation risk score
Make a help center easier to useRetrieve and rank relevant support articlesOrdered list of documents
Inspect manufactured componentsDetect visible defects in product photographsDefect label or location
Plan efficient delivery routesSearch for a feasible route under time and capacity constraintsOrdered route
Help staff answer policy questionsRetrieve policy passages and generate an answer grounded in themAnswer 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:

  1. Who uses the result? A customer, operator, analyst, clinician, or another software component?
  2. What action follows the result? Review a case, send an alert, recommend an item, or approve a request?
  3. When is the decision made? In real time, once per day, or only when someone submits a query?
  4. What happens if the system is wrong? A minor inconvenience, unnecessary work, lost revenue, or a safety concern?
  5. 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: spam or not 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 typeDefinitionExample
ClassificationAssign an input to one or more categoriesDetect spam
RegressionPredict a continuous numerical valueEstimate electricity demand
ClusteringGroup observations using patterns of similarityExplore customer segments
RankingOrder candidates by estimated relevance or utilityRank search results
RecommendationSelect items likely to be useful to a userRecommend courses
Anomaly detectionIdentify observations that differ from expected patternsFlag unusual sensor activity
ForecastingPredict future values or events using available historyForecast next week’s demand
GenerationProduce new content conditional on instructions or contextDraft a policy-based answer
Planning or decision-makingChoose actions that pursue an objective under constraintsPlan 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 1 if the subscription is canceled during the following 30 days and 0 otherwise, 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.

Timeline showing the feature window, prediction date, and future outcome period
A historical label can be constructed using future outcomes, but the inputs for the corresponding prediction must stop at the prediction cutoff.

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

TaskCommon metricsWhat they help evaluate
ClassificationPrecision, recall, F1-score, ROC-AUCDetection quality and class discrimination
RegressionMAE, RMSESize of numerical prediction errors
RankingPrecision@K, NDCGRelevance of top-ranked items
ForecastingMAE, RMSE, horizon-specific errorsPredictive accuracy over time
GenerationGroundedness, factual correctness, task successReliability 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 conditionPredicted positivePredicted negative
PositiveTrue positive (TP)False negative (FN)
NegativeFalse 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.

ConstraintQuestion to resolve
LatencyHow quickly must a prediction or response arrive?
CostWhat is the acceptable cost per request or per day?
Data availabilityCan required inputs be collected reliably at inference time?
PrivacyIs collection and processing of the information appropriate and authorized?
ExplainabilityMust the system provide understandable reasons for decisions?
ReliabilityWhat happens during outages, missing data, or unexpected inputs?
FairnessCould errors disproportionately harm particular groups?
Human oversightWhich decisions require human review or approval?
MaintenanceHow 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

ElementSpecification
Prediction unitOne active subscription on one prediction date
Available inputsBilling and product-usage records available before the cutoff
OutputA score estimating cancellation risk over the next 30 days
TargetCancellation recorded in the subsequent 30 days
DeliveryBatch scoring once each day
Human workflowStaff review prioritized subscriptions before contacting customers
ConstraintsAuthorized 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

MistakeWhy it causes problemsBetter approach
Starting with a model nameThe chosen technique may not fit the taskDefine the decision and output first
Using a vague targetDifferent teams may label examples differentlySpecify an observable outcome and time horizon
Ignoring prediction timeFuture data may leak into inputsSet an explicit cutoff for every example
Selecting only accuracyImportant error types may be hiddenChoose task-appropriate metrics and error costs
Skipping a baselineComplexity may bring no measurable benefitCompare with a simple reliable alternative
Ignoring deployment constraintsA working prototype may be unusableSpecify latency, cost, access, and oversight
Assuming prediction creates impactCorrect predictions may not improve decisionsEvaluate the downstream action separately
Treating all data as usablePrivacy and authorization problems may resultDefine permitted data sources and handling rules

14. Check your understanding

  1. 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?
  2. Why is “predict customer churn” not yet a complete problem statement?
  3. How could a classifier with high accuracy still be unsuitable for a fraud-screening workflow?
  4. What baseline would you compare against an AI system that retrieves answers from institutional documents?
  5. Why should a team evaluate the effect of an intervention separately from the accuracy of a risk model?
Show suggested answers
  1. 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.
  2. The definition of churn, prediction unit, prediction date, horizon, inputs, and intended response are unspecified.
  3. Fraud may be rare, making majority-class predictions highly accurate while missing most fraud. Error costs and review capacity matter.
  4. A conventional keyword-search system or an existing staff workflow is a useful baseline, evaluated on the same queries and criteria.
  5. A score can predict who is at risk without showing that an intervention improves outcomes. A separate evaluation can test that effect.

References and further reading

Related articles in

Image preview

Fit