AI · CONCEPT GUIDE
Machine Learning vs. Artificial Intelligence: A Programmer’s Guide
Separate the broad field of artificial intelligence from learning with data, using examples that make sense to a website developer.

Artificial intelligence and machine learning are often used as if they mean exactly the same thing. For a programmer, that can make a simple technical decision sound more mysterious than it is. You might need a search algorithm, a few explicit rules or a model trained on examples. Those approaches solve different problems, require different inputs and fail in different ways.
This guide starts with the practical question: how does the software decide what to do? If you can explain the decision as a small set of reliable rules, ordinary code may be sufficient. If the useful pattern is difficult to describe but visible in many examples, machine learning may be worth investigating. Neither label removes the need to define the task and verify the result.
AI is the broader field
Artificial intelligence includes approaches to reasoning, planning, search, perception and other tasks associated with intelligent behavior. Machine learning is one part of that field, concerned with systems that learn useful patterns from data. A program does not have to contain a trained neural network to use an AI technique. A game-search algorithm is a useful example.
Consider a computer opponent that explores possible moves in tic-tac-toe. It can evaluate the resulting positions using explicit rules and choose a move through search. That does not require a large collection of recorded games or a training phase. The intelligence comes from the representation of the problem, the evaluation of positions and the search procedure.
This distinction is particularly relevant when looking back at older programming projects. Techniques such as minimax, expert-system rules and evolutionary search belong in the AI conversation even when they are not modern language models. Treating the history of AI as if it began with chatbots makes those ideas harder to connect to current software.
Machine learning uses examples to shape a model
In a supervised-learning task, training data pairs inputs with desired outputs. A model uses those examples to adjust its parameters, and the resulting model is then evaluated on data it did not learn from. The desired output might be a category, such as whether a message is spam, or a number, such as an estimate of future demand.
Imagine a contact-form spam filter. An explicit version might check for blocked phrases and excessive links. A learned version might use labeled messages to identify combinations of features associated with unwanted submissions. The learned model can capture patterns you did not write as individual rules, but its quality depends on the examples and the way you evaluate it.
Unsupervised learning explores structure without the same labeled target, such as grouping similar records. Reinforcement learning concerns actions and feedback in an environment. These are different setups, not interchangeable shortcuts. Choose the setup after describing the available data and the decision you need to support.
A rules-based recommendation is still useful
A website that randomly selects eight games from the current category is using selection logic, not learning visitor preferences. Excluding the current page improves the result, and a curated list can improve relevance further. Those are worthwhile features even though they do not require a trained recommendation model. Clear naming helps you understand what the component actually promises.
A learned recommendation system would need a more specific objective and suitable evidence, perhaps interactions with items and a way to measure useful suggestions. Popularity alone can create a feedback loop where already-prominent items receive still more attention. Before adding a model, compare it with a simple category-based or editorial baseline and ask which visitor problem remains unsolved.
For a small site, the basic method may win because it is easy to inspect, fast to run and cheap to maintain. Calling a feature AI does not make its tradeoffs disappear. The best implementation is the one whose complexity is justified by a measured improvement in the intended task.
Training and using the model are separate activities
Training changes the model based on data. Using that trained model to produce an output is inference. The distinction affects deployment: you can train in a separate workflow and serve the resulting model through an application. A website does not necessarily retrain whenever a visitor requests a page.
The model may also become less useful as conditions change. A spam filter trained on yesterday’s attacks can miss a new pattern. That is a reason to monitor outcomes and maintain an update process, not a reason to retrain without checking labels or evaluation data. A complicated pipeline with careless examples can be less reliable than a transparent rule.
Evaluate on data that represents the real job
Suppose a classifier gets most messages right in a mixed test collection. That number hides whether it blocks legitimate inquiries or lets spam through. Those mistakes have different costs. A useful evaluation reports the relevant kinds of error and examines actual examples, rather than relying on one attractive overall percentage.
Keep evaluation records separate from training records. For time-sensitive tasks, a time-based split may tell you more than a random split that mixes past and future. Also watch for information that would not be available at decision time. If the model accidentally sees the answer through a proxy field, the test result can look strong while deployment disappoints.
A small project can begin with a handwritten set of representative cases. Include easy cases, ambiguous cases and cases likely to fail. The same habit helps ordinary rules-based code: list what should happen and inspect what actually happened. Machine learning changes how behavior is produced, but it does not eliminate testing.
Generative models are another use of learned patterns
A generative model produces content, such as text or images, rather than only assigning a label. That output can be helpful while still requiring review. A generated explanation can be fluent without being correct, and an illustration can communicate a concept without being an exact technical diagram. Decide how the output will be checked before it becomes part of a public workflow.
A practical application may combine several methods. Explicit code can validate a form, search can retrieve relevant records, and a learned model can summarize them. The whole product is not reducible to one model. Thinking in components lets you place predictable code around uncertain outputs and measure the part that needs improvement.
Start with the smallest defensible solution
Write down the input, output, acceptable mistakes and a baseline before choosing a method. If deterministic code handles the task, use it. If examples contain a useful pattern that rules cannot reasonably capture, investigate learning. If the problem asks for a good configuration under constraints, optimization and search may be the better starting point.
Continue with a simple genetic algorithm and the early neural-network project. Google’s machine-learning introduction explains the main learning setups. The examples and decision framework here focus on everyday website development rather than prescribing a single technique for every project.