Prefix-Tuning for Arbitrary Output Sequences on Pretrained Transformers
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 , does there always exist a prefix such that prepending to induces the model to generate the target output ? In this work, we prove that under the assumption that is in the range of the pretrained Transformer, such a prefix 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.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
- Comments
- Accepted at NeurIPS 2026. Code: https://github.com/wzii/prefix_tuning. Online demo: https://wzii.github.io/prefix_tuning/
Related papers
Many Biases, One Circuit: Post-Training Tunes a Pretrained Cue-Routing Mechanism
Shared title terminologycs.CLPrakhar Gupta, Terry Jingchen Zhang, Zhijing Jin
Look Back, Draft Ahead: Corrective Prefix Attention for Parallel Speculative Decoding
Shared title terminologycs.CLMohammad Mahdi Moradi, Ali Pourranjbar, Zongzuo Wang et al.
Unlocking the Power of Loops in Pretrained LLMs with Loop Residuals
Shared title terminologycs.CLXuanlei Zhao, Hailun Xu, Kai Wang et al.
The Temporal Residual: Fast and Effective Retrofitting of Latent Feedback into Pretrained Language Models
Shared title terminologycs.CLZiyang Cai, Xingyu Zhu, Sanjeev Arora
Grammar Sparsity Sets How Transformers Learn Random Languages
Shared title terminologycs.CLEdgar Andres Hernandez Moreno, Francesco Cagnetta
Medical Specialty Prediction from Bangla Patient Narratives: A Comparative Study of ML, DL, Transformers, and LLMs
Shared title terminologycs.CLTasnin Tabassum Ali, Faisal Ahmed, Muhammad Anwarul Azim