Microsoft Agent Framework Generative AI ( Tutorial 1 ) Created: 14 Apr 2026 Updated: 14 Apr 2026

What Is Generative AI

Generative AI is software that creates new content (text, images, code, audio) based on patterns it learned from existing data. Unlike traditional software that follows fixed rules, generative AI produces original outputs — from writing paragraphs to generating images — by recognizing and recreating patterns found in massive training datasets.

Large Language Models (LLMs)

At the heart of most generative AI applications, usually, are Large Language Models (LLMs). These are neural networks trained on massive amounts of text data. During training, they learn patterns, relationships, and structures in language.

LLMs are built on deep learning architectures, most commonly the Transformer architecture. They use enormous numbers of parameters — from hundreds of millions to trillions — to capture the complexity of natural language.

Key Characteristics of LLMs

  1. Scale: LLMs use architectures with an immense number of parameters. Models like GPT-3 have 175 billion parameters, and GPT-4 has 1.76 trillion, allowing them to capture complex patterns in language.
  2. Pretraining: LLMs are pretrained on a large corpus of text data from the internet. This pretraining enables them to learn grammar, syntax, semantics, and a broad range of knowledge about language and the world.
  3. Fine-tuning: After pretraining, LLMs can be fine-tuned on specific tasks or domains with smaller, task-specific datasets. This process allows them to adapt to specialized tasks such as text classification, translation, summarization, and question answering.

How Does Generative AI Work?

All generative AI is built on models. These models are trained with large sets of data in the form of content, such as natural language, images, audio, and code. Generative AI models use the patterns identified in the training data to produce new, statistically similar content.

  1. The AI model parses your input into a form it can understand.
  2. It then uses that data to identify matching patterns from its training.
  3. It combines those patterns to build the final output.

Generative AI models are designed to produce unique content, so they typically won't generate the exact same output for identical inputs.

How Do LLMs Generate Text?

When training an LLM, the training text is first broken down into tokens. Each token identifies a unique text value — it can be a distinct word, a partial word, or a combination of words and punctuation.

After tokenization, a contextual vector called an embedding is assigned to each token. These embedding vectors are multi-valued numeric data where each element represents a semantic attribute of the token. Tokens that are used together or in similar contexts end up with similar embedding values.

The model then predicts the next token in the sequence based on the preceding tokens:

  1. The model assigns a weight to each token in the existing sequence, representing its relative influence on the next token.
  2. It uses the preceding tokens' weights and embeddings to calculate and predict the next vector value.
  3. The most probable token is selected to continue the sequence.
  4. This process repeats iteratively — each output is used regressively as input for the next iteration.

This is analogous to how auto-complete works: suggestions are based on what's been typed so far and updated with each new input.

Common Uses of Generative AI

Use CaseDescriptionExamples
Natural Language GenerationProducing human-like text from promptsSummaries, product descriptions, meal ideas, emails
Image GenerationCreating images from text descriptionsLogos, avatars, artistic concepts, marketing visuals
Audio GenerationSynthesizing speech or music from textVoice assistants, music production, narration
Code GenerationProducing source code from natural languageCode completion, translation between languages, documentation

Key Concepts Summary

ConceptDescription
Generative AIAI that creates new content (text, images, code, audio) based on learned patterns
LLM (Large Language Model)Neural network trained on massive text data to understand and generate human-like language
TokenThe basic unit of text that an LLM processes — can be a word, part of a word, or punctuation
EmbeddingA numeric vector that represents the semantic meaning of a token
TransformerThe deep learning architecture that powers most modern LLMs
PretrainingInitial training phase using large datasets to learn language fundamentals
Fine-tuningCustomizing a pretrained model for specific tasks using smaller datasets
NLP (Natural Language Processing)The AI discipline that enables machines to understand, interpret, and generate human language


Share this lesson: