<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Microsoft · LLMobile.news</title><link>https://llmobile.kavents.com/tags/microsoft/</link><description>A concise news ticker covering AI on mobile devices, local models, apps and hardware.</description><language>en-GB</language><atom:link href="https://llmobile.kavents.com/tags/microsoft/index.xml" rel="self" type="application/rss+xml"/><item><title>Microsoft runs Phi-3-mini offline on an iPhone 14 at over 12 tokens per second</title><link>https://llmobile.kavents.com/ticker/phi-3-mini/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/phi-3-mini/</guid><pubDate>Mon, 22 Apr 2024 18:00:00 +0200</pubDate><description>Microsoft introduced Phi-3-mini on April 22, 2024, a 3.8-billion-parameter model trained on 3.3 trillion tokens. The technical report puts it at 69 percent on MMLU and 8.38 on MT-bench, which the authors say rivals models such as Mixtral 8x7B and GPT-3.5.
Quantised to 4 bits the model occupies about 1.8 GB, small enough for a phone. The report describes the test directly.
We tested the quantized model by deploying phi-3-mini on iPhone 14 with A16 Bionic chip running natively on-device and fully offline achieving more than 12 tokens per second.
Screenshots: Microsoft, Figure 1 of the technical report. The same report covers two larger siblings, Phi-3-small at 7B parameters and Phi-3-medium at 14B, both trained on 4.8 trillion tokens. Microsoft reports 75 percent on MMLU for the small model and 78 percent for the medium one.
Source: https://arxiv.org/abs/2404.14219
Read the article: https://llmobile.kavents.com/ticker/phi-3-mini/</description><category>Microsoft</category><category>Phi</category><category>iPhone</category><category>Quantisation</category><category>Open weights</category></item><item><title>BitNet b1.58 gives every weight three values and runs 3B in 2.22 GB</title><link>https://llmobile.kavents.com/ticker/bitnet-b1-58/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/bitnet-b1-58/</guid><pubDate>Tue, 27 Feb 2024 19:56:00 +0100</pubDate><description>Microsoft Research and the University of Chinese Academy of Sciences published BitNet b1.58 on February 27, 2024, a language model in which every single weight is one of three values, -1, 0 or 1. At 3B parameters the authors measure it at 2.22 GB of memory against 7.89 GB for a full-precision Llama-style model of the same size trained on the same number of tokens, a 3.55 times reduction, with a slightly lower perplexity of 9.91 against 10.04.
Three possible values need log2(3) bits to store, which is roughly 1.58 and where the name comes from. What that buys is a change to the matrix multiplication that dominates the work of running a model. A normal model multiplies each weight by an activation in floating point and sums the products, but multiplying by -1, 0 or 1 is only a sign flip, a skip or a copy, so the paper states that the matrix multiplication of BitNet &amp;amp;ldquo;only involves integer addition&amp;amp;rdquo;. Activations stay at 8 bits.
The models are trained from scratch at this precision rather than trained in full precision and squeezed down afterwards, which is how most low-bit models on phones are produced today. The authors trained BitNet b1.58 and their own reproduced Llama baseline on the same data for the same number of tokens at each size, and compare the two directly. They report that BitNet b1.58 starts to match the full-precision baseline in perplexity at 3B and on zero-shot end tasks from 3B as well, where it averages 50.2 against 49.7.
The efficiency figures widen with size. Memory drops 2.60 times at 700M, 2.93 times at 1.3B and 3.55 times at 3B, and latency per output token falls 1.23 times, 1.67 times and 2.71 times across the same three sizes. For throughput the authors ran 70B models on two A100 cards and report a batch size of 176 against 16 and 2977 tokens per second against 333, an 8.9 times gain. They also calculate that on 7nm chips the arithmetic for matrix multiplication costs 71.4 times less energy, because integer addition is far cheaper than floating-point multiply-accumulate.
The paper names no model release and its arXiv listing marks it as work in progress. The authors argue the approach suits CPUs, &amp;amp;ldquo;which are the main processors used in edge and mobile devices&amp;amp;rdquo;, and say the lower memory and energy cost is what would let such models run there. They close by calling for new hardware and systems designed specifically for 1-bit models.
Update, April 16, 2025. Microsoft released BitNet b1.58 2B4T, a 2B model trained from scratch on 4 trillion tokens at ternary precision, which the team calls the first open-source native 1-bit model at that scale. The report puts its non-embedding memory at 0.4 GB against 1.4 GB for Gemma-3 1B and 2.6 GB for Qwen2.5 1.5B, measures CPU decoding at 29 ms per token on a 13th Gen Intel Core i7-13800H using 8 threads against 41 ms and 65 ms for the same two models, and estimates energy at 0.028 J against 0.186 J and 0.347 J. Across the benchmark suite it averages 54.19, above Llama 3.2 1B at 44.90 and just under Qwen2.5 1.5B at 55.23. The weights are on Hugging Face, with a custom CUDA kernel for GPUs and CPU inference through bitnet.cpp, the runtime Microsoft published in October 2024 and measured at 2.37 to 6.17 times faster than the baseline on x86 CPUs and 1.37 to 5.07 times faster on ARM.
Source: https://arxiv.org/abs/2402.17764
Read the article: https://llmobile.kavents.com/ticker/bitnet-b1-58/</description><category>Microsoft</category><category>Research</category><category>Quantisation</category><category>Memory</category><category>Chips</category></item><item><title>Microsoft releases Phi-2, a 2.7B model it says matches models 25 times larger</title><link>https://llmobile.kavents.com/ticker/phi-2/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/phi-2/</guid><pubDate>Tue, 12 Dec 2023 18:00:00 +0100</pubDate><description>Microsoft released Phi-2 on December 12, 2023, a base language model with 2.7 billion parameters. The company says that on complex benchmarks it matches or outperforms models up to 25 times larger, and that it surpasses Mistral and Llama-2 at 7B and 13B parameters on various aggregated benchmarks. Microsoft&amp;amp;rsquo;s own table scores Phi-2 at 53.7 on grouped coding benchmarks against 38.3 for Llama-2-70B, and at 61.1 on math against 64.1 for the same model. Against Google&amp;amp;rsquo;s Gemini Nano 2 at 3.2B, Microsoft reports 59.3 versus 42.4 on BigBench-Hard and 59.1 versus 27.2 on MBPP, using Google&amp;amp;rsquo;s own reported figures for the comparison.
Microsoft trained the model on 1.4 trillion tokens from multiple passes over a mixture of synthetic and web data for language and code, following what it calls textbook-quality data. The synthetic sets were written to teach common sense reasoning and general knowledge such as science, daily activities and theory of mind, and the web portion was filtered for educational value and content quality. The model card puts the underlying dataset at 250 billion tokens, combining synthetic text generated with GPT-3.5 and web data from Falcon RefinedWeb and SlimPajama that was assessed with GPT-4.
Microsoft did not train Phi-2 from scratch. It started from the 1.3-billion-parameter Phi-1.5 and embedded that model&amp;amp;rsquo;s knowledge inside the larger one, a step the company says both accelerates training convergence and raises Phi-2&amp;amp;rsquo;s benchmark scores. Training then took 14 days on 96 A100 GPUs, and the model card lists a context length of 2048 tokens. Phi-2 is a base model that went through neither reinforcement learning from human feedback nor instruction tuning.
Chart: Microsoft&amp;amp;#39;s own evaluation figures for the two models. Microsoft published the weights in the Azure AI Studio model catalog and on Hugging Face, where the first model card, dated December 13, 2023, named the Microsoft Research License and limited use to research. Microsoft replaced that file on January 5, 2024, and the model card has since stated &amp;amp;ldquo;The model is licensed under the MIT license&amp;amp;rdquo;, which the repository&amp;amp;rsquo;s commit history dates to that day.
Source: https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/
Read the article: https://llmobile.kavents.com/ticker/phi-2/</description><category>Microsoft</category><category>Phi</category><category>Benchmarks</category><category>Research</category><category>Open weights</category></item><item><title>Microsoft carries its textbook data recipe from code to reasoning with the 1.3B phi-1.5</title><link>https://llmobile.kavents.com/ticker/phi-1-5/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/phi-1-5/</guid><pubDate>Mon, 11 Sep 2023 16:00:00 +0200</pubDate><description>Microsoft Research published phi-1.5 on September 11, 2023, a 1.3-billion-parameter model that applies the synthetic textbook data approach of phi-1 to common sense reasoning and general world knowledge rather than Python code. The authors report common sense benchmark results comparable to models ten times the size trained on more than ten times as much data, and describe natural language performance as comparable to models five times larger.
phi-1.5 scores 0.734 on WinoGrande against 0.691 for Llama2-7B, 0.444 on ARC-Challenge against 0.434, and 0.526 on SIQA against 0.480, all measured in Microsoft&amp;amp;rsquo;s own evaluation pipeline. The gap widens on multi-step reasoning, with 40.2 on GSM8K grade-school maths against 14.6 for Llama2-7B, 34.1 on HumanEval against 12.8, and 37.7 on MBPP against 20.8, which the authors note puts its coding scores at or above Llama-65B. MMLU runs the other way, at 0.376 for phi-1.5 and 0.453 for Llama2-7B.
Chart: Microsoft, Figure 1 of the technical report. The training set combines 7B tokens from phi-1 with roughly 20B tokens of newly generated textbook-like text, seeded from 20,000 selected topics spanning science, daily activities and theory of mind. That yields a 30B-token dataset whose only non-synthetic part is 6B tokens of filtered code, and training runs over 150B tokens, 80 percent of them from the new synthetic data. Microsoft puts the cost at 1,500 GPU hours on a single A100-80G, against more than 80,000 hours for Llama-7B.
The same report covers two variants built to test what web data adds. phi-1.5-web-only trains purely on 95B tokens of filtered web text, 88B of it from the Falcon RefinedWeb dataset and 7B of code from The Stack and Stack Overflow, while phi-1.5-web mixes filtered web data, phi-1&amp;amp;rsquo;s code and the synthetic text in shares of roughly 40, 20 and 40 percent. phi-1.5-web comes out ahead on reasoning at 44.6 on GSM8K, 41.4 on HumanEval and 43.5 on MBPP.
The authors list hallucinations and the potential for toxic and biased generations among the traits phi-1.5 shares with larger models, and write that it &amp;amp;ldquo;is not immune&amp;amp;rdquo; despite the absence of web data in its training set. On an 86-prompt probe they wrote themselves, phi-1.5 passed 47 and failed 34, while Llama2-7B and Falcon-7B failed 54 and 50. Microsoft released the raw base model with no instruction fine-tuning and no RLHF, and the weights sit on Hugging Face under the MIT license.
Source: https://arxiv.org/abs/2309.05463
Read the article: https://llmobile.kavents.com/ticker/phi-1-5/</description><category>Microsoft</category><category>Phi</category><category>Research</category><category>Benchmarks</category><category>Open weights</category></item><item><title>Microsoft trains phi-1 to 50.6 percent on HumanEval with 1.3B parameters</title><link>https://llmobile.kavents.com/ticker/phi-1/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/phi-1/</guid><pubDate>Tue, 20 Jun 2023 18:14:00 +0200</pubDate><description>Microsoft Research published phi-1 on June 20, 2023, a Python code model with 1.3B parameters. The paper reports 50.6 percent pass@1 on HumanEval and 55.5 percent on MBPP, pass@1 being the share of problems the model solves with its first generated answer. The same table lists StarCoder at 15.5B parameters and 1 trillion training tokens with 33.6 percent and 52.7 percent, GPT-3.5 at 175B parameters with 47 percent, and CodeGen-Mono at 16.1B parameters and 577B tokens with 29.3 percent.
The training data comes to under 7B tokens in three parts. About 6B tokens are Python files pulled from The Stack and StackOverflow by a classifier the authors trained on roughly 100,000 GPT-4 ratings of how instructive a snippet is for someone learning to code. Under 1B tokens are synthetic Python textbooks written by GPT-3.5, and about 180M tokens are synthetic exercises with solutions, used only in the finetuning step that turns phi-1-base into phi-1.
Microsoft ran the training on 8 Nvidia A100 GPUs, reaching the base model in under 4 days and spending another 7 hours on the finetuning. That amounts to about 8 passes over the pretraining data and a little over 50B tokens seen, which the paper&amp;amp;rsquo;s chart puts at 1090 GPU hours for the 1.3B run.
Chart: Microsoft, Figure 2.1 of the paper. The GPU hours on the axis are the authors&amp;amp;#39; own figures. The same pipeline at 350M parameters yields phi-1-small, which the authors put at 45 percent on HumanEval and use to argue that parameter count still drives which capabilities appear at all. Microsoft posted phi-1 on Hugging Face in September 2023, where the model card lists the MIT license.
Source: https://arxiv.org/abs/2306.11644
Read the article: https://llmobile.kavents.com/ticker/phi-1/</description><category>Microsoft</category><category>Phi</category><category>Research</category><category>Benchmarks</category><category>Open weights</category></item><item><title>ONNX Runtime 1.5 adds a mobile build that ships only the operators a model uses</title><link>https://llmobile.kavents.com/ticker/onnx-runtime/</link><guid isPermaLink="true">https://llmobile.kavents.com/ticker/onnx-runtime/</guid><pubDate>Tue, 29 Sep 2020 19:00:00 +0200</pubDate><description>Microsoft released ONNX Runtime 1.5 on September 29, 2020 with a preview of ORT for Mobile Platforms, described in the release notes as minimising build size for mobile and embedded devices. The same release added a reduced operator kernel build, which compiles the runtime with only the operators the target models actually use, and the ORT model format that those reduced builds require. The format documentation records version 1 of the ORT format as introduced in 1.5.
Diagram: ONNX Runtime documentation. The pre-built mobile packages, onnxruntime-android for Java, C and C++ and onnxruntime-c and onnxruntime-objc for iOS, carry the full operator set and load .onnx files directly, while a custom build takes models converted to the .ort format. Microsoft&amp;amp;rsquo;s mobile guide puts numbers on the difference for version 1.18.0, where a custom build supporting the operators of a ResNet50 model produces an Android AAR of 7,532,309 bytes against 24,415,212 bytes for the pre-built package, and an arm64-v8a libonnxruntime.so of 3,962,832 bytes against 16,276,832 bytes.
Accelerators are called execution providers. The NNAPI provider requires Android 8.1 or higher and is recommended on Android 9 or higher, the Core ML provider requires iOS 13 or macOS 10.15 and higher, and the XNNPACK provider covers floating-point CPU work on both platforms. Microsoft&amp;amp;rsquo;s guidance is to start on the CPU provider for a quantised model and on XNNPACK otherwise, then try NNAPI or Core ML if that misses the performance target. The QNN provider reaches Qualcomm Snapdragon chips on Android and Windows through the Qualcomm AI Engine Direct SDK, with pre-built packages for Windows only and an HTP backend that takes quantised models only.
Quantisation in ONNX Runtime is 8-bit linear quantisation, offered as dynamic and static post-training quantisation in two representations, QOperator with dedicated quantised operators and QDQ with QuantizeLinear and DequantizeLinear pairs inserted around the originals. The mobile guide states that moving 32-bit weights to 8 bits cuts model size by roughly a factor of 4. The tooling also does block-wise weight-only quantisation to int4 and uint4 for MatMul and Gather nodes, with RTN, HQQ and GPTQ algorithms, and models with GatherBlockQuantized nodes need ONNX Runtime 1.20 or later to run.
Generative models run through the separate onnxruntime-genai package, which implements the generation loop, KV cache management, search and sampling around the runtime. Its support matrix lists Android as supported and iOS as on the roadmap, with CPU, QNN, WebGPU, CUDA, DirectML and OpenVINO among the acceleration options. Microsoft reported in April 2024 that RTN int4 quantisation shrinks Phi-3 Mini enough to run on a Samsung Galaxy S21 at what it called a moderate speed, and recommends the int4_accuracy_level=4 variant on mobile. Both projects are published under the MIT license.
Source: https://github.com/microsoft/onnxruntime/releases/tag/v1.5.1
Read the article: https://llmobile.kavents.com/ticker/onnx-runtime/</description><category>Microsoft</category><category>Android</category><category>iOS</category><category>Quantisation</category><category>Developer tools</category></item></channel></rss>