LoopAI-103

Exercise: Optimize generative AI model performance

Unit 6 of 7 · Module 5: Optimize generative AI model performance with Microsoft Foundry

Read this lesson

Your turn

Now it's your turn: fine-tune a language model in Microsoft Foundry, and compare it with a base model, to see which one fits your needs better. You're building a chat app for a travel agency, one that suggests destinations and activities in a consistent, friendly, conversational tone. You'll need an Azure subscription with permission to create AI resources. The lab takes about ninety minutes, because fine-tuning depends on cloud capacity, and the job alone can take an hour or more.

The run sheet

First, create a Foundry project in a region that supports fine-tuning for gpt-5 models, like North Central US or Sweden Central, and deploy gpt-5 as your baseline. Then start the fine-tuning job right away, because it takes time: base model gpt-5, the supervised method, standard training, the travel training file you download as a JSONL file, the suffix FT dash travel, and automatic deployment as a developer deployment. While it runs, chat with the base model. Ask what it can do, and refine its instructions, until it helps plan trips, avoids hotel, flight, rental car, and restaurant recommendations, and asks engaging questions. Then ask the Rome questions, and note the tone. Next, open the training file: every example uses that same system message, a travel question, and a playful, friendly answer. When the fine-tuned model is deployed, give it the same instructions, ask the same questions, and compare. Finally, delete the resource group.

Before you start

You can practice every step here in a simulation, including a fast-forwarded fine-tuning job. Some features are in preview, and Microsoft's docs currently list gpt-5 for reinforcement fine-tuning only, by invitation, so if Supervised isn't offered for gpt-5 in your portal, pick a model the fine-tuning page lists for supervised fine-tuning. Good luck.

Facts from Microsoft's documentation: Customize a model with fine-tuning; Retrieval augmented generation (RAG) and indexes in Microsoft Foundry (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.