How generative AI models work and how to choose them
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
- How a language model generates text, step by step
- Choosing a model by capability: chat, reasoning, multimodal, embeddings, image generation
- Deployment types: Global Standard, Data Zone, provisioned and batch
- Settings such as temperature, top_p and maximum output tokens
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.
- 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.
| Need | Type of model |
|---|---|
| Chat, writing, summarising | A general chat (GPT-style) model |
| Step-by-step problem solving, maths, planning | A reasoning model |
| Understand images or audio in prompts | A multimodal model |
| Semantic search or RAG | An embeddings model |
| Create images from text | An image generation model |
| Low cost, fast, simple tasks or running on small devices | A 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
| Type | Billing | Choose when |
|---|---|---|
| Global Standard | Pay per token | The default: newest models, lowest price, highest quota |
| Data Zone Standard | Pay per token | Data must be processed within the EU or US data zone |
| Standard (regional) | Pay per token | Processing 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 Batch | About 50% cheaper | Large jobs that can wait up to 24 hours |
4. Configuration parameters
| Setting | What it does |
|---|---|
| Temperature | Randomness. Low (for example 0.2) for consistent, factual answers, and high (for example 0.9) for creative writing. |
| Top P | Limits choices to the most likely tokens. Adjust temperature or top P, not usually both. |
| Maximum output tokens | Caps the length (and cost) of the answer. |
| Stop sequences | Text that tells the model to stop generating. |
| Frequency and presence penalties | Reduce 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