Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AI Customization and Fine Tuning

AI Customization and Fine Tuning

Make Azure AI Real - Dec 2024

Nitya Narasimhan, PhD

December 13, 2024
Tweet

More Decks by Nitya Narasimhan, PhD

Other Decks in Technology

Transcript

  1. A N A I E N G I N E

    E R G U I D E T O A I C U S T O M I Z AT I O N & F I N E T U N I N G Nitya Narasimhan, PhD Senior AI Advocate, Microsoft #in/nityan Make Azure AI Real
  2. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  3. The Rise of the AI Engineer Traditional application development separated

    model creation roles (data science & ML) from model usage (software engineering) – creating a gap in knowledge.
  4. I build foundation AI Models I ship AI Products Generative

    AI keeps evolving fast. The AI Engineer Role bridges the gap between two existing skillsets • Model Selection • Prompt Engineering • Fine Tuning • Retrieval Augmented Generation • AI-Assisted Evaluation • Agent-Assisted Automation
  5. Building my AI Engineer Toolkit – Catalog to Code to

    Cloud Model Selection How do I pick the right model for my needs? Prompt Engineering How do I design the prompt for optimal responses? RAG Design Architecture How do I ground responses in my data or context Model Fine Tuning How can I customize a pre-trained AI model? Model Evaluation How can I assess the quality of an AI model’s responses? CATALOG CODE Multi-Agent Architecture How do I automate tasks & coordinate complex flows? CLOUD Unified E2EPlatform Rich Developer Tools Model Catalog Code-First SDK AI App Templates
  6. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  7. What is fine tuning? Fine-tuning refers to customizing a pre-trained

    LLM with additional training on a specific task or new dataset for enhanced performance, new skills, or improved accuracy Curated Data Set LLM Fine-Tuned LLM Azure OpenAI Service uses low rank approximation (LoRA) to fine-tune models. LoRA works by approximating the original high-rank matrix with a lower rank one, only fine-tuning a smaller subset of "important" parameters. This technique reduces the complexity of fine tuning while maintaining performance, making training faster and more affordable.
  8. Gen AI journey Plan an iterative path from basic to

    advanced GenAI leveraging your data Prompt engineering Crafting specialized prompts and pipelines to guide model behavior Retrieval augmented generation (RAG) Combining an LLM/SLM with your enterprise data Fine-tuning Adapting a pre-trained Gen AI model to specific datasets or domains Pre-training Training a GenAI model from scratch Accuracy / Complexity / Compute-Intensive
  9. Where does fine-tuning fit in? Fine-tune the LLM to: •

    Reduce the length of your prompt • Show not tell the model how to behave • Improve the accuracy when you look up information • Improve the model’s handling of retrieved data Will my sleeping bag work for my trip to Patagonia next month? Tone and style Weather lookup Example responses Personalization Intent mapping …and more! User input Prompt engineering Output LLM Basic prompt engineering Retrieval/RAG LLMs are language calculators Yes, your Elite Eco sleeping bag is rated to 21.6F, which is below the average low temperature in Patagonia in September
  10. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  11. Why customize Gen AI models? Scalability Customization enables AI models

    to scale and adapt to specific enterprise needs. Reducing hallucinations Tailored models are less likely to produce inaccurate or irrelevant responses. Increased reliability Enhances the model's accuracy for domain-specific tasks. Improved efficiency Customization ensures faster and more precise results, saving time and resources. Tailored solutions Models are fine-tuned for specific use cases, providing more relevant and context-aware outcomes.
  12. Vertical specific use cases Natural language to code Translation and

    dialects Style and formatting Customer specific knowledge infusion
  13. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  14. Before You Begin – Things to consider 1. Is AI

    Customization justified? (Benefits & Tradeoffs) 2. Is AI Customization viable? (Model & Data Ready) 3. Is AI Customization successful? (Metrics & Insights) Demo: Model Catalog Demo: GPT-4o-mini FT
  15. Fine Tuning Guidance – Using Azure AI Foundry Tooling When

    to use Azure Open AI Fine Tuning Regional Availability of Fine-Tuning Models Fine Tuning Methods (See: Portal, SDK, REST) There are two unique fine-tuning experiences in Azure AI Foundry portal. Both allow you to fine-tune Azure OpenAI models, but only the Hub/Project view supports fine-tuning non Azure OpenAI models.
  16. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  17. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  18. Announcing What’s new in Azure OpenAI fine-tuning? Distillation (Stored Completions

    + Evals + Fine-tuning) Vision fine-tuning W&B and Gretel integration Provisioned and Global Standard deployments
  19. Distillation & Data Generation  Distillation refers to the process

    of using a large, general purpose teacher model to train a smaller student model to perform well at a specific task.  Distillation is of particular interest for several reasons:  reduce the costs and latency  improve performance.  operate in resource-constrained environments  Distillation typically has three steps:  Data Generation (Stored Completions)  Training (Azure OpenAI Finetuning)  Evaluation (Azure OpenAI Evaluation) From Microsoft Product Terms Azure OpenAI Evaluation Define testing criteria Evaluate your Finetuned model Export data with pass status to fine-tune Fine-tuning Select hyper parameters Finetune a GPT-4o-mini model Stored Completions Log GPT-4o model responses View, query and filter data Export filtered data to fine- tune or evaluation
  20. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A
  21. Build Your AI Engineer Toolkit – #GenerativeAIForBeginners Model Selection How

    do I pick the right model for my needs? Prompt Engineering How do I design the prompt for optimal responses? RAG Design Architecture How do I ground responses in my data or context Model Fine Tuning How can I customize a pre-trained AI model? Model Evaluation How can I assess the quality of an AI model’s responses? CATALOG CODE Multi-Agent Architecture How do I automate tasks & coordinate complex flows? CLOUD Unified E2EPlatform Rich Developer Tools Model Catalog Code-First SDK AI App Templates
  22. 1. Rise of the AI Engineer 2. What is AI

    Customization? 3. Why is AI Customization Useful? 4. The Model Fine Tuning Process 5. The Azure AI Foundry Platform 6. What’s New in AI Customization? 7. Where Can I Learn More? 8. Summary – Q&A