# FedTP: Federated Learning by Transformer Personalization

FedTP: 트랜스포머 개인화를 통한 연합 학습

Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin 외 1명 · arXiv · 2022년 11월 3일

- **연구 문제** 연합 평균이 데이터 이질성이 있는 환경에서 Transformer의 자기 주의를 약화시킬 수 있다는 점이 핵심 문제입니다.
- **연구 방법** FedTP는 자기 주의 투영 파라미터를 클라이언트별로 개인화하고, 서버 하이퍼네트워크가 클라이언트 임베딩으로부터 이를 생성하도록 합니다.
- **주요 결과** CIFAR-100 Pathological 50 클라이언트 설정에서 FedTP는 68.05±0.24를 보고했으며, Shakespeare에서는 84.40±0.10을 보고했습니다.

## 연합 평균이 자기 주의를 해치는 문제

연합학습은 여러 클라이언트가 데이터를 공유하지 않고 함께 모델을 학습하는 패러다임입니다. 최근 Transformer를 연합학습에 적용하려는 시도가 있었지만, 연합 집계 알고리즘이 자기 주의(self-attention)에 어떤 영향을 주는지는 충분히 연구되지 않았습니다. 본 논문은 클라이언트 간 데이터 이질성이 있을 때 기본 FedAvg가 자기 주의를 약화시킬 수 있다고 문제를 제기합니다.

이를 확인하기 위해 저자들은 CIFAR-100에서 다섯 클라이언트의 이미지를 사용해 Local-T, FedAvg-T, Vanilla Personalized-T의 주의 맵을 비교했습니다. 이 비교에서 로컬 학습이나 Vanilla 개인화로 얻은 자기 주의는 과제 관련 영역에 집중했지만, FedAvg-T의 주의 맵은 의미 있는 형태를 만들지 못했습니다. 이 관찰은 이질적인 데이터를 가진 클라이언트의 자기 주의를 합치면 클라이언트 고유 표현이 훼손될 수 있다는 해석으로 이어집니다.

