Manuscript Offprint

arXiv:2611.08383

FedReason: Large Language Models as Weight-Space Meta-Aggregators for Heterogeneous Federated Learning

Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour

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

Abstract

Federated learning servers combine client models with a fixed aggregation rule, and each rule in common use is designed for one kind of heterogeneity. We study whether a large language model (LLM) that inspects the client models can choose the rule itself, without any training on the server. In FedReason, the LLM is called every ten rounds. It analyses the weights by running code in a restricted server-side sandbox, sees only the printed results, may score a few candidates on a 500-image proxy set, and submits a short Python aggregation program. The server applies the program until the next call and falls back to FedAvg whenever its output is invalid. Full weight tensors never leave the server. We evaluated FedReason with Claude Opus 5.5 on CIFAR-10 and CIFAR-100 with ResNet-18 under Dirichlet label skew, width-heterogeneous sub-models and Byzantine clients, in 168 runs against 14 baselines. Across 12 paired label-skew runs it beat FedAvg by 1.26 percentage points on average (10 wins), and a control that spends the same per-round proxy budget on choosing among standard rules by 1.08 points. It was the strongest server-side rule on CIFAR-100 but did not beat SCAFFOLD, which changes client training. With three of ten clients malicious, it excluded all sign-flipping clients from the first round and stayed about one point below FLTrust without training a root model. Without proxy feedback, accuracy fell from 73.8% to 38.8% in one seed. A 60-round run cost 0.79 USD in API fees on average.

Keywords: Federated learning, Model aggregation, Large language models, Statistical heterogeneity, Model heterogeneity, Byzantine robustness, Weight-space programming

1. Introduction

This paper asks whether a large language model (LLM) that reads the client models on a federated learning (FL) server can decide how to combine them, and do so better than a fixed aggregation rule. We test this when clients differ in their label distributions, in the width of model they can train, or in whether they are honest. Each standard aggregation rule encodes one assumption about what goes wrong, and a deployment rarely knows in advance which assumption holds. We add one constraint that keeps the comparison fair: the server trains nothing. It may evaluate a model on a small labelled proxy set a fixed number of times, but it may not fit any parameter to that set by gradient descent.

Our idea is to let the LLM write the aggregation rule as a program. In every round of FL the server holds a set of freshly trained models of one architecture, and these models carry information that a weighted average throws away. The rows of a client's classifier show which classes the client has seen. The size and direction of its update show whether it agrees with the other clients, and a poisoned update usually stands out on both counts. In FedReason (Fig. 1), the server calls the LLM every T rounds. The LLM examines the weights by running Python code in a restricted sandbox on the server and reads only what that code prints. It may score a few candidate models on the proxy set. It then submits a short function, aggregate(ctx), which the server executes in every round until the next call.

∗^{*}Corresponding author.

Email addresses: ali.mohammadiruzbaha@ucalgary.ca (Ali Mohammadi Ruzbahani), Abbas.Yazdinejad@uregina.ca (Abbas Yazdinejad), hadis.karimipour@ucalgary.ca (Hadis Karimipour)

Figure

Figure 1: Overview of FedReason (dashed line: server boundary).

A program can express whichever rule the evidence supports: sample-weighted averaging, clipping of large updates, exclusion of clients that look malicious, separate treatment of the classifier rows, or a server step with momentum. When the evidence changes, the LLM replaces it. Since the LLM looks at the evidence before it chooses, the server does not have to know in advance whether its clients are skewed, limited in compute or malicious. The program keeps running between calls, so a 60-round run needs six calls, the API cost is bounded and most rounds incur no LLM latency. The server checks the program's output in every round and falls back to federated averaging (FedAvg) when the output is invalid, so a faulty program cannot stop training. Each decision is stored as code together with the rationale the LLM gave for it and can be audited after training. The raw weight tensors stay on the server, and the clients run ordinary local training.

FL trains a shared model on data that remain on the clients [1, 2]. FedAvg weights each client model by its sample count [1], and most alternatives replace this formula by another one that is fixed before training starts and designed for one problem, such as label skew [3, 4], sub-models of different widths [5] or malicious clients [6, 7]. Methods that adapt during training tune the client weights or pick one rule from a fixed menu [8, 9]. Recent LLM agents for FL design whole systems or choose among rules from specifications, data characteristics, client profiles and scalar metrics [10–12]. None of them looks at the weights. Takehi et al. [13] recently reported, in a blog post that has not been peer reviewed, that a frontier LLM could tell from the weights of a small policy network which game it had been trained on. The LLM could also write or edit small networks without gradient training. The authors name model merging beyond weight averaging as a possible use. FedReason puts this suggestion to a controlled test in FL.

We make four contributions.

  • We formulate meta-aggregation, in which the server chooses the aggregation operator during training as a sequence of programs written from the observed client models, under budgets on LLM cost and proxy evaluations and without server-side training. It generalises per-round selection among fixed rules [9] (Section 3).

  • We present FedReason, in which a tool-using LLM inspects the client models in a server-side sandbox and writes an aggregation program that the server checks in every round, falling back to FedAvg when the check fails. The clients are unchanged and every API call is logged (Section 4).

  • We evaluate FedReason in 168 runs on CIFAR-10 and CIFAR-100 under label skew, width heterogeneity and two Byzantine attacks, against 14 baselines that include a control spending the same per-round proxy budget on selecting among standard rules. FedReason beats FedAvg in 10 of 12 paired label-skew runs and is the most accurate server-side rule on CIFAR-100, but it does not beat SCAFFOLD. Under attack it comes within about one point of FLTrust without training on the server (Sections 5 and 6).

  • We analyse what the LLM does, through ablations that withhold the weights or the proxy feedback, an audit of all 120 programs accepted in the main runs, and an account of the cases in which its inferences were wrong (Sections 6 and 7).

Section 2 reviews related work, Section 3 states the problem, Section 4 describes FedReason, Sections 5 and 6 report the experiments, Section 7 discusses limitations and Section 8 concludes.

References (35)