cs.CLOct 16, 2026

Prefix-Tuning for Arbitrary Output Sequences on Pretrained Transformers

Authors: Peter Cho-Ho Lam, Ziyi Wang, Zirui Zhou

Organizations: Huawei Technologies Canada Co., Ltd.

Abstract

Prefix-tuning is a parameter-efficient fine-tuning method for large language models (LLMs) that steers model outputs by prepending task-specific prefix representations to the input sequence. Despite its practical success, the theoretical understanding of the expressiveness of prefixes remains incomplete. In particular, the following question remains open: Given a pretrained autoregressive Transformer, for any input-output sequence pair (x,y)(\mathtt{x},\mathtt{y}), does there always exist a prefix S\mathcal{S} such that prepending S\mathcal{S} to x\mathtt{x} induces the model to generate the target output y\mathtt{y}? In this work, we prove that under the assumption that y\mathtt{y} is in the range of the pretrained Transformer, such a prefix S\mathcal{S} exists and can be explicitly computed by solving multiple linear systems. We further show that this assumption is necessary, in the sense that such a prefix may not exist when the assumption fails, thereby providing a complete answer to the above question. Our analysis is constructive and the obtained theoretical results hold under fairly general assumptions on model architecture. Extensive experiments on GPT-2 and Qwen3-4B demonstrate that our algorithm produces prefixes with strong control over model outputs.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Prefix Parsing is Just Parsing

    Apr 23, 2026Clemente Pasti, Andreas Opedal, Timothy J. O'Donnell +2Grammar-Constrained Decoding

  2. How Many Different Outputs Can a Transformer Generate?

    May 21, 2026Maxime Meyer, Mario Michelessa, Caroline Chaux +1Transformer ExpressivityTransformer

  3. Learning When Not to Listen: Selective Anti-Interference Pretraining for Language Models

    Aug 22, 2026Jinchang Zhu, Haowei He, Yi Ding +5Language Model PretrainingLanguage Model Robustness