Papers › Can Textual Gradient Work in Federated Learning?

Can Textual Gradient Work in Federated Learning?

27 Feb 2025arXiv:2502.19980archive 2025-07-28

Minghui Chen, Ruinan Jin, Wenlong Deng, YuanYuan Chen, Zhi Huang, Han Yu, Xiaoxiao Li

Recent studies highlight the promise of LLM-based prompt optimization, especially with TextGrad, which automates differentiation'' via texts and backpropagates textual feedback. This approach facilitates training in various real-world applications that do not support numerical gradient propagation or loss calculation. In this paper, we systematically explore the potential and challenges of incorporating textual gradient into Federated Learning (FL). Our contributions are fourfold. Firstly, we introduce a novel FL paradigm, Federated Textual Gradient (FedTextGrad), that allows clients to upload locally optimized prompts derived from textual gradients, while the server aggregates the received prompts. 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 FedTextGrad. Our findings highlight the importance of properly tuning key factors (e.g., local steps) in FL training. Thirdly, we highlight a major challenge in FedTextGrad aggregation: retaining essential information from distributed prompt updates. 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. 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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2502.19980")

Code

Syntology Ran 6 of 12 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 2 ran · violated contract; 2 ran · our draft was wrong; 1 ran · fixture could not drive it; 1 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ubc-tea/FedTextGrad officialmentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 6 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · violated contract
2ran · our draft was wrong
1ran · fixture could not drive it
1ran
6unverified

Licence: 12 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ubc-tea/FedTextGrad. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

SingletonBackwardEngine ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran no licence file found · pointer only · 5008a349531d9698 · report
_check_if_multimodal ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran · violated contract no licence file found · pointer only · 6c6b64c6f227a73e · report
construct_tgd_prompt ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran · our draft was wrong no licence file found · pointer only · 792feffeafa114cd · report
get_gradient_and_context_text ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran · our draft was wrong no licence file found · pointer only · ce12de8593347921 · report
is_valid_url ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran · violated contract no licence file found · pointer only · a5790751e1d60937 · report
validate_engine_or_get_default ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository ran · fixture could not drive it no licence file found · pointer only · 1bebe4ea01268cce · report
EngineLM ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · 4742d5b210b29ae7 · report
Optimizer ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · 564ea28ae44d788f · report
TextualGradientDescent ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · 37c7ec07ab37ca27 · report
_backward_idempotent ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · 6facfd654eb7db2e · report
_check_and_reduce_gradients ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · b40994628dd26d87 · report
get_engine ubc-tea/FedTextGrad/textgrad/optimizer/optimizer.py official repository unverified no licence file found · pointer only · d0b6421efc2f659d · report

Tasks

Federated Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

TextGrad

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections