Yaligar, Shashidhar (2025) Browser-Native Machine Learning: WebAssembly and WebGPU-Accelerated Training for Classical Text Classification Models. Masters thesis, Dublin, National College of Ireland.
Preview |
PDF (Master of Science)
Download (1MB) | Preview |
Preview |
PDF (Configuration Manual)
Download (3MB) | Preview |
Abstract
This paper explores the viability, performance properties, and design needs of the possibility of training a complete machine learning in a web browser using WebAssembly (WASM) and the newly announced WebGPU interface. Although similar inference has been investigated in the recent literature, in-browser training of machine learning models has not been investigated extensively. To fill this gap, the paper creates a full, client-side text classification system, which does preprocessing, vectorisation, model training and evaluation without the use of the server. Itis a system that was programmed in Rust-compiled WASM and executed using WebGPU compute shaders to execute a multinomial logistic regression model. Two other models are used: a linear Support Vector Machine (SVM) and a shallow Multi-Layer Perceptron (MLP) which are used as baselines in the the given deterministic pipeline to enable controlled comparisons. An equal number of BBC News entries are sampled to test accuracy-time trade-offs, computational stability and memory behaviour among model types. Documents are preprocessed in a uniform pipeline such as normalization, rule-based tokenisation and converting them to a 5,000 term bag-of-words representation to allow reproducibility. According to experimental results WebGPU-accelerated logistic regression is reliably converging and has 84% accuracy and 84.26% macro-F1, which is very similar to MLP baseline (82% accuracy). The simple hinge-loss optimisation without regularisation (SVM baseline) has a very low performance (20% accuracy) under the high-dimensional sparsified text features. The measurement of training time shows the advantage of WebGPU in efficiency, where the training of logistic regression would take 2.5 seconds, whereas it took 19 seconds to train the CPU-bound MLP. The results prove that meaningful, stable, and competitive text classification models can be very easily trained completely in-browser despite limited data and restricted hyperparameter optimization. It provides a modular, reproducible WebGPU-based architecture, a comprehensive analysis of WebGPU compute behaviour, and support that classical ML models may effectively run on the client-side to support privacy-preserving edge intelligence. The resulting architecture gives a basis to further research on larger datasets, more extensive feature engineering, more optimisation schemes, and fully GPU-implemented classical models.
| Item Type: | Thesis (Masters) |
|---|---|
| Supervisors: | Name Email Khan, Sallar UNSPECIFIED |
| Subjects: | Q Science > QA Mathematics > Electronic computers. Computer science T Technology > T Technology (General) > Information Technology > Electronic computers. Computer science P Language and Literature > P Philology. Linguistics > Computational linguistics. Natural language processing Q Science > Q Science (General) > Self-organizing systems. Conscious automata > Machine learning |
| Divisions: | School of Computing > Master of Science in Data Analytics |
| Depositing User: | Ciara O'Brien |
| Date Deposited: | 09 Sep 2026 11:20 |
| Last Modified: | 09 Sep 2026 11:20 |
| URI: | https://norma.ncirl.ie/id/eprint/9929 |
Actions (login required)
![]() |
View Item |
Tools
Tools