Federated Learning: An LLM Chooses How to Combine Models
FedReason lets an LLM choose the aggregation rule in federated learning: +1.26 points over FedAvg, but it does not beat SCAFFOLD.

In federated learning, a form of training in which data stays on users’ devices, a server has to merge the models produced by individual clients. A new study published on arXiv on November 5 proposes leaving this choice to a large language model (LLM), with no training at all on the server.1 The system is called FedReason. In the authors’ tests it beats the standard FedAvg rule by 1.26 percentage points on average, but does not outperform SCAFFOLD, a method that intervenes in client training.1
How federated learning works and where the LLM comes in
Federated learning trains a shared model on data that stays on the clients. The most widespread rule, FedAvg, weights each model by the number of samples on the client; its formulation comes from an earlier work that introduced the term “Federated Learning” and the method of iterative model averaging.12 According to the authors of FedReason, most alternatives replace this formula with another one, fixed before training and designed for a single problem. These can be data with classes distributed differently across clients, sub-models of different widths, or malicious clients. In practice, they explain, whoever runs the server rarely knows in advance which of these cases will arise.1 The idea is to have the LLM write the rule in the form of a program. The models received from the clients contain information that a weighted average discards. The rows of the classifier show which classes a client has seen, while the size and direction of the update show whether it agrees with the others and whether it has been tampered with.1
What the language model does, step by step
The server calls the LLM every ten training rounds. The model analyzes the weights by running Python code in an isolated environment on the server and reads only what the code prints. It can also evaluate a few candidates on a control set of 500 images, and finally it hands over a short function, aggregate(ctx).1 The server applies that function in every round until the next call. A 60-round run therefore requires six calls, and in most rounds there is no waiting for the LLM.1 If the program’s output is not valid, the server falls back to FedAvg, so a faulty program does not block training. The full weight tensors never leave the server. Every decision is saved as code together with the reasoning given by the LLM and can be checked after training.1 The server trains nothing. It can evaluate a model on the control set only a fixed number of times and cannot fit any parameter to that set with gradient descent.1
What results do the authors report?
The authors used Claude Opus 5.5 on CIFAR-10 and CIFAR-100, two image collections, with the ResNet-18 network. They tested three situations: labels distributed unevenly across clients (Dirichlet distribution), sub-models of different widths, and Byzantine clients, meaning malicious ones. In total there are 168 runs against 14 baseline methods.1 Across 12 paired runs with unbalanced labels, FedReason beat FedAvg by 1.26 percentage points on average, with 10 wins. It beat by 1.08 points a control that spends the same evaluation budget on the control set to choose among standard rules.1 On CIFAR-100 it was the best of the server-side rules, but it did not beat SCAFFOLD.1 With three out of ten clients malicious, the system excluded all the sign-flipping ones from the first round. It remained about one point below FLTrust, a baseline method, without having to train a reference model.1 Without the feedback from the control set, in one single-seed case accuracy fell from 73.8% to 38.8%. A 60-round run cost an average of $0.79 in API costs.1
Does the LLM see users’ data?
According to the authors, no. The data stays on the clients, the full weight tensors never leave the server, and the language model sees only the results printed by the code it runs in an isolated environment.1
What happens if the LLM produces a faulty program?
The server checks the output in every round. If it is not valid, it uses FedAvg, so a faulty program cannot stop training.1
This article was written by artificial intelligence from the sources cited, without human review. Automatic newsroom by Redazia.


