How generative AI models work and how to choose them

AI-901 Azure AI FundamentalsAI concepts and capabilitiesAbout 25 minutesBy Cloud Hands On

Tokens, embeddings and transformers in plain English, how to pick a model from the Foundry catalog, and the deployment types and settings that shape its behaviour.

In this lesson you'll learn

1. How generative models work

New to AI? Start here

A large language model (LLM) has learned patterns from huge amounts of text. When you give it a prompt, it predicts the most likely next piece of text, adds it, and repeats until the answer is complete.

A prompt is split into tokens, tokens are turned into embeddings (numbers), the transformer uses attention to weigh which tokens matter, and the model predicts the next token, repeating until the answer is complete. Promptyour text Tokenssmall chunks Embeddingsnumbers Transformerattention Next tokenrepeat added to the input, then the next token is predicted
Generation happens one token at a time. Attention lets the model weigh which earlier tokens matter most for the next one.
  • Tokens are what models count: prompts and answers both use tokens, and pricing and limits are measured in them.
  • Embeddings turn text into vectors so that similar meanings are close together. They power semantic search and retrieval.
  • Context window is the maximum number of tokens a model can consider at once, including the conversation so far.

2. Choosing a model

The Foundry model catalog has thousands of models from Microsoft, OpenAI, Meta, Mistral and others. Choose by capability first, then by cost and speed.

NeedType of model
Chat, writing, summarisingA general chat (GPT-style) model
Step-by-step problem solving, maths, planningA reasoning model
Understand images or audio in promptsA multimodal model
Semantic search or RAGAn embeddings model
Create images from textAn image generation model
Low cost, fast, simple tasks or running on small devicesA small language model (SLM), such as Phi

Use the catalog's benchmarks and leaderboards to compare quality, cost and speed, and test candidates in the playground with your own prompts.

3. Deployment types

TypeBillingChoose when
Global StandardPay per tokenThe default: newest models, lowest price, highest quota
Data Zone StandardPay per tokenData must be processed within the EU or US data zone
Standard (regional)Pay per tokenProcessing must stay in one Azure geography
Provisioned (global, data zone or regional)Reserved capacity (PTUs)High, steady volume with predictable latency
Global or Data Zone BatchAbout 50% cheaperLarge jobs that can wait up to 24 hours

4. Configuration parameters

SettingWhat it does
TemperatureRandomness. Low (for example 0.2) for consistent, factual answers, and high (for example 0.9) for creative writing.
Top PLimits choices to the most likely tokens. Adjust temperature or top P, not usually both.
Maximum output tokensCaps the length (and cost) of the answer.
Stop sequencesText that tells the model to stop generating.
Frequency and presence penaltiesReduce repetition and encourage new topics.

Some reasoning models don't support temperature or top P. You control them with a reasoning effort setting instead.

Exam focus

"Answers must be consistent and factual" means lower the temperature. "Answers are too long or cost too much" means reduce the maximum output tokens.

Exam traps to remember

  • Embeddings models don't chat. They turn text into vectors for search.
  • Global Standard is the starting point unless the scenario mentions data residency, reserved throughput or batch.
  • Higher temperature gives more varied answers, not more accurate ones.

Test yourself: 3 check questions and exam-style practice questions on this topic are in the AI-901 Azure AI Fundamentals app.

Practise in the app

Keep going