Dynamic Client-Server Small Language Model Inference
Research Area
Web Engineering
Students
Advisers
Small Language Models (SLMs) enable natural language interactions for tasks such as content generation, query understanding, and conversational assistance. Recent advances in browser-based machine learning through WebGPU and WebAssembly allow client devices to achieve near-native inference performance. Their current deployment strategies are static: either full client-side execution, constrained by device capabilities and energy budgets, or cloud-based inference, which incurs network latency, operational costs, and privacy concerns. Dynamic workload distribution between client and server could optimize resource utilization and reduce operational costs through selective local processing. The DCM approach provides an architectural basis for dynamic code mobility in web applications at runtime. However, SLM inference introduces distinct challenges: preserving conversational state across execution transitions, maintaining dialogue coherence during migration, and SLM execution within browser constraints.
This thesis aims at adapting the DCM approach to enable the dynamic distribution of SLM inference workloads between browser-based and server-based execution environments at runtime. The solution needs to implement runtime decision-making based on client capabilities and server load, develop context synchronization mechanisms that preserve conversational state during execution transitions, and ensure consistent model outputs regardless of execution location. The supporting infrastructure needs to deploy SLM instances to both client and server environments, provide adaptive orchestration that routes inference requests based on real-time resource availability, and demonstrate feasibility through a practical conversational application scenario.
The objective of this thesis is the creation of a method and supporting software infrastructure to solve the problem of adaptive SLM inference distribution in web applications with conversational user interfaces through an adaption of the DCM architecture as described above. This comprises the analysis of the state of the art in browser-based language model execution and code mobility/distributed inference systems as well as the demonstration of the solution by prototypical implementation and a suitable evaluation based on experimentation regarding performance, context preservation quality, cost efficiency, and migration overhead under representative conditions.