FedTP
A vision transformer whose self-attention projections come from a per-client hypernetwork, for federated learning.
Image classification · 203 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 180.2M
- Operations
- 203
- Framework
- PyTorch
- Recurrent
- No
- Published
- IEEE Transactions on Neural Networks and Learning Systems 2023
- Cited by
- 129 (as of 29 October 2026)
- Authors
- Hongxia Li, Zhongyi Cai, Jingya Wang and others
- Source
- GitHub: zhyczy/FedTP
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m16663
- Graph hash
- d3c64860b2dd4771c7923a05e51fc724767a5f6153ce2b7d41d79e1ae492cd38
- Skeleton hash
- fb2c37686eefb67540e9e1e654aac68e79853c985215d47f9d0e2bdffb0b9202
- Architecture hash
- 6efc7e64b0dc9e793b69bb392463e9cf6cb14e22754e859cc9472355b0ef465f
- Diagram SHA-256
- 0c863bf4143755f145c1103873f4eb875c884198dd459bdb6afaf657e540fb4d
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
FedTP is a Transformer-based framework for personalized federated learning: it learns personalized self-attention for each client while the other parameters are aggregated among the clients. The paper starts from its finding that federated averaging has a negative impact on self-attention when the clients' data is heterogeneous. In its attention-map comparison, a ViT trained with FedAvg failed to generate a meaningful attention map.
Keeping each client's self-attention layers local avoids that problem, but the paper notes that such layers are not scalable, because they increase linearly with the number of clients. FedTP instead learns a hypernetwork on the server that outputs the projection matrices of the self-attention layers, which generate client-wise queries, keys and values. The hypernetwork is built from simple fully-connected layers, with a last layer that is unique for each Transformer block. Its input is an embedding vector learned for each client.
The framework uses a ViT for image tasks and a Transformer for language tasks. For the image experiments the authors chose a tiny ViT with 8 attention heads, a patch size of 4 and a hidden size of 128. They name slow training speed, compared to CNNs-based federated learning models, as the primary limitation of FedTP.
Key idea. FedTP personalizes a federated Transformer by having a server-side hypernetwork generate each client's self-attention projection matrices while the other parameters are aggregated across clients.
- fedtp
- federated learning by transformer personalization
- personalized federated learning
- federated transformer
- hypernetwork
- learn-to-personalize
- personalized self-attention
- non-iid
- federated vit
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{li2023fedtpfederatedlearningtransformer,
title={FedTP: Federated Learning by Transformer Personalization},
author={Hongxia Li and Zhongyi Cai and Jingya Wang and Jiangnan Tang and Weiping Ding and Chin-Teng Lin and Ye Shi},
year={2023},
eprint={2211.01572},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2211.01572},
}