AI, ML, deep learning

Each term names a smaller field inside the one before

Artificial intelligenceany machine doing a task that needs intelligenceMachine learninglearns the rules from dataDeep learningmany-layered neural networksGenerative AIcreates new text, images, codeDeep Blue (1997)chess by hand-written searchRoute plannersrules and search, no learningSpam filterslearned from labelled mailCredit scoringtrees trained on past loansFace unlocka network trained on facesSpeech to textaudio in, words outChat assistantslarge language modelsEach term names a smaller field inside the one before it.AI is the goal: a machine doing work that needs intelligence. Machine learning is the main way to get there today: instead ofwriting the rules, you show the computer examples and it finds the rules. Deep learning does that with large neural networks,and generative AI is the part of deep learning that produces new content rather than labels or numbers.

AI is the goal, machine learning the method, deep learning its strongest form.

AI, ML, deep learning · Going deeper

Programming writes the rules; machine learning learns them

Traditional programmingRuleswritten by a personDataa new emailProgramAnswerspam or notMachine learningData: 50,000 emailsAnswers: their labelsTrainingModelthe learned rulesInferencemodel + new email = answerA person must foresee every case.Rules break when spammers change words.Programming turns rules into answers. Machine learning turns answers into rules.Training is the expensive, one-off step that produces the model. Inference is using it: every request runs the model once.

Training makes the model once. Inference uses it on every request.

Supervised learning

Labelled examples teach the model which answer to give

Labelled examplesSize m²RoomsAreaPrice622city310k953suburb395k1204suburb468k481city265kfeatures: what the model seeslabel: the answerModelfits the patternNew house: 80 m², 3 roomspredicted price: 360kRegressionthe label is a number: price, demand, minutesClassificationthe label is a class: spam, fraud, cat or dogSupervised learning learns from examples whose answers are known.Each row holds features, the inputs, and a label, the answer a person or a past event supplied. The model learns to map one tothe other, then predicts labels for rows it has never seen. It is the most used kind of machine learning, and labels are its cost.

Features go in, the label is the answer. Regression predicts numbers, classification classes.

Unsupervised learning

With no labels, the model finds the structure itself

visits a monthaverage spendBefore: 48 customers, no labelsvisits a monthrare, big basketsloyal regularsoccasional, smallAfter: the model found three groupsUnsupervised learning finds structure in data that has no labels.Nobody told the model these groups exist. Clustering found them from the data alone; a person then names what each group means.The same family finds anomalies (the transaction unlike all others), reduces many columns to a few, and recommends products.

Clustering groups similar rows. A person names what the groups mean.

Dimensionality reduction · Going deeper

PCA swaps many columns for a few that keep most of the variation

-303-303visits a month (z)spend a month (z)PC1PC2All five columns: share of the variation in each componentPC160.0% running total 60.0%PC231.4% running total 91.4%PC33.4% running total 94.8%PC43.1% running total 97.9%PC52.1% running total 100.0%Keep 2 of 5 components: 91.4% of the variation survives.Left: two of the five columns; PC1 carries 85% of that pair's spread.PCA builds new columns, ordered by how much of the variation each carries, and keeps the first few.Each principal component is a weighted mix of the original columns, at right angles to the ones before it. These five columns ofcustomer behaviour were generated from two habits (how often, how much), so two components keep 91% and the other three are mostlynoise. Standardise first, or the column with the biggest numbers wins. The new columns are harder to explain. Invented data.

Principal component analysis keeps the directions of most spread and drops the rest.

Reinforcement learning

An agent learns from the rewards its actions earn

Agentchooses an actionEnvironmenta game, a robot arm, a marketaction: move leftnew state, and a reward: +1 or -1learns which actionsearn the most rewardover timeReinforcement learning learns by trial and error, from the reward its actions earn.There are no labelled answers, only a score. The agent tries actions, sees what happens, and shifts towards the ones that paid off.AlphaGo learned Go this way in 2016. Chat models are tuned the same way: people rank answers, and the ranking is the reward (RLHF).It needs millions of tries, so most of it happens in simulation.

