Ruihang Lai
· 2 previous affiliations
- Carnegie Mellon UniversitySince 2022
- PhD student · Since 2022
- Shanghai Jiao Tong University2018–2022
- Undergrad student · 2018–2022
Research Overview
Ruihang Lai focuses on machine learning compilation, system optimization for emerging hardware, and the efficient deployment of large language models. His work spans from foundational tensor program abstractions to high-performance inference engines that handle dynamic shapes, sparsity, and complex control flow. Currently, he investigates composable compiler architectures and advanced serving systems to accelerate generative models across diverse computing platforms.
Research Trajectory
During his doctoral studies at Carnegie Mellon University, Lai's early research focused on automating and optimizing tensor computations for deep learning. With collaborators, he contributed to Tensor Program Optimization with Probabilistic Programs (2022), introducing MetaSchedule, a probabilistic programming language abstraction designed to construct rich search spaces for tensor programs. This foundational work helped simplify how domain experts propose stochastic choices for program transformations, contributing to the broader area of Bridging the Software-Hardware Gap for Specialized Accelerators.
Moving into 2023, his focus expanded to handle the complexities of sparse and tensorized workloads. He co-developed SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning, addressing the difficulty of maximizing hardware efficiency for sparse operators by leveraging composable formats and transformations. Alongside this, he participated in the development of TensorIR: An Abstraction for Automatic Tensorized Program Optimization, further advancing automatic optimization techniques for deep learning compilers.
As large language models (LLMs) became central to machine learning, his research shifted toward optimizing their deployment across diverse and constrained environments. In 2024, he contributed to WebLLM: A High-Performance In-Browser LLM Inference Engine, a framework utilizing WebGPU and machine learning compilers to bring hardware-accelerated inference directly to web browsers. This work intersects with the research direction of Performance Portability for Heterogeneous Hardware Abstraction. To address the software engineering challenges of deploying models on emerging platforms like Metal and Vulkan, he collaborated on Emerging Platforms Meet Emerging LLMs: A Year-Long Journey of Top-Down Development, introducing the TapML tooling pipeline to streamline system deployment. In the realm of server-side inference, he co-authored A System for Microserving of LLMs. This project proposed breaking monolithic LLM inference into fine-grained, programmable micro-actions, enabling dynamic serving strategies like prefill-decode disaggregation to significantly reduce job completion times.
His recent work in 2025 culminates in comprehensive compiler abstractions and specialized inference engines. He introduced Relax: Composable Abstractions for End-to-End Dynamic Machine Learning, a novel compiler abstraction that unifies computational graphs, tensor programs, and external libraries to optimize dynamic models end-to-end for diverse hardware backends. To support the growing need for structured outputs in LLM agents, he participated in developing XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models. This engine optimizes context-free grammar execution during runtime, advancing the research direction of Grammar Constrained Decoding for Structured LLM Generation and the broader area of Constrained Decoding for Structured and Lexical Generation, as well as work in Reconciling Sub-word Tokenization with Structural Constraints.
Addressing long-context generation, he collaborated on MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decoding. By leveraging sparse KV cache drafting, this work achieves significant speedups at high batch sizes, contributing to the area of Managing the Latency Throughput Tradeoff in Machine Learning Serving. Finally, he contributed to FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Serving, which utilizes a block-sparse format for KV-cache storage and a Just-In-Time (JIT) compiler to accelerate diverse attention variants.
Current Directions
The most recent papers in the evidence indicate a strong focus on optimizing the serving and execution of large language models, particularly under dynamic and complex constraints. Recent work investigates end-to-end compiler abstractions that can seamlessly handle dynamic shapes and control flow across diverse hardware backends. Additionally, there is a clear emphasis on breaking traditional performance bottlenecks in LLM inference. This includes developing specialized attention engines, utilizing speculative decoding to manage latency and throughput in long-context scenarios, and engineering efficient runtime systems for structured, grammar-constrained generation.
Profile updated
Loading new papers…
Other researchers whose papers cluster into the same research directions — a proxy for overlapping technical interests and shared intellectual neighborhoods.
See something wrong? Report a mistake