   FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation


                Chengying Fang * 1 Wenke Huang * 1 Guancheng Wan * 1 Yihao Yang 1 Mang Ye 1


                        Abstract
                                                                                            PL        tcls
                                                                                                                                                Model Heterogeneity
     Federated Prompt Learning (FPL) adapts pre-                                            Pi        tcls   Text        Visual
                                                                                                                                           Pi
                                                                        Server              Pj        tcls
     trained Vision-Language Models (VLMs) to fed-                                                                                        Pj

     erated learning through prompt tuning, leverag-                                   Client i                         Client j
                                                                                                                                                Data Heterogeneity
     ing their transferable representations and strong                    Prompt
                                                                                       PL
                                                                                                             Prompt
                                                                                                                        PL    ∈RL×d
                                                                          Fixed:            ∈RL×d            Fixed:
     generalization capabilities. Traditional methods                     (others)

                                                                         Unique:        Pi ∈RTi×d
                                                                                                             (others)

                                                                                                             Unique:     Pj   ∈RTj×d
                                                                           (ours)                             (ours)
                                                                                                                                       A: Cat-heavy                   B: Dog-heavy               C: Mixed data
     often require uniform prompt lengths for feder-
                                                                         Dataset                             Dataset                     (b) Heterogeneity Problem
     ated aggregation, limiting adaptability to clients
     with diverse prompt lengths and distribution bi-                                            PL                               PL       Impede Personalization
     ases. In this paper, we propose Federated Prompt
     Learning for Heterogeneous Client Adaptation                                                                                         Pi                                       Pig   tcls
                                                                                                                                                                                                  Text




                                                                                                                                                      Aggregation

                                                                                                                                                                    Distribution
     (FedPHA), a novel framework that combines a                                                  Pi                              Pj

                                                                                                                                          Pj                                       Pjg    tcls
     fixed-length global prompt for efficient aggrega-                                                                                                                                            Text



     tion with local prompts of varying lengths to cap-
     ture client-specific data characteristics. Addition-                            (a) Heterogeneous FPL                                 (c) Conflicting Problem
     ally, FedPHA designs Singular Value Decompo-
                                                                     Figure 1: Problem illustration of heterogeneous federated prompt
     sition (SVD) based projection and bidirectional                 learning (FPL). (a) Heterogeneous FPL: Clients hold different
     alignment to disentangle global conflicts arising               prompts, models, and data distributions. (b) Heterogeneity Prob-
     from client heterogeneity, ensuring that personal-              lem: Aggregation of heterogeneous prompts and models under
     ized client tasks effectively utilize non-harmful               non-IID data is inherently challenging. (c) Conflicting Problem:
                                                                     Aggregated global prompts may conflict with client-specific knowl-
     global knowledge. This approach ensures that
                                                                     edge, impeding personalization during local adaptation.
     global knowledge improves model generalization
     while local knowledge preserves local optimiza-
                                                                     tion. However, existing federated learning approaches face
     tion. Experimental results validate the effective-
                                                                     significant limitations due to the frequent exchange large
     ness of FedPHA in achieving a balance between
                                                                     volumes of model parameters with a central server. This
     global and personalized knowledge in federated
                                                                     results in high communication overhead, increased train-
     learning scenarios. The source code is avail-
                                                                     ing costs, potential performance degradation, and instability
     able at: https://github.com/CYFang6/
                                                                     during the training process (Wu et al., 2020; Kulkarni et al.,
     FedPHA.
                                                                     2020; Chen et al., 2022; Wan et al., 2024).
                                                                     Fortunately, vision-language pre-trained models such as
1. Introduction                                                      Contrastive Language-Image Pretraining (CLIP) (Radford
                                                                     et al., 2021) have demonstrated potential in learning robust
Federated learning (McMahan et al., 2017; Yang et al., 2019;
                                                                     and versatile representations suitable for various image dis-
Hong & Chae, 2021; Qu et al., 2022; Huang et al., 2024),
                                                                     tributions, aligning well with the objectives of federated
as a distributed machine learning paradigm, addresses data
                                                                     learning. However, the substantial communication overhead
silos by enabling participants to collaboratively train models
                                                                     between the server and clients poses challenges for train-
locally, ensuring data privacy while promoting AI collabora-
                                                                     ing CLIP within federated learning frameworks (Lu et al.,
   *
     Equal contribution 1 National Engineering Research Center       2023). Additionally, overfitting concerns may arise when
for Multimedia Software, School of Computer Science, Wuhan           large-scale models are trained on limited client data. Prompt
University, Wuhan, China. Correspondence to: Mang Ye <ye-            learning (Zhou et al., 2022b;a; Khattak et al., 2023; khattak
mang@whu.edu.cn>.                                                    et al., 2023; Li et al., 2024b) offers a flexible approach to
Proceedings of the 42 st International Conference on Machine         adapt pre-trained models to downstream tasks by training
Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025          only additional parameters. This enables prompts to capture
by the author(s).                                                    task-specific information while guiding the performance of

                                                                 1
                          FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

the fixed model. Leveraging its lightweight nature, prior re-         lengths and varying data distributions while preserving in-
search (Guo et al., 2023b; Qiu et al., 2023; Feng et al., 2023;       formation integrity. (2) Developing a method to mitigate
Su et al., 2024) has explored integrating prompt learning             the negative impact of the conflicting parts between global
into federated learning to address these challenges.                  and local knowledge, allowing clients to retain their unique
                                                                      characteristics while benefiting from global knowledge.
As shown in Figure 1, one of the fundamental challenges in
federated learning is client heterogeneity (Li et al., 2021b;a;       In this work, we propose FedPHA (Federated Prompt Learn-
Huang et al., 2022; Wang et al., 2023; Huang et al., 2023b;           ing for Heterogeneous Client Adaptation), a novel method
Hu et al., 2024; Tan et al., 2025), which manifests in two key        designed to address challenges related to data and model het-
forms: data heterogeneity, where client data distributions            erogeneity, as well as resolving conflicts between global and
are non-IID, and model heterogeneity, where clients employ            local knowledge. FedPHA designs a G-L (Global-Local)
diverse model architectures or have varying computational             architecture to manage the varying prompt requirements of
resources. These challenges significantly hinder model con-           heterogeneous clients. Each client receives a local prompt
vergence and system efficiency. Intuitively, different clients        with a unique length and a global prompt with a uniform
should require prompts of varying lengths to more effec-              length. These prompts are connected through shared to-
tively capture the characteristics of their local data (proved        kens and a frozen encoder, establishing an implicit coupling
in Sec 4.3). However, due to aggregation constraints, current         between global and local prompts. To resolve conflicts
federated prompt learning frameworks (Guo et al., 2023b;a;            between global and local knowledge, we integrate an SVD-
Feng et al., 2023; Yang et al., 2023; Bai et al., 2024) typi-         based projection mechanism, which filters out conflicting
cally enforce uniform prompt lengths across all clients to            parts while preserving essential local information. In addi-
facilitate the aggregation process. Although some works               tion, we introduce a bidirectional alignment function in the
(Li et al., 2024a; Cui et al., 2024) have proposed dual-layer         optimization process. This ensures alignment between local
architectures incorporating both global and local prompts             and projected features while ensuring a clear distinction
while aggregating only global prompts, the structural con-            between global and local features, preserving their unique
straints of these methods prevent support for varying local           characteristics. Our main contributions are summarized as:
prompt lengths. In such approaches, forcibly expanding or
reducing the length of prompts may lead to information loss,          • We are the first to consider the heterogeneity of prompt
further highlighting the challenge of designing methods that            lengths in federated prompt learning. We design a G-L
can adapt to different prompt length requirements.                      framework to facilitate aggregation and individual client
Furthermore, the complex interplay between shared global                requirements. Shared tokens and a frozen encoder connect
knowledge and client-specific local knowledge presents an-              the global and local prompts, creating implicit coupling.
other critical challenge in federated prompt learning, as               We use feature-level computation to prevent information
illustrated in Figure 1(c). While global knowledge aggre-               loss from prompt length variations.
gated from multiple clients can provide valuable general-             • We devise an SVD-based projection mechanism to disen-
izable features, it may also contain potentially conflicting            tangle conflicting parts between global and local knowl-
information that hinders local optimization (Wang et al.,               edge, retaining essential local information while remov-
2020; Li et al., 2022; Nguyen et al., 2024). Specifically, in           ing inconsistencies. And bidirectional alignment func-
high data heterogeneity scenarios, the knowledge learned                tion aligns local and projected features and preserves the
from other clients may not align with or even contradict the            unique characteristics of global and local representations.
optimal features required for a specific client’s local task.         • We evaluate FedPHA against the existing personalized
The conventional federated averaging approach (Guo et al.,              techniques on widely-adopted datasets. Extensive experi-
2023b;a) may force clients to compromise their locally opti-            ments and ablation studies demonstrate the superiority of
mal representations to accommodate the global consensus,                our methods under heterogeneous settings.
potentially degrading performance on client-specific tasks.
Although some recent works (Guo et al., 2023a; Li et al.,             2. Related Work
2024a) have attempted to mitigate this issue by separating
global and local prompts, they lack explicit mechanisms to            2.1. Heterogeneous Federated Learning
resolve knowledge conflicts and ensure effective knowledge            Federated Learning (FL) aims to address the critical chal-
transfer between the two.                                             lenge of heterogeneity in client data distributions (Xu et al.,
To address the challenges in Figure 1, our work is moti-              2021; Huang et al., 2022; Fang & Ye, 2022; Huang et al.,
vated by two primary objectives: (1) Designing a framework            2023a). Key types of heterogeneity include label shift,
that balances federated learning aggregation requirements             where the label distribution P (Y ) differs across clients
with client-side flexibility, accommodating diverse prompt            while P (X|Y ) remains consistent, and domain shift, where
                                                                      the feature distribution P (X) varies while P (Y ) stays un-

                                                                  2
                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

changed. These challenges necessitate specialized meth-              A = U SV ⊤ , where U ∈ Rm×m , V ∈ Rn×n are orthonor-
ods to ensure effective collaboration across diverse client          mal matrices, and S ∈ Rm×n is a diagonal matrix of sin-
datasets. To handle such heterogeneity, early approaches             gular values. SVD enables dimensionality reduction by
in FL often include incorporated regularization terms to             retaining only the largest singular values. SVD has been
the loss function (Li et al., 2020) or fine-tuning the global        widely explored in large language models (LLMs) for its
model on clients’ local datasets (Fallah et al., 2020). How-         ability to decompose matrices into orthogonal components,
ever, these methods risk local overfitting due to the limited        offering robust mathematical foundations for a variety of ap-
and diverse data on clients, potentially compromising global         plications. It is a powerful tool for dimensionality reduction
generalizability. More advanced methods explicitly aim to            (Hsu et al., 2022; Yuan et al., 2023; Saha et al., 2023; Wang
balance global and local models (Chen & Chao, 2022), or              et al., 2024), enabling the extraction of key features while
leverage client relationships through weighted aggregation           minimizing redundant information. Additionally, SVD has
techniques, such as FedPAC (Xu et al., 2023) and FedDisco            proven effective in noise filtering (Sharma et al., 2023; Dai
(Ye et al., 2023). Parameter decomposition has been ex-              et al., 2024), as it isolates signal-dominant components and
plored for heterogeneity; e.g., FedTP (Li et al., 2023) learns       suppresses less significant, noisy contributions. Further-
client-specific self-attention layers. Despite progress, FL          more, it is frequently utilized in subspace projection (Feng
methods continue to struggle with balancing personalization          et al., 2023; Lan et al., 2024), enabling data representation
and generalization under high data and model heterogeneity.          in lower-dimensional subspaces while preserving essential
Our proposed FedPHA addresses these challenges by im-                properties and optimizing computational efficiency. Our
proving the balance between global consistency and local             work builds on these principles by proposing an SVD-based
personalization under prompt-length heterogeneity.                   projection mechanism in the context of federated prompt
                                                                     learning, addressing heterogeneity and reducing potential
2.2. Federated Prompt Learning                                       conflicts between local and global information.
Prompt learning, initially developed for NLP, has been ex-
tended to Vision-Language Models to adapt pre-trained mod-           3. Proposed Method
els to diverse downstream tasks. Early methods like CLIP             In this section, we present the details of FedPHA illustrated
(Radford et al., 2021) used manual templates, while newer            in Figure 2. To address the issue that existing methods
approaches learn prompts in continuous embedding spaces.             cannot adapt to heterogeneous prompt lengths, FedPHA in-
For example, CoOp (Zhou et al., 2022b) fine-tunes CLIP               troduces a G-L heterogeneous federated prompt architecture
with continuous vectors, and ProGrad (Zhu et al., 2023) se-          (Sec 3.2). Meanwhile, to reduce the negative impact caused
lectively updates prompts to preserve essential VLM knowl-           by the conflict between global prompts and local prompts,
edge. To integrate prompt learning into Federated Learn-             we propose SVD-based projection (Sec 3.3) and bidirec-
ing (FL), methods like FedPrompt (Zhao et al., 2023) and             tional alignment (Sec 3.4). The details of our FedPHA are
PromptFL (Guo et al., 2023b) accelerate global aggregation           provided in Algorithm 1.
and address limited user data. Building on these, pFed-
prompt (Guo et al., 2023a) employs a non-parametric per-
                                                                     3.1. Preliminaries of Prompt Learning
sonalized attention module for local feature generation, and
pFedPG (Yang et al., 2023) designs a server-side prompt              Prompt learning efficiently adapts pre-trained models like
generator for client-specific personalization. FedOTP (Li            CLIP for downstream tasks by introducing learnable pa-
et al., 2024a) uses unbalanced Optimal Transport to coordi-          rameters in the text encoder. Unlike zero-shot transfer,
nate global and local prompts. FedPGP (Cui et al., 2024)             which uses fixed word embeddings W = {w1 , w2 , . . . , wl }
adapts to heterogeneous data via low-rank decomposition              from handcrafted prompts (e.g., ”a photo of a 〈label〉”),
of global prompts and contrastive loss to balance personal-          prompt learning adds learnable continuous context vectors
ization and generalization. However, the structural limita-          Pt = {p1 , p2 , . . . , pT } ∈ RT ×d , where T is the prompt
tions of these methods prevent them from accommodating               length and d is the embedding dimension. This allows the
varying local prompt lengths and lack a mechanism to sepa-           text encoder to capture task-specific information while keep-
rate conflicting global knowledge from personalized local            ing the image encoder fixed. For a class label tClass , the
knowledge. In contrast, our proposed FedPHA leverages a              textual input is extended as:
dual-layer architecture and Singular Value Decomposition
(SVD) to effectively address these challenges.                               Ỹp = {tSOS , Pt , t1 , t2 , . . . , tL , tClass , tEOS },   (1)

2.3. Singular Value Decomposition                                    where tSOS and tEOS are learnable start/end embeddings,
                                                                     {t1 , . . . , tL } are fixed word embeddings, and tClass is the
Singular Value Decomposition (SVD) (Golub et al., 1987)              class label embedding. The text encoder g(·), composed of
is a technique that decomposes a matrix A ∈ Rm×n into                transformer layers, generates the prompted textual feature

                                                                 3
                                        FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation


                                                  Prompt Heterogeneous Architecture                               SVD-Based Projection
           Client i                                                                                                                                                                    Projected input
                                                                                                                  Tg×d
                                    Constructing input                                                                              SVD   Tg×Tg       Tg×d       d×d

                                                                                                                                           U           S
                                                                                                                              decompose                          V┬            d´
                                                                                                                                                                                                 Insert
                                                                                                                                                                                                Padding
                                         Local lens                                       Insert                         Client i
                                                           Adaption                                                                         Ti×d        d´×d     d×d´
                                                                                         Padding
                                                                                                                                                                 V2┬
                                                                                                                                                        V2                                    P̃l   Ti×d
                                             ……
                                                                                                                                                                 Q d×d              Local projected prompt
          Server                                            select      tSOS       Pt     tsuf tcls tEOS
                                                           longest
                                                                                          Insert                  Bidirectional Alignment
                                                           Adaption                      Padding
           Client j                      Global len                                                                                               Euclidean distance                    Projected input

                                                                                                                     Local input          fl            Lpull            f̃l
                                                                                                                                                             0
                                     Constructing input                                                                                           Euclidean distance                      Global input

                                                                                                                     Client i             fl            Lpush           fg
                                    Local         Global    Projected          Zero           Input
      Learnable       Frozen        Prompt        Prompt    Prompt             Padding        Sequence                                                     α




Figure 2: Our proposed FedPHA framework for heterogeneous federated prompt learning consists of three main components. The
dual-layer architecture (Sec 3.2) assigns each client a local prompt of varying lengths and a global prompt of uniform length. The longest
prompt forms frozen tokens (tSOS , tClass , tSuffix , tEOS ), distributed to all clients for input sequence construction, with tPadding filling gaps.
The top right shows the SVD-Based Projection (Sec 3.3), where the global prompt is decomposed via SVD. The last d′ components of V T
form the null space, into which local prompts are projected. The bottom right illustrates the bidirectional alignment (Sec 3.4), which uses
Lpull to align local and projected features, and Lpush to separate local and global features. Only local features are used for final inference.


g̃p = g(Ỹp , θg ) ∈ Rd , where θg includes frozen pre-trained                                                 Suppose there are N clients indexed by i = 1, 2, . . . , N
parameters and the learnable Pt . For image classification,                                                    and a central server. Each client i holds a local dataset Di
textual features {g̃pi }C
                        i=1 are compared with image features                                                   of size ni , with {D1 , . . . , DN } collectively denoting the
f˜, extracted by the frozen image encoder f (·). The class k                                                   full dataset. Let Cr ⊆ {1, . . . , N } be the subset of clients
probability for an image x is:                                                                                 selected at communication round r. Each selected client
                                                                                                               performs local training for E epochs using a loss L. During
                                                                                                                                                               r,e
                           exp(sim(g̃pk , f˜)/τ )                                                              local optimization, the global prompt Pg,i           ∈ RTg ×d and
          P (ŷ = k|x) = PC                          ,                                             (2)                              r,e        Ti ×d
                                              ˜                                                                the local prompt Pl,i ∈ R             (where Tg is fixed and Ti
                          i=1 exp(sim(g̃pi , f )/τ )
                                                                                                               may vary across clients) are updated. Let η be the learning
where sim(·, ·) is cosine similarity, and τ regulates the Soft-                                                rate. For each local epoch e, the updates are
max sharpness. The learnable prompts Pt are optimized                                                                   r,e+1      r,e
                                                                                                                                                      
                                                                                                                                                         r,e      r,e
                                                                                                                                                                          
with cross-entropy loss. For a dataset D of input-output                                                              P∗,i    = P∗,i    − η∇P∗,i L Pg,i      , Pl,i   ; Di , (4)
pairs (X, y), the objective is:
                                                                                                                        r,e                                    r,e
                                                                                                               where P∗,i   denotes either the global prompt Pg,i  or the
                                                                                                                               r,e
          LCE = arg min E(X,y)∼D L(sim(g̃p , f˜), y).                                              (3)         local prompt Pl,i .
                               Pt
                                                                                                                                                       r,E
                                                                                                               At the end of local training, only Pg,i      is uploaded to the
                                                                                                                                r,E
3.2. Federated Prompt Heterogeneous Architecture                                                               server, while Pl,i   is kept locally to preserve personalized
                                                                                                               information. The server then aggregates the global prompts
In federated learning, different clients often exhibit diverse                                                 from all clients i ∈ Cr . The new global prompt is obtained
data distributions and task requirements, making it difficult                                                  by weighted averaging based on the sample sizes ni of the
to use a single, fixed-length prompt that balances person-                                                     participating clients:
alization and aggregability. To address this issue, we pro-
                                                                                                                                                   n
pose a G-L heterogeneous federated prompt architecture,                                                                                        P i
                                                                                                                                          X                   r,E
                                                                                                                            Pg(r+1,0) =                     Pg,i  ,         (5)
which comprises a fixed-length global prompt and a variable-                                                                                      j∈Cr  n j
                                                                                                                                                        i∈Cr
length local prompt for each client. Additionally, we employ
frozen contextual tokens and zero-padding tokens to ensure                                                     where ni denotes the number of samples in the local dataset
the implicit coupling between global and local prompts,                                                        Di . This ensures that clients with larger datasets contribute
providing a consistent structure that facilitates subsequent                                                   more significantly to the aggregated global prompt. The
                                                                                                                                           (r+1,0)
feature computation.                                                                                           updated global prompt Pg            is then distributed to all

                                                                                                           4
                              FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

clients in preparation for the next round of communication.                   If Pgr,e ∈ RTg ×d be the current global prompt at local epoch
Formally, the objective function can be expressed as:                         e. We directly perform singular value decomposition (SVD)
                      N
                                                                              on Pgr,e , obtaining
                      X      ni           
                                            r,e     r,e
                                                            
        min                 PN          Li Pg,i , Pl,i  ; Di ,      (6)                              Pgr,e = U S V ⊤ ,                           (8)
    Pg ,{Pl,i }N
               i=1    i=1      j=1 nj                                                       Tg ×Tg                       d×d
                                                                              where U ∈ R          and V ∈ R      are orthonormal matri-
             r,e     r,e
where Li (Pg,i   , Pl,i  ; Di ) denotes the local loss of client i.           ces, and S ∈ RTg ×d is a diagonal matrix with descending
During training, both global and local prompts are lever-                     singular values. Because the global prompt has length Tg
aged to jointly optimize the model. During inference, only                    and the local prompt may have a different length Ti , choos-
local features, derived from the local prompts, are used for                  ing U to construct the projection could lead to dimension
final inference to ensure adaptability to personalized data                   mismatch. Therefore, we utilize V , which naturally resides
distributions.                                                                in the same feature dimension d as both local and global
                                                                                                                                 ′
                                                                              prompts, to form the null space. Let V2 ∈ Rd×d be the
Heterogeneous Key. The fundamental distinction of our
                                                                              matrix collecting the columns of V corresponding to the
method from others lies in its unique handling of global
                                                                              smaller singular values. The number of selected columns d′
and local prompts. Specifically, on the text-encoder side,
                                                                              is determined by the hyperparameter ratio ρ:
each client is assigned a local prompt of varying lengths
and a global prompt of fixed length. We select the                                                    d′ = ⌊(1 − ρ)d⌋.                           (9)
longest prompt among all clients to construct the frozen
tSOS , tClass , tSuffix , tEOS via Eq.(1). Each client then forms             These directions typically capture less significant or poten-
three types of input sequences by concatenating its pre-                      tially conflicting components in the global prompt. The null-
fix tokens, class name tokens, and suffix tokens with: (1)                    space projection matrix Q is then defined as Q = V2 V2⊤ .
                             r,e                          r,e
the global prompt Pg,i           , (2) the local prompt Pl,i  , and (3)       Then the projection of the local prompt is defined as:
                                         r,e
the projected local prompt Pl,i (in Eq.(10)). If the result-
                                       e
                                                                                                r,e     r,e       r,e
ing sequence is shorter than the maximum encoder length                                      Pel,i  = Pl,i  Q = Pl,i  V2 V2⊤ ,                  (10)
Lmax , zero vectors (tPadding ) are appended. The final input                         r,e
                                                                              where Pl,i  ∈ RTi ×d is the local prompt for client i. The
sequence can be represented as:
                                                                              projected prompt Per,e ∈ RTi ×d retains the same dimen-
                                                                                                     l,i
         Ỹp = {tSOS , Pt , tClass , tSuffix , tEOS , tPadding },   (7)                                                            r,e
                                                                              sions as the original local prompt. By projecting Pl,i   onto
The global and local prompts are implicitly coupled and                       Q, we effectively “filter out” dimensions dominated by the
interact through shared prefix and suffix tokens, as well                     global prompt’s major components, thereby reducing po-
as a common Transformer encoder. This interaction en-                         tential conflicts between local and global information. This
sures that while local prompts retain their client-specific                   step is crucial in heterogeneous settings: it preserves local
distinctions, the overall model still operates within a shared                discriminative features relevant to each client’s data while
high-dimensional representation space, promoting informa-                     mitigating interference from global prompt directions that
tion exchange across clients. Finally, the resulting input                    may not generalize to individual client distributions.
sequences are fed into the pre-trained CLIP encoder along-
side image representations to compute similarity scores and                   3.4. Bidirectional Alignment
perform classification.                                                                                                            r,e
                                                                              To mitigate conflicts, we project the local prompt Pl,i  into
                                                                              the null space. However, this may lead to information loss,
3.3. SVD-Based Projection                                                     reducing client-specific expressiveness. To address this, we
Although the above framework achieves personalization                         introduce a bidirectional alignment mechanism: a ”pull”
with heterogeneous prompt lengths by thoroughly separat-                      term to retain information by aligning the local prompt
ing global prompts and local prompts, an interaction mech-                    with its projection and a ”push” term to ensure sufficient
anism between global and local prompts is still required                      divergence from the global prompt.
to facilitate information exchange. Simple alignment or                       To ensure that the local prompt does not deviate excessively
orthogonality between the two may be insufficient in cases                    from its projected prompt, we minimize the      mean squared
of highly heterogeneous data distribution. Therefore, it is                   error (MSE) between f Pl,i  r,e          r,e 
                                                                                                              and f Pel,i    . Formally,
necessary to further refine local prompts to mitigate poten-
tial conflicts with global prompts. Inspired by subspace                                                       r,e             r,e    2
projection in matrix factorization, we propose a projection                               Lpull =          f Pl,i        − f Pel,i          ,   (11)
                                                                                                                                        2
mechanism based on Singular Value Decomposition (SVD)                                               r,e
to filter out unnecessary or conflicting components from                      which encourages Pl,i     to “pull” closer to its null-space-
                                                                                                  r,e
local prompts.                                                                projected version Pe in the feature space. By doing so, we
                                                                                                 l,i


                                                                          5
                          FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

retain essential local information while filtering out compo-           Algorithm 1 Overall Procedure of FedPHA
nents that conflict with the global prompt.                             Data: The random public dataset {Di }Ni=1 , sizes {ni };
                                                                        Input: Communication rounds R; Local epochs E; Learning
In parallel, to prevent the local prompt from collapsing too                                                                         (0)
                                                                               rate η; SVD ratio ρ; Margin α; Initial global prompt Pg
closely to the global prompt, we introduce a margin-based                                             (0)
                                                         r,e                   Initial local prompts Pl,i .
“push” term to maintain a safe distance between f Pl,i
                                                                       Output: The final local models MiR
and f Pgr,e . Specifically,
                                                                        // Federated Rounds
     Lpush = ReLU α − ∥f (Pl,i    r,e
                                      ) − f (Pgr,e )∥2 ,
                                                      
                                                         (12)           for r = 1, 2, . . . , R do
                                                                              // Participant Side
where α > 0 defines the minimal acceptable distance. This                     for each client i ∈ Cr in parallel do
                                                                                    (r,E)    (r,E)                  (r,1)  (r−1,E)
ensures that each local prompt remains sufficiently person-                       Pg,i , Pl,i      ← LocalU pdate(Pg,i , Pl,i      )
alized and does not become overly dominated by the global
                                                                              end
prompt’s major components.
                                                                              // Server Side
In practice, both of these MSE-based terms (pull and push)                     (r+1,1)
                                                                              Pg
                                                                                                       (r,E)
                                                                                       ← i∈Cr P ni nj Pg,i in Eq.(5)
                                                                                        P
                                                                                                     j∈Cr
are combined with standard cross-entropy losses (for both
the local prompt and the global prompt), forming a unified              end
training objective:                                                     // Local Epochs
                                                                        for e = 1, 2, . . . , E do
            r,e
 L = LCE (Pl,i  , yi ) + LCE (Pgr,e , yi ) + Lpull + Lpush . (13)             // SVD-Based Projection
                                                                               r,e
This bidirectional alignment strategy mitigates potential con-                Pg,i ← U SV ⊤ in Eq.(8)
flicts arising from heterogeneous data distributions, ensuring                V2 ← V [:, d(1 − ρ) : d] via Eq.(5)
that local prompts retain discriminative characteristics while
still benefiting from global knowledge.                                       Q ← V2 V2⊤ // Construct projection
                                                                                 r,e     r,e
                                                                              Pel,i  ← Pl,i  Q in Eq.(10)
4. Experiments
                                                                              // Compute losses
                                                                                            r,e           r,e 2
In this section, we conduct extensive experiments aiming at                   Lpull ← ∥f (Pl,i  ) − f (Pel,i )∥ in Eq.(11)
answer following research questions:                                                                 r,e         r,e
• Q1: Does the proposed method maintain its effectiveness                     Lpush ← ReLU(α − ∥f (Pl,i  ) − f (Pg,i )∥) in Eq.(12)
  when the prompt length is fixed? How does it compare to
                                                                              L ← LCE + Lpull + Lpush in Eq.(13)
  the state-of-the-art (SOTA) methods? (in Sec 4.2)
• Q2: For clients with diverse data distributions, can                        // Update prompts using gradients
                                                                                      (r,e+1)     (r,e+1)
  prompts of varying lengths enhance performance? Does                        Update Pg,i     , Pl,i      using ∇L
  length heterogeneity provide any advantage? (in Sec 4.3)
                                                                        end
4.1. Experimental Setup                                                 return MiR // Final model after R rounds

Datasets. Following previous research (Guo et al., 2023b;a),
we evaluate our method on multiple public benchmark
                                                                        CIFAR-100 (Krizhevsky & Hinton, 2009), where data is ran-
datasets exhibiting significant data heterogeneity. We use
                                                                        domly partitioned among clients using a symmetric Dirichlet
five visual classification datasets—Food101 (Bossard et al.,
                                                                        distribution as in (Cao et al., 2023; Shamsian et al., 2021)
2014), DTD (Cimpoi et al., 2014), Caltech101 (Fei-Fei,
                                                                        with β = 0.5, further enhancing the diversity in data dis-
2004), Flowers102 (Nilsback & Zisserman, 2008), and Ox-
                                                                        tribution. Details of these dataset setups are provided in
fordPets (Parkhi et al., 2012)—collectively referred to as
                                                                        Appendix Section B.1.
the CLIP dataset (1 domain). These datasets are configured
using a pathological non-IID setting, where each client is              Baselines. We compare our FedPHA with five baseline
randomly allocated a distinct number of non-overlapping                 methods: (1) Zero-shot CLIP (Radford et al., 2021), a lo-
classes to simulate heterogeneous data distributions. In addi-          cal training approach that utilizes manually designed text
tion, we select two cross-domain datasets, Office31 (Saenko             prompt templates to generate the model’s initial perfor-
et al., 2010) (3 domains) and OfficeHome (Venkateswara                  mance. (2) PromptFL (Guo et al., 2023b), a prompt-based
et al., 2017) (4 domains), where the data for each client               federated learning method that learns a unified prompt
is drawn from a specific domain, further emphasizing data               across clients using the federated averaging mechanism
heterogeneity. Finally, we employ two classic image bench-              (McMahan et al., 2017). (3) PromptFL+Prox (Li et al.,
mark datasets, CIFAR10 (Krizhevsky et al., 2010) and                    2020), as introduced in (Guo et al., 2023a), which con-

                                                                    6
                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

      Table 1: Comparison with the SOTA methods with same prompt length on single-domain datasets across 10 clients.

 Methods                                       Caltech101           Food101        Flowers102       OxfordPets        DTD
 Zero-Shot CLIP (Radford et al., 2021)         91.43±0.24       85.43±0.05         67.70±0.12       88.95±0.12    43.28±0.10
 PromptFL (Guo et al., 2023b)                  93.47±0.42       86.60±0.10         85.54±0.65       93.44±0.25    55.24±0.31
 Prompt+Prox (Li et al., 2020)                 93.55±0.36       86.65±0.17         85.74±0.25       93.48±0.32    55.64±0.23
 FedPGP (Cui et al., 2024)                     95.86±0.50       88.30±0.41         94.46±2.44       93.87±0.31    62.95±3.01
 FedOTP (Li et al., 2024a)                     98.11±0.04       92.96±0.16         98.47±0.07       98.60±0.11    89.97±0.17
 FedPHA                                        99.05±0.08       96.42±0.05         99.25±0.05       99.25±0.06    91.79±0.17

Table 2: Comparison with the SOTA methods with the same prompt length on multi-domain datasets. Each domain consists of two
clients, and the table presents both the average accuracy within each domain and the overall global accuracy.

                                                        Office31                                    OfficeHome
 Methods
                                               A        D      W           Avg        A         C        P     R          Avg
 Zero-Shot CLIP (Radford et al., 2021)       80.96    71.63     74.60      75.73    84.21    66.37     89.16     89.68   82.35
 PromptFL (Guo et al., 2023b)                88.20    84.89     91.14      88.08    86.75    75.30     94.38     93.24   87.41
 Prompt+Prox (Li et al., 2020)               88.32    85.03     91.43      88.26    86.58    75.65     94.79     93.27   87.57
 FedOTP (Li et al., 2024a)                   86.62    87.40     93.55      89.19    80.38    76.29     92.49     87.86   84.26
 FedPGP (Cui et al., 2024)                   89.55    90.70     94.50      91.58    88.34    78.09     95.49     93.86   88.95
 FedPHA                                      90.44    95.80     97.98      94.74    88.70    79.59     95.93     93.83   89.51


strains local prompt updates using a proximal term instead          Eq.(9)) defaults to 0.8, and alpha (α in Eq.(12)) to 1. More
of direct aggregation. Additionally, we include two popular         details are provided in Appendix Section B.2.
methods that integrate both global and local prompts: (4)
FedOTP (Li et al., 2024a), which employs the Unpaired               4.2. Comparison with State-of-the-Art Methods
Optimal Transport (UOT) method to align prompts with
the most relevant image features, thereby enhancing per-            Evaluation Protocol. We evaluate the models on each
sonalization. (5) FedPGP (Cui et al., 2024), which uses             client’s private test data, which follows the same distribution
low-rank decomposition and contrastive learning to balance          as its training set. The reported results represent the average
personalization and generalization.                                 test accuracy across all clients over three different seeds.
                                                                    For fairness, we use the same prompt length as other models
Implementation Details. All methods use a frozen CLIP               for comparison.
model with two backbones: ResNet50 (He et al., 2016)
and ViT-B16 (Dosovitskiy et al., 2021), with ViT-B16 as             Single-Domain Model Evaluation. To verify that the
the default. Local training rounds are set to E = 1 and             proposed method remains effective with a fixed prompt
federated communication rounds to R = 50, except for                length, we first evaluate FedPHA against baseline methods
CIFAR-10 and CIFAR-100, where R = 25. Final perfor-                 on single-domain CLIP datasets under a pathological non-
mance is averaged over the last 10 communication rounds.            IID setting. For ease of comparison, Table 1 presents results
The number of clients varies by dataset. CLIP datasets              using the 16-shot setting. As shown in the table, FedPHA
(Food101, DTD, Caltech101, Flowers102, OxfordPets) use              consistently outperforms state-of-the-art algorithms across
N = 10, with each client holding a distinct class subset.           all datasets, demonstrating the effectiveness of our global-
Multi-domain datasets (Office31, OfficeHome) set N to               local prompt separation mechanism in single-domain sce-
twice the number of domains, assigning each domain’s data           narios. Notably, on the Food101 dataset, FedPHA achieves
to two clients. CIFAR-10 and CIFAR-100 use N = 100,                 a 3.46% performance gain over the best competing method,
with each client randomly assigned 10% of the dataset.              further highlighting its superiority. An analysis of conver-
For learnable prompts, the default length is 16 with a 512-         gence speed is provided in Appendix Section C.1.
dimensional representation. In heterogeneous settings, local        Impact of Number of Shots. Additionally, we explore
prompt lengths range from 4 to 32, while the global prompt          the impact of the number of shots on FedPHA. To ana-
length remains 16. The batch size is 32 for training and            lyze this, we vary the number of shots during training from
128 for testing. For hyperparameter settings, the ratio (ρ in       [1, 2, 4, 8, 16]. As shown in Figure 3, FedPHA consistently


                                                                7
                                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

                                                                      PromptFL                     FedPGP          FedOTP                     FedPHA
                     Caltech101                                Food101                                  Flowers102                                 OxfordPets                 100        DTD
             99                                      96                                       95                                         98
             97                                      92
Accuracy %




                                        Accuracy %




                                                                                 Accuracy %




                                                                                                                            Accuracy %




                                                                                                                                                                 Accuracy %
                                                                                                                                                                              80
                                                                                              85
             95                                      88                                                                                  94
                                                                                              75                                                                              60
             93                                      84
             91 1 2 4     8        16                80 1 2 4     8        16                 65 1 2 4     8          16                 90 1 2 4     8         16            40 1 2 4     8        16
                     Shot Number                             Shot Number                              Shot Number                                Shot Number                          Shot Number
Figure 3: Ablation study on the number of shots. The x-axis represents the number of shots, and the y-axis denotes the average test
accuracy. Each curve corresponds to a different method, with error bars indicating standard deviations across multiple random seeds.


Table 3: Runtime overhead of SVD-based prompt projection.                                                    and backward passes—dominates the runtime, taking over
All results are averaged over 10 communication rounds. Compared
                                                                                                             4 seconds per round. These results indicate that the added
to model training, the SVD overhead is negligible
                                                                                                             SVD step does not introduce any significant computational
      Operation Stage                                        Time (ms)      Overhead                         bottleneck, even under large-scale settings. This lightweight
                                                                                                             design confirms that the benefits of SVD-based global-local
      Global prompt decomposition                                4.2             <1%                         prompt separation come at almost no cost, further support-
      Local prompt projection                                    2.8             <1%                         ing the practicality of our method in federated settings where
      Local model training                                     4536.8             —                          efficiency is critical.

outperforms other methods across all shot settings. In par-                                                  4.3. Effectiveness of prompt length heterogeneity
ticular, when the number of shots is small, other methods                                                    Evaluation Protocol. In this set of experiments, each client
experience significant performance degradation, whereas                                                      uses a different prompt length ranging from 4 to 32. For
FedPHA exhibits only a slight decline compared to its per-                                                   multi-domain datasets, the specified prompt lengths are
formance at 16 shots. This demonstrates the robustness of                                                    applied, whereas for CIFAR-10/100, each client is assigned
our approach, enabling effective and rapid adaptation to                                                     a randomly selected prompt length.
personalized client requirements even in few-shot scenarios.
                                                                                                             Cross Domain Analysis. We investigate the impact of
Multi-Domain Model Evaluation. We also evaluate the                                                          different prompt length combinations on cross-domain per-
performance of FedPHA in comparison to baseline methods                                                      formance. In the Office31 dataset with three domains, each
on multi-domain datasets. To simulate client heterogeneity,                                                  domain has eight possible prompt length choices: [4, 8, 12,
we partition data within the same domain into two clients                                                    16, 20, 24, 28, 32]. After evaluating 512 combinations, we
using a Dirichlet distribution (β = 0.5). We analyze both                                                    identify the optimal combination as [28, 12, 16], achiev-
the average performance of clients within the same domain                                                    ing an accuracy of 95.45%. Figure 4 visualizes the results,
and the overall mean performance across all clients. Results                                                 where the color intensity of each cell represents the global
for the Office31 and OfficeHome datasets are summarized                                                      accuracy for a given prompt length combination. Black-
in Table 2. Our method consistently outperforms baseline                                                     outlined cells indicate cases where all domains use the same
approaches. For instance, on the Office31 dataset, FedPHA                                                    prompt length. Notably, most high-accuracy points fall out-
outperforms FedPGP across all domains, further validating                                                    side these black-boxed regions, suggesting that the conven-
its effectiveness in handling heterogeneous data distribu-                                                   tional approach of assigning the same prompt length to all
tions. These results demonstrate the robustness of FedPHA                                                    clients is suboptimal and fails to capture the varying prompt
under diverse domain settings.                                                                               length requirements introduced by data heterogeneity. In
Computational Cost of SVD. To evaluate the efficiency of                                                     contrast, FedPHA enables each client to adopt different
the proposed SVD-based prompt projection mechanism, we                                                       prompt lengths, demonstrating its effectiveness in handling
measure its runtime cost on the client side. As summarized                                                   heterogeneous data distributions. More details and addi-
in Table 3, the additional overhead introduced by SVD is                                                     tional experiments on the OfficeHome dataset are provided
minimal compared to standard model training. Specifically,                                                   in Appendix Section C.2.
global prompt decomposition and local prompt projection                                                      Intra Domain Analysis. Furthermore, we explore the im-
take 4.2 ms and 2.8 ms per communication round on aver-                                                      pact of prompt length on client performance across different
age, each contributing less than 1% to the total training time.                                              length combinations. The two clients within the same do-
Importantly, these operations are performed only once per                                                    main use identical prompt lengths. As shown in Figure 5,
round, not per batch, making their amortized cost negligi-                                                   we illustrate the effect of prompt lengths on the performance
ble. In contrast, local model training—including forward

                                                                                                         8
                                                                                                FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

                         Domain1 P Len = 4                                 Domain1 P Len = 8                                     Domain1 P Len = 12                                     Domain1 P Len = 16                                Domain1 P Len = 20                                Domain1 P Len = 24                                Domain1 P Len = 28                                Domain1 P Len = 32
Domain3 P Len = [4,32]




                                                  Domain3 P Len = [4,32]




                                                                                                        Domain3 P Len = [4,32]




                                                                                                                                                               Domain3 P Len = [4,32]




                                                                                                                                                                                                                 Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                                   Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                                                                                     Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                                                                                                                                       Domain3 P Len = [4,32]
                         Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                                Domain2 P Len = [4,32]                                 Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]


  Figure 4: Impact of Prompt Length on Domains Performance across different length combinations on overall accuracy. Each 8×8
  heatmap illustrates the effect of different Domain 2 and Domain 3 prompt length combinations on model performance when Domain 1 has
  a fixed prompt length in Office31 dataset. The X-axis represents the average prompt length of Domain 2, while the Y-axis represents that
  of Domain 3. Color intensity indicates accuracy, with red representing higher accuracy and blue representing lower accuracy. Black-boxed
  grids highlight cases where the prompt length of Domain 1 matches that of Domain 2 or 3 under the current length combination.


                                     Client 1                                                         Client 2                                                                          Client 3                                          Table 4: Comparison with the SOTA methods and FedPHA
                                                                                           90                                                          100                                                                                variants (fixed vs. random prompt length) on CIFAR-10 and
                         93
                                                                                                                                                                                                                                          CIFAR-100 across 100 clients. All baseline methods use a fixed
  Accuracy %




                                                                              Accuracy %




                                                                                                                                          Accuracy %

                                                                                           89                                                            99
                         92                                                                                                                                                                                                               prompt length of 16. FedPHA (fixed length) also uses 16 tokens
                                                                                           88                                                            98
                                                                                                                                                                                                                                          for all clients, while FedPHA (random length) assigns each client
                         91                                                                87                                                            97                                                                               a random prompt length between 4 and 32.
                              4 8 12 16 20 24 28 32                                             4 8 12 16 20 24 28 32                                         4 8 12 16 20 24 28 32
                                Prompt Length                                                     Prompt Length                                                       Prompt Length                                                         Methods                                                                                              CIFAR-10                                       CIFAR-100
                                   Client 4                                                          Client 5                                                            Client 6
                                                                                         100                                                                                                                                                CLIP (Radford et al., 2021)                                                                         87.88±0.11                                      64.89±0.19
                         94                                                                                                                              99
  Accuracy %




                                                                            Accuracy %




                                                                                                                                            Accuracy %




                         92                                                                98                                                            98                                                                                 PromptFL (Guo et al., 2023b)                                                                        91.70±0.11                                      72.58±0.04
                         90                                                                                                                              97                                                                                 Prompt+Prox (Li et al., 2020)                                                                       91.83±0.12                                      72.08±0.09
                                                                                           96
                                                                                                                                                         96                                                                                 FedPGP (Cui et al., 2024)                                                                           92.10±0.21                                      74.81±0.48
                         88
                                                                                           94                                                            95                                                                                 FedOTP (Li et al., 2024a)                                                                           93.43±0.41                                      75.07±0.39
                              4 8 12 16 20 24 28 32                                             4 8 12 16 20 24 28 32                                         4 8 12 16 20 24 28 32
                                Prompt Length                                                     Prompt Length                                                       Prompt Length                                                         FedPHA (fixed length)                                                                               94.11±0.14                                      75.92±0.13
                                                                                                                                                                                                                                            FedPHA (random length)                                                                              93.80±0.17                                      75.63±0.17
 Figure 5: Impact of Prompt Length on Client Performance
 across different length combinations. Clients (1,2), (3,4), and (5,6)
 belong to the same domain, respectively. The X-axis represents
 the prompt length, while the Y-axis shows the client’s accuracy.
 The box depicts the IQR, capturing the middle 50% of values,                                                                                                                                                                             (4–32 tokens) prompts. The fixed-length variant slightly
 with the horizontal line inside indicating the median accuracy.
 Whiskers extend to the min/max within 1.5 times the IQR, and                                                                                                                                                                             outperforms the random one, not due to design limitations,
 outliers appear as points beyond them, highlighting deviations.                                                                                                                                                                          but because random lengths may not align with each client’s
                                                                                                                                                                                                                                          data distribution, leading to occasional inefficiencies. In con-
                                                                                                                                                                                                                                          trast, fixed lengths ensure stable optimization and aggrega-
                                                                                                                                                                                                                                          tion. Nevertheless, the random-length setting better reflects
  of each client. We observe that clients within the same do-
                                                                                                                                                                                                                                          real-world client heterogeneity, and FedPHA is uniquely ca-
  main exhibit similar sensitivity to prompt length, even when
                                                                                                                                                                                                                                          pable of operating under such conditions. Future work may
  their data distributions differ. For instance, both Client 1 and
                                                                                                                                                                                                                                          explore adaptive prompt assignment strategies to further
  Client 2 achieve the best performance with a prompt length
                                                                                                                                                                                                                                          improve performance in heterogeneous environments.
  of 32, while the worst performance occurs at a prompt length
  of 4. However, the sensitivity to prompt length varies across
  domains. For example, while Client 1’s optimal prompt                                                                                                                                                                                   5. Conclusion
  length is 32, Client 3 performs best at a prompt length of 16
                                                                                                                                                                                                                                          This paper proposes a novel and effective method of Fed-
  and performs poorly at 32.
                                                                                                                                                                                                                                          PHA for federated prompt learning. FedPHA is capable
 Robustness Analysis. On the CIFAR datasets, we randomly                                                                                                                                                                                  of handling heterogeneity problem and alleviating conflicts
 select prompt lengths to evaluate robustness. Table 4 com-                                                                                                                                                                               between global and local knowledge. In particular, we de-
 pares state-of-the-art methods under the Dirichlet setting                                                                                                                                                                               sign a G-L heterogeneous federated prompt architecture to
 (β = 0.5). FedPHA achieves the best performance on both                                                                                                                                                                                  effectively accommodate varying prompt lengths. Mean-
 datasets, demonstrating strong generalization in non-IID                                                                                                                                                                                 while, we introduce SVD-based projection and bidirectional
 scenarios. Its improvement on CIFAR-100 further high-                                                                                                                                                                                    alignment to reduce the negative impact caused by the con-
 lights the effectiveness of the global-local prompt separation                                                                                                                                                                           flict between global and local prompts. Experimental re-
 mechanism in balancing personalization and global perfor-                                                                                                                                                                                sults on classification tasks demonstrate that our method
 mance. To examine prompt length adaptability, we compare                                                                                                                                                                                 outperforms state-of-the-art approaches and validate the
 FedPHA with fixed-length (16 tokens) and random-length                                                                                                                                                                                   effectiveness of prompt length heterogeneity.

                                                                                                                                                                                                                 9
                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

Acknowledgement                                                        Heigold, G., Gelly, S., et al. An image is worth 16x16
                                                                       words: Transformers for image recognition at scale. In
This work is supported by the National Key Research                    ICLR, 2021.
and Development Program of China (2023YFC2705700),
and National Natural Science Foundation of China under               Fallah, A., Mokhtari, A., and Ozdaglar, A. Personalized
Grant (62361166629, 62176188, 62225113, 623B2080), the                 federated learning with theoretical guarantees: A model-
Wuhan University Undergraduate Innovation Research Fund                agnostic meta-learning approach. In NeurIPS, pp. 3557–
Project. The supercomputing system at the Supercomput-                 3568, 2020.
ing Center of Wuhan University supported the numerical
calculations in this paper.                                          Fang, X. and Ye, M. Robust federated learning with noisy
                                                                       and heterogeneous clients. In CVPR, 2022.
Impact Statement
                                                                     Fei-Fei, L. Learning generative visual models from few
This paper presents work whose goal is to advance the field            training examples. In Workshop on Generative-Model
of Machine Learning. There are many potential societal                 Based Vision, IEEE Proc. CVPR, 2004, 2004.
consequences of our work, none which we feel must be
specifically highlighted here.                                       Feng, C.-M., Li, B., Xu, X., Liu, Y., Fu, H., and Zuo, W.
                                                                       Learning federated visual prompt in null space for mri
                                                                       reconstruction. In CVPR, 2023.
References
Bai, S., Zhang, J., Li, S., Guo, S., Guo, J., Hou, J., Han,          Golub, G. H., Hoffman, A., and Stewart, G. W. A general-
  T., and Lu, X. Diprompt: Disentangled prompt tuning                  ization of the eckart-young-mirsky matrix approximation
  for multiple latent domain generalization in federated               theorem. Linear Algebra and its applications, 88:317–
  learning. In CVPR, 2024.                                             327, 1987.

Bossard, L., Guillaumin, M., and Van Gool, L. Food-101–              Guo, T., Guo, S., and Wang, J. Pfedprompt: Learning per-
  mining discriminative components with random forests.                sonalized prompt for vision-language models in federated
  In ECCV, pp. 446–461. Springer, 2014.                                learning. In Proceedings of the ACM Web Conference
                                                                      2023, pp. 1364–1374, 2023a.
Cao, Y.-T., Shi, Y., Yu, B., Wang, J., and Tao, D. Knowledge-
  aware federated active learning with non-iid data. In              Guo, T., Guo, S., Wang, J., Tang, X., and Xu, W. Promptfl:
  ICCV, pp. 22279–22289, 2023.                                         Let federated participants cooperatively learn prompts
                                                                       instead of models-federated learning in age of foundation
Chen, H., Huang, S., Zhang, D., Xiao, M., Skoglund, M.,                model. IEEE TMC, 2023b.
  and Poor, H. V. Federated learning over wireless iot
  networks with optimized communication and resources.               He, K., Zhang, X., Ren, S., and Sun, J. Deep residual
  IEEE Internet of Things Journal, pp. 16592–16605, 2022.              learning for image recognition. In CVPR, pp. 770–778,
                                                                       2016.
Chen, H.-Y. and Chao, W.-L. On bridging generic and
  personalized federated learning for image classification.          Hong, S. and Chae, J. Communication-efficient random-
  In ICLR, 2022.                                                       ized algorithm for multi-kernel online federated learning.
Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and                  IEEE PAMI, 44(12):9872–9886, 2021.
  Vedaldi, A. Describing textures in the wild. In CVPR, pp.
                                                                     Hsu, Y.-C., Hua, T., Chang, S., Lou, Q., Shen, Y., and Jin,
  3606–3613, 2014.
                                                                       H. Language model compression with weighted low-rank
Cui, T., Li, H., Wang, J., and Shi, Y. Harmonizing general-            factorization. arXiv preprint arXiv:2207.00112, 2022.
  ization and personalization in federated prompt learning.
  arXiv preprint arXiv:2405.09771, 2024.                             Hu, M., Zhou, P., Yue, Z., Ling, Z., Huang, Y., Li, A., Liu,
                                                                      Y., Lian, X., and Chen, M. Fedcross: Towards accu-
Dai, S., Zhou, Y., Pang, L., Liu, W., Hu, X., Liu, Y., Zhang,          rate federated learning via multi-model cross-aggregation.
  X., Wang, G., and Xu, J. Neural retrievers are biased                In IEEE International Conference on Data Engineering
  towards llm-generated content. In ACM SIGKDD, pp.                   (ICDE), pp. 2137–2150. IEEE, 2024.
  526–537, 2024.
                                                                     Huang, W., Ye, M., and Du, B. Learn from others and be
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn,              yourself in heterogeneous federated learning. In CVPR,
  D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M.,           2022.

                                                                10
                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

Huang, W., Ye, M., Shi, Z., and Du, B. Generalizable                Li, Z., Li, X., Fu, X., Zhang, X., Wang, W., and Yang, J.
  heterogeneous federated cross-correlation and instance              Promptkd: Unsupervised prompt distillation for vision-
  similarity learning. TPAMI, 2023a.                                  language models. In CVPR, 2024b.
Huang, W., Ye, M., Shi, Z., Li, H., and Du, B. Rethinking           Lu, W., Hu, X., Wang, J., and Xie, X. Fedclip: Fast general-
  federated learning with domain shift: A prototype view.             ization and personalization for clip in federated learning.
  In CVPR, 2023b.                                                     IEEE DEB, 2023.
Huang, W., Ye, M., Shi, Z., Wan, G., Li, H., Du, B., and            McMahan, B., Moore, E., Ramage, D., Hampson, S., and
 Yang, Q. A federated learning for generalization, robust-           y Arcas, B. A. Communication-efficient learning of deep
  ness, fairness: A survey and benchmark. TPAMI, 2024.               networks from decentralized data. In AISTATS, pp. 1273–
khattak, M. U., Rasheed, H., Maaz, M., Khan, S., and Khan,           1282. PMLR, 2017.
  F. S. Maple: Multi-modal prompt learning. In CVPR,
                                                                    Nguyen, M. D., Le, K., Do, K., Tran, N. H., Nguyen, D.,
  2023.
                                                                     Trinh, C., and Yang, Z. Towards layer-wise personalized
Khattak, M. U., Wasim, S. T., Naseer, M., Khan, S., Yang,             federated learning: Adaptive layer disentanglement via
  M.-H., and Khan, F. S. Self-regulating prompts: Founda-             conflicting gradients. arXiv preprint arXiv:2410.02845,
  tional model adaptation without forgetting. In ICCV, pp.            2024.
 15190–15200, October 2023.
                                                                    Nilsback, M.-E. and Zisserman, A. Automated flower clas-
Krizhevsky, A. and Hinton, G. Learning multiple layers of             sification over a large number of classes. In 2008 Sixth
  features from tiny images. Master’s thesis, Department              Indian conference on computer vision, graphics & image
  of Computer Science, University of Toronto, 2009.                   processing, pp. 722–729. IEEE, 2008.
Krizhevsky, A., Nair, V., and Hinton, G. Cifar-10 (canadian         Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C.
  institute for advanced research). URL http://www. cs.               Cats and dogs. In CVPR, pp. 3498–3505. IEEE, 2012.
  toronto. edu/kriz/cifar. html, 5(4):1, 2010.
                                                                    Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J.,
Kulkarni, V., Kulkarni, M., and Pant, A. Survey of person-
                                                                      Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga,
  alization techniques for federated learning. In WorldS4,
                                                                      L., et al. Pytorch: An imperative style, high-performance
  pp. 794–797, 2020.
                                                                      deep learning library. In NeurIPS, 2019.
Lan, M., Torr, P., Meek, A., Khakzar, A., Krueger, D., and
  Barez, F. Sparse autoencoders reveal universal feature            Qiu, C., Li, X., Mummadi, C. K., Ganesh, M. R., Li, Z.,
  spaces across large language models. arXiv preprint                 Peng, L., and Lin, W.-Y. Text-driven prompt generation
  arXiv:2410.06981, 2024.                                             for vision-language models in federated learning. arXiv
                                                                      preprint arXiv:2310.06123, 2023.
Li, H., Cai, Z., Wang, J., Tang, J., Ding, W., Lin, C.-T.,
  and Shi, Y. Fedtp: Federated learning by transformer              Qu, Z., Li, X., Duan, R., Liu, Y., Tang, B., and Lu, Z.
  personalization. IEEE TNNLS, 2023.                                  Generalized federated learning via sharpness aware mini-
                                                                      mization. In ICML, 2022.
Li, H., Huang, W., Wang, J., and Shi, Y. Global and local
  prompts cooperation via optimal transport for federated           Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G.,
  learning. In CVPR, pp. 12151–12161, 2024a.                          Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J.,
                                                                      et al. Learning transferable visual models from natural
Li, Q., He, B., and Song, D. Model-contrastive federated
                                                                      language supervision. In ICML, pp. 8748–8763. PMLR,
  learning. In CVPR, pp. 10713–10722, 2021a.
                                                                      2021.
Li, Q., Diao, Y., Chen, Q., and He, B. Federated learning on
   non-iid data silos: An experimental study. IEEE TKDE,            Robbins, H. and Monro, S. A stochastic approximation
   2022.                                                              method. AoMS, pp. 400–407, 1951.

Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A.,        Saenko, K., Kulis, B., Fritz, M., and Darrell, T. Adapting
  and Smith, V. Federated optimization in heterogeneous               visual category models to new domains. In ECCV, pp.
  networks. In MLSys, 2020.                                           213–226, 2010.

Li, X., Jiang, M., Zhang, X., Kamp, M., and Dou, Q.                 Saha, R., Srivastava, V., and Pilanci, M. Matrix compression
  Fed{bn}: Federated learning on non-{iid} features via               via randomized low rank and low precision factorization.
  local batch normalization. In ICLR, 2021b.                          NeurIPS, 36, 2023.

                                                               11
                        FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

Shamsian, A., Navon, A., Fetaya, E., and Chechik, G. Per-          Yang, Q., Liu, Y., Chen, T., and Tong, Y. Federated machine
  sonalized federated learning using hypernetworks. In               learning: Concept and applications. ACM TIST, pp. 1–19,
  ICML, pp. 9489–9502, 2021.                                         2019.

Sharma, P., Ash, J. T., and Misra, D. The truth is                 Ye, R., Xu, M., Wang, J., Xu, C., Chen, S., and Wang,
  in there: Improving reasoning in language models                   Y. Feddisco: Federated learning with discrepancy-aware
  with layer-selective rank reduction. arXiv preprint                collaboration. In ICML, pp. 39879–39902. PMLR, 2023.
  arXiv:2312.13558, 2023.
                                                                   Yuan, Z., Shang, Y., Song, Y., Wu, Q., Yan, Y., and Sun,
Su, S., Yang, M., Li, B., and Xue, X. Federated adaptive             G. Asvd: Activation-aware singular value decomposition
  prompt tuning for multi-domain collaborative learning.             for compressing large language models. arXiv preprint
  In AAAI, pp. 15117–15125, 2024.                                    arXiv:2312.05821, 2023.

Tan, Z., Wan, G., Huang, W., Li, H., Zhang, G., Yang,              Zhao, H., Du, W., Li, F., Li, P., and Liu, G. Fedprompt:
  C., and Ye, M. Fedspa: Generalizable federated graph               Communication-efficient and privacy-preserving prompt
  learning under homophily heterogeneity, 2025.                      tuning in federated learning. In ICASSP, pp. 1–5. IEEE,
                                                                     2023.
Venkateswara, H., Eusebio, J., Chakraborty, S., and Pan-
                                                                   Zhou, K., Yang, J., Loy, C. C., and Liu, Z. Conditional
  chanathan, S. Deep hashing network for unsupervised
                                                                     prompt learning for vision-language models. In CVPR,
  domain adaptation. In CVPR, pp. 5018–5027, 2017.
                                                                     2022a.
Wan, G., Huang, W., and Ye, M. Federated graph learn-
                                                                   Zhou, K., Yang, J., Loy, C. C., and Liu, Z. Learning to
 ing under domain shift with generalizable prototypes. In
                                                                     prompt for vision-language models. IJCV, 130(9):2337–
 Proceedings of the AAAI Conference on Artificial Intelli-
                                                                     2348, 2022b.
 gence, volume 38, pp. 15429–15437, 2024.
                                                                   Zhu, B., Niu, Y., Han, Y., Wu, Y., and Zhang, H. Prompt-
Wang, B., Li, H., Liu, X., and Guo, Y. Frad: Free-rider              aligned gradient for prompt tuning. In ICCV, pp. 15659–
 attacks detection mechanism for federated learning in               15669, 2023.
 aiot. IEEE IoT-J, 2023.

Wang, J., Liu, Q., Liang, H., Joshi, G., and Poor, H. V.
 Tackling the objective inconsistency problem in hetero-
 geneous federated optimization. In NeurIPS, pp. 7611–
 7623, 2020.

Wang, X., Zheng, Y., Wan, Z., and Zhang, M. Svd-
 llm: Truncation-aware singular value decomposition
 for large language model compression. arXiv preprint
 arXiv:2403.07378, 2024.

Wu, W., He, L., Lin, W., Mao, R., Maple, C., and Jarvis,
 S. Safa: A semi-asynchronous protocol for fast feder-
 ated learning with low overhead. IEEE Transactions on
 Computers, 70(5):655–668, 2020.

Xu, C., Qu, Y., Xiang, Y., and Gao, L. Asynchronous
  federated learning on heterogeneous devices: A survey.
  arXiv preprint arXiv:2109.04269, 2021.

Xu, J., Tong, X., and Huang, S.-L. Personalized federated
  learning with feature alignment and classifier collabora-
  tion. In ICLR, 2023.

Yang, F.-E., Wang, C.-Y., and Wang, Y.-C. F. Efficient
  model personalization in federated learning via client-
  specific prompt generation. In ICCV, pp. 19159–19168,
  2023.

                                                              12
                           FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

A. Method Details                                                          and local prompts, FedPHA avoids negative transfer from
                                                                           global representations to client-specific learning, thereby
A.1. Notations Definition                                                  enhancing the robustness and adaptability of personaliza-
To facilitate understanding of our proposed FedPHA, we                     tion in federated settings.
provide a summary of key notations used throughout this
paper in Table 5.                                                        B. Experimental Details
               Table 5: Summary of Notations.                            B.1. Details of Dataset Setup

  Symbol     Definition             Symbol      Definition               For our evaluation, we selected nine diverse visual classifi-
    N        Clients number              L      Loss function            cation datasets as benchmarks. Table 6 provides a detailed
     i       Client index                α      Push loss margin         overview, including the original task, number of classes,
    Di       Local dataset          U, S, V     SVD matrices             training and test sample sizes, and domain counts.
    ni       Dataset size                ρ      Null-space ratio
                                                                         For datasets with multiple domains, we followed the well-
    Cr       Clients in round r         d′      Null-space dim.
     E       Local epochs               V2      Null-space basis
                                                                         established Office-31 benchmarking protocol, which in-
     r,e
   Pg,i      Global prompt              Q       Projection matrix        cludes three domains: Amazon (A), Webcam (W), and
     r,e
   Pl,i      Local prompt               Ỹp     CLIP text input          DSLR (D). These domains represent variations in image
   Per,e     Projected prompt        tPadding   Zero padding             quality and style, capturing differences between online prod-
     l,i
   (r+1,0)
  Pg         Aggregated prompt         g(·)     Text encoder             uct images (Amazon), low-resolution webcam photos, and
       Tg    Global prompt length     f (·)     Image encoder            high-resolution DSLR images. Additionally, we incorpo-
       Ti    Local prompt length        g̃p     Text feature             rated Office-Home, which consists of four domains: Art
       η     Learning rate               f˜     Image feature            (Ar), Clipart (Cl), Product (Pr), and Real-World (Rw). These
       τ     Softmax temperature    sim(·, ·)   Cosine similarity        domains encompass diverse image sources, including artis-
                                                                         tic renderings, clipart illustrations, product photos, and nat-
                                                                         ural scene images, effectively capturing distribution shifts
A.2. Discussion                                                          across different acquisition methods and environments.
                                                                         By leveraging these datasets, our evaluation ensures a com-
Distinction from Existing G-L Prompt Methods. Here,
                                                                         prehensive assessment of model performance across varying
we provide a more detailed analysis of how our approach
                                                                         domains and real-world conditions.
fundamentally differs from prior work in terms of architec-
ture design and personalization flexibility.
• FedOTP (Li et al., 2024a) adopts a dual-prompt structure               B.2. Details of Implementation
  consisting of a global prompt and a local prompt. How-                 The optimizer used is Stochastic Gradient Descent (SGD)
  ever, it requires both prompts to be of equal length due to            (Robbins & Monro, 1951) with a learning rate of η = 0.001.
  the constraints of its unbalanced optimal transport frame-             All input images are resized to 224 × 224 pixels and fur-
  work. This architectural constraint significantly limits               ther divided into 14 × 14 patches with a dimension of 768.
  flexibility and the ability to tailor local representations to         We conducted all experiments with PyTorch (Paszke et al.,
  client-specific needs.                                                 2019) on NVIDIA RTX 3090 GPUs.
• FedPGP (Cui et al., 2024) employs a global prompt along-
  side two local adapters. In this setup, the local prompt is            B.3. Details of Baseline Implementation
  generated by adding a local adapter to the global prompt,
  resulting in a tightly coupled formulation. This additive              To ensure fair and transparent comparison with existing
  dependency forces the local prompt to inherit features                 Global-Local prompt methods, we re-implemented both
  from the global prompt, which may be suboptimal. In                    FedOTP (Li et al., 2024a) and FedPGP (Cui et al., 2024) un-
  scenarios where the global prompt is poorly aligned with               der a unified experimental framework. All experiments
  a client’s local data, this coupling can lead to negative              followed the protocol described in Section 4.1 and Ap-
  transfer, reducing the effectiveness of personalization.               pendix B.2, including identical training schedules, model
                                                                         architectures, and optimization settings.
• FedPHA (Ours) introduces a decoupled G-L prompt
  structure where each client receives a shared fixed-length             For all methods, we used a frozen CLIP backbone (ViT-
  global prompt and independently configures its local                   B/16), with a prompt length of 16 and embedding dimension
  prompt with a variable length. This design explicitly                  512. Local training was performed using SGD with a learn-
  supports heterogeneous prompt configurations, enabling                 ing rate of 0.001 and a batch size of 32. Each client trained
  better alignment with diverse data distributions and com-              for one local epoch per round, and we ran 50 communication
  putational capacities. Importantly, by decoupling global               rounds (reduced to 25 for CIFAR-10 and CIFAR-100). In ad-

                                                                    13
                                                FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

                                                           Table 6: Statistical details of datasets used in experiments.

               Dataset                                                        Classes       Train                Test           Domains                Task
               Caltech101 (Fei-Fei, 2004)                                      100          4,128              2,465                    1              Object recognition
               Food101 (Bossard et al., 2014)                                  101         50,500              30,300                   1              Fine-grained food recognition
               Flowers102 (Nilsback & Zisserman, 2008)                         102          4,093              2,463                    1              Fine-grained flower recognition
               OxfordPets (Parkhi et al., 2012)                                 37          2,944               3,669                   1              Fine-grained pet recognition
               DTD (Cimpoi et al., 2014)                                        47          2,820               1,692                   1              Texture classification
               Office31 (Saenko et al., 2010)                                   31          3,292                813                    3              Multi-domain image recognition
               OfficeHome (Venkateswara et al., 2017)                           65         12,475               3,113                   4              Multi-domain image recognition
               CIFAR10 (Krizhevsky et al., 2010)                                10         50,000              10,000                   1              General image classification
               CIFAR100 (Krizhevsky & Hinton, 2009)                            100         50,000              10,000                   1              General image classification


                                                                          PromptFL         FedPGP              FedOTP           FedPHA
                              Caltech101                       Food101                          Flowers102                                       OxfordPets                                                  DTD
               100                                                               100                                          100                                            90
                95                               90                               90                                           90                                            80
Accuracy (%)




                                                                                  80                                                                                         70
                90                               80                                                                            80
                                                                                  70                                                                                         60
                85                                                                                                             70                                            50
                                                 70
                                                                                  60
                80                                                                                                             60                                            40
                                                 60                               50
                     0   10    20    30    40         0   10   20   30   40            0   10       20    30         40             0       10    20    30    40                   0     10            20          30   40
                                Rounds                         Rounds                               Rounds                                        Rounds                                                 Rounds

 Figure 6: Comparison with the SOTA methods of convergence speed on single-domain datasets across 10 clients. The x-axis represents
 training rounds (from 0 to 50), while the y-axis shows the model accuracy over the course of training.


dition to the shared setup, each baseline has its own method-
specific parameters. For FedOTP, we used an unbalanced
optimal transport formulation (COT), with Sinkhorn pa-
rameters set to THRESH = 1e-3 and EPS = 0.1, and                                                                                                                                             32                         95.0
a maximum iteration limit of 100. For FedPGP, we followed                                                                                                                                    28




                                                                                                                                                                                                  Domain3 P Len
                                                                                                                                                                                            24
its original implementation using a bottleneck dimension of




                                                                                                                                                                                                                             Overall Accuracy %)
                                                                                                                                                                                            20                          94.5
4 and contrastive loss parameters µ = 1 and temperature                                                                                                                                     16
= 0.5. Other hyperparameters were kept consistent across                                                                                                                                    12
                                                                                                                                                                                            8
both baselines, including disabling context initialization                                                                                                                                                              94.0
                                                                                                                                                                                            4
(CTX INIT = False), disabling class-specific context                                                                                                                                   32
prompts (CSC = False), using mixed-precision training                                                                                                                                28                                 93.5
                                                                                                                                                                                   24
(fp16), and placing the class token at the end of the se-                                                        4                                                               20
                                                                                                                                                                                    en




                                                                                                                          8 12                                              16
                                                                                                                                                                                  PL




                                                                                                                                                                       12
                                                                                                                                                                             in2




quence.                                                                                                                          16
                                                                                                                            Doma      20
                                                                                                                                                                            ma




                                                                                                                                in1 P     24                       8
                                                                                                                                                                       Do




                                                                                                                                      Len    28                4
These configurations ensure that any observed performance                                                                                       32
differences arise from algorithmic or architectural factors,
rather than inconsistencies in training conditions. All experi-                                          Figure 7: Prompt length combination effects on Office31. The
                                                                                                         X, Y, and Z axes represent the average prompt lengths for Domain
ments were repeated across three random seeds for statistical                                            1, Domain 2, and Domain 3, respectively. The color intensity
robustness.                                                                                              of each point indicates the global accuracy achieved under the
                                                                                                         corresponding prompt length configuration.
 C. Additional Experiments Results
 C.1. Convergence Analysis                                                                               formance of four different training methods: PromptFL,
                                                                                                         FedPGP, FedOTP, and FedPHA. It can be observed that
 Figure 6 presents a comparison of convergence speed across                                              our FedPHA consistently converges faster than other meth-
 five different datasets (Caltech101, Food101, Oxford Flow-                                              ods, and its accuracy remains higher than that of other ap-
 ers, Oxford Pets, and DTD) over 50 training rounds. Each                                                proaches at all stages. This demonstrates the effectiveness
 subfigure represents a distinct dataset, illustrating the per-                                          of our method in personalization.

                                                                                                14
                                                                                       FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

                          Domain1 P Len = 4                                Domain1 P Len = 8                                 Domain1 P Len = 12                                Domain1 P Len = 16                                Domain1 P Len = 20                                Domain1 P Len = 24                                    Domain1 P Len = 28                                  Domain1 P Len = 32
Domain3 P Len = [4,32]




                                                  Domain3 P Len = [4,32]




                                                                                                    Domain3 P Len = [4,32]




                                                                                                                                                      Domain3 P Len = [4,32]




                                                                                                                                                                                                        Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                          Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                                                                            Domain3 P Len = [4,32]




                                                                                                                                                                                                                                                                                                                                                                    Domain3 P Len = [4,32]
                         Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                            Domain2 P Len = [4,32]                                Domain2 P Len = [4,32]                              Domain2 P Len = [4,32]
  Figure 8: Impact of Prompt Length on Domain Performance in OfficeHome. Each 8×8 heatmap illustrates the effect of different
  Domain 2 and Domain 3 prompt length combinations on global accuracy, when the prompt length of Domain 1 is fixed and Domain 4 is
  set to 16. The X-axis represents the prompt length of Domain 2, while the Y-axis represents that of Domain 3. Color intensity indicates
  accuracy, with red representing higher accuracy and blue representing lower accuracy. Black-boxed grids highlight configurations where
  the prompt length of Domain 1 matches that of Domain 2 or 3.


  C.2. Inter Domain Analysis

 Table 7: Comparison of Overall Mean values across different                                                                                                                                                                                                                                                                                                                                               89.6
 domains with different prompts lengths.                                                                                                                                                                                                                                                                                                                            32
                                                                                                                                                                                                                                                                                                                                                                    28                                     89.4




                                                                                                                                                                                                                                                                                                                                                                                   Domain3 P Len
                         ID       Domain1                                     Domain2                                   Domain3                  Overall Acc                                                                                                                                                                                                       24




                                                                                                                                                                                                                                                                                                                                                                                                               Overall Accuracy %)
                                                                                                                                                                                                                                                                                                                                                                   20
                          1             28                                          12                                          16                                             95.45                                                                                                                                                                               16                                      89.2
                                                                                                                                                                                                                                                                                                                                                                   12
                          2             20                                          12                                          28                                             95.19                                                                                                                                                                               8
                          3             24                                          12                                          32                                             95.15                                                                                                                                                                               4                                       89.0
                          4              4                                          4                                            4                                             95.13                                                                                                                                                                          32
                                                                                                                                                                                                                                                                                                                                                            28                                             88.8
                          5              8                                          32                                          16                                             95.12                                                                                                                                                                      24
                                                                                                                                                                                                                                        4                                                                                                               20




                                                                                                                                                                                                                                                                                                                                                           en
                          6             32                                          8                                           28                                             95.12                                                         8 12                                                                                                  16




                                                                                                                                                                                                                                                                                                                                                         PL
                                                                                                                                                                                                                                                                                                                                              12                                                           88.6




                                                                                                                                                                                                                                                                                                                                                    in2
                                                                                                                                                                                                                                                    16
                          7             28                                          4                                           28                                             95.09                                                           Doma      20




                                                                                                                                                                                                                                                                                                                                                ma
                                                                                                                                                                                                                                                   in1 P     24                                                                           8




                                                                                                                                                                                                                                                                                                                                              Do
                                                                                                                                                                                                                                                         Len    28                                                                   4
                          8             16                                          32                                           8                                             95.05                                                                               32
                          9              8                                          16                                          32                                             95.05
                                                                                                                                                                                                                                 Figure 9: Prompt length combination effects on OfficeHome.
                         10             20                                          4                                           32                                             95.04
                                                                                                                                                                                                                                 The X, Y, and Z axes represent the average prompt lengths for
                          ..             ..                                          ..                                          ..                                              ..                                              Domain 1, Domain 2, and Domain 3, respectively, with Domain
                           .              .                                           .                                           .                                               .
                                                                                                                                                                                                                                 4 fixed at length 16. The color intensity of each point reflects the
                   512               32          28         12                                                                                                                 93.04                                             global accuracy.
                                   Mean of 512 combinations                                                                                                                    94.36


 Additionally, we investigated the impact of different prompt                                                                                                                                                                    rowing the search space to a manageable 512 combinations.
 length combinations on overall performance, as shown in
                                                                                                                                                                                                                                 The corresponding 3D scatter plot is illustrated in Figure 9,
 Figure 7. The eight heatmaps in Figure 4 can be regarded
                                                                                                                                                                                                                                 where each point represents a unique prompt length combi-
 as planar slices of Figure 7, providing a more granular view
                                                                                                                                                                                                                                 nation for the first three domains. The spatial distribution
 of how prompt length variations influence accuracy across
                                                                                                                                                                                                                                 reveals clear patterns: high-performing configurations tend
 different domains. In Table 7, we list the average accuracy
                                                                                                                                                                                                                                 to cluster in regions where the prompt lengths differ across
 of 512 prompt length combinations sorted in descending
                                                                                                                                                                                                                                 domains, again suggesting that uniform configurations are
 order. From the table, we can observe that the only well-
                                                                                                                                                                                                                                 not optimal. This observation is consistent with our earlier
 performing combination with uniform lengths is [4,4,4],
                                                                                                                                                                                                                                 findings from Office31.
 while all other combinations have varying lengths. This fur-
 ther validates our research motivation: for clients with dif-                                                                                                                                                                   In addition, Figure 8 presents eight heatmaps with fixed
 ferent data distributions, adopting different adaptive prompt                                                                                                                                                                   prompt lengths for Domain1, offering a slice-by-slice visu-
 lengths is more beneficial for personalization.                                                                                                                                                                                 alization across Domain2 and Domain3. Similar to Office31,
                                                                                                                                                                                                                                 black-boxed cells indicate uniform prompt lengths across all
 Beyond Office31, we extended our inter-domain prompt
                                                                                                                                                                                                                                 domains. These boxed areas rarely correspond to the highest
 length analysis to the OfficeHome dataset, which comprises
                                                                                                                                                                                                                                 accuracy regions, reinforcing the insight that heterogeneity-
 four distinct domains. Given the increased number of clients,
                                                                                                                                                                                                                                 aware prompt length selection is critical for maximizing
 the total number of possible prompt length combinations
                                                                                                                                                                                                                                 performance in multi-domain federated settings.
 grows exponentially (84 = 4096), making exhaustive eval-
 uation computationally infeasible. To reduce complexity                                                                                                                                                                         Taken together, these findings provide converging evidence
 while maintaining representative coverage, we constrained                                                                                                                                                                       across datasets: the assumption that all clients benefit from
 the prompt length of the fourth domain to 16, thereby nar-                                                                                                                                                                      the same prompt length is fundamentally flawed. Instead,

                                                                                                                                                                                                    15
                         FedPHA: Federated Prompt Learning for Heterogeneous Client Adaptation

Table 8: Sensitivity analysis of projection ratio ρ and push margin α on 5 datasets. FedPHA achieves robust performance across a
wide range of settings with shot number = 16. Default values are ρ = 0.8, α = 1.0.

                   (a) Average over 5 datasets.                                            (b) Caltech101.

      α/ρ        0.3      0.5       0.8      1.0     Avg.               α/ρ        0.3      0.5      0.8      1.0     Avg.
      0.5      97.05    97.04     96.99     96.92    97.00               0.5     98.97    98.99     98.91    98.97    98.96
      1.0      97.04    97.02     97.13     97.08    97.07               1.0     99.01    99.05     99.12    99.04    99.06
      1.5      96.94    96.99     96.94     96.95    96.96               1.5     98.97    99.07     98.93    98.95    98.98
      2.0      96.88    96.82     96.85     96.87    96.85               2.0     98.89    98.77     98.88    98.84    98.84
      Avg.     96.98    96.97     96.98     96.96    96.97               Avg.    98.96    98.97     98.96    98.95    98.96

                          (c) Food101.                                                     (d) Flowers102.

      α/ρ        0.3      0.5       0.8      1.0     Avg.               α/ρ        0.3      0.5      0.8      1.0     Avg.
      0.5      96.22    96.27     96.23     96.27    96.25               0.5     99.33    99.16     99.23    99.24    99.24
      1.0      96.35    96.38     96.42     96.33    96.37               1.0     99.28    99.19     99.23    99.32    99.25
      1.5      96.61    96.51     96.49     96.48    96.52               1.5     99.01    99.14     99.14    99.12    99.10
      2.0      96.48    96.42     96.43     96.38    96.43               2.0     99.17    98.78     99.08    99.07    99.02
      Avg.     96.42    96.39     96.39     96.36    96.39               Avg.    99.20    99.07     99.17    99.19    99.16

                         (e) OxfordPets.                                                      (f) DTD.

      α/ρ        0.3      0.5       0.8      1.0     Avg.               α/ρ        0.3      0.5      0.8      1.0     Avg.
      0.5      99.15    99.06     99.13     99.08    99.11               0.5     91.59    91.74     91.45    91.02    91.45
      1.0      99.24    99.18     99.21     99.14    99.19               1.0     91.31    91.30     91.67    91.57    91.46
      1.5      99.08    99.27     99.03     99.06    99.11               1.5     91.02    90.96     91.12    91.16    91.06
      2.0      99.06    98.94     98.86     99.01    98.97               2.0     90.82    91.17     90.98    91.07    91.01
      Avg.     99.13    99.11     99.06     99.07    99.09               Avg.    91.19    91.29     91.31    91.20    91.25


our FedPHA approach, which allows client-specific prompt              deployments where fine-tuning may not always be feasible.
length adaptation, effectively captures domain-level vari-
                                                                      For Caltech101 and OxfordPets, performance remains re-
ability and leads to superior cross-domain generalization.
                                                                      markably stable, exceeding 98.8% across all tested settings,
                                                                      with optimal configurations coinciding with the default val-
C.3. Sensitivity Analysis                                             ues. Food101 exhibits a mild preference for larger α (es-
Table 8 reports a detailed sensitivity analysis of FedPHA             pecially 1.5), indicating that a stronger push margin may
with respect to the projection ratio ρ in Eq.(9) and the push         help in fine-grained classification tasks. Flowers102 shows
margin α in Eq.(12) across five datasets. Each cell in the            high tolerance to both α and ρ changes, suggesting that
table presents the average accuracy over the last 10 training         the method generalizes well in image domains with intra-
epochs under a specific configuration.                                class similarity. In contrast, DTD reveals greater sensi-
                                                                      tivity to hyperparameter shifts. Nevertheless, its accuracy
As shown in Table 8 (a), the average accuracy across all              remains within a relatively narrow and acceptable range
datasets remains consistently high across a broad range               (90.8%–91.7%), demonstrating that FedPHA retains com-
of (α, ρ) combinations. The best overall performance                  petitiveness even under more challenging visual domains.
(97.13%) is achieved when α = 1.0 and ρ = 0.8, which
are also the default values used throughout our main experi-          This table-based analysis confirms that FedPHA achieves
ments. Importantly, performance degradation remains mini-             strong and stable performance under a wide spectrum
mal—typically within 0.2%—even when deviating from this               of hyperparameter choices. The default configuration
configuration. This reflects the robustness of FedPHA and             (α=1.0, ρ=0.8) serves as a robust and well-balanced setting
its insensitivity to moderate variations in hyperparameter            across diverse data distributions, minimizing the need for
settings, which is a desirable property in practical federated        extensive tuning in real-world federated learning scenarios.


                                                                 16