Act, see the reward, do more of what paid. Chat models are tuned this way with RLHF.

Reinforcement learning · Going deeper

Self-supervised learning: the data supplies its own labels

One sentence from the web becomes many training examples, with no person labelling anythingThecatsatonthematinput: "The ..."label: "cat"input: "The cat ..."label: "sat"input: "The cat sat ..."label: "on"input: "The cat sat on ..."label: "the"KindWhere the answer comes fromSuperviseda person or past eventUnsupervisedno answer at allSelf-supervisedhidden in the data itselfReinforcementa reward signalSelf-supervised learning makes its own labels by hiding part of the data.Hide the next word and ask the model to guess it: every sentence ever written becomes a labelled example. This is how largelanguage models are pretrained, on trillions of words, without any human labelling. Image models do the same by hiding patches.

Hide the next word, then guess it. That is how LLMs are pretrained.

AI workloads

Most AI products do one of six jobs, sold ready-made

WorkloadInput to outputAWSAzureGoogle CloudVisionimage: what is in it, where, read textRekognitionAzure VisionCloud Vision APIText analysissentiment, entities, key phrasesComprehendAzure LanguageNatural Language APISpeechspeech to text, text to speechTranscribe, PollyAzure SpeechSpeech-to-Text, Text-to-SpeechTranslationtext in one language to anotherTranslateAzure TranslatorCloud TranslationInformation extractionfields from forms, invoices, videoTextractContent UnderstandingDocument AIGenerative and agentswrite, summarise, chat, actBedrockMicrosoft FoundryVertex AIMost AI products do one of six jobs, and every cloud sells each one ready-made.A pretrained service is called by an API, with no training: send an image, get labels back. Build your own model only when no servicefits. The fundamentals exams test this mapping: from a described need to the workload, then to the provider’s service.Microsoft groups its prebuilt services as Foundry Tools inside Microsoft Foundry (2026 names).

Match the need to a workload, then to the provider’s pretrained service.

Task vocabulary · Going deeper

The exact task names that exam questions turn on

The question describes an output; the answer is the task name that produces it.

Vision

  • Image classification one label for the whole image: "cat".
  • Object detection a label and a bounding box for each object: three cars, and where.
  • Semantic segmentation a class for every pixel: road, pavement, sky.
  • Instance segmentation pixels grouped per object: this car, that car.
  • OCR printed or handwritten text in an image becomes characters.
  • Face detection finds that a face is present, and where. Recognition or verification says whose it is; Microsoft gates that behind an approval form (Limited Access).

Language and speech

  • Sentiment analysis positive, negative, neutral or mixed, with a score.
  • Named entity recognition finds people, places, organisations, dates, amounts.
  • Key phrase extraction the main talking points of a text.
  • Text classification your own categories: billing, complaint, sales.
  • Summarisation extractive picks sentences from the text; abstractive writes new ones.
  • Speech recognition and synthesis speech to text, and text to speech.
Every pretrained service returns a confidence score from 0 to 1 with each label, box or entity. Choosing the cut-off is your job: it is the decision threshold of lesson 3.
The two pairs most often confused: classification (what) against detection (what and where), and detection of a face against recognition of a person.

When not to use ML

Use it only when the rules can’t be written and data exists

Can the rule be written down exactly?✗Write code: tax rules, a discount, a sort.Must every answer be exactly right and explained?✗ML is right most of the time, never always.Is there enough good, relevant data?✗No data, no model: collect it first.Does the pattern change faster than you can retrain?✗The model will be out of date on day one.Is a wrong answer cheap, or caught by a person?✓Then ML fits: ranking, spotting, suggesting.Machine learning is the right tool only when the rules cannot be written and the data exists.Its answers are probabilities. Where a rule is known, a few lines of code are cheaper, exact and explainable. Where errors are costly,a model may still help, but behind a check. Exams ask this directly: the scenario that needs a deterministic answer is not an ML problem.

Known rule: write code. Unknown pattern, enough data, tolerable error: use ML.

Lesson complete

You finished “What AI and machine learning are”

Nicely done.

Open in a new tab