Phi 3: Definition and Examples
Phi 3 is a family of small language models (SLMs) developed by Microsoft Research, designed to deliver performance close to large models while being compact enough to run on local devices.
Full definition
Phi 3 is the third generation of Microsoft's Phi series, a family of Small Language Models (SLMs) that pushes the boundaries of what compact models can achieve. Launched in April 2024, this family includes several variants — Phi-3-mini (3.8 billion parameters), Phi-3-small (7 billion), and Phi-3-medium (14 billion) — each optimized for a different balance between performance and efficiency.
The particularity of Phi 3 lies in its training methodology. Rather than simply increasing model size, Microsoft focused on the quality of training data by using carefully filtered datasets and synthetic data generated by larger models. This approach, inspired by the principle 'textbooks are all you need', allows Phi 3 to achieve performance comparable to much larger models on many benchmarks.
Phi-3-mini, the flagship model of the family, can run directly on a smartphone or laptop thanks to its small size. It supports a context window of up to 128,000 tokens and particularly excels in logical reasoning, mathematics, and code generation. This ability to run locally makes it a preferred choice for applications requiring data privacy or offline operation.
Available as open source under the MIT license, Phi 3 integrates easily into existing pipelines via platforms like Hugging Face, Ollama, or Azure AI. Its performance-to-size ratio makes it particularly relevant for developers and companies looking to deploy generative AI solutions without the infrastructure costs associated with large models.
Etymology
The name 'Phi' (φ) refers to the Greek letter often associated in mathematics with the golden ratio and the idea of optimal proportion, reflecting Microsoft's ambition to find the ideal ratio between model size and performance. The '3' indicates the third iteration of this family, after Phi-1 (specialized in code) and Phi-2.
Concrete examples
Deploying a local AI assistant for a mobile application without internet connection
You are an onboard assistant running on Phi 3 Mini. Respond concisely and in a structured manner. The user asks you questions about cooking. Give recipes in a maximum of 5 steps with the necessary ingredients.
Using Phi 3 to analyze confidential documents locally in a legal context
Analyze the following contract and identify potentially problematic clauses. List each clause with its number, quote the exact passage, and explain the risk in one sentence. Document: {CONTRACT_CONTENT}
Integrating Phi 3 into a code generation pipeline for real-time suggestions
Complete the following Python function while respecting the style of the existing code. Generate only the missing code, without explanation. Function: {INCOMPLETE_CODE}
Practical usage
In prompt engineering, Phi 3 is mainly used for targeted tasks where data privacy or latency are priorities. Favor concise and structured prompts, as compact models respond better to precise instructions than to vague queries. For complex tasks, decompose your prompt into sequential steps (chain-of-thought) to compensate for the more limited reasoning capacity compared to large models.
Related concepts
FAQ
What is the difference between Phi 3 and GPT-4?
Can Phi 3 run on a personal computer?
Is Phi 3 suitable for prompt engineering in French?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- Replace the bracketed variables with your details, then refine the result.
About Prompt Guide
Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.
More definitions
Pinecone: Definition and Examples
Pinecone is a cloud-native vector database designed to store, index, and search embeddings at scale, used particularly in
Positional Encoding: Definition and Examples
Positional Encoding is a technique used in Transformer architectures to inject information about the position of each token in a sequence.
Precision Recall: Definition and Examples
Precision and recall are two complementary metrics used to evaluate the quality of a classification model's results.
Presence Penalty: Definition and Examples
The Presence Penalty is a language model parameter that penalizes tokens that have already appeared in the generated text, encouraging the model to introduce
Prompt Chaining: Definition and Examples
Prompt chaining is a technique that involves chaining multiple sequential prompts, where the output of each step feeds the input of the next, to
Prompt Engineering: Definition and Examples
Prompt engineering is the art and science of formulating precise and structured instructions to get the best possible results from a generative AI model.
Get new prompts every week
Join our newsletter.