Make Phi-4-mini-reasoning more powerful with industry reasoning on edge devices
May 1, 2025
Azure OpenAI Service – Controlling Outbound Access
May 1, 2025Showcasing Phi-4-Reasoning: A Game-Changer for AI Developers
Introduction Phi-4-Reasoning is a state-of-the-art AI model developed by Microsoft Research, designed to excel in complex reasoning tasks. With its advanced capabilities, Phi-4-Reasoning is a powerful tool for AI developers, enabling them to tackle intricate problems with ease and precision.
What is Phi-4-Reasoning? Phi-4-Reasoning is a 14-billion parameter open-weight reasoning model that has been fine-tuned from the Phi-4 model using supervised fine-tuning on a dataset of chain-of-thought traces.. We are also releasing Phi-4-reasoning-plus, a variant enhanced through a short phase of outcome-based reinforcement learning that offers higher performance by generating longer reasoning traces.
This model is designed to handle complex reasoning tasks, including mathematical problems, scientific queries, and coding challenges
Why Phi-4-reasoning and Phi-4-reasoning-plus Excels
- Advanced Reasoning Capabilities: Phi-4-Reasoning is trained to generate detailed reasoning chains, making it highly effective in solving complex problems. It leverages additional inference-time compute to enhance its reasoning abilities
- High-Quality Data Curation: The model’s training involved meticulous data curation and the use of high-quality synthetic datasets, allowing it to compete with much larger models
- Performance: Despite its smaller size, Phi-4-Reasoning outperforms larger models like OpenAI’s o1-mini and DeepSeek-R1-Distill-Llama-70B on various benchmarks, including mathematical reasoning and PhD-level science questions
- Industry Applications: Phi-4-Reasoning is versatile and can be deployed in various industry scenarios, including medicine, where it can be used for reasoning tasks on edge devices
Real-World Examples
- Wordplay Riddle: Phi-4-Reasoning can solve wordplay riddles by recognizing patterns and applying logical reasoning. For example, it deduced that collecting three strawberries would yield 9 r’s because the word “strawberry” contains three r’s
Example 1: How many strawberries for 9 r’s?
User: How many strawberries do I need to collect 9 r’s?
Phi-4-Reasoning:
TRUNCATED
It’s a wordplay riddle! Notice that the word “strawberry” has three r’s in it. So if you “collect” three strawberries, you get 3 Å~ 3 = 9 r’s.
Thus, you need 3 strawberries.
Solving a Riddle: The model can decrypt complex riddles by identifying patterns and performing arithmetic operations. It demonstrated this capability by solving a riddle involving foreign language number-words and reversed number-words.
What This Problem Proves:
- Pattern Recognition: Phi-4-Reasoning demonstrates its ability to identify patterns in words and apply logical reasoning to solve the riddle.
- Wordplay Understanding: The model showcases its proficiency in understanding and solving wordplay riddles, which require a combination of linguistic knowledge and logical deduction.
- Efficiency: Phi-4-Reasoning quickly arrives at the correct solution by applying a straightforward multiplication operation, highlighting its efficiency in solving such problems.
Example 2: Solving a Riddle
User: I will give you a riddle to solve with a few examples, and something to complete at the end
What is a likely completion for X that is consistent the with examples above?
Phi-4-Reasoning:
TRUNCATED
We can “decrypt” the riddle by noticing that each line has
five parts. In every example the parts are:
- A “number-word” in a foreign language (or with an
extra minus sign),
- A “first name” (of any nationality),
- A “reversed number-word” (or two, joined by a hyphen),
- A “second name”, and
- A final number.
When you “reverse” the third word you get a familiar numberin English:
- In line 1 “evif” is “five” (5) and the first number is “uno” = 1, and 5 – 1 = 4.
- In line 2 “neves” is “seven” (7) and “tres” = 3, and 7 – 3 = 4.
- In line 3 “evlewt” is “twelve” (12) and “drei” = 3, and 12 – 3 = 9.
- In lines 4 and 5 with two reversed “number-words”:
– Line 4: “xis” →“six” (6) and “ytnewt” →“twelve” (12); 6 + 12 = 18, plus 3 = 21.
– Line 5: “eerht” → “three” (3) and “ytnewt” → “twelve” (12); 3 + 12 = 15, plus 3 = 18.
Now look at the final line:
“minus one-point-two Satya eno Bill X”
It follows the same five–part format. Notice that “eno” reversed is “one” (1). And the “first number” is “minus onepoint-two” (–1.2).
Since for a one–number–word line the rule is:
final number = (number from reversed word)−(first number)
we compute: final = 1 − (−1.2) = 1 + 1.2 = 2.2
Thus, a likely completion for X is 2.2.
Phi-4-Reasoning: Phi-4-Reasoning decrypts the riddle by identifying a pattern in the examples provided. Each line consists of five parts: a number-word in a foreign language, a first name, a reversed number-word, a second name, and a final number. By reversing the third word and performing arithmetic operations, Phi-4-Reasoning determines that the likely completion for X is 2.2
What This Problem Proves:
- Complex Pattern Recognition: Phi-4-Reasoning excels in recognizing complex patterns involving multiple elements, such as foreign language number-words and reversed number-words.
- Logical Deduction: The model demonstrates its ability to apply logical deduction to solve the riddle by performing arithmetic operations based on the identified patterns.
- Versatility: Phi-4-Reasoning showcases its versatility in handling diverse types of riddles and problems, making it a valuable tool for AI developers.
Example 3. solve complex graph traversal tasks, such as finding a path through a maze.
The maze is represented as an adjacency list, which is a common way to describe graphs in computer science. Each node in the graph (or maze) is connected to other nodes, and the task is to find a valid path from the starting node (node 0) to the destination node
Example 3: Solving a maze
User:
Please solve the maze provided in adjacency list form below, by outputting a valid path from node 0 to node {destination}, in a space-separated list of integers.
Adjacency list:
{depicted as an image below}
Phi-4-Reasoning:
TRUNCATED
{path depicted as an image below}
What This Problem Proves:
- Graph Traversal Capability: Phi-4-Reasoning can effectively navigate through graphs using algorithms like Depth-First Search (DFS) or Breadth-First Search (BFS). This capability is crucial for solving problems that involve finding paths, cycles, or connectivity in graphs.
- Logical Reasoning: The model demonstrates its ability to apply logical reasoning to determine the correct sequence of nodes to traverse from the start to the destination. This involves understanding the structure of the graph and making decisions based on the connections between nodes.
- Pattern Recognition: Phi-4-Reasoning can recognize patterns in the adjacency list and use them to find a solution. This is important for tasks that require identifying and following specific paths or routes.
- Versatility: The ability to solve a maze using an adjacency list showcases the model’s versatility in handling different types of data structures and problem-solving scenarios. This is beneficial for AI developers who need to work with various data representations and algorithms.
- Efficiency: The model’s ability to quickly and accurately find a valid path through the maze highlights its efficiency in solving complex problems. This is valuable for applications that require fast and reliable solutions.
Conclusion:
Phi-4-Reasoning’s ability to solve a maze using an adjacency list demonstrates its advanced reasoning capabilities, making it a powerful tool for AI developers. Its proficiency in graph traversal, logical reasoning, pattern recognition, versatility, and efficiency makes it well-suited for tackling a wide range of complex problems.
Deployment and Integration Phi-4-Reasoning can be deployed on various platforms, including Azure AI Foundry and Hugging Face. It supports quantization using tools like Microsoft Olive, making it suitable for deployment on edge devices such as IoT, laptops, and mobile devices. Phi-4-Reasoning is a groundbreaking AI model that offers advanced reasoning capabilities, high performance, and versatility. Its ability to handle complex reasoning tasks makes it an invaluable tool for AI developers, enabling them to create innovative solutions across various industries.
References
Make Phi-4-mini-reasoning more powerful with industry reasoning on edge devices | Microsoft Community Hub
Phi-4 Reasoning Technical Paper
Phi-4-Mini-Reasoning Technical Paper
One year of Phi: Small language models making big leaps in AI | Microsoft Azure Blog
PhiCookBook
Phi-4-reasoning models on Azure AI Foundry Models
Model catalog – Azure AI Foundry
Microsoft Models on Hugging Face