Can Textual Gradient Work in Federated Learning?
Authors: Minghui Chen
Ruinan Jin
Wenlong Deng
Yuanyuan Chen
Zhi Huang
Han Yu
Xiaoxiao Li
Venue: ICLR 2025 Poster (2025)
Keywords: Federated Learning; LLMs-as-Optimizer
Primary area: foundation or frontier models, including LLMs
TL;DR: A Pilot Study on Federated Learning Using Large Language Models as Optimizers

Abstract: Recent studies highlight the promise of LLM-based prompt optimization, especially with TextGrad, which automates ``differentiation'' via texts and backpropagates textual feedback provided by LLMs. This approach facilitates training in various real-world applications that do not support numerical gradient propagation or loss calculation.  It opens new avenues for optimization in decentralized, resource-constrained environments, suggesting that users of black-box LLMs (e.g., ChatGPT) could enhance components of LLM agentic systems (such as prompt optimization) through collaborative paradigms like federated learning (FL). In this paper, we systematically explore the potential and challenges of incorporating textual gradient into FL. Our contributions are fourfold.
**Firstly**, we introduce a novel FL paradigm, Federated Textual Gradient (FedTextGrad), that allows FL clients to upload their locally optimized prompts derived from textual gradients, while the FL server aggregates the received prompts through text summarization. Unlike traditional FL frameworks, which are designed for numerical aggregation, FedTextGrad is specifically tailored for handling textual data, expanding the applicability of FL to a broader range of problems that lack well-defined numerical loss functions. 
**Secondly**, building on this design, we conduct extensive experiments to explore the feasibility of federated textual gradients. Our findings highlight the importance of properly tuning key factors (e.g., local steps) in FL training to effectively integrate textual gradients. 
**Thirdly**, we highlight a major challenge in federated textual gradient aggregation: retaining essential information from distributed prompt updates. Concatenation often produces prompts that exceed the LLM API’s context window, while summarization can degrade performance by generating overly condensed or complex text that lacks key context. 
**Last but not least**, in response to this issue, we improve the vanilla variant of FedTextGrad by providing actionable guidance to the LLM when summarizing client prompts by leveraging the Uniform Information Density principle. Such a design reduces the complexity of the aggregated global prompt, thereby better incentivizing the LLM's reasoning ability. Through this principled study, we enable the adoption of textual gradients in FL for optimizing LLMs, identify important issues, and pinpoint future directions, thereby opening up a new research area that warrants further investigation.

Published as a conference paper at ICLR 2025
CAN TEXTUAL GRADIENT WORK IN FEDERATED LEARNING?
Minghui Chen 1,2,3, Ruinan Jin 1:2 Wenlong Deng! Yuanyuan Chen', Zhi Huang Han Yu?,
Xiaoxiao Li
'The University of British Columbia
Vector Institute
Nanyang Technological University
University of Pennsylvania
ABSTRACT
Recent studies highlight the promise of LLM-based prompt optimization, espe- cially with TextGrad (Yuksekgonul et al. 2024), which automates "differentia- tion" via texts and backpropagates textual feedback provided by LLMss This approach facilitates training in various real-world applications that do not sup- port numerical gradient propagation or loss calculation. It opens new avenues for optimization in decentralized, resource-constrained environments, suggest- ing that users of black-box LLMs (e-g., ChatGPT) could enhance components of LLM agentic systems (such as prompt optimization) through collaborative paradigms like federated learning (FL). In this paper, we systematically explore the potential and challenges of incorporating textual gradient into FL. Our con- tributions are fourfold. Firstly, we introduce a novel FL paradigm, Federated Textual Gradient (FedTextGracl that allows FL clients to upload their lo- cally optimized prompts derived from textual gradients, while the FL server ag- gregates the received prompts through text summarization. Unlike traditional FL frameworks, which are designed for numerical aggregation, GedTextGrad is specifically tailored for handling textual data, expanding the applicability of FL to broader range of problems that lack well-defined numerical loss func- tions. Secondly, building on this design, we conduct extensive experiments to explore the feasibility of federated textual gradients. Our findings highlight the importance of properly tuning key factors (e.g., local steps) in FL training to effectively integrate textual gradients. Thirdly, We highlight major chal- lenge federated textual gradient aggregation: retaining essential information from distributed prompt updates. Concatenation often produces prompts that ex- ceed the LLM API's context window, while summarization can degrade perfor- mance by generating overly condensed complex text that lacks key context. Last but not least, in response to this issue, we improve the vanilla variant of FedText Grad by providing actionable guidance to the LLM when marizing client prompts by leveraging the Uniform Information Density prin- ciple. Such a design reduces the complexity of the aggregated global prompt. thereby better incentivizing the LLM's reasoning ability. Through this principled study, we enable the adoption of textual gradients in FL for optimizing LLMs. identify important issues, and pinpoint future directions, thereby opening up a new research area that warrants further investigation. Our code is available on https://githunt com /ubc tea/
INTRODUCTION
Large Language Models (LLMs) (Zhao et al. 2023). such as GPT (Brown 2020), Gemini (eam al. 2023) and LLaMa (Touvron al.) 2023) have become the foundational backbone of modern natural language processing (NLP) systems. These models often require fine-tuning to enhance their responsiveness specific tasks. While existing open datasets play important role in LLM tuning, the vast amount of privately owned, potentially sensitive data continuously generated by end devices represents a significant, yet largely untapped, pool of samples for LLM fine-tuning.

---