![Figure 1: An example showing the attention maps of Local-T, FedAvg- T and Vanilla Personalized-T over 5 clients with different local datasets. These results sh…](https://refivu.com/papers/fd89ac79-f476-41f1-a530-fe73b0b36237/figures/figure-4903abfdbb57d126aa214b342da477db.png?thumb=512)

**Fig. 1** . An example showing the attention maps of Local-T, FedAvg- T and Vanilla Personalized-T over 5 clients with different local datasets. These results show that self-attention either trained locally or by a Vanilla personalized-T model can focus on task-speciﬁc information well. However, FedAvg-T disturbs these information.

[원문](https://arxiv.org/abs/2211.01572v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin, Ye Shi · FedTP: Federated Learning by Transformer Personalization · 원문 그림 인용 · 원본 PDF 1쪽에서 그림 영역을 추출했습니다.

## Learn-to-personalize 자기 주의 구조

FedTP는 각 클라이언트의 자기 주의 투영 파라미터를 개인화하고, 나머지 파라미터는 서버에서 집계하는 Transformer 기반 연합학습 방법입니다. 가장 단순한 Vanilla 개인화는 각 클라이언트의 자기 주의 파라미터 Wi를 로컬에 유지하지만, 클라이언트 수가 늘수록 저장해야 할 투영 파라미터가 선형으로 증가하고 새 클라이언트에 대한 일반화가 제한됩니다.

FedTP는 서버에 하이퍼네트워크 h(ϕ;zi)를 두어 학습 가능한 클라이언트 임베딩 zi로부터 Wi=h(ϕ;zi)를 생성합니다. 생성된 Wi는 쿼리, 키, 값의 투영 행렬로 나뉘어 자기 주의에 사용됩니다. 나머지 파라미터 ξ는 가중 평균으로 집계됩니다. 로컬 갱신 후 자기 주의 변화량 ΔWi를 이용해 하이퍼네트워크 파라미터와 클라이언트 임베딩을 갱신하며, 이 과정이 학습-대-개인화 메커니즘입니다. 저자들은 하이퍼네트워크의 파라미터 수가 대략 Dh×Ds에 비례하므로, 클라이언트 수 N이 Dh보다 크면 Vanilla 방식보다 자원 소비가 적다고 설명합니다.

![Figure 2: An overview of FedTP. On the left, the self-attention layers are retained locally while the other parameters are aggregated on the server and shared…](https://refivu.com/papers/fd89ac79-f476-41f1-a530-fe73b0b36237/figures/figure-459460faf05612ad1142474b38b2eb81.png?thumb=512)

**Fig. 2** . An overview of FedTP. On the left, the self-attention layers are retained locally while the other parameters are aggregated on the server and shared among clients. The right shows the workﬂow of learn-to-personalize that generates the projection matrices in the self-attention layers of L Transformer blocks. This is performed by a hypernetwork located on the server, which consists of simple MLP layers with the last layer being unique for each Transformer block.

[원문](https://arxiv.org/abs/2211.01572v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin, Ye Shi · FedTP: Federated Learning by Transformer Personalization · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.

![Figure 3: The ﬂow chat of FedTP. The blue part of the ﬂow chart represents the operations that occur on the server side, while the green part indicates the cli…](https://refivu.com/papers/fd89ac79-f476-41f1-a530-fe73b0b36237/figures/figure-2486a02ec9f4527b2f5b3d9517812ca5.png?thumb=512)

**Fig. 3** . The ﬂow chat of FedTP. The blue part of the ﬂow chart represents the operations that occur on the server side, while the green part indicates the client-side operations.

[원문](https://arxiv.org/abs/2211.01572v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin, Ye Shi · FedTP: Federated Learning by Transformer Personalization · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.

## 이미지와 언어 과제에서의 비교 결과

FedTP의 성능은 CIFAR-10, CIFAR-100의 Pathological 및 Dirichlet 설정과 Shakespeare 다음 문자 예측에서 평균 테스트 정확도로 측정되었습니다. 표 II에서 FedTP는 CIFAR-100 Pathological 설정의 50 클라이언트 조건에서 68.05±0.24를 보고하며, 같은 표의 Vanilla Personalized-T 61.98±0.13보다 높은 값을 보입니다. 이는 같은 Transformer 구조에서 자기 주의만 학습-대-개인화로 바꾼 비교로 읽어야 합니다.

표 IV에서 Shakespeare 데이터셋의 평균 테스트 정확도는 FedTP가 84.40±0.10, FedAvg가 21.34±1.04로 보고됩니다. 다만 pFedHN과의 비교는 저자들이 보고한 조건에서 이루어졌으며, 자기 주의 파라미터가 전체 네트워크의 약 9.8%를 차지한다는 보고는 pFedHN 대비 CIFAR-100 평균 향상 11.31%와 함께 읽어야 합니다.

## 적용 범위와 한계

저자들은 FedTP의 주요 한계로 CNN 기반 연합학습 모델에 비해 학습 속도가 느린 점을 제시합니다. 이는 Transformer 기반 방법에 흔한 문제로 설명되며, 보다 계산 및 통신 효율적인 FedTP는 향후 과제로 남아 있습니다.

또한 본 논문의 주요 이미지 비교는 Transformer 구조에서 수행되었고, 언어 과제의 기준선에는 LSTM 기반 설정이 포함됩니다. 따라서 결과를 모든 모델 계열이나 모든 데이터 분포에 일반화하기 전에 실험의 백본과 분할 조건을 확인해야 합니다.

## 논문 정보

- **저자**: Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin, Ye Shi
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2022년 11월 3일
- **등록일**: 2026년 11월 6일
- **수정일**: 2023년 4월 18일
- **버전**: v2
- **arXiv**: 2211.01572
- **분류**: cs.LG · cs.AI
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2211.01572v2) · [원문 PDF ↗](https://arxiv.org/pdf/2211.01572v2)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Federated learning is an emerging learning paradigm where multiple clients collaboratively train a machine learning model in a privacy-preserving manner. Personalized federated learning extends this paradigm to overcome heterogeneity across clients by learning personalized models. Recently, there have been some initial attempts to apply Transformers to federated learning. However, the impacts of federated learning algorithms on self-attention have not yet been studied. This paper investigates this relationship and reveals that federated averaging algorithms actually have a negative impact on self-attention where there is data heterogeneity. These impacts limit the capabilities of the Transformer model in federated learning settings. Based on this, we propose FedTP, a novel Transformer-based federated learning framework that learns personalized self-attention for each client while aggregating the other parameters among the clients. Instead of using a vanilla personalization mechanism that maintains personalized self-attention layers of each client locally, we develop a learn-to-personalize mechanism to further encourage the cooperation among clients and to increase the scablability and generalization of FedTP. Specifically, the learn-to-personalize is realized by learning a hypernetwork on the server that outputs the personalized projection matrices of self-attention layers to generate client-wise queries, keys and values. Furthermore, we present the generalization bound for FedTP with the learn-to-personalize mechanism. Notably, FedTP offers a convenient environment for performing a range of image and language tasks using the same federated network architecture - all of which benefit from Transformer personalization. Extensive experiments verify that FedTP with the learn-to-personalize mechanism yields state-of-the-art performance in non-IID scenarios. Our code is available online.

## 원문 인용

Hongxia Li, Zhongyi Cai, Jingya Wang, Jiangnan Tang, Weiping Ding, Chin-Teng Lin, Ye Shi (2022). FedTP: Federated Learning by Transformer Personalization. arXiv:2211.01572v2. https://arxiv.org/abs/2211.01572v2

**BibTeX**

```
@misc{li2022fedtp,
  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 = {2022},
  eprint = {2211.01572},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.01572v2}
}
```

## 이 논문의 용어

- [CIFAR-10](https://refivu.com/terms/19035a518d0a-cifar-10)
- [CIFAR-100](https://refivu.com/terms/5afa3b877d18-cifar-100)
- [Self-attention](https://refivu.com/terms/426589b81077-self-attention)
- [Test accuracy](https://refivu.com/terms/021c3c30b755-test-accuracy)
- [FedAvg](https://refivu.com/terms/42fd22f625c0-fedavg)
- [ViT](https://refivu.com/terms/c041b72c53b8-vit)
- [Shakespeare](https://refivu.com/terms/9a3123e85f39-shakespeare)
- [attention rollout](https://refivu.com/terms/998a97071246-attention-rollout)
- [data heterogeneity](https://refivu.com/terms/4e8566b733d3-data-heterogeneity)
- [hypernetwork](https://refivu.com/terms/1147aba1e35a-hypernetwork)

## 다른 논문 해설

- [Policies for elementary links in a quantum network](https://refivu.com/papers/d57f8c18-a2ae-4514-9f2f-1e58422e4fd6-policies-for-elementary-links-in-a-quantum-network.md)
- [Convolutional Neural Networks with Intermediate Loss for 3D Super-Resolution of CT and MRI Scans](https://refivu.com/papers/0f13845f-46e4-457a-ae3a-9e2abc017f22-convolutional-neural-networks-with-intermediate-loss-for-3d.md)
- [Bayesian Learning for Neural Networks: an algorithmic survey](https://refivu.com/papers/ad989b2f-a3c4-4aa9-b594-cdc6718af341-bayesian-learning-for-neural-networks-an-algorithmic-survey.md)
- [A hybrid transformer and attention based recurrent neural network for robust and interpretable sentiment analysis of tweets](https://refivu.com/papers/b54f3e5e-d4a7-4e94-9cbc-b7688f012b1a-a-hybrid-transformer-and-attention-based-recurrent-neural.md)
- [Attention Spiking Neural Networks](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09-attention-spiking-neural-networks.md)
- [Automatic extraction of road intersection points from USGS historical map series using deep convolutional neural networks](https://refivu.com/papers/2b720330-0dfa-40de-a1dd-bbdf2e0088e0-automatic-extraction-of-road-intersection-points-from-usgs.md)
- [Situational Graphs for Robot Navigation in Structured Indoor Environments](https://refivu.com/papers/5d77c5be-ceb9-49aa-be90-630f7a53d968-situational-graphs-for-robot-navigation-in-structured-indoor.md)
- [Optimal Adaptive Prediction Intervals for Electricity Load Forecasting in Distribution Systems via Reinforcement Learning](https://refivu.com/papers/8e3625e0-1c9c-41fa-9dbb-4ae6c7d06664-optimal-adaptive-prediction-intervals-for-electricity-load.md)
- [Large Language Models Leverage External Knowledge to Extend Clinical Insight Beyond Language Boundaries](https://refivu.com/papers/1681bcb8-eaa3-4d90-af0d-f1d68b6f815a-large-language-models-leverage-external-knowledge-to-extend.md)
- [TiROD: Tiny Robotics Dataset and Benchmark for Continual Object Detection](https://refivu.com/papers/ba3ea100-4e7e-4568-aab9-c8aa20c4afae-tirod-tiny-robotics-dataset-and-benchmark-for-continual.md)
- [On the role of gradients for machine learning of molecular energies and forces](https://refivu.com/papers/7daff4be-4692-48e0-92e5-30725516646b-on-the-role-of-gradients-for-machine-learning.md)
- [Detect Faces Efficiently: A Survey and Evaluations](https://refivu.com/papers/13eb42e8-ad32-4f42-9dd4-913ad7464dd5-detect-faces-efficiently-a-survey-and-evaluations.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/fd89ac79-f476-41f1-a530-fe73b0b36237-fedtp-federated-learning-by-transformer-personalization)
