arXiv:2610.35090cs.CVOct 2026

Manuscript Offprint

arXiv:2610.35090

Test-Time Prompt-Agnostic Decomposition

Junze Wang, Lei Fan, Dezheng Zhang, Donglin Di, Yang Song, Sidong Liu, Cong Cong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Test-Time Prompt Tuning (TPT) adapts large pretrained models to unseen target distribution shifts by updating only lightweight prompt tokens. Existing TPT methods are effective, but they mainly optimize each prompt update locally. Across test-time steps, prompts updated at the current step are reused for the corresponding predictions and updates, so noisy or biased unlabeled objectives can accumulate and destabilize the prompt-update trajectory. We identify two failure modes: magnitude expansion, where updates move the prompt too far, and directional drift, where consecutive updates point in inconsistent directions. To analyze and control these failures, we propose Test-Time Prompt-Agnostic Decomposition (TPD), which characterizes observed prompt-update trajectories from a dynamical-systems view and decomposes base prompt updates into magnitude and direction. TPD computes a spectral radius to measure update expansion and decomposes update directions into persistent, oscillatory, and residual components. Building on this decomposition, Adaptive Koopman Control (AKC) regulates update magnitude by shrinking updates under expansive recent dynamics, while Hankel Update Router (HUR) refines update direction by preserving persistent components and suppressing oscillatory and residual components. Together, AKC and HUR produce a stabilized prompt update. As a prompt-agnostic framework, TPD can be plugged into visual and text TPT methods without modifying the backbone, prompt architecture, or adaptation loss. Experiments on 15 datasets show that TPD consistently improves 10 baselines, with accuracy gains of 3–8% for visual prompts and over 2% for text prompts 1^{1}.

1 Introduction

Test-Time Prompt Tuning (TPT) has emerged as a parameter-efficient paradigm for adapting large pretrained vision and vision-language models, such as ViT [Dosovitskiy et al., 2020] and CLIP [Radford et al., 2021], to unseen target distribution shifts [Yuan et al., 2023]. Instead of updating the full backbone, TPT adapts only prompt tokens during inference, making it well suited for frozen foundation models [Liang et al., 2025]. Existing methods adapt prompts from unlabeled test data using step-level objectives, including entropy minimization [Shu et al., 2022], confidence-based augmentation selection [Feng et al., 2023, Farina et al., 2024], prompt calibration [Yoon et al., 2024], prompt-history regularization [Ma et al., 2023, Xiao et al., 2025], and black-box prompt updates [Meng et al., 2025]. Although effective, these methods primarily optimize each prompt update locally. This local-update view is incomplete for TPT across steps: prompts updated at the current step are used for the corresponding predictions and updates, so noisy or biased updates from unlabeled objectives can influence later prompt states and accumulate over time [Niu et al., 2023].

This cross-step dependency exposes a key weakness of existing TPT methods. Consecutive updates may move with inappropriate magnitudes or point in inconsistent directions, leading to prompt-update trajectory instability. As illustrated in Figure 1(a), CLIP-based text TPT shows pronounced

∗^{*}Corresponding author.

1^{1}The code is available at https://github.com/reeive/TPD.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

(a)

Figure

(b)

Figure

(c)

Figure 1: (a) The accuracy of ViT visual and CLIP text prompts in episodic modes, averaged over four ImageNet variants. Gains denote TPD improvements. The zoomed windows show accuracy, magnitude (spectral radius ρ\rho), and direction ( ℓ2\ell_{2} distance between consecutive update vectors, decomposed in (b)) in unstable and stable regimes. (b) TPD decomposes each prompt update into persistent, oscillatory, and residual components, with the spectral radius measuring local expansion. (c) Stability-performance relation summarized by spectral radius and persistent ratio.

oscillations in accuracy and update behavior, while ViT-based visual TPT exhibits unstable update behavior together with persistently low accuracy across test steps. These observations indicate that existing methods lack a principled tool for analyzing and controlling prompt updates across test steps. To better characterize prompt-update trajectories, we decompose each update into two complementary components: magnitude, which describes the update step size, and direction, which describes the update orientation [Bottou et al., 2018]. This magnitude-direction view provides a structured way to analyze prompt-update trajectories: instability may arise when update magnitudes expand across steps, when update directions drift or oscillate over time, or when both occur jointly.

Accordingly, we propose Test-Time Prompt-Agnostic Decomposition (TPD), which characterizes observed prompt-update trajectories from a dynamical-systems perspective [Williams et al., 2015]. TPD operationalizes the magnitude-direction view through the prompt-update decomposition, enabling both analysis and stabilization across test steps. As illustrated in Figure 1(b), TPD provides a quantitative interpretation of the unstable behaviors observed in Figure 1(a) by decomposing trajectory dynamics into two complementary branches. For the magnitude branch, TPD computes a spectral radius as an expansion measure, where larger values indicate stronger growth of update magnitudes across recent steps. For the direction branch, TPD decomposes each update into three additive components: a persistent component capturing consistent adaptation signals, an oscillatory component capturing sign-flipping interference, and a residual component capturing unexplained noise. These quantities provide an explicit basis for magnitude expansion and directional drift.

The decomposition quantities reveal a stability pattern in Figure 1(c): methods with a large spectral radius and a low persistent ratio consistently exhibit poor performance. Specifically, the spectral radius summarizes magnitude expansion, while the persistent ratio denotes the fraction of update direction assigned to the persistent component. To this end, we propose two complementary mechanisms. Adaptive Koopman Control (AKC) regulates update magnitude by shrinking updates when recent prompt dynamics indicate expansion. Hankel Update Router (HUR) refines update direction by preserving persistent components across recent updates while suppressing oscillatory and residual components. These two mechanisms produce a stabilized prompt update. Since TPD only processes the base prompt update, it can be plugged into both visual and text TPT methods without modifying the backbone, prompt architecture, or adaptation loss. The contributions are summarized as follows:

• To the best of our knowledge, Test-Time Prompt-Agnostic Decomposition (TPD) is the first prompt-agnostic framework that analyzes and stabilizes prompt-update trajectories across ViT-based visual TPT and CLIP-based text TPT methods.

• We introduce Adaptive Koopman Control (AKC), which uses the spectral radius to scale down updates under expansive local dynamics and further attenuates them under consecutive unstable steps, preventing excessive prompt-state movement.

• We propose Hankel Update Router (HUR), which uses the three-component decomposition to reshape update directions by preserving persistent components and suppressing oscillatory and residual components, thereby mitigating directional conflict and cumulative drift.

• Extensive experiments on 15 datasets across shifted-domain and cross-dataset benchmarks demonstrate the generality of TPD. Across 10 TPT methods, TPD achieves the accuracy gains of 3–8% for visual prompts and over 2% for text prompts.

References (86)