Table of Contents
Fetching ...

OTAS: An Elastic Transformer Serving System via Token Adaptation

Jinyu Chen, Wenchao Xu, Zicong Hong, Song Guo, Haozhao Wang, Jie Zhang, Deze Zeng

TL;DR

OTAS tackles elastic serving of large transformers under dynamic workloads by introducing token adaptation: prompting to boost accuracy and reduction to accelerate inference, guided by adaptive batching. It replaces multi-variant model training with a unified token-space manipulation, and optimizes per-batch token changes via a dynamic programming approach under latency and memory constraints. The method achieves substantial utility gains, outperforming model-adaptation and fixed-token baselines on both synthetic and real azure traces. This work reveals a practical design space for transformer serving centered on token-level control, with significant implications for cloud AI workloads.

Abstract

Transformer model empowered architectures have become a pillar of cloud services that keeps reshaping our society. However, the dynamic query loads and heterogeneous user requirements severely challenge current transformer serving systems, which rely on pre-training multiple variants of a foundation model, i.e., with different sizes, to accommodate varying service demands. Unfortunately, such a mechanism is unsuitable for large transformer models due to the additional training costs and excessive I/O delay. In this paper, we introduce OTAS, the first elastic serving system specially tailored for transformer models by exploring lightweight token management. We develop a novel idea called token adaptation that adds prompting tokens to improve accuracy and removes redundant tokens to accelerate inference. To cope with fluctuating query loads and diverse user requests, we enhance OTAS with application-aware selective batching and online token adaptation. OTAS first batches incoming queries with similar service-level objectives to improve the ingress throughput. Then, to strike a tradeoff between the overhead of token increment and the potentials for accuracy improvement, OTAS adaptively adjusts the token execution strategy by solving an optimization problem. We implement and evaluate a prototype of OTAS with multiple datasets, which show that OTAS improves the system utility by at least 18.2%.

OTAS: An Elastic Transformer Serving System via Token Adaptation

TL;DR

OTAS tackles elastic serving of large transformers under dynamic workloads by introducing token adaptation: prompting to boost accuracy and reduction to accelerate inference, guided by adaptive batching. It replaces multi-variant model training with a unified token-space manipulation, and optimizes per-batch token changes via a dynamic programming approach under latency and memory constraints. The method achieves substantial utility gains, outperforming model-adaptation and fixed-token baselines on both synthetic and real azure traces. This work reveals a practical design space for transformer serving centered on token-level control, with significant implications for cloud AI workloads.

Abstract

Transformer model empowered architectures have become a pillar of cloud services that keeps reshaping our society. However, the dynamic query loads and heterogeneous user requirements severely challenge current transformer serving systems, which rely on pre-training multiple variants of a foundation model, i.e., with different sizes, to accommodate varying service demands. Unfortunately, such a mechanism is unsuitable for large transformer models due to the additional training costs and excessive I/O delay. In this paper, we introduce OTAS, the first elastic serving system specially tailored for transformer models by exploring lightweight token management. We develop a novel idea called token adaptation that adds prompting tokens to improve accuracy and removes redundant tokens to accelerate inference. To cope with fluctuating query loads and diverse user requests, we enhance OTAS with application-aware selective batching and online token adaptation. OTAS first batches incoming queries with similar service-level objectives to improve the ingress throughput. Then, to strike a tradeoff between the overhead of token increment and the potentials for accuracy improvement, OTAS adaptively adjusts the token execution strategy by solving an optimization problem. We implement and evaluate a prototype of OTAS with multiple datasets, which show that OTAS improves the system utility by at least 18.2%.
Paper Structure (17 sections, 1 theorem, 1 equation, 13 figures, 2 tables, 3 algorithms)

This paper contains 17 sections, 1 theorem, 1 equation, 13 figures, 2 tables, 3 algorithms.

Key Result

Theorem 1

The problem equa:optim is an NP-hard problem.

Figures (13)

  • Figure 1: Comparison between model adaptation and token adaption.
  • Figure 2: The vision transformer model. The image is split into patches, projected with linear network and added with position embeddings. The tokens are forwarded to the transformer encoder that contains normalization, multi-head attention and multi-layer perception.
  • Figure 3: Token prompting and token merge.
  • Figure 4: Accuracy and throughput comparison when we change the numbers of tokens.
  • Figure 5: The framework of OTAS, which can assign a query to a batch and allocate the token number automatically.
  • ...and 8 more figures

Theorems & Definitions (2)

  • Theorem 1
  • Proof 1