In my previous article, I wrote about the latest open AI model i.e. LLaMA 3 being on par with the best proprietary models available today. While Meta decided to go open-source with LLaMA 3 to democratise innovation for the broader research community and developers, Microsoft has introduced Phi-3, a small language model (SLM) that offers impressive capabilities while being more efficient and accessible than large language models (LLMs).
The goal behind Phi-3 is to extend the reach of AI technologies to resource-constrained environments, including on-device and offline inference scenarios. And guess what? Companies are already leveraging Phi-3 model to build solutions for such environments, particularly in areas where internet connectivity might be limited or unavailable like Agriculture. Powerful small models like Phi-3, combined with Microsoft's copilot templates, can be made available to farmers at the point of need, providing the additional benefit of running at reduced cost and making AI technologies more accessible to the common people.
ITC, a leading Indian business is leveraging Phi-3 SLM as part of their continued collaboration with Microsoft on the Krishi Mitra copilot, a farmer-facing app that reaches over a million farmers. The aim is to improve efficiency while maintaining the accuracy of a large language model by using fine-tuned versions of the efficient Phi-3.
The Microsoft Phi-3-mini is the latest most capable small 3.8B language model, available on Microsoft Azure AI Studio, Hugging Face, and Ollama. This versatile small language model comes in two context-length variants: 4K and 128K tokens, making it the first model in its class to support a context window of up to 128K tokens with minimal impact on quality. One of the standout features of Phi-3-mini is its instruction-tuned nature, meaning that it is trained to follow different types of instructions reflecting how people normally communicate. This ensures the model is ready to use out-of-the-box for a better developer and user experience. Phi-3-mini has been optimised for ONNX Runtime, with support for Windows DirectML with cross-platform support across GPUs, CPUs and even mobile hardware.
The decision to develop Phi-3 as a family of small language models could be derived from Microsoft's commitment to addressing the growing need for different-sized models across the quality-cost curve for various tasks. SLMs like Phi-3 offer several advantages making it “The One” for common people and small organisations.
“Some customers may only need small models, some will need big models and many are going to want to combine both in a variety of ways”
-Luis Vargas, Vice President of AI at Microsoft
Here are the technical specifications of Microsoft's Phi-3 SLM:
Microsoft Phi-3 model comes with an impressive range of capabilities. This makes it an attractive option for various applications. Some of its key capabilities include:
The capabilities of the Phi-3 models significantly outperform language models of the same and larger sizes on key benchmarks. To give you an idea, Phi-3-mini does better than models twice its size, while Phi-3-small (7B) and Phi-3-medium (14B) outperform much larger models, including GPT-3.5T. While Phi-3 models excel in various areas, it is worth mentioning that Phi-3 may not perform well on factual knowledge benchmarks, such as TriviaQA because a smaller model size has less capacity to retain facts.
Click here to check the image source
If we look at the performance benchmarks for Microsoft's Phi-3 model family above, it compares small language models across various tasks to other prominent models like Gamma, Mistral, LLaMA, GPT-3 and Claude.
It is important to note that all reported benchmark numbers are produced with the same pipeline to ensure comparability. However, these numbers may differ from other published numbers due to slight differences in evaluation methodology.
The Microsoft Phi-3 mini can be quantised to 4 bits so that it only consumes 1.8GB of memory. The model was tested by deploying phi-3-mini on iPhone 14 with an A16 Bionic chip running natively on-device and fully offline achieving more than 12 tokens per second. See the image below for reference.
Image source: Microsoft's Phi-3 Technical Report
The development of the Phi-3 models followed a "safety-first" approach, adhering to the Microsoft Responsible AI Standard – a comprehensive set of company-wide requirements grounded in six core principles:
The Phi-3 model underwent extensive safety measures and evaluations to ensure alignment with these principles throughout their development cycle. This included meticulous safety measurements, thorough evaluation processes, adversarial "red-teaming" exercises, sensitive use case reviews, and strict adherence to security best practices. This comprehensive approach aimed to mitigate potential risks and biases while upholding the highest transparency, fairness, and privacy protection standards.
Microsoft Phi-3 SLM's versatility and efficiency make it an attractive option for various applications and use cases, including:
Microsoft Phi-3 model has the potential to transform various industries, including:
Microsoft Phi-3 is a family of small language models (SLMs) from Microsoft. Unlike large language models (LLMs), Phi-3 models are designed to be more efficient and require fewer resources. This makes them ideal for tasks on devices with limited processing power or in situations where internet connectivity is unavailable.
Microsoft Phi-3 SLM offers several advantages, including:
Microsoft Phi-3's capabilities make it suitable for various applications, including:
Microsoft Phi-3 models outperform similar-sized models and even some larger models on various benchmarks. They excel in tasks involving reasoning, logic, and code generation. However, due to their smaller size, they may not perform well on factual knowledge tasks.
Microsoft developed Phi-3 with safety as a priority. The models undergo rigorous testing and adhere to Microsoft's Responsible AI Standard, focusing on accountability, transparency, fairness, and user privacy.