Skip to content

PTMO: Enable Neural Network for Elastic Matryoshka Inference at Low-Cost

Tianyi Chen, Christina Huang, Jiachen Sun, Anil Ramakrishna, Daqi Sun, Kevin Huang, Zhou Fang, Baekjin Kim, Mingfu Liang, Feng Qi, Zaiwei Zhang, Yanhui Guo, Dian Yu, Yufei Li, Yavuz Yetim, Gaoxiang Liu, Jean-Pascal Billaud, Sandeep Pandey, Frank Shyu, Xi Liu, Luke Simon

cs.AI

Abstract

Elastic Matryoshka inference allows a single deep neural network to activate subnetworks of different widths in a nested manner to accommodate varying serving budgets. However, constructing such nested networks typically requires costly specialized training. We introduce Post-Training Matryoshka Optimization (PTMO), a framework that reparameterizes pretrained neural networks into Matryoshka-friendly representations without additional training. PTMO comprises three dedicated algorithmic components: (i) identifying and partitioning the network variables into groups that admit function-preserving permutations or orthogonal transformations (MPIGs); (ii) applying composed importance-based transformation to MPIGs; and (iii) allocating heterogeneous widths across MPIGs via budget orchestration to construct nested subnetworks for multiple serving budgets. PTMO supports two complementary use cases. When the resulting subnetworks have meet the desired quality targets, they can be used directly for nested-width inference. When further adaptation is needed, PTMO provides a favorable initialization to accelerate the convergence of Matryoshka-aware training (MAT). Evaluations of convolutional networks, vision-language models, large language models, and diffusion language models across diverse applications, including generative recommendation, image classification, and common-sense reasoning, demonstrate the generality and efficacy of PTMO.

Create a lesson