AI901: Describe how generative AI models work

1) Core idea: learn patterns → generate new content

Generative AI models don’t “store answers”—they learn statistical patterns from large datasets (text, images, code, etc.).
After training, they can generate new content that follows those patterns.

Text → write sentences, code, summaries
Images → create pictures from prompts
Audio → generate speech or music

2) The main building block: the Transformer

Most modern generative AI models (like GPT-style models) are based on the Transformer architecture.

Transformer model

Key mechanism:

Self-attention → the model looks at relationships between words in a sequence
It decides which words matter most when predicting the next one

👉 Example:
“Microsoft Fabric is a ___ platform”
The model uses context (“Microsoft”, “Fabric”) to predict “data” or “analytics”.

3) Tokens: how models read and write

Models don’t see full sentences—they process tokens (chunks of text).

Tokenization

Example:

“Fabric platform” → [“Fabric”, “platform”]
Or even smaller subword pieces

Generation works by:

Predict next token
Append it
Repeat

4) Training phase (how the model learns)

Generative models are trained on massive datasets.

Typical process:

Input text sequence
Hide or shift part of it
Model predicts missing/next token
Compare with actual answer
Adjust weights (via gradient descent)

Neural network

This happens billions of times until the model:

Understands grammar
Captures meaning
Learns patterns across domains

5) Inference phase (how it generates output)

Once trained, the model generates content using:

A prompt (your input)
Probability predictions for next token

Example:
Prompt:
“Explain Microsoft Fabric in simple terms”

The model:

Converts to tokens
Predicts next token probabilities
Selects one (based on settings like temperature)
Repeats until response is complete

6) Model configuration (important for AI-901)

These control how output is generated:

Temperature → randomness
Low = more predictable
High = more creative
Max tokens → response length
Top-k / Top-p sampling → controls word selection diversity
Stop sequences → where generation ends

These are part of model configuration, not training.

7) Fine-tuning and grounding

Generative models can be improved by:

Fine-tuning → train on specific domain data
Prompt engineering → better instructions
Grounding (RAG) → use external data to improve accuracy

8) Simple mental model (for the exam)

Think of a generative AI model as:

“A highly advanced autocomplete system trained on massive data that predicts the most likely next piece of content.”