Published as a conference paper at ICLR 2025
To adapt to this reality, federated learning (FL) (McMahan et al. 2017) offers promising privacy-
preserving framework for collaboratively fine-tuning LLMs with distributed, privately owned data. To address the efficiency demands and black-box nature of many involving LLM APIs (Achiam
et al. 2023), recent advancements in zeroth-order optimization (Qin et al. 2023; Fang et al. 2022)
beginning to provide useful tools for exploring this avenue. However, these methods gener-
ally rely on numerical loss calculations to estimate gradients Balasubramanian & Ghadimi (022).
which infeasible when using black-box LLM APIs, where the loss definition is unclear Yang
et al. 2024b) and only textual feedback (e.g., human feedback in ChatGPT (Achiam et al. 2023 is
available Yuksekgonul al. 2024).
Recently, LLMs have been demonstrated as effective optimizers (Pryzant et al. 2023 Liu et al.
2024 Yang et al., 2024b), capable of automatically refining prompts step-by-step to enhance perfor- mance (Shinn et al.) 2024), while providing informative and interpretable natural language crit- icism to the variables to guide how the variables should update. As representative method, TextGrad (Yuksekgonul et al., 2024) enables automatic "differentiation" through text, allowing the backpropagation of textual feedback to improve individual components of a compound LLM agentic system without relying on gradients or numerical calculations. While TextGrad offers substantial advantages in traditional centralized machine learning settings, its adaptation to FL environments remains unexplored. In this paper, we seek answer the exploratory question:
Can textual gradient work under federated learning settings?
Our contributions are fourfold, as outlined below.
To facilitate textual gradient operations in FL environments, we propose first-of-its- kind redTextGrad method. Under this method, each FL client is equipped with TextGrad-based textual gradients during local training. Instead of uploading model parameters like in classical FL (e.g., FedAvg (McMahan et al.) (017)), ) clients upload their optimized local prompts to the FL server. The server then performs prompt aggregation through concatenating and summarizing clients' local prompts, and redistribute the global prompt back to the clients for further training.
Adapting:
With Ged we then conduct experimental studies across various LLMs and configurations to empirically investigate its relative performance under FL settings compared to TextGrad in centralized settings on a range of reasoning tasks. During this process, we study the impact of key factors-such as local update epochs, batch size, number of clients, and data heterogeneity- on the performance of our framework.
Investigating:
Through our empirical investigation, we have identified key challenge for feder- ated textual gradient aggregation: preserving critical information in distributed prompt updates. Concafenation-baseed prompt aggregation can produce excessively long prompts that exceeds the LLM API's context window, while summarization based prompt aggregation often degrades per- formance by generating overly complex and densely packed texts. This is currently the key hurdle hindering the adoption of textual gradient in FL settings.
Uncovering:
Improving: To address this challenge, we develop key insight that uneven distribution of in- formation within the summarized prompts is the root cause. We then introduce an enhanced sum- marization method based on the Uniform Information Density (UID) principle to ensure more balanced information distribution across the summarized global prompt. It improves prompt ag- gregation in FedText Grad by maintaining a uniform information density, resulting in shorter aggregated prompts that preserve critical contents without sacrificing model performance.
Related work: A detailed literature review is provided in App. A
For LLMs. As LLMs have achieved significant success in centralized learning, there is a grow- ing interest in adapting FL to accommodate the fine-tuning of pre-trained L.MMs (Ren et al.
2024).
particularly to supplement the publicly available data with privately owned datasets Jin & L.] 2023)
In response, several frameworks have emerged recently, including OLM Ye et al. (2024)
and FederatedScope-LLL
Kuang et al. (2024). Moreover, advanced methods such as FedbiOT Wu
et al. (2024) which safeguards model ownership, and FFA-LORA (Sun et al. (2024) which enhances performance under differential privacy constraints, are being developed to optimize LLM training in federated environments.
L.Ms Optimziers. Recent research has turned towards leveraging L.LMs as optimizers in black-
2

---

Published as a conference paper at ICLR 2025
Qunny: thove thrse cranges, pia. fmg a con, three tanaras. tectariss wanet, Hew many
Reccoonee lo find the tottal number of antmmais nead
Updated Prompe
identily and count anamata
provkling cleaa endicinose
response that accunedly
Promsic You will answer wensoring quartion Think avep by seop, The lost line of your
The las includeea elg frog. and is coes There now all animmate. We don't necd to count the fruita and small thiy are
agdregate?
acdrussss the qu ention being
asbed: Coraider connect
response should the
Ground Truth:44 Answer:
Summarization?
response includss and concse arswerr fornat.
accusste. Freure
SVALUE VALUE
So, the totall number
Evolustion:
Multi-
Concatenation?
Arower SUALLE Viili
dResponce
divalaation Resprrnsse
numeriaal volac....
diprumpe
"Impr rone the promut
"issprove respense by
4. Textural Grad
Appregened quedtton nicng
step-ty tyyuthep and privicing clear and concase resporse ther
Prompt AgD legregation
LLM
LLM
accuistelyy sidrrence the quustion being sxrees, Consider connoct
Prompp
2. R.Rosponse
3.Eaaluation
Client
BReepunaae @Prompt
"ompruve the prrumpt by
Evallstion iMerrponee
"Improve the respoxce by
octieve this broak down the prob wm into amall and provice a clear explanation ofwachh cnep...
Textural Grad
* LLM
LLM
S8
Challanges
Undaned Promet You will answer ruason ng questin.
1.Prompt
2. Responsee
3. Evaluation
Client 2
Think ctepity step and prouide
Haterogeneity
eeplir colcclaatoon. intermaciitt stads
Querys hove coiiiien, a trog mousi, col, pr go, two howe??
Reeponon fodind numberr wercod indio dially and then them togetiier.
Ground Arswon
Robustness
Eniluttoor1
Privacy
excculetions and cleasty indicets the tisl snewer within your spp arstion stmplyy state nnower prowiding
Prompnt You enswor o reasoning question Trink step by step. lin your
1. Yourhaee chickin..
2 Youlhawe flog.
Efficiency
animalls
Latiicatio...
Yerswar:
gul LIT wheee Vhl
I Jooksoon) 1 (tregi (mnuue))
numentaa valuo..
11 (pary Pipipe 2 (mbaais)- +
Figure 1: Illustration of FedText where the upper part (blue boxes) and the lower part (green boxes) represent two different clients. Within each client, circles represent the prompts, and boxes represent the LLM. FedTextGrad consists of four steps for local updating, proceeding from left to right. In step-1 (Prompt), the client is tasked with answering the Query by initializing Prompi to the LLM to obtain a response. Then, in step-2 (Response). the LLM performs multi-step reasoning (e.g.. CoT) and generates Response. In step-3 (Evaluation), the Response is evaluated against the ground truth by the LLM, and Evaluation score is generated. Finally, step-4 (Textual 1 Grad), ; the Prompt is updated "backward" based on feedback from the L.M. After this, the client sends the Updated Prompt to the server. On the server-side, the collected prompts from all clients are aggregated by the server, which acts as a trusted third party, and then sent back to the clients, as shown in step-5, 5. Two aggregation strategies are available: simply concatenating the prompts or using the server-side LLM to summarize them. The system iteratively performs local updates (multiple local epochs of steps 1-4) and global aggregation (step-5) for optimization in the FL system.
box settings (Yang et al. 2023). The foundation of this concept stems from the ability of LLMs to simulate human decision-making Zhheng et al. (2023) benchmarked the behavior of LLMs and human decisions, finding that modern LLMs align closely with human judgment. Building on this, Yang al. (2024b) proposed optimization by prompting. where LLMs generate new solutions based on prompt that includes previously generated solutions Ma et al. (2024) further investigated whether I.IMSs are effective prompt optimizers. Tools like DSPy Khattab et al. (2023) and Pro- TeGi Pryzant Pryzatry et al. (2023) introduced programmatic frameworks for optimizing LLM- APIs, achieving performance gains across tasks such as question answering and prompt refinement. These new solutions are then assessed and incorporated into the prompt for the next optimization step.
2 THE PROPOSED FedTextGrad METHOD
In this section, we first provide background on TextGrad, including its forward operation, backpro- pogation and how LLM-as-the-optinne -hhoooooe can be integrated with TextGrad (Section 2.1). Next, we explain the analogy between textual and numerical gradients, and describe its extension into the FL setting redTextGrad (Section 2.2). Finally, we present preliminary results across various LLM APIs using TextGrad and FedTextGrad highlighting the performance drops (Section 2.3
3

---

Published as a conference paper at ICLR 2025
2.1 PRELIMINARIES ON TEXTGRAD.
TextGrad is a framework that leverages LLMs for iterative prompt optimization through natural language feedback, combining (1) forward operation to generate and evaluate responses, (2) backpropagation-lik updates using textual gradients, and (3) LLM-based optimization via Textual Gradient Descent to refine prompts effectively across tasks.
Forward Operation of TextGrad. As illustrated in Figure I the forward operation of TextGrad take input query and the Prompt (parameter to be optimized) to fixed LLM to generating responses. This Response is then concatenated with the Evaluation Instruction to form the input for the next LLM call for evaluation. The structure of the computational graph can be expressed as:
LLM
Response- + Evaluation Instruction LLM Evaluation,
Query + Prompt
where + denotes the concatenation operation. The depth of this computational graph can be ex- tended by adding intermediate response nodes before performing the final evaluation step. This ex- tension accommodates more complex step-by-step reasoning chain, which analogous adding more layers in deep neural network.
Backpropogation of TextGrad. Based on the output of the forward operation, TextGrad pro- ceeds with backpropagation to update the Prompr by calculating @Evaluation/ /Prompt using the Chain Rule first computing the 'gradient' with respect to the Response, @Evaluation RRsiiooseeessseeeeeeeeee by collecting feedback on the Response from the Evaluation; then /Response ing prompt updates from Response using LLMs. The textural gradient represents natural language feedback, such as: "This response can be improved by...", ", guiding the adjustment of variables (e.g.. the Prompt) to optimize the downstream objective, similar to how numerical gradients function in traditional optimization. This approach allows for the iterative refinement of the Prompt, analogous to the use of numerical gradients backpropagation to optimize neural network weights.
by obtain-
L.MMs-as-Optimize: in TextGrad. After obtaining the 'gradient' (dEvaluation/OPrrome Tex- tual Gradient Descent (TGD) leverages LLMs to update the Prompt, by iteratively refining using the obtained textual 'gradient', similar to the backpropagation process in neural networks. The update rule for the Prompt is:
(8) where textual gradients inform the optimization process. Essentially, TGD step (-) imple- mented through an LLM call using predefined instruction template: "Below are the criticisms on (Prompt]: {dEvaluation/ (0Evaluation//Promppl Incorporate the criticisms and generate an updated prompt."
Prompt = step. (Prompt, @ (orriitt)//
2.2 FROM TEXTGRAD TO FedTextGrad.
We introduce FedTextGrad, a novel adaptation of TextGrad for FL environments. While our ini- tial demonstration focuses on prompt optimization (Pryzant et al.) 2023), the methodology is versa- tile and can be applied to a wide range of tasks such retrieval-augmented generation (Lewis al., 2020) and tool use (Schick et al. 2024) supporting federated L.M agentic systems. FedTextGrat extends TextGrad by integrating textual gradient-based optimization into FL. client local training. In this setup, clients optimize their local prompts using LLM -LM-generated textual gradients. sharing these prompts instead of raw gradient updates with the central server. It mirrors FedAvg (McMahan al. 2017,, where local model updates are aggregated at the server. Rather than aggregating numerical gradients, FedText Grad aggregates natural language prompts across clients. The key innovation in Fedd is enabling collaborative textual optimization in FL settings, where prompts are iteratively improved by individual FL clients and then aggregated to form a global prompt. The challenge here lies in defining explore intuitive methods such as concatenation and summarization to evaluate their effectiveness across various LLM APIs and FL settings.
effective aggregation strategy for these local prompts. We first
2.3 FedTextGrad FRAMEWORK DESCRIPTION
The FedTextGrad framework iteratively refines prompts through (1) client-specific updates using textual gradients, (2) server-side aggregation into global prompt, and (3) redistribution to clients
4

---

Published as a conference paper at ICLR 2025
across communication rounds. The detailed process, outlined in Algorithm follows these steps:
1. Client Prompt Updates: (Algorithm [ steps 12-18): Each client receives the global prompt
P' and fine-tunes it using its local dataset D. Textual gradients generated by the LLM guide this local optimization, producing an updated prompt P which captures the unique distribution of each client's data.
2. Server Prompt Aggregation (Algorithm | step 9): The server collects the updated prompts Pf from all clients and aggregates them into new global prompt pt+1, Aggregation strategies such as concatenation or summarization are used to integrate client updates.
steps 6-8): The server then distributes the updated global prompt p++1 to all clients. This iterative process continues across several communication rounds, with each iteration refining the global prompt based on client-specific updates.
Global Prompt Distribution (Algorithm 1
This iterative framework enables prompt updates at both local and global levels, ensuring the model adapts effectively to heterogeneous client environments.
EXPERIMENTAL INVESTIGATION
3.1 EXPERIMENT SETTINGS
Algorithm 1
Algorithm of FedTextGrad
Data and Tasks, We evaluate FedTextGrad on prompt optimization across three key tasks from the BBH benchmark (Srivastava et al. 2022; : 1) BBII Object Counting, 2) BBH Mul- tistep Arithmetic, and 3) GSM8k Math Prob- lem (Cobbe et al.) (021). They are well-suited for assessing the effectiveness of prompt opti- mization in complex reasoning scenarios. For each dataset, we split it into training, validation, and test sets. We adopt the dataset preprocess- ing methodology outlined in (Yuksekgonul et al. 2024). The training set is used for prompt opti- mization. The validation set is used for prompt selection and set is used for reporting the final performance, thereby ensuring fair and rigorous evaluation.
Input: N clients indexed by i, B: local mini-
batch size, C: Client sampling rate. T: number of rounds
Output: Updated Prompts P 1: ServerExecute(C)): Initialize pe
3: for each round f = 1, 2. do
m + max NN,
5:
S. + (random set of clients)
for each client E S, in parallel do
7:
pt+ ClientUpdate((i, P')
8: end for
pi+1 PromptAgg((P hes.) (ess))
tuning. The test
10: end for
11: Return Final PT
12: ClientUpdate(i, P):
Model and Setup. For our experiments, the Alama-3.1-8B model (Dubey et al.) (2024) for prompt optimization, serving as both the infer- ence engine and the optimizer within our frame- work. Unless otherwise specified, we use a default batch size of 3 with 3 local steps for tuned hyper-parameters, with batches sampled randomly with replacement. After each iteration, the same batch evaluated loop. The prompt is updated only if the performance does not drop compared the previous non-updated version. Under homogeneous FL settings, each dataset is randomly split into 3 clients, each having an equal number of training and validation samples.
use
13: B +- (Split D; in to batches of size B)
14: for each local epoch e = to do
15: for each batch b E B do
16:
T+GG..tstep (P, @Evalaaioon oP
17:
end for
18:
end for
19: Return to server.
3.2 EMPIRICAL STUDY ON KEY HYPER-PARAMESS CHOICES
This section investigates the impact of key Syper-parameters, including local steps, number of clients and batch size, FedText Grad through ablation studies.
Local steps: Previous FL research (McMahan et al. 2017) has frequently conducted ablation studies on local steps to understand the balance between local model updates and global model synchroniza- tion. traditional FL, increasing local steps is expected to reduce communication costs by allowing more local updates before synchronization with the server (McMahan et al., 2017 Li et al. 2020). However, this often comes at the cost of performance degradation due to local overlitting and diver- gence from the global model. As observed in Fig. 2a increasing local steps in our setting leads to
5

---

Published as a conference paper at ICLR 2025
Object Counting
Object Counting Mullistu Arithmeic GSMBK
Acc.
Object Counting Multistep Arithmetic GGNBK
Multistop Arithmetic
Local Step
Client Num
Batch Size
(a) Local Steps
(b) Number of FL Clients
(c) Batch Sizes
Figure 2: Ablation study of the impact three key FL haphhh-pppaeeee haper-parameters on FedTextGrad, eval-
uated across three datasets.
significant performance drop, confirming that too many local updates without frequent synchroniza- tion exacerbate model misalignment across clients.
Previous work McMahan et al. (2017) Li et al. (2020) has explored the effect of increasing the number of clients in FL to evaluate the model's robustness to client heterogeneity and communication bottlenecks. In Fig. 2b examine this effect by splitting single-task dataset into multiple subsets, each representing client. With the increase in the number of clients, the performance drops dramatically. This can be attributed communication overhead and misaligned prompt updates between the server and clients. Furthermore, in tasks like Object Counting, increas- ing the number of clients consistently degraded performance, likely due the model's sensitivity to the heightened heterogeneity and divergent data distributions.
Number of clients:
Batch size: Ablation studies on batch size in FL typically explore its impact on convergence and communication efficiency. Larger batch sizes are expected to stabilize training by reducing gradient variance, but they might also slow the convergence due the reduced frequency of updates (McMa- han et al. 2017). In Fig. [c] it can be observed that increasing the batch size initially improves performance by smoothing the optimization process. After a certain threshold, performance de- clines. This is likely due to less frequent updates, which reduce the model's ability to adapt quickly to new data distributions, especially under distribution shifts.
In summary, our ablation studies reveal that while increasing local steps and batch size ini- tially stabilize and improve optimization, they ultimately introduce significant challenges related to communication efficiency and global model alignment. Similarly, increasing the number of clients improves performance up to a point, but leads to degradation due to communication and synchro- nization issues, partieularly in data heterogeneous environments.
3.3 EVALUATION ON HETEROGENEOUS SETTINGS
Heterogeneous Experimental Setup. We
Table 1: Performance of Heterogeneous FedTextGrad Framework Across Batch Sizes (B) and Local Steps (E). This table presents the performance of the Heteroge- neous FedTextGrad framework using three datasets (Object Counting, Multistep Arithmetic, GSM8K) as clients in a federated learning setup, with total of 3 clients.
evaluate the Heterogencous FedTextGrad framework using three distinct datasets: Object Counting, Multistep Arithmetic, and GSM8K, with each dataset representing a client in the federated learning setting. The experiments fo- critical hyperparameters: the num- ber of local steps (E) and batch size (B). Lo- cal steps (E) refer to the number of client- specific updates performed before global model synchronization, while the batch size (B) de- termines the number of samples processed in each local update. To investigate the interac-
E
==
==3
B 10
3
0.73 (0.03)
0.78 (0.02)
0.72 (0.03)
5
0.83 (0.02)
0.86 (0.02)
0.84 (0.01)
tion between these hyperparameters, we con- duct evaluations with E {3. 5, 10] and B E 31 10}. Each dataset is split evenly among clients, and the performance is assessed based on the model's ability to adapt under varying hyper- parameter configurations.
10
0.81 (0.03)
0.83 (0.02)
0.80 (0.02)

---

Published as a conference paper at ICLR 2025
Results and Observations. The results presented in Table 1 reveal notable patterns in the Het- erogeneous FedText Grad framework's performance across different local steps and batch sizes. Increasing local steps (E) from 3 to 5 improves performance across all batch sizes, indicating that more local updates allow clients to better capture their specific data distributions. However, further increasing E. to 10 leads to slight performance degradation, suggesting that excessive local updates before synchronization may result in overfitting to client-specific data. Similarly, batch size (B) ex- hibits an optimal value B 3, which consistently delivers the best results. Larger batch sizes, such B = 10, show diminishing returns or even performance drops, possibly due to the reduced frequency of updates, which hampers the model's ability adapt effectively to local distributions. These findings underscore the importance of careful tuning of local steps and batch size to balance local adaptation with global model convergence.
3.4 PERFORMANCE WITH VARIOUS LLM APIS.
Experimental Setup. We evaluate the performance of various LLM application programming in- terfaces (APIs) on the BBH Object Counting dataset, considering both centralized and federated learning settings. In the federated learning setup, we use the homogeneous F FedTextGra con- figuration with the following default hyperparameters: local steps (E 3), batch size (B 3), and three clients, each receiving an evenly split portion of the dataset. For the centralized setting, the split datasets are grouped and trained as a single dataset, enabling a direct comparison between centralized learning and federated learning.
Results. The results, illustrated in Figure 3 highlight several notable trends. the centralized TextGrad setting (Figure 3a). GPT-4 (Achiam al. (023) and DeepSeck RI distill Llama 70B (Guo ctt al. 2025) model achieve the highest accuracy (0.99), closely followed by LLaMA-3.1-44 (0.96) and LLaMA-3.1 1---00BBBBBBBBB (0.95). In the federated learning setting (Fig. 3a), while GPT-4 contin- ues to perform best (0.98), there a slight performance drop across all models when transitioning from centralized federated learning. The performance gap is more pronounced in smaller models, such as Gemma-2-9B (Team et al.) 2024) and Qwen-2-7B (Yang et al. (024a), which experience sharper declines in accuracy (see Fig. 3b). These findings suggest that while federated learning has a marginal effect on more capable models like GPT-4 and LLaMA, the impact is more substantial for less powerful LLMs, underscoring the challenges of federated learning in heterogeneous envi- ronments.
1.0
0.99
0.99
0
0.95
00
0
1.0
0.98
0.96
0.94
00
0.93
00
0.90
0.88
Acc.
0.8
0.7
0.66
0.7
0.69
0.64
1>
0.6
GPT-4-1.8T
DS-R1-a D9-R1-DistIll-OB Distill-T0B
Liama-3.1 4008
Llama-3.1--0 1-708
1-700
Llama-3.1
--1-8-
1.1-8B
Gemma-2 Gemma-2--8
-298
Qwen-2-78
0.6
GPT-4-1.87
DS-R1 -Dittill-70B
Llama-3. 1-405B
Laama-31-405B
Liama-3 3.1-70B
Llama-3. 1.mm--3.--8
Gemma -298
Qwen-2-7B
(a) TextGrad on BBH Object Counting
(b) FedTextGrad on BBH Object Counting
Figure Comparison of the impact of different LLMs on (a) Centralized TextGrad and (b) FedTextGrad for BBH Object Counting tasks.
4 ENHANCED FedTextGrad PROMPT AGGREGATION METHOD
In the following section, we first highlight the limitations of directly applying prompt concatenation for prompt aggregation in FedText demonstrating that this approach is impractical due to the excessive token length it generates, which often exceeds the context window of LLM API and leads to processing errors. Second, we explore summarization as an alternative method to miti- gate this issue; however, we observe that it consistently underperforms compared concatenation.

---

Published as a conference paper at ICLR 2025
Finally, inspired by principles of human communication, introduce enhanced summariza- tion approach that incorporates uniform information density. We find that this simple yet effective method significantly improves performance while maintaining practical token lengths.
4.1 PROMPT CONCATENATION ANALYSIS
Concatenation aggregation in FedTextGrad risks exceeding token limits and increasing costs, posing scalability challenges. Concatenation is natural approach for aggregating text infor- mation; however, this method introduces significant issue in our FedText framework, as the prompt length increases with the number of clients, potentially exceeding token limits and lead- ing rejection by LLM API services. The Fig- Iillstrrate the exponential growth concatenated prompt token length as the number of clients increases, highlighting the risk of exceeding GPT-4's context window limit 8192 tokens (denoted by the red dashed line). The right y-axis shows the associated cost in USD, with increasing token lengths resulting in higher costs. Error bars represent the standard deviation of token lengths across different client configurations. The figure emphasizes the trade-off between prompt length and scalability in federated learning settings, particularly when using concatenation- prompt aggregation methods.
4.2 CONCATENATION VS. SUMMARIZATION
Summarization is often regarded as a natural so- lution to mitigate the issue of long token lengths introduced by concatenation. However, in our
10000
8192 tokens
F FedTextGrad framework, summarization under-
Concalennted Prompt Takem
performs compared to concatenation, prompting the need for further enhancements. In this section, compare concatenation and summarization prompt aggregation strategies. The results, shown in
Cosl In
1000
Fig. (aa] cover three tasks: Object Counting, Multi- step Arithmetic, and GSM8K. For the Object Count- ing task, concatenation slightly outperforms summa- rization with accuracies of 0.90 and 0.88, respec- tively. In the more complex Multistep Arithmetic task, the performance gap is more pronounced, with concatenation (0.69) significantly surpassing sum- marization (0.55). In contrast, for the GSM8K task, both methods perform comparably, with concatena- tion achieving 0.94 accuracy and summarization closely following at 0.92. Overall, concatenation consistently demonstrates superior performance, particularly in more complex tasks like multistep arithmetic, underscoring its advantage in framework.
GPT-4 Contest Window (8192 tokans))
Length
Number of Clients
Figure 4: Increasing token length of concate- nated prompts.
Concatenation
Summarization
Sum, we UID
Clients
B) When onswningg quaation,
WWiten antwweri ig oou riinn
You anover reasoning The last chouidiie the owing format: Aro EVALue when VALUE anamencal
are to sckea renszning quastion ofyour
Aggregated
Prompt
thought process,
provided,, sodeedddee considuring
numevical Lnower On the last line, fommath Wnrwerr SYALUE where VALUE the seaui, you colculatis..
complning
provideoo
Length
includingery reaeam
the conmodt or the quess the py tnwninainng ng sekedt
ratietenee maszninng......
Contee Wertiww WGPP4)
Eonncion
Information Density (ID)
Distribution
Figure 5: Illustration of the three types of prompt aggregation proposed in this paper: 1) Concate- nation- where prompts from clients are directly concatenated; 2) Sunmarization where large language model (LLM) is employed to summarize the prompts provided by the clients; 3) Sum- marization with UID (SUM w/ UID) where the summarization process is enhanced by applying uniform information density principles.
8

---

Published as a conference paper at ICLR 2025
1.0
Concatonation Summarization
0.94
0.92
10-
9:14
0.828.93
Demaity Uniformas
0.9
0.88
0.8
0.86
Acc
0.8
6.90
0.55
A.75
0.69
T p.50
0.7
Object Counting
Nultstap Anthmmlic
Object Counting
Multistep Arithmetic
GSMSK
taston Performance
Summarteation Uniformity Sum USD Uniormll
Sum, UID Performance
(a) Concatenation vs. Summarization
(b) Summarization vs. Sum UID
Figure 6: Observations of different aggregation strategies, where (a) presents the performance of concatenation and summarization, and (b) compares the performance of UID and summarization.
4.3 THE PROPOSED SUM UID PROMPT AGGREGATION METHOD
We propose UID-based prompt summarization method to overcome the limitations of summarization's information non-uniformity, enhancing the stability and accuracy of FedTextGrad. Fig. highlights the effects of different prompt aggregation approaches. The main challenge lies efficiently combining local prompt updates into a global prompt that retains essential information while adhering input length constraints for federated optimization. Direct concatenation client prompts can produce overly long global prompts, particularly with many FL clients, potentially exceeding the LLM's context window. Summarization addresses this issue by keeping the global prompt within the allowed length, but it often creates overly dense prompts that degrade model performance.
UID Hypothesis. To address the issue of excessive token lengths in concatenation, we pro- pose prompt aggregation method based the Uniform Information Density Hypothesis (UIDH) (Meister et al. 2020),, which posits that effective communication involves distributing in- formation uniformly. We hypothesize that uneven information distribution in prompts adversely affects LLM performance, as critical updates from clients may be diluted. To mitigate this, we in- troduce an enhanced summarization approach incorporating UID principles ensure balanced representation of client updates in the aggregated prompt.
Measuring Uniformity. To measure information density uniformity (Meister et al., 2020). sur- prisal values are computed for each word in text based on the conditional probabilities de- rived from pre-trained language model, such as GPT-2. The uniformity is quantified by the variance in surprisal values, where lower variance indicates more uniform distribution of in- formation. The process involves tokenizing the text, extracting log-probabilities, calculating sur- prisal for each token, and then computing the mean and variance of these values. The mean prisal (μ)) represents the average information density, while the variance (a²) reflects the unifor- mity of information distribution: = + E [ww/CC) log, P( ((w,CC (C) is the surprisal for token u given context C. and N is the number of tokens in the text. A lower value of o² indicates higher uniformity in information density, consistent with the Uniform Information Density hypothesis.
> (ww]C)
o² = E
(Lw;; C*) μ²² where i
Performance Gains. Our method improves prompt aggregation by maintaining uniform informa- tion density across the summarized prompt, preserving key information from each client while pre- venting over-compression. Fig. 60 shows that, compared to summarization, our UlD--based method yields superior performance Object Counting and GSM8K dataset. Our empirical results demon- strate consistent gains in accuracy and prompt stability, confirming the effectiveness of applying UID principles in FL systems.
AN ENVISIONED ROADMAP FORWARD
With LLMs becoming burgeoning field and model sizes continuously increasing, addressing the high costs and data privacy concerns in LLM training is paramount. Adapting FL to LLMs offers a promising direction. F BedTextGrad introduces novel and efficient paradigm that utilizes LLMs as optimizers and textual gradients to update LLM components. However, practical implementation of FedTextGrad involves several critical challenges, including (1) managing heterogeneous data

---

Published as a conference paper at ICLR 2025
to prevent conflicting contexts and ensure effective aggregation, (2) developing preeeriiie methods tailored to textual gradients, as traditional approaches often compromise utility in natural language settings, (3) improving communication efficiency through advanced summarization and adaptive encoding to scale in federated environments, and (4) ensuring robustness against diverse adversarial attacks by adapting different defense mechanisms.
Learning on Heterogeneous Environment: When encountering heterogeneous data and model architecture, clients can produce conflicting contexts, which result in failed texture aggregation or ambiguous summarized texts. In traditional federated learning (FL), strategies such as resolving gra- dient conflicts with flatter minima (Chen et al. 2023) or regularizing clients' gradient updates (Li) iet al.) (2020), as well as sharing common hidden features (Yi et al.) (024), have proven effective.
However, these approaches depend on numerical operations or the use of hidden features, mak- ing them unsuitable for scenarios involving textual gradients or black-box settings. Consequently, adapting existing methods or developing novel solutions represents a crucial direction for future research.
Privacy Attack and Protection: By sharing texture gradient from client LLMs, FedTextGrad exposure attack surfaces. Although direct gradient inversion might be less effective on textual gra- dients, adversaries could still use the contextual nature of text to uncover private information, mak- ing carcless prompt engineering significant risk for revealing sensitive data (Yao et al. 2024). In traditional FI., privacy protection methods such as differential privacy (DP), secure multi-party computation (SMPC), and homomorphic encryption are widely used to safeguard numerical gra- dients (Behnia et al. (022). However, these strategies face challenges when applied to federated textual gradients, as natural language contains more context and meaning, making harder to ob- fuscate without losing utility. While DP could introduce noise into text, this risks rendering the gra- dients incoherent, and SMPC or encryption techniques would require significant advances to handle the complexity of encrypted text. Thus, new srivacy-reseering methods tailored specifically for textual data are needed in federated learning.
Communication Efficiency: Traditional FL. approaches to improving communication efficiency typically employ techniques such as gradient compression (Jiang al.) 2022) or conflict resolution to reduce the number of communication rounds (Chen et al.). However, none of these methods are specifically designed for the textual gradient domain. Unlike numerical gradients, textual gradients inherently contextual and carry semantic information, making direct compression or sparsifica- tion infeasible without risking the loss of critical information or coherence, highlighting the need for further research into scalability within FrddextGradd
Robustness: Research in this area examines various methods, such as poisoning attacks, Byzantine attacks, and other empirical approaches, that adversaries use undermine the integrity of global models in FL systems. To counter these attacks, various defense mechanisms have been developed enhance robustness in FL. For example, Byzantine-resilient aggregation methods like Krum and Trimmed Mean mitigate malicious updates by focusing on reliable client contributions and have been widely adopted traditional FL (So al.] [0200] Jin & Li, (023) but infeasible in the textu- ral context. Methods based on outlier detection can identify and remove suspicious updates. With proper prompt design or text embedding. such strategies show potential for use in FedTextGrad. However, the inherent complexity of L-sed systems exacerbates the difficulty of both execut- ing these attacks and defending against them.
6 CONCLUSIONS
In this work, we introduced FedText an extension of the TextGrad framework specifically designed to address the challenges of prompt optimization in federated learning settings. By identi- fying the training instability caused by aggregating distributed prompt updates and demonstrating the limitations of traditional concatenation and summarization-ban -based techniques, we proposed novel approach based on Uniform Information Density Principles to enhance FedText Grad prompt summarization. Our method addresses the issue of uneven information distribution, leading to im- proved prompt efficacy and overall performance in federated environments. This study establishes foundation for future advancements in prompt optimization for large-scale, distributed learning systems and opens new avenues for deploying LLMs in vironments.
aesource-constraii en-
10

---

Published as a conference paper at ICLR 2025
ACKNOWLEDGEMENTS
The research supported by Natural Science and Engineering Research Council of Canada (NSERC), Canada CIFAR Al Chairs program, Canada Research Chair program, MITACS-CIFAR Catalyst Grant Program, the Digital Research Alliance of Canada. The research is also supported, in part, by the Ministry of Education, Singapore, under its Academic Research Fund Tier I; and the National Research Foundation, Singapore and DSO National Laboratories under the Al Singapore Programme (AISG Award No.
REFERENCES
Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Ale- man, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.055: 08777744 2023.
Krishnakumar Balasubramanian and Saeed Ghadimi. Zeroth-order nonconvex stochastic optimiza- tion: Handling constraints, high dimensionality. and saddle points. Foundations of Computational Mathematics, 22(1):35-76, 2022.
Rouzbeh Behnia, Mohammadreza Reza Ebrahimi, Jason Pacheco, and Balaji Padmanabhan. Ew- tune: A framework for privately fine-tuning large language models with differential privacy. In 2022 IEEE International Conference on Data Mining Workshops (ICDMW), pp. 560-566. IEEE, 2022.
Tom B Brown. Language models are few-shot learners. arXiv preprint arXiv:2005. /4/65, 2020.
Minghui Chen, Meirui Jiang, Xin Zhang, Qi Dou, Zehua Wang, and Xiaoxiao Li. Local superior soups: A catalyst for model merging cross-silo federated learning. In The Thirty-eighth Annual Conference on Neural Information Processing Systems.
Minghui Chen, Meirui Jiang, Qi Dou, Zehua Wang. and Xiaoxiao Li. Fedsoup: improving gen- eralization and personalization federated learning via selective model interpolation. In lernational Conference Medical Image Computing and Computer-Assisted Intervention, pp- 318-328. Springer, 2023.
Chun Jie Chong, Chenxi Hou, Zhihao Yao, and Seyed Mohammadjavad Seyed Talebi. Casper: Prompt sanitization for protecting user privacy in web-based large language models. arXiv preprint (tX.i::248.0000000 2024.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reüichir Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:21 14168, 2021.
Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Zhiyong Wu, Baobao Chang, Xu Sun, Jingjing Xu, and Zhifang Sui. A survey in-context learning. arXiv preprint urXiv:2301.0023: 2022.
Abhimanyu Dubey, Abhinav Jaubri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang. Angela Fan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21778 2024.
Kennedy Edemacu and Xintao Wu. Privacy preserving prompt engineering: A survey. arXiv preprint arXiv:2404.06001 2024.
Wenzhi Fang, Ziyi Yu, Yuning Jiang, Yuanming Shi, Colin N Jones, and Yong Zhou. Communication-efficee stochastic zeroth-order optimization for federated learning. IEEE Trans- actions on Signal Processing, 70:5058-509 2022.
In Gim, Caihua Li, and Lin Zhong. Confidential prompting: Protecting user prompts from cloud 11m providers. arXiv preprint ar 2409:22009199333.. 2024.
Daya Guo, Dejian Yang, Haowei Zhang. Junxiao Song. Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma. Peiyi Wang, Xiao Bi, et al. Deepseek-rl: Incentivizing reasoning capability in Ilms via reinforcement learning, arXiv preprint ar0iv:2501. 12948, 2025.

---

Published as a conference paper at ICLR 2025
Chun-Yin Huang, Ruinan Jin, Can Zhao, Daguang Xu, and Xiaoxiao Li. Federated virtual learning on heterogeneous data with local-global distillation. arXiv preprint arXiv:2303.02277 2023.
Dongfu Jiang, Xiang Ren, and Bill Yuchen Lin. Llm blendeender: Ensembling large language models with pairwise ranking and generative fusion. arXiv preprint ww.Xvv233060225600 2023.
Yuang Jiang. Shiqiang Wang, Victor Valls, Bong Jun Ko, Wei-Han Lee, Kin Leung, and Leandros Tassiulas. Model pruning enables efficient federated learning edge devices. IEEE Transactions on Neural Networks and Learning Systems, 34(12): 13744-03366 2022.
Ruinan Jin and Xiaoxiao Li. Backdoor attack and defense in federated generative adversarial network-based medical image synthesis. Medical Image Analysis, 90: 2023.
Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, Sri Vardhamanan, Saiful Haq, Ashutosh Sharma, Thomas T Joshi, Hanna Moazam, al. Dspy: Compiling declarative language model calls into self-improving pipelines. arXiv preprint arXiv:2310.03714. 2023.
Weirui Kuang, Bingchen Qian, Zitao Li, Daoyuan Chen, Dawei Gao, Xuchen Pan, Yuexiang Xie, Yaliang Li, Bolin Ding, and Jingren Zhou. Federatedscope-Ilm: A comprehensive package for fine-tuning large language models in federated learning. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 5260-5271, 2024.
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmente genera- tion for nnowledgeiintensin nlp tasks. Advances Neural Information Processing Systems, 33: 2020.
Qinbin Li, Junyuan Hong, Chulin Xie, Jeffrey Tan, Rachel Xin, Junyi Hou, Xavier Yin, Zhun Wang, Dan Hendrycks, Zhangyang Wang, et al. LIm-pbe: Assessing data privacy in large language models. arXiv preprint 4rXiv:2408.12787 2024.
Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. Proceedings of Machine learning and sys- lems, 2:429-450, 2020.
Shengcai Liu, Caishun Chen, Xinghua Qu, Ke Tang, and Yew-Soon Ong. Large language models as evolutionary optimizers. In 2024 IEEE Congress on Evolutionary Computation (CEC), pp. 1-8. IEEE, 2024.
Wei Liu, Li Chen, Yunfei Chen, and Wenyi Zhang. Accelerating federated learning via momentum gradient descent. IEEE Transactions on Parallel and Distributed Systems, 18):117554 1766, 2020.
Ruotian Ma, Xiaolei Wang, Xin Zhou, Jian Li, Nan Du, Tao Gui, Qi Zhang, and Xuanjing Huang. Are large language models good prompt optimizers? arXiv preprint ar 402. 2024.
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-effcieentt learning of deep networks from decentralized data. In Artificial intelli- gence and statistics, pp. 1273-1282, PMLR, 2017.
Clara Meister, Tim Vieira, and Ryan Cotterell. If beam search is the answer, what was the question? arXiv preprint arXiv:2010.02650 026600 2020.
Yifan Niu and Weihong Deng. Federated learning for face recognition with gradient correction. In Proceedings of the AAAI Conference Artificial Intelligence, volume 36, pp. 1999-2007, 2022.
Reid Pryzant, Dan Iter, Jerry Li, Yin Tat Lee, Chenguang Zhu, and Michael Zeng. Automatic prompt optimization with" gradient descent" and beam search. arXiv preprint arXiv:2305.0 03495, 2023.
Zhen Qin, Daoyuan Chen, Bingchen Qian, Bolin Ding, Yaliang Li, and Shuiguang Deng. Feder- ated tull-parameter tuning of billion- sized language models with communication cost under 18 kilobytes. arXiv preprint 1rXiv:2312.06333 2023.
12

---

Published as a conference paper at ICLR 2025
Chao Ren, Han Yu, Hongyi Peng, Xiaoli Tang, Bo Zhao, Liping Yi, Alysa Ziying Tan, Yulan Gao, Anran Li. Xiaoxiao Li, Zengxiang Li, and Qiang Yang. Advances and open challenges in feder- ated foundation models. arXiv preprint arXiv:2404.5386 2024.
Timo Schick, Jane Dwivedi- Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer. Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves use tools. Advances in Neural Information Processing Systems, 36, 2024.
Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems, 36, 2024.
Jinhyun So, Başak Güler, and Salman Avestimehr. Byzantine-resilien secure federated learning- IEEE Journal on Selected Areas in Communications, 39(7):2168-2) 218111 2020.
Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. arXiv preprint 2XXiv22066046155 2022.
Youbang Sun, Zitao Li, Yaliang Li, and Bolin Ding. Improving lora in learning. arXiv preprint arXiv:2403.12311 2024.
federated
Gemini Team, Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean- Bean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M Dai, Anja Hauth, et al. Gemini: a family of highly capable multimodal models. arXiv preprint arXiv:2312. 1805, 2023.
Gemma Team, Morgane Riviere, Shreya Pathak, Pier Giuseppe Sessa, Cassidy Hardin, Surya Bhu- patiraju, Léonard Hussenot, Thomas Mesnard, Bobak Shahriari, Alexandre Ramé, et al. Gemma 2: Improving open language models at a practical size. arXiv preprint arXiv:2408.00 001 18, 2024.
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302. 13971, 2023.
Tu Vu, Brian Lester, Noah Constant, Rami AI-Rfou, and Daniel Cer. Spot: Better frozen model adaptation through soft prompt transfer. In Proceedings of the 60th Annual Meeting of the Asso- ciation for Computational Linguistics (Volume 1: Long Papers), pp. 5039-5059, 2022.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoe Le, Denny Zhou, et al. Chain-of thothh prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824 24837,24777 2022.
Colin White, Samuel Dooley, Manley Roberts, Arka Pal, Ben Feuer, Siddhartha Jain, Ravid Shwartz- Ziv, Neel Jain, Khalid Saifullah, Siddartha Naidu, al. Livebench: A challenging, contamination- free 1lm benchmark. arXiv preprint arXiv:2406. 193 2024.
Feijie Wu, Zitao Li, Yaliang Li, Bolin Ding, and Jing Gao. Fedbiot: Llm local fine-tuning in federated learning without full model. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 3345-3355, 2024.
Hongda Wu and Ping Wang. Fast-convergent federated learning with adaptive weighting. JEEE Transactions on Cognitive Communications and Networking, 7(4): 10888 2021.
Yang, Baosong Yang, Binyuan Hui, Bo Zheng. Bowen Yu, Chang Zhou, Chengpeng Li, Chengyuan Li. Dayiheng Liu, Fei Huang, et al. Qwen2 technical report. arXiv preprint arXiv:2407.10671, 2024a.
Chengrun Yang. Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoe Le, Denny Zhou, and Xinyun Chen. Large language models optimizers. 2023. Accessed on, 1, 2023.
Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoe V Le, Denny Zhou, and Xinyun Chen. Large language models as optimizers. In The Twelfth International Conference on Learning Representations, 2024b. URL http://pnneeeeeeeeeee/rrorrrrr//
13

---

Published as a conference paper at ICLR 2025
Yifan Yao, Jinhao Duan, Kaidi Xu, Yuanfang Cai, Zhibo Sun, and Yue Zhang. A survey large language model (Im)) security and privacy: The good, the bad, and the ugly. ConfiCooeeeecce Computing, pp. 100211, 2024.
Rui Ye, Wenhao Wang. Jingyi Chai, Dihan Li, Zexi Li, Yinda Xu, Yaxin Du, Yanfeng Wang, and Siheng Chen. Openfedllm: Training large language models on decentralized private data via fed- erated learning. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 6137-6147, 2024.
Liping Yi, Han Yu, Chao Ren, Gang Wang, Xiaoguang Liu, and Xiaoxiao Li. Federated model heterogeneous matryoshka representation learning. arXiv preprint arXiv:2406.0044 004880 2024.
Da Yu, Peter Kairouz, Sewoong Oh, and Zheng Xu. large language models. arXiv preprint arXiv:2402. 13659, 2024.
instructions for aligning
Fuxun Yu. Weishan Zhang, Zhuwei Qin, Zirui Xu, Di Wang. Chenchen Liu, Zhi Tian, and Xiang Chen. Fed2: Feature-aligned federated learning. In Proceedings of the 27th ACM SIGKDD conference on knowledge discovery data mining, pp. 2074,0074, 2021.
Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Zhi Huang, Carlos Guestrin, and James Zou. TextGrad: Automatic "differentiation" via text. arXiv preprint arXiv:2406.0744 2024.
Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, al. A survey of large language models. arXiv preprint arXiv:2303.1822.. 2023.
Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Erie Xing, et al. Judging llm-as-a-judge with mt-bench and chatbot arena. Advances in Neural Information Processing Systems, 04446695-46662 2023.
14

---

Published as a conference paper at ICLR 2025
A RELATED WORK
A.1 FEDERATED LEARNING WITH LLMS
Federated Learning. FL is a tiple parties to build shared global model without the need to exchange raw data. One of the main challenges in FI. is data heterogeneity, as client datasets often stem from different distribu- tions (McMahan et al. (017). To address this issue, various techniques have been proposed, includ- ing regularization (Li et al. 2020), gradient correction (Niu & Deng, 2022), feature alignment (Yu et al. 202T), adaptive aggregation weights (Wu & Wang 2021). momentum introduction (Liu al.
collaborative training paradigm that allows mul-
2020 and leveraging pre-trained models (Huang et al. 2023).
Fedeated Learning with LLMs. As LLMS have achieved significant success in centralized learn- ing, there is a growing interest in adapting FL to accommodate the fine-tuning of pre-trained LLMs (Ren et al.] (222)). particularly to supplement the publicly available data with privately owned datasets (Jin & Li, (023). In response, several frameworks have emerged recently, includ- ing OpenFedL.LMM Ye et al. | (2024) and FederateddScope-LL.. (Kuang et al., 2024). Moreover, advanced methods such as FedbiOT (Wu et al. (2024) which safeguards model ownership, and FFA- LoRA (Sun et al.) 2024) which enhances performance under differential privacy constraints, are being developed to optimize LLM training in federated environments.
Privacy in LLM Prompting. LLM prompting have revolutionized natural language processing but face significant challenges when handling privacy-sensitive text data, topic that remains rela- tively underexplored. Chong et al. (2024) propose "Casper," a browser extension that sanitizes user prompts by removing sensitive information before submission LLMs. [Edemacu & Wul (2024) survey sevaacyprrserving prompt engineering techniques, emphasizing approaches such as differ- ential privacy and data obfuscation. Gim al.) (2024) introduce "Confidential Prompting," which leverages confidential computing to secure user prompts during LLM inference. Yu et al.) (2024) tackle privacy concerns in instruction tuning by generating synthetic instructions under differential privacy guarantees, reducing data exposure risks. Finally, Li et al. (2024) present "LLM-PBE," toolkit designed to evaluate privacy risks and mitigation strategies in LLMs. These studies high- light the pressing need for robust privacy- peeauccypreeevingge mechanisms in LLM prompting applications. techniques,
Building on these advancements, future work can explore integrating such differential privacy, data obfuscation, or confidential computing, into Fed to secure prompts or textual gradients and mitigate privacy risks in federated learning scenarios.
A.2 LLMS AS OPTIMIZERS
Prompt Optimization. Prompt optimization has attracted significant attention. with various strategies proving effective in enhancing the performance of L.MMs. Techniques such as selecting optimal few-shot examples (Pryzant et al., 2023), in-context learning (Dong et al. 2022). chain of thought reasoning (Wei et al., 2022), and model ensembles (Jiang et al., 2023) have shown promise. Furthermore, several strategies have been developed to automate this process. White-box approaches, which rely on numerical gradients, offer a useful solution. However, they are limited by the need to access model parameters, restricting their applicability to only open-source LLMs.
LLMs as Optimizier: Recent research has turned towards leveraging LLMs as optimizers in black- box settings (Yang et al. (003). The foundation of this concept stems from the ability of LLMs to simulate human decision-
Zheng et al. (2023) benchmarked the behavior of LLMs and human decisions, finding that modern L.L.Ms align closely with human judgment. Building on this, Yang et al. (2024b) proposed optimization by prompting, where L.LMs generate new solu- tions based on a prompt that includes previously generated solutions. Ma et al. (2024) further in- vestigated whether LLMs are effective prompt optimizers. Tools like DSPy Khattab et al. (2023) and ProTeGi Pryzant et al. (2023) introduced programmatic frameworks for optimizing LLMed APIs, achieving performance gains across tasks such question answering and prompt refinement. All LLM-as Lopp-ioo approaches require the LLM to be as powerful (large-scale) as possible, as smaller I.LMs currently lack the capability serve effective optimizers. However, it is feasible
15

---

Published as a conference paper at ICLR 2025
to prompts optimized by large-scale models for smaller ones Vu al. (2022). enabling the adaptation of the LLMMassoptiimize paradigm in resource-constraine settings
generalized approach of using LLM as optimizers by adapting the above ideas to broader domains, such as optimizing instances like molecular structures code snippets, using textual catual-backpropagalie based frame- work. These methods highlight the versatility of LLMs in enhancing their own outputs across diverse applications, thus opening up opportunities for prompt optimization in closed-source LLMs within centralized learning settings by circumventing the need for access to model parameters. However, the research question of how achieve similar advances in FL settings remains unresolved. This paper seeks to address this question. Nevertheless, adapting FedTextGrad to resource-constrained settings with smaller LLMs remains challenging and unresolved research question, as smaller LLMs often lack the capacity to serve effectively as LLM-as-optmmizers for self-refinement.
TextGrad. Recently, TextGrad (Yuksekgonul et al., 2024) presents
B EXPERIMENTAL DETAILS
B.1 DATASETS
We evaluate our method on three primary reasoning tasks:
BBH Object Counting (Srivastava al. 2022]: task challenges models to accurately count objects based on visual or textual descriptions, testing their ability to reason about quantities and manage multiple elements within a scene or context.
BBH Multi-Step Arithmetic (Srivastava et al. 2022): Another BBH task that tests model's ability to solve mathematical problems that require multiple sequential steps of reasoning, assessing its proficiency in handling complex, multi-stage arithmetic operations.
GSM8k Math Problem (Cobbe et al.) (021): A dataset of grade school math problems designed test the mathematical reasoning capabilities of LLMs.
B.2 BASE MODELS
We conduct experiments using five large language models (LLMs), encompassing both widely-used commercial APIs such GPT-4o and GPT-3.5 (Achiam et 2023), as well as cutting-edge open- source models like Llama 3, Llama 3.1 (Dubey et al.) 2024), and Qwen (Yang et al. 2024a).
By leveraging this diverse set of models, bustness of our approach across range of architectures and model sizes, ensuring comprehensive evaluation and applicability.
able rigorously assess the scalability and
B.3 FedTextGrad SETUP
All datasets are split into training. validation, and test sets. The training set is used to optimize prompts through Feaa, the validation set helps with the prompt selection and hyper- parameter tuning, and the test set is reserved for reporting the final performance. FL simulates decentralized setting where clients send prompt updates to central server without sharing raw data.
C PROMPT AGGREGATION TECHNIQUES
Prompt aggregation plays critical role in federated learning with LLMs, especially the number of clients increases. We explore two primary methods for aggregating client prompts and evaluate their effectiveness under varying conditions.
Concatenation: this method, the individual prompts from each client are concatenated into single, aggregated prompt. While simple implement, this approach has significant drawbacks. As the number clients increases, the total prompt length can easily exceed the input length constraints imposed by large language models (LLMs), such GPT-4's context window of 8192 tokens. This results in prompts being truncated or rejected by the LLM API, severely limiting the scalability of this approach in federated settings.
16

---

Published as a conference paper at ICLR 2025
Summarization: To alleviate the issue of prompt length in concatenation, summarization techniques are applied to compress the information from each client into a shorter prompt. Although this reduces token length, it often comes at the cost of performance degradation. The compression inherent in summarization leads to information loss, particularly when the prompts contain complex or diverse client-specific updates. This information loss cause suboptimal model performance, especially in tasks that require retaining detailed and nuanced client data.
Summarization with Uniform Information Density: We introduce summarization ap- proach based on the Uniform Information Density (UID) hypothesis, which ensures a more balanced distribution of information within aggregated prompts. The UID hypothesis sug- gests that distributing information uniformly optimizes communication efficiency, and we apply this principle mitigate the performance degradation observed in traditional sum- marization methods. By maintaining uniform information density, our method preserves critical information from each client while reducing prompt length, aligning with LLM input constraints. This approach consistently enhances performance across tasks by im- proving reasoning accuracy and prompt stability in federated learning environments.
An Example of the Prompt Designed for Summarizing Prompts From TextGrad.
Prompt for Summarization
Merge the following list of prompts into a single, cohesive prompt while preserving all original information. Ensure that the final instruction remains unchanged and is placed the last sentence. Provide only the merged prompt.
An Example of the Prompt Designed for Summarizing Prompts with UID From TextGrad.
Prompt for Summarization with UID
Merge the following list of prompts into single, cohesive prompt while preserving all original information. Apply Uniform Information Density Principles. Ensure that the final instruction remains unchanged and is placed as the last sentence. Provide only the merged prompt.
Concatenated Prompt Example.
17

---

Published as a conference paper at ICLR 2025
Concatenated Prompt for Object Counting
When answering a reasoning question, provide clear and explicit explanation of your thought process, including any relevant calculations or reasoning, to support your answer. Use specific language to explain your reasoning, and avoid using vague or ambiguous language that could be interpreted in multiple ways.
Provide a detailed and step-by-step explanation of your thought process, including any relevant calculation or reasoning, to support your answer. For example, a good response might be: 'To determine the total number of objects, I counted each item individually: table, 1 fridge, 1 stove, 1 oven, 1 toaster, couch, and cars. Therefore, the total number of objects is 1 1 11.'
microwave,
++1+1+11
Ensure that your response is clear, concise, and free of unnecessary words or phrases, and that it clearly addresses the question being asked. Use precise and descriptive language to explain your reasoning, avoiding oversimplificate
and providing a nuanced or detailed explanation of the answer.
Consider the potential for ambiguity in your response and avoid using language that could be interpreted in multiple ways. Provide clear and concise explanation of the reasoning behind your answer, using relevant details and examples to support your response.
When providing a numerical answer, avoid including unnecessary phrases or context, and focus presenting
the answer in a clear and concise format, such as a single number or brief explanation of the caleulation.
When answering counting question, provide clear and explicit statement of the count, using a specific format such as 'Answer: X where
the numerical value. When providing a final answer, explicitly state the operations performed to arrive at the answer, and provide a clear and concise explanation of the reasoning behind the answer.
Use precise and descriptive language to explain your reasoning, avoiding oversimplificatio nuanced detailed explanation of the answer. Address any missing information in the problem and provide a complete and accurate response.
and providing a
Use specific details and concrete examples support your response and provide clear and concise explanation of the reasoning behind the answer. Provide a final answer that explicitly states the operations performed to arrive at the answer and includes a clear and concise explanation of the reasoning behind the answer.
Use formal and objective tone to ensure that the response is clear and unambiguous. If ambiguity is unavoidable, provide a clear and concise explanation of the ambiguity, and ensure that the response is still clear and unambiquous. Ensure that the response directly addresses the question being asked and provides clear and concise answer to the problem.
18

---

Published as a conference paper at ICLR 2025
A Summarized Prompt Example.
Summarized Prompt for Object Counting
When answering a counting question, clearly state the problem being asked based the input provided, considering the context of the question, the type of item being asked about, and any relevant information that may affect the answer.
Identify and count the specific category of items mentioned the question, and provide clear and concise count the objects mentioned. Ensure that the numerical answer accurate and precise, and provide a clear and concise step-by-step explanation of how you arrived at your answer.
aware of idiomatic and col colloquial language that may affect the answer, and use your best judgment to interpret any unclear or ambigueus language in the question. Consider alternative scenarios or edge cases that may affect the disambiquate
answer, and use relationship understanding any unclear or ambiquous language in the question.
Provide direct answer to the problem being asked, in the format "The total number of [object type] is [number]". Avoid paraphrasing the input and use step-by-step explanations to provide a clear understanding of the calculation reasoning behind the answer.
Specify the type of objects being counted, such as 'animals,' 'fruits,' or 'household items,' based on the input provided. To ensure accuracy, please count each type of object individually and add them together. For example, if the question asks for the total number of musical instruments, count each type separately (e.g., guitars, violins, drums)
Answer: $VALUE where VALUE is numerical value. The last line of your response should of the following format: "Answer: $VALUE" where VALUE is a numerical value.
D EXPERIMENTS ON MORE CHALLENGING AND HIGH-COMPLEXITY TASKS WITH FEDTEXTGRAD
To evaluate the performance of FedTextGrad on tasks with higher complexity and reasoning chal- lenges, we conducted experiments using GPT-4o on datasets extracted from LiveBench (White ct al. 2024). These datasets include tasks that test logical inference, spatial reasoning, and math- ematical abstraction, providing rigorous benchmark for assessing the robustness of our Fed- TextGrad.
Experimental Setup. We evaluated FedTextGrad on two categories of tasks: reasoning and ad- vanced mathematical problems. For reasoning tasks, we utilized Web of Lies (Version 2), an en- hanced dataset that introduces deductive red herrings to challenge logical rigor; Zebra Puzzle, deductive reasoning task involving multiple constraints across variables like colors and nationali- ties; and a Spatial Dataset, requiring the model to reason about numerical and positional attributes of solid, regular heptagons. For mathematical tasks, employed the AMPS Hard Dataset, de- signed to test advanced symbolic manipulation and mathematical reasoning through challenging, randomized problem distributions.
19

---

Published as a conference paper at ICLR 2025
Table Performance of Centralized and Federated Configurations on Reasoning and Mathematical Tasks. Best test accuracies are reported for each method across the datasets. Results for Centralized TextGrad and FedTextGrad with summarization.
Category
Dataset
Centralized TextGrad
FedTexttGrad
Spatial
0.53
0.40
Reasoning
Web of Lies
0.37
0.30
Zebra Puzzle
0.33
0.27
Math
AMPS Hard
0,46
0.50
Table 3: Results of Prompt Transferability from LLaMA 3.2-11B to LLaMA 3.2-3B. The table
reports the performance of prompts optimized on the larger model and directly transferred to the smaller model, compared initial prompts without optimization. Performance metries predic- tion accuracy on the task (higher is better).
Task
Initial Prompt 1 Transferred Prompt 1
Performance Change
Object Counting
0,66
0.69
+0.03
Multi-step Arithmetic
0.51
0.66
+0.15
GSM8K
0.80
0.72
-0.08
Results. In Table on reasoning tasks, FedTextGrad with summarization demonstrates adequate performance but remains below the centralized TextGrad configuration across all datasets. For the Web of Lies dataset, FedTextGrad achieves an accuracy of 0.30, which is lower than the central- ized TextGrad accuracy of 0.37, highlighting challenges in adapting to deductive reasoning tasks in federated settings. Similarly, on the Zebra Puzzle dataset, FedTextGGrd achieves 0.27 compared to the centralized TextGrad's 0.33, reflecting the difficulty of effectively optimizing logical reasoning tasks in a decentralized environment. For the Spatial dataset, FedTextGrad records 0.40 accuracy compared to the centralized TextGrad's 0.53, further showcasing challenges in handling spatial rea- soning under federated conditions.
In contrast, results for the mathematical task (AMPS Hard Dataset) show that FedTextGrad sur- passes centralized TextGrad with an accuracy of 0.50 versus 0.46. This indicates that, despite chal- lenges in reasoning tasks, FedTextGrad excels in tasks requiring mathematical reasoning, possibly due to its ability to better capture client-specific variations in structured numerical tasks. These results underscore the varying effectiveness of FedTextGrad across different task domains, with po- tential for further improvements in reasoning tasks under federated settings.
E FEASIBILITY OF SMALLER LLMS DEPLOYMENT WITH TEXTGRAD.
Experimental Setup. To evaluate the feasibility of deploying prompts optimized on larger LLMs in resource-constrained settings, we conducted additional experiment on prompt transferring. Specifically, prompts optimized using TextGrad on larger model (LLaMA 3.2-11B) were di- rectly applied to smaller model (LLaMA 3. 2 3B) without further optimization. Unlike the LLaMA 3. 1--8BB 8B model used in the main text, we opted for the LLaMA 3.2 series because the 3.1 series does not include models smaller than 8B. The LLaMA 3.2 series, on the other hand, offers wider range of model sizes, making it suitable for evaluating prompt transferability across different model scales. The tasks used were the same as the main text, including BBH Object Counting, BBH Multi-step Arithmetic, and GSM8K.
The results in Table 3 showed that on BBI Object Counting and BBH Multi-step Arith- metic, the transferred prompts achieved significantly better performance compared to the initial prompts. This indicates the potential for reusing optimized prompts in smaller, resource-efficient models without requiring further optimization. However, on the GSM8K task, the transferred prompts experienced noticeable performance downgrade. This highlights the challenges of prompt
Results.
20

---

Published as a conference paper at ICLR 2025
Table Averaged performance with client heterogeneity of summarization and UID summarization across three clients under varying batch sizes (3). Performance is reported as the mean accuracy across tasks.
Method
=
10
Summarization
0.73 (0.03)
0.78 (0.02)
0.72 (0.03)
UID Summarization
0.75 (0.02)
0.79 (0.02)
0.74 (0.03)
generalization for more complex reasoning tasks. These findings suggest that prompt transferring is promising approach for leveraging the optimization capabilities of larger LLMs while deploying smaller models in resource-conse constraied settings. Nevertheless, the observed limitations in tasks like GSM8K underscore the need for further studies to enhance the generalization capabilities of prompt transferring within the TextGrad framework. This represents an important direction for future re- search.
UID SUMMARIZATION GENGRALIZABILITY ON CLIENT HETEROGENEITY.
Experimental Setup. We evaluate the robustness of UID-based summarization heterogeneous client settings, where each client is assigned distinct task. This configuration follows the setup described in Section 3.3 the main text. The tasks used to simulate client heterogeneity include reasoning-basee based benchmarks, and the model employed is LLaMA 3.1-8B.
In this setup, three clients handle unique tasks to represent heterogeneity in data distributions. Specifically, one client addresses object counting tasks, another manages multi-step arithmetic,, and the third tackles problems from GSM8K. UTD-based summarization is compared with stan- dard summarization aggregation measure its performance under these conditions. Additionally, performance trends are analyzed as the batch size increases to better understand the behavior of the summarization methods. The training epoch is fixed
the default for all experiments.
Results The results in Table 4 demonstrate that UID-based summarization performs effectively under moderate client heterogeneity. achieves slightly better results than standard summariza- tion aggregation, showcasing its ability to retain essential information while adapting to diverse data distributions. Moreover, the performance trends with increasing batch size closely mirror those observed for standard summarization, indicating consistent and stable behavior across different figurations. These findings highlight the effectiveness of UID summarization in federated settings with heterogeneous client data. They reinforce applicability in real-worke scenarios, where client heterogeneity is common challenge. The additional results and analysis are included in the revised manuscript to provide a comprehensive evaluation of the method under varying conditions.
G DYNAMIC PROMPT AGGREGATION
To explore the feasibility of dynamic aggregation strategies in federated learning, we conduct an experiment evaluating the performance of dynamic switching between concatenation and summa- rization during the aggregation stage. This experiment extends the analysis presented in Figure 6(a), using the same dataset and LLaMA 1BB model.
Experimental Setup. In this experiment, implement dynamic aggregation strategy where concatenation is used for prompt aggregation by default. However, the concatenated prompt exceeds the model's pre-defined context window (selected 800 tokens), summarization is applied to reduce the prompt length. This hybrid approach leverages the strengths of both methods, aiming balance information retention and context limitations. The federated setup follows the same configuration as described in Figure 6(a) of the main text.
The results, shown in Figure / demonstrate that the dynamic aggregation strategy un- derperforms compared both the summarization-only and concatenation approaches in general.
Results.
21

---

Published as a conference paper at ICLR 2025
Notably, in task (object counting), the dynamic strategy slightly outperforms summarization. However, in other tasks, its performance lags behind. These findings highlight the potential adapt- ability of dynamic aggregation switching in managing varying prompt lengths.
Discussion. This experiment underscores the promise of dy- namic aggregation switching as an effective strategy for fed- erated textual aggregation. By addressing context window constraints dynamically, the method balances the trade-off be- tween information retention and prompt length management. However, significant limitation the need to pre-select an optimal context window for specific datasets, which can be challenging and requires dedicated selection and prior knowl- edge. Future work could focus refining the switching cri- teria and exploring its applicability across a broader range of datasets and models.
Conmiraatioo
Synaris Swesniing
a7
Figure 7: Concatenation vs Sum- marization Dynamic Aggrega- tion Performance.
H SURPRISAL ANALYSIS ON SUMMARIZATION WITH AND WITHOUT UID
To investigate the information retention capabilities of UID summarization compared to standard summarization, we con- duct experiment analyzing the mean and maximum prisal values of prompts after aggregation. Surprisal values measure the unexpectedness of generated text, providing in-
uf muse bocees
Serniee 24/9
sights into the uniformity and completeness of information across aggregated prompts.
Experimental Setup. We caleulate the mean and maximum surprisal values of prompts aggregated using both standard summarization and UID summarization. The calculations performed across multiple tasks to ensure a comprehensive evaluation. Surprisal values are derived from the aggregated prompts post-processing, capturing how effectively the summarization methods retain critical information.
Figure 8:
Summarization vs
UID Summarization Aggregation Prompt Surprisal Value.
g indicate that the mean and maximum surprisal values for UID summarization are nearly identical to those for standard summarization across all tasks. This sug- gests that both methods exhibit similar levels of information retention. While UID summarization specifically designed to enhance information uniformity, it does not introduce additional information loss compared to standard summarization, as evidenced by the surprisal metrics.
Results. The results in Figure
These findings confirm that UID summarization retains essential information ef- fectively as standard summarization while achieving improved task performance, as demonstrated in Section 4. The analysis highlights the robustness of UID summarization in ensuring both critical information retention and enhanced uniformity.
Discussion.
22


Reviews:
[{"review_id": "mBFwgCXsln", "reviewer": "Reviewer_iWmc", "summary": "This paper introduces FedTextGrad, a novel paradigm designed to extend the capabilities of federated learning (FL) by incorporating textual gradients rather than traditional numerical ones. Building on TextGrad, an approach for LLM-based prompt optimization through text-based feedback, this work explores how such textual gradients can function within FL frameworks. The motivation behind this approach is to enable FL applications where numerical loss functions or gradients are impractical or unavailable, such as when working with black-box LLM APIs. FedTextGrad allows clients to upload optimized prompts—derived from textual feedback during local training—to a central server, which then aggregates these prompts and redistributes a global prompt to clients. This method adapts FL for decentralized and privacy-sensitive environments, expanding potential applications.\n\nThe paper identifies unique challenges in aggregating textual gradients across clients, particularly in retaining essential context within the aggregated prompts. Traditional methods like concatenation often lead to prompts that exceed LLM token limits, while summarization can compromise performance by overly compressing information. To address this, the authors propose an enhancement based on the Uniform Information Density (UID) principle, which balances information distribution within aggregated prompts to maintain a coherent context without excessive length. This UID-informed summarization improved global prompt quality.\n\nExperiments are conducted to evaluate FedTextGrad across various reasoning tasks, including object counting and arithmetic problems, using different LLM architectures such as LLaMA and GPT-4. The results demonstrate that key FL hyperparameters, like local steps, batch size, and the number of clients, greatly impact FedTextGrad’s performance. Increasing local steps can enhance local adaptation but risks misalignment with the global prompt, while adding clients initially improves performance by introducing data diversity but eventually leads to synchronization challenges. These findings underscore the importance of carefully tuning FL parameters to balance local and global model alignment in a textual gradient setting.\n\nWhile the study offers promising insights into applying textual gradients in FL, it acknowledges several limitations, particularly in terms of privacy and security. Textual gradients inherently carry more contextual information than numerical gradients, posing privacy risks when shared among clients and servers. Though the paper suggests differential privacy and encryption as potential solutions, it lacks an experimental exploration of these methods, leaving privacy protection as a critical area for future research.", "questions": "1) Has dynamic switching between aggregation methods, based on task complexity, been considered?\n2) How effectively does UID summarization capture essential information across tasks?", "limitations": "", "rating": 6, "confidence": 3, "soundness": 2, "presentation": 2, "contribution": 3, "strengths": "1) The introduction of FedTextGrad as a framework to incorporate textual gradients into FL represents a novel approach, particularly valuable in settings where numerical gradients are unavailable, such as black-box LLM applications. \n2) The paper addresses a core challenge in aggregating textual data—preserving essential context without exceeding token limits—by proposing a UID-based summarization approach. This innovative method helps maintain critical information balance across prompts, solving a major limitation in using textual gradients and improving FedTextGrad's scalability and robustness in handling prompt length constraints in federated settings.\n3) The paper thoroughly investigates key FL hyperparameters, including local steps, batch size, and the number of clients, assessing their impact on performance. This systematic analysis provides practical insights into optimizing FedTextGrad for different settings, demonstrating the framework's adaptability and offering a foundation for further research and application in federated environments with textual gradients.", "weaknesses": "1) The paper identifies privacy risks with textual gradients but does not provide or test concrete methods to protect sensitive information, which is crucial for FL applications in privacy-sensitive domains.\n2) The experiments are primarily conducted on a few large LLMs, restricting insights into how FedTextGrad performs across diverse architectures, particularly smaller models in resource-constrained settings.\n3) The UID-based summarization method helps with prompt aggregation but has limitations in fully retaining information, especially with high client heterogeneity and complexity, potentially affecting scalability. The effectiveness of UID summarization under varying levels of client heterogeneity and task complexity is not thoroughly explored.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "ZnCgTDnSvL", "reviewer": "Reviewer_X2Ad", "summary": "The authors present a novel approach to analyze the potential and pitfalls of integrating methods like TextGrad (Yuksekgonul et al., 2024) into a federated learning context. In this setup, each client initiates a prompt and refines it locally using its data and local LLM. The optimized local prompts are then uploaded to a server, which aggregates the prompts and redistributes them back to the clients. The main aggregation strategies considered are concatenation and summarization, with an additional focus on optimizing aggregation by prioritizing words with the highest information content.\n\nThe authors offer several insights:\n- Accuracy vs. number of local steps performed before sending the final prompt to the server\n- Accuracy vs. number of clients\n- Accuracy vs. batch size\n- Impact of using different LLMs, e.g., GPT-4 vs. LLaMA\n- Cost implications of concatenation in terms of $\n- Insights on summarization vs. concatenation\n\nOne potential area for improvement, although I understand is challenging due to the novelty of the topic, is a comparison with previous federated learning or prompt optimization solutions. For example:\n- A comparison with traditional Federated Learning based on numerical gradients, such as Communication-Efficient Learning of Deep Networks from Decentralized Data (2023) or FedBiOT: LLM Local Fine-Tuning in Federated Learning without Full Model (2023). If these comparisons are not feasible, it would be helpful to clarify why.\n- A direct comparison with the centralized version (TextGrad).", "questions": "Although the topic is new, authors should try to do the following things if possible: \n- A comparison with traditional Federated Learning based on numerical gradients, such as Communication-Efficient Learning of Deep Networks from Decentralized Data (2023) or FedBiOT: LLM Local Fine-Tuning in Federated Learning without Full Model (2023). If these comparisons are not feasible, it would be helpful to clarify why.\n- A direct comparison with the centralized version (TextGrad).", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- Presentation of a novel framework for handling prompt-based learning in a federated learning context.\n- Numerous insights on learning in a federated learning setting without numerical gradients.", "weaknesses": "- lack of comparisons w.r.t. previous works on federated learning", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "uYRm1r9p3B", "reviewer": "Reviewer_3fjj", "summary": "This paper investigates the integration of textual gradients into federated learning environments, focusing on improving the optimization of large language models with privacy preservation. The authors propose a novel approach, Federated Textual Gradient (FedTextGrad), which adapts the concept of textual gradients for federated settings.", "questions": "1. The quality of text gradients generated across different clients may fluctuate. How can we ensure the consistency and effectiveness of these text gradients, especially in cases of uneven data distribution or varying data quality?\n2. The paper tests the proposed method primarily on reasoning tasks. Can you discuss or provide insights on how FedTextGrad might perform across different domains, where data might be more sensitive or heterogeneous?\n3. Consider providing more detailed descriptions for the implementation of FedTextGrad, especially how textual gradients are computed and aggregated.\n4. Elaborate on the practical implications of FedTextGrad. How can this method be integrated into existing federated learning frameworks? What are the practical challenges of deploying FedTextGrad in operational environments, and how can they be overcome?", "limitations": "", "rating": 5, "confidence": 5, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "This paper proposes a concept called FedTextGrad for optimizing large language models by integrating text gradients. This method utilizes text feedback for model optimization in a federated environment, extending the application of federated learning to areas where numerical gradients are impractical or infeasible. This paper identifies and addresses key challenges in joint text gradient aggregation, such as maintaining basic information in distributed updates and managing prompt sizes to accommodate LLM API constraints.", "weaknesses": "Although the experiments in the paper are comprehensive, they mainly focus on inference tasks, which may not fully demonstrate the broad applicability of FedTextGrad in various fields.\nThe discussion on the limitations of the FedTextGrad method is somewhat insufficient. Although this article briefly discusses challenges such as prompt length management and information retention, it does not delve into potential limitations or scalability issues that may arise when deployed in larger, more heterogeneous environments.\nSome parts of the manuscript are dense and highly technical, which may make it difficult for readers to understand. Using complex descriptions may obscure key points and findings.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "C3mTd7u80s", "reviewer": "Reviewer_hPgp", "summary": "The paper presents FedTextGrad, a novel federated learning approach that incorporates textual gradients, allowing for the optimization of Large Language Models in decentralized environments. It introduces a new aggregation method based on the Uniform Information Density principle to address the challenge of retaining essential information from distributed prompt updates, thereby enhancing the applicability of federated learning to text-based optimization.", "questions": "(1) The paper, while thorough in its experimental section, could be further strengthened by incorporating a wider array of datasets and tasks, including but not limited to coding, problem-solving, medicine and chemistry, to enhance the generalizability of its findings.\n(2) The paper could benefit from a more direct comparison with existing federated learning methods, especially those tailored for LLMs.\n(3) Why was the Llama-3.1-8B model exclusively utilized for prompt optimization and ablation studies, and not a variety of models?", "limitations": "", "rating": 6, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "(1) Originality: The originality of the paper lies in its pioneering effort to adapt TextGrad, a method for automatic differentiation via text, into the federated learning (FL) framework. By proposing FedTextGrad, the authors have expanded the scope of FL to leverage the capabilities of LLMs in a decentralized manner, without the need for explicit numerical loss functions.\n(2) Quality: The paper provides a thorough analysis of the proposed method's feasibility and identifies key challenges associated with textual gradient aggregation in a federated setting.\n(3) Clarity: The paper is clear and well-structured. \n(4) Significance: The significance of the paper lies in its integration of textual gradients into the federated learning framework.", "weaknesses": "(1) two typographical errors was identified on lines 191 and 216 of the paper;\n(2) The description of \"Client\" in the paper is unclear: Figure 2(b) shows \"Client Num\" exceeding three, but on line 312, the number of clients is stated to correspond to the number of datasets used in the paper, yet the paper only mentions three datasets;\n(3) This paper introduces TextGrad into the federated learning framework, but experiments are only conducted on reasoning tasks, which is not sufficient in terms of experimental scenarios.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)