WeInfer: Unleashing the Power of WebGPU on LLM Inference in Web Browsers
Zhiyang Chen, Yun Ma, Haiyang Shen, Mugeng Liu
Abstract
Web-based large language model (LLM) has garnered significant attention from both academia and industry as it combines the benefits of on-device computation with the accessibility and portability of Web applications. The advent of WebGPU, a modern browser API that enables Web applications to utilize a device's GPU, has opened up new possibilities for GPU-accelerated LLM inference within browsers. However, our experiment reveals that existing Web-based LLM inference frameworks exhibit inefficiencies in GPU utilization, limiting the inference speed. These inefficiencies primarily arise from underutilizing the full capabilities of WebGPU, particularly in resource management and execution synchronization. To address these limitations, we present WeInfer, an efficient Web-based LLM inference framework specifically designed to unleash the power of WebGPU. WeInfer incorporates two key innovations: 1) buffer reuse strategies that reduce the overhead associated with resource preparation, optimizing the lifecycle management of WebGPU buffers, and 2) an asynchronous pipeline that decouples resource preparation from GPU execution, enabling parallelized computation and deferred result fetching to improve overall efficiency. We conduct extensive evaluations across 9 different LLMs and 5 heterogeneous devices, covering a broad spectrum of model architectures and hardware configurations. The results demonstrate that WeInfer delivers substantial improvements in decoding speed, achieving up to a 3.76× performance boost compared with WebLLM, the state-of-the-art Web-based LLM inference framework.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Cited by top-tier papers1
Ask how each one uses itRelated papers
- GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPUYudong Han, Weichen Bi, Ruibo An, Deyu Tian et al.WWW 2025 · 3 citations
- SPIN: Accelerating Large Language Model Inference with Heterogeneous Speculative ModelsFahao Chen, Peng Li, Tom H. Luan, Zhou Su et al.INFOCOM 2025 · 10 citations
- DynamicInfer: Runtime-Aware Sparse Offloading for LLMs Inference on a Consumer-Grade GPUZhui Zhu, Weichen Zhang, Zhenghan Zhou, Yunhao Liu et al.ICLR 2026
- PipeInfer: Accelerating LLM Inference using Asynchronous Pipelined SpeculationBranden Butler, Sixing Yu, Arya Mazaheri, Ali JannesariSC 2024 · 12 citations
- LightRetriever: A LLM-based Text Retrieval Architecture with Extremely Faster Query InferenceGuangyuan Ma, Yongliang Ma, Xuanrui Gou, Zhenpeng Su et al.ICLR 2026 · 3 citations
