Behavior-Equivalent Token: Single-Token Replacement for Long Prompts in LLMs

Jiancheng Dong, Pengyue Jia, Jingyu Peng, Maolin Wang, Yuhao Wang, Lixin Su, Xin Sun, Shuaiqiang Wang, Dawei Yin, Xiangyu Zhao · OpenReview

Abstract

Carefully engineered system prompts play a critical role in guiding the behavior of LLM agents, but their considerable length introduces significant drawbacks, including increased inference latency, higher computational cost, and reduced effective context length. This raises the question of whether such lengthy prompts can be replaced by a drastically reduced number of tokens while preserving their behavioral effect on downstream tasks. To enable this, we propose a lightweight three-stage training framework that learns a single prompt-specific Behavior-Equivalent token ([BE]). The framework first trains [BE] to encode the natural-language content of the original system prompt via reconstruction, and then distills the prompt's downstream behavior into this single token. Importantly, our method requires no access to model internals, no auxiliary compression models, and no labeled responses. Empirical evaluations on three datasets show that a single [BE] token achieves up to a 3000x reduction in prompt length, while retaining about 98% of the downstream performance of the original system prompts. This substantially reduces inference cost and leaves almost the entire context window available for user inputs.

Introduction: The Cost of Persona

In the ecosystem of Large Language Models (LLMs), system prompts serve as the essential "steering wheel." They define an agent’s persona, tone, and specific operational constraints. However, as these prompts become more sophisticated, they often grow to consume thousands of tokens. This creates three primary challenges for practical deployment:

  1. Latency: LLMs must process the entire system prompt before generating the first token of a response (Time-to-First-Token or TTFT).
  2. Computational Cost: Long prompts increase overhead and KV-cache storage requirements.
  3. Context Limitations: Every token dedicated to a system prompt is one less token available for the user’s query or the model’s generated context.
Extracted figure from page 1 of Behavior-Equivalent Token: Single-Token Replacement for Long Prompts in LLMs

While existing solutions like "soft prompts" or "memory tokens" exist, they often struggle to capture complex reasoning or fail to maintain behavioral nuances across diverse user queries. This research introduces the Behavior-Equivalent ([BE]) token, a single-token replacement that preserves the model's intended behavior with extreme efficiency.

Methodology: The Three-Stage Framework

The core of this approach is a lightweight training framework designed to compress content while aligning behavior. Unlike traditional methods, this framework is self-contained, requiring no external models or labeled data.

Extracted figure from page 3 of Behavior-Equivalent Token: Single-Token Replacement for Long Prompts in LLMs

Stage 0: The Universal Trigger ([AE])

The process begins by training a universal Auto-Encoder token ([AE]). Its sole function is to signal the LLM to reconstruct the text preceding it. This creates a detached mechanism for triggering reconstruction without modifying the base model's weights, serving as an anchor for the subsequent stages.

Stage 1: Content Compression

In this stage, a prompt-specific embedding for the [BE] token is learned. By pairing [BE] with the [AE] trigger, the framework forces the [BE] token to encode all necessary information for the LLM to verbatim reconstruct the original long system prompt. This ensures the token captures the full semantic content of the prompt.

Stage 2: Behavior Alignment

Verbatim reconstruction is insufficient for task performance; the model must act as though the prompt is present. The authors utilize Knowledge Distillation (KD), treating the LLM with the full prompt as a "teacher" and the LLM with the single [BE] token as a "student." The student is trained to match the teacher's output probability distributions (logits) across various unlabeled queries. This "self-distillation" is highly effective because the model is already familiar with its own internal logic.

Empirical Evaluation

The framework was evaluated across four LLM backbones (Llama-3.2-1B/3B, Llama-3.1-8B, and Qwen3-4B) using three distinct datasets:

  • RoleLLM: 95 diverse character profiles to test persona preservation.
  • GSM8K: Grade-school math problems to test complex reasoning and instruction following.
  • Harry Potter Dialogue (HPD): Supplementary evaluation for narrative coherence.

Key Results

  • Performance Retention: The [BE] token retained approximately 98% of the original performance across all benchmarks.
  • Massive Compression: The method achieved up to a 3000× reduction in prompt length (compressing 3,000 tokens into 1).
  • Efficiency Gains: On GSM8K, the [BE] token reduced TTFT by 28% to 59% depending on the model size.
  • Qualitative Success: In case studies, the [BE] token successfully followed complex constraints—such as maintaining a persona without revealing its AI nature—where other compression methods failed and reverted to generic assistant behaviors.

Discussion and Future Work

A critical insight from this work is the distinction between behavior and memory. While "memory tokens" help a model repeat a prompt, they often fail to help the model follow those instructions. The [BE] token succeeds because it prioritizes behavioral equivalence through distillation.

Currently, the evaluation is focused on single-turn interactions. Future research will explore multi-turn dialogue settings and the compositionality of [BE] tokens—investigating whether multiple tokens representing different skills can be combined in a "plug-and-play" fashion to create complex, multi-faceted agent behaviors.

Summary updated

BibTeX
@misc{dong2025behavior,
  author = {Jiancheng Dong and Pengyue Jia and Jingyu Peng and Maolin Wang and Yuhao Wang and Lixin Su and Xin Sun and Shuaiqiang Wang and Dawei Yin and Xiangyu Zhao},
  title = {{Behavior-Equivalent Token: Single-Token Replacement for Long Prompts in LLMs}},
  year = {2025},
  eprint = {2511.23271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.23271},
}
Figure