Manuscript Offprint

arXiv:2610.20753

Optimal Hydra: Model Heterogeneous Federated Learning for LLMs using Data-Informed Hydra-Nets

Gwen Legate, Rahaf Aljundi, Eugene Belilovsky

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

Abstract

Large language models (LLMs) trained on vast amounts of data have demonstrated impressive performance over a wide range of tasks, but future performance gains will require increasing amounts of data and compute. Federated Learning (FL) can facilitate training on decentralized private data, but client resource limitations can make FL training impractical, particularly as model sizes continue to expand. These resource constraints make the widely accepted assumption of a shared server–client architecture impractical. Model heterogeneous FL offers a promising alternative by adapting model size to client capabilities; however, previous work is limited to the pre-training setting, and these conclusions on sub-network selection do not necessarily hold for fine-tuning. Furthermore, prior approaches have created client sub-networks without considering their unique data distributions, thereby overlooking the opportunity to tailor sub-network architecture to local data. Motivated by evidence that attention heads exhibit task dependency within layer defined feature spaces, we propose Optimal Hydra, a transformer based heterogeneous FL framework for fine-tuning that combines global layer selection with client specific attention head selection aligned with local data distributions. Optimal Hydra makes explicit use of client data to produce client-specific sub-networks we call Hydra-nets. To our knowledge, this is the first model heterogeneous FL approach tailored to LLM fine-tuning. Experiments on three datasets show significant improvements over a number of baseline methods while also reducing local resource demands.

1 Introduction

Foundation models have demonstrated advanced abilities on diverse tasks and have been widely adopted in domains including healthcare, education and autonomous vehicles (Bommasani et al., 2021; Thirunavukarasu et al., 2023; Brown et al., 2020; Hu et al., 2023). Established scaling laws indicate that continued performance gains will require increasingly large amounts of data (Kaplan et al., 2020), a requirement at odds with the growing awareness of digital privacy. Federated learning (FL) (McMahan et al., 2017) offers a privacy preserving alternative that may create a greater willingness to share data Sani et al. (2024); however, the application of FL to foundation models is challenging due to large parameter counts that considerably exceed the capabilities of a typical edge device (Yao et al., 2024). Previous attempts to bridge this gap have largely relied on Parameter-Efficient Fine-Tuning (PEFT) (Babakniya et al., 2023a; Tian et al., 2024; Bai et al., 2024), but these methods can struggle to match the performance of full fine-tuning and are prone to overfitting when parameters are strictly limited (Chen et al., 2022). Furthermore, these methods still require homogeneous model architectures, so client nodes must have adequate resources to store and train the entire large model, which is often not the case (Yao et al., 2024). This creates a dilemma: either we limit model complexity to accommodate the most under resourced client or we exclude low resource clients from training. Neither of these options is ideal, since limiting model complexity eliminates our ability to train large SoTA models and excluding low resource clients from training creates a bias towards the data of those with better resources (Kairouz et al., 2021).

Model heterogeneous FL relaxes the assumption that server and client model architectures must be identical, it allows for federated training with heterogeneous models better suited to unique client capabilities. Early

Figure

Figure 1: Each model is represented as a set of horizontal rectangles denoting transformer layers. The segregation of each layer represents attention heads present in the layer. Note: for simplicity, attention heads are the only architectural components depicted. Hydra-Net selection algorithm: Clients first collaboratively select a subset of common layers from which no attention heads may be removed; these layers are highlighted in orange to indicate the protected status of their attention heads during the individual head selection process. Next, clients individually select a subset of heads in each unimportant layer via a gradient based scoring mechanism. Heads that were not selected by clients in the individual selection process are grey to indicate their removal from the sub-network. The end result is a unique, data aligned Hydra-Net for each client that is subsequently used in the model heterogeneous FL framework, Optimal Hydra.

work used static (Diao et al., 2020; Horvath et al., 2021) or random (Wen et al., 2022) sub-networks that trained model parameters unequally, making them susceptible to client drift (Karimireddy et al., 2020). Subsequent work improved stability by training model parameters more equally (Alam et al., 2022; Liao et al., 2025); however, all of these approaches overlook the fact that optimal sub-networks are intrinsically linked to the data they encounter (Frankle & Carbin, 2018). For FL in particular, client data distributions are often highly heterogeneous and tailoring sub-network architectures to local data presents an important opportunity to capture distribution-specific features. Notably, while prior work focuses exclusively on the pre-training setting, our work addresses fine-tuning and we will show that previous conclusions regarding strictly equal parameter training in the pre-training setting do not necessarily hold in the context of fine-tuning.

We propose Optimal Hydra, a method that adapts model-heterogeneous FL for LLM fine-tuning. Prior research has focused exclusively on pre-training (Alam et al., 2022; Diao et al., 2020; Liao et al., 2025; Wen et al., 2022; Horvath et al., 2021); we address this gap in the literature by being the first to investigate model-heterogeneous FL in the fine-tuning setting, a setting that has become increasingly relevant as large foundation models become the norm. We also take the opportunity to improve upon the random sub-network selection used in previous works by creating data-informed sub-networks we call Hydra-Nets that are tailored to local client data to better capture distribution-specific features. Fig. 1 provides a high level overview of our Hydra-Net selection method that proceeds in two steps; common layer selection and individual head selection. Common layer selection is motivated by the fact that transformer layers govern macro level feature transformations (Voita et al., 2019) and that in FL a lack of consensus amongst client sub-networks can negatively affect global model convergence (Diao et al., 2020; Horvath et al., 2021; Babakniya et al., 2023b). We adapt a metric used to determine the relative importance of transformer layers by He et al. (2024) to enable clients to collaboratively identify a small subset of “important” layers, establishing a shared structural backbone across clients from which no attention heads may be removed. Subsequently, each individual client will select a unique subset of attention heads to keep from each “unimportant” layer via a gradient based scoring metric, the rest will be discarded. Ultimately, Hydra-Net selection is motivated by the task dependent nature of attention heads to create targeted sub-networks, informed by each client’s unique local data distributions.

Our key contributions are as follows:

  • We propose Optimal Hydra for model heterogeneous federated fine-tuning using data-informed LLM sub-networks. As the first model-heterogeneous FL method to tailor sub-network architectures to local client data, Optimal Hydra achieves up to a 42.5% improvement over the best performing baseline in challenging model heterogeneous conditions and achieves reductions in computational and memory resource utilization up to 32.0% and 29.3%, respectively.

  • We demonstrate that assumptions from the pre-training about evenly distributing parameters can be relaxed in the fine-tuning regime due to the strong initial representations provided by the pre-trained model.

  • Based on representation dynamics and prior work suggesting that attention heads may be linked to specific tasks within layer feature spaces, we combine common layer selection to create Hydra-Nets, data-informed sub-networks that are better able to capture distribution specific features.

References (42)