Accelerating the Edge: TensorFlow Lite Unlocks 2x Performance Gains with Half-Precision Inference

By Marat Dukhan and Frank Barchard, Software Engineers at Google
In the rapidly evolving landscape of machine learning (ML), the CPU remains the most ubiquitous and accessible compute resource. While specialized hardware like NPUs (Neural Processing Units) and high-end GPUs grab headlines, the reality for the vast majority of AI-powered applications is that they must run efficiently on the standard CPUs found in billions of smartphones, tablets, and laptops. Recognizing this, Google has made optimizing CPU-based inference a core priority for the TensorFlow Lite ecosystem.
In a significant milestone for mobile and edge computing, the TensorFlow team has announced that they have successfully doubled floating-point inference performance within the XNNPack backend by enabling half-precision (FP16) inference on ARM-based CPUs. This advancement is not merely a technical optimization; it is a gateway for deploying sophisticated AI features to a broader spectrum of devices, including older and entry-level hardware that previously struggled to run complex models in real-time.
The Core Technical Shift: Moving Beyond FP32
To understand the magnitude of this breakthrough, one must examine the traditional constraints of mobile machine learning. Historically, TensorFlow Lite has relied on two primary numerical formats: 32-bit floating-point (FP32) and quantized 8-bit integers.
FP32 has long been the industry standard for research and initial development because it offers maximum numerical flexibility and ease of use. However, this flexibility comes with a heavy price tag. FP32 models are memory-intensive, requiring four times the storage and memory bandwidth compared to 8-bit quantized models. Furthermore, they often suffer from performance overhead during execution because processors must handle large, complex data structures.
Quantized 8-bit integer math offers a performance alternative, but it often necessitates complex training techniques—such as Quantization Aware Training (QAT)—to ensure the model doesn’t lose accuracy during the compression process.

Enter half-precision, or FP16. By using 16 bits instead of 32, FP16 serves as the "Goldilocks" solution. It balances the ease of implementation found in floating-point models with the performance benefits of reduced data footprints. Because the processor needs to transfer only half the bytes for each operation, and because vector units can process twice as many elements in the same clock cycle, FP16 essentially paves the way for a 2x throughput increase for floating-point models compared to the traditional FP32 approach.
A Brief History: From Research Topic to Production Reality
The journey to bring FP16 to the CPU has been a long one. For years, half-precision was largely confined to research papers and specialized GPU compute tasks. The primary barrier was hardware: early mobile chipsets lacked native support for FP16 arithmetic. Without hardware-level acceleration, attempting to perform FP16 math on a CPU would often result in performance degradation rather than improvement.
The tide began to turn around 2017. As mobile silicon evolved, manufacturers began integrating native FP16 support into their architectures to support the growing demands of mobile photography and augmented reality. Today, the landscape is vastly different. Modern mobile devices, ranging from high-end flagships to budget-conscious handsets, now feature chipsets with robust, native FP16 capabilities.
Recognizing this shift, the TensorFlow Lite team embarked on a multi-year project to integrate these capabilities into the XNNPack backend. This wasn’t a simple "switch-on" task; it required rigorous testing and optimization to ensure that the transition to FP16 would be seamless for developers and accurate for end users. The technology has now been battle-tested in some of Google’s most critical applications, including Google Assistant, Google Meet, YouTube, and the ML Kit platform, where it has consistently demonstrated a near-doubling of speed across diverse neural network architectures.
Supporting Data: Benchmarking the Gains
The impact of this update is best illustrated through real-world performance metrics. The TensorFlow team conducted extensive benchmarking across nine public models spanning various computer vision tasks, testing them on five representative mobile devices, including the Pixel 3a, Pixel 5a, Pixel 7, and the Samsung Galaxy M12 and S22.
Performance on Mobile
The results are consistent: across the board, the transition from FP32 to FP16 yields significant speedups. In single-threaded inference tests, the average performance boost is roughly 2x. This means that a model that previously took 50 milliseconds to process a frame can now potentially run in 25 milliseconds, allowing for smoother frame rates in real-time video processing or reduced latency in voice recognition tasks.

Performance on Laptops
The improvements are not limited to handheld devices. The team also benchmarked the performance on three distinct laptop architectures: the Apple MacBook Air (M1), the Microsoft Surface Pro X, and the Surface Pro 9. These platforms, which utilize ARM-based architecture, also showed remarkable efficiency gains, proving that the move to FP16 is a platform-agnostic win for the ARM ecosystem.
Official Guidelines: How Developers Can Implement FP16
For developers looking to integrate this performance boost into their own applications, the process has been streamlined to minimize friction.
Enabling FP16 in Models
To leverage the half-precision acceleration, developers must provide an FP32 model with FP16 weights. Crucially, the model must include specific "reduced_precision_support" metadata, which informs the runtime that the model is compatible with FP16 execution. This is done during the model conversion phase using the tf.lite.TargetSpec object:
# Implementation example
converter.target_spec.supported_types = [tf.float16]
converter.target_spec._experimental_supported_accumulation_type = tf.dtypes.float16
The "Transparent Deployment" Advantage
One of the most impressive features of this implementation is its intelligence. When a compatible model is delegated to XNNPack on hardware that supports native FP16, the runtime automatically swaps FP32 operators for their FP16 equivalents and manages the necessary input/output conversions. If the model is deployed on older hardware that lacks native FP16 support, the system intelligently falls back to FP32. This allows developers to maintain a single model file that provides optimal performance across a massive, heterogeneous device fleet.
Development and Debugging
For those in the development phase, Google has provided a "forced" FP16 mode. This is particularly useful for testing the end-to-end accuracy of a model under FP16 constraints. For x86/x86-64 devices with AVX2 extensions, the system can even simulate FP16 behavior. While this emulation mode is slower and intended solely for debugging, it allows developers to observe the effects of reduced mantissa precision and exponent range, ensuring their models remain robust before final deployment.
Implications for the Future of Mobile AI
The implications of this update are profound. By effectively doubling the performance of existing floating-point models, developers can now deploy "heavier" and more accurate AI models to devices that were previously considered too slow to handle them.

Broadening the Scope of Mobile AI
This democratization of performance is a significant win for the global developer community. Features that were previously exclusive to premium-tier smartphones—such as advanced background blurring in video calls, real-time object detection, or complex natural language processing—can now reach the mass market.
Future-Proofing with New Instruction Sets
The team is not stopping here. Looking ahead, Google has signaled its commitment to the x86 ecosystem as well. Recent Intel processors, specifically those with the Sapphire Rapids architecture, support native FP16 arithmetic via the AVX512-FP16 instruction set. Furthermore, the newly announced AVX10 instruction set promises to bring these capabilities to an even wider range of x86 devices. The TensorFlow team has confirmed that they are actively planning to optimize XNNPack for these architectures, ensuring that the benefits of FP16 are eventually available across the entire computing spectrum, regardless of the CPU manufacturer.
A Note of Recognition
This technical achievement is the result of collaborative effort. The TensorFlow team acknowledges the contributions of Alan Kelly, Zhi An Ng, Artsiom Ablavatski, Sachin Joglekar, T.J. Alumbaugh, Andrei Kulik, Jared Duke, and Matthias Grundmann. Their collective work has provided the infrastructure that will power the next generation of mobile AI applications, making them faster, more efficient, and more accessible than ever before.
As we move toward a future where AI is woven into every aspect of our digital lives, these low-level optimizations in TensorFlow Lite serve as a reminder that performance is not just about raw power—it is about the intelligent use of the hardware we already have in our pockets.
