Fixed Input Parameterization for Efficient Prompting

Eunbi Choi, Yongrae Jo, Joel Jang, Joonwon Jang, Minjoon SeoACL 2023

Abstract

Recent works have shown that attaching prompts to the input is effective at conditioning Language Models (LM) to perform specific tasks. However, prompts are always included in the input text during inference, even when they are fixed, thus incurring substantial computational and memory overhead. Also, there is currently no straightforward method of utilizing prompts that are longer than the maximum input length of the LMs without incurring additional costs during inference. We formally define Fixed Input Parameterization (FIP) problem that focuses on injecting the fixed prompt into the parameters of an LM to be an efficient alternative to attaching fixed prompts to the input. We show that in scenarios with long fixed prompts, FIP can be up to 280 times more efficient in terms of total FLOPs than previous approaches. We further explore methodologies for FIP and show promising results in persona-dependent conversation, semantic parsing, and zero-shot learning with task instructions. Through these explorations, we show that FIP can be a promising direction for conditioning language models, in scenarios with long and fixed prompts.

Introduction: The Prompting Tax

In modern Large Language Model (LLM) workflows, we typically control model behavior using prompts—instructions, personas, or context prepended to every user query. While effective, this "explicit prompting" approach incurs a significant computational and memory cost, particularly when prompts are long and fixed. This "prompting tax" manifests in three ways: quadratic computational overhead due to attention mechanisms, reduced memory for actual conversation context, and redundant processing of the same fixed text for every interaction.

Conceptual comparison between explicit prompting (left) and the proposed prompt injection via FIP (right).

To address this, we propose Fixed Input Parameterization (FIP). Instead of concatenating the prompt to every input, FIP "injects" the prompt directly into the model's weights. This allows the model to internalize the context, leading to massive efficiency gains—up to 280x in scenarios with very long prompts.

Methodology: Baking in the Prompt

The core challenge of FIP is transferring information from a static text prompt into the parameters of a Language Model. We explore three primary strategies for this injection:

  1. Continued Pre-training (CP): The model is fine-tuned on the prompt text using standard Masked Language Modeling (MLM), forcing it to "memorize" the content.
  2. Curriculum Learning (CP w/ CURR): An advanced version of CP that progressively increases the difficulty of the masking task to encourage deeper semantic encoding.
  3. Pseudo-INput Generation (PING): Our novel distillation-based approach.
The PING framework: Phase 1 trains an input generator to create relevant queries, and Phase 2 distills prompt-aware knowledge from a Teacher to a Student.

As shown in Figure 2, PING operates in two main phases. First, an Input Generator is trained to produce "pseudo-inputs" relevant to the prompt. Second, a Teacher model (which has access to the explicit prompt) generates responses to these pseudo-inputs. Finally, a Student model (which cannot see the prompt) is trained to mimic the Teacher's outputs, effectively distilling the prompt's influence into its own parameters.

Experimental Setup and Datasets

We evaluated FIP across three distinct domains to test its versatility:

  • Persona-dependent Conversation: Using PERSONA-CHAT and Multi-Session Chat (MSC) to test character consistency.
  • Semantic Parsing: Using the Spider dataset, where the prompt consists of a complex database schema required for SQL generation.
  • Zero-shot Learning: Using task instructions from the SuperGLUE benchmark (WSC, RTE, COPA).

Key Results and Insights

Our experiments demonstrate that FIP, particularly via the PING method, can recover a substantial portion of the performance of explicit prompting while being significantly more efficient.

  • Efficiency Gains: For prompts significantly longer than the standard context window (e.g., 28x the model's standard input length), FIP achieves up to a 280x reduction in total FLOPs during inference.
  • Scaling Laws: We observed that larger models (scaling from 220M to 3B parameters) are better at "storing" injected prompts, showing higher "FIP Scores" as parameter count increases.
  • Handling Long Contexts: FIP enables models to utilize information from sources far exceeding their native context window. For example, we successfully injected a 13,000-token Wikipedia article into a T5 model (native limit ~512 tokens), allowing it to answer persona-specific questions about Elon Musk's career and goals without the source text being present in the input during the chat.

Conclusion

Fixed Input Parameterization offers a promising path toward more efficient LLM deployment. By moving static instructions from the input sequence into the model parameters, we can bypass the computational bottlenecks of long-context prompting. While a performance gap remains compared to explicit prompting, the massive efficiency gains and the ability to handle extremely long contexts make FIP a compelling strategy for specialized, high-throughput AI agents.

Summary updated

BibTeX
@inproceedings{choi2023fixed,
  author = {Eunbi Choi and Yongrae Jo and Joel Jang and Joonwon Jang and Minjoon Seo},
  title = {{Fixed Input Parameterization for Efficient Prompting}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=toTchDhxaU},
}

Loading related content...

Figure