# Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion

트랜스포머의 순열 대칭을 넘어서: 모델 융합에서 회전의 역할

Binchi Zhang, Zaiyi Zheng, Zhengzhang Chen, Jundong Li · arXiv · 2025년 2월 1일

- **연구 문제** 트랜스포머 모델 병합에서는 이산적인 순열 대칭만으로 파라미터를 맞추기 어렵습니다.
- **연구 방법** self-attention layer의 쿼리·키 및 값·출력 쌍에 회전 대칭을 적용하고, 닫힌 형태 해로 끝 모델을 앵커 모델에 맞춥니다.
- **주요 결과** 회전 기반 매칭은 여러 병합 기준선의 성능을 개선하는 경우를 보였고, 완전 매칭은 선형 보간 손실 장벽을 가장 낮추었습니다.

## 연구 문제와 기존 한계

트랜스포머 모델 병합에서는 같은 구조의 여러 학습 완료 모델을 파라미터 공간에서 합쳐 하나의 모델을 만듭니다. 이때 모델들이 서로 가까울수록 병합 성능이 좋아지는 경향이 알려져 있습니다. 기존 연구는 다층 퍼셉트론에서 뉴런 순열을 맞추는 순열 대칭을 활용해 이 거리를 줄였습니다. 그러나 순열 대칭은 이산적이어서 트랜스포머의 self-attention layer에 그대로 적용하기 어렵습니다. 저자들은 이 간극을 메우기 위해 self-attention layer의 연속적인 대칭을 찾고, 이를 파라미터 매칭에 쓰는 문제를 다룹니다.

## 회전 대칭과 자기주의 매칭

본 논문은 self-attention layer의 쿼리와 키 행렬에 회전 행렬 R을 곱하고 그 역회전을 키 쪽에 적용해도 쿼리-키 곱이 보존된다는 회전 대칭을 제시합니다. 값과 출력 행렬에도 같은 방식의 회전 규칙을 적용할 수 있다고 설명합니다. 피드포워드 네트워크는 여전히 순열 대칭으로 매칭하며, self-attention layer는 회전 행렬이 연속적으로 적용되는 점이 다릅니다. 매칭 목적함수는 두 끝 모델의 쿼리·키 쌍과 값·출력 쌍에 대해 정의되고, Theorem 4.1은 두 직교 행렬 쌍의 목적함수에 대해 R1=UV⊤, R2=I의 닫힌 형태 해를 제시합니다. 여기서 U Σ V⊤는 쿼리·키 또는 값·출력 항을 합한 행렬의 특이값 분해로 얻습니다.

이 해는 Kabsch 알고리즘의 변형인 Algorithm 1에서 사용됩니다.

## 실험 설정과 병합 성능

실험은 RoBERTa-base와 DeBERTa-large를 NER와 감정 분류 과제에 미세조정한 뒤 병합하고, ViT pre-training 모델 쌍을 CIFAR-10에서 병합하는 방식으로 이루어집니다. 언어 모델은 각 데이터셋에서 20 epoch 동안 학습률 1e-5, 배치 크기 16, warmup 비율 0.06으로 미세조정됩니다. Simple, Fisher-weighted averaging, RegMean 기준선에 +match 모듈을 플러그인으로 결합하여 성능을 비교합니다. Table 1에서 Fisher-weighted averaging의 NER DeBERTa 값은 매칭 없이 33.20이고 매칭 후 33.83입니다.

RegMean의 감정 분류 RoBERTa 값은 35.87에서 39.95로 올라갑니다. 일부 설정은 변화가 없어 개선이 모든 조건에서 나타나지는 않습니다.

## 절제 실험과 파라미터 거리

절제 실험은 w/o ATTN, w/o FFN, w/o rescaling 변형을 비교합니다. 저자들은 Fisher와 RegMean에서 attention 매칭의 기여가 더 크고, OT-Fusion은 FFN 매칭의 기여가 더 크다고 해석합니다. rescaling 대칭을 제거하면 대부분 설정에서 성능이 떨어집니다. 파라미터 거리 실험에서는 전체 모델의 Euclidean 거리를 측정하며, 본 방법이 Git Re-Basin과 OT-Fusion보다 끝 모델 간 거리를 더 줄인다고 보고합니다. OT-Fusion은 원논문 설정에 따라 FFN 모듈에만 적용됩니다.

## 손실 장벽과 연결성

ViT 모델 쌍에서 선형 보간 경로를 따라 교차 엔트로피 손실을 측정하면, 모든 쌍에 양의 손실 장벽이 나타납니다. 완전 매칭은 attention 전용 매칭과 FFN 전용 매칭보다 낮은 손실 장벽을 보입니다. 저자들은 이를 회전 대칭이 모델 쌍의 연결성을 더 매끄럽게 만든다고 해석합니다. 이 결과는 선택한 ViT 모델 쌍과 선형 보간 경로에서 얻은 것입니다.

## 계산 비용과 부분 층 매칭

매칭 모듈의 평균 실행 시간은 Fisher 및 RegMean 병합 대비 5% 미만이라고 보고됩니다. 계산 복잡도는 피드포워드 네트워크 부분에서 Hungarian 알고리즘을 쓰는 O(d^3)와 회전 매칭의 고유분해 O(d^3)에 의존하며, 층 수와 헤드 수에 따라 증가합니다. DeBERTa를 CoLA와 STS-B에서 미세조정한 실험에서는 앞쪽 5개 층을 매칭하면 손실이 급격히 줄었다고 보고됩니다. 따라서 일부 층만 매칭하는 것도 효율 개선 수단으로 제시됩니다.

## 적용 범위와 한계

Theorem 4.1의 최적성 논의는 두 모델을 매칭하는 이진 경우에 초점을 맞춥니다. 다중 모델 매칭에서는 기준 모델을 고정하거나 쌍별 매칭을 순차 적용하면 전역 최적성이 보장되지 않으며, 순서에 따라 결과가 달라질 수 있습니다. 회전 최적화 뒤 rescaling을 순차 적용하는 방식도 결합 최적해를 보장하지 않습니다. 또한 본 논문은 회전, 순열, 재스케일링 외의 전체 대칭군을 규명하지 않습니다.

## 논문 정보

- **저자**: Binchi Zhang, Zaiyi Zheng, Zhengzhang Chen, Jundong Li
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2025년 2월 1일
- **등록일**: 2026년 10월 29일
- **수정일**: 2025년 5월 28일
- **버전**: v2
- **arXiv**: 2502.00264
- **분류**: cs.LG · cs.CV
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

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

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

## 초록

Symmetry in the parameter space of deep neural networks (DNNs) has proven beneficial for various deep learning applications. A well-known example is the permutation symmetry in Multi-Layer Perceptrons (MLPs), where permuting the rows of weight matrices in one layer and applying the inverse permutation to adjacent layers yields a functionally equivalent model. While permutation symmetry fully characterizes the equivalence set for MLPs, its discrete nature limits its utility for transformers. In this paper, we introduce rotation symmetry, a novel form of parameter space symmetry for transformers that generalizes permutation symmetry by rotating parameter matrices in self-attention layers. Unlike permutation symmetry, rotation symmetry operates in a continuous domain, thereby significantly expanding the equivalence set for transformers. Based on this property, we propose a theoretically optimal parameter matching algorithm as a plug-and-play module to enhance model fusion. We evaluate our approach using pre-trained transformers across diverse natural language and vision tasks. Experimental results demonstrate that our rotation symmetry-based matching algorithm substantially improves model fusion, highlighting the potential of parameter space symmetry to facilitate model fusion. Our code is available on https://github.com/zhengzaiyi/RotationSymmetry.

## 원문 인용

Binchi Zhang, Zaiyi Zheng, Zhengzhang Chen, Jundong Li (2025). Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion. arXiv:2502.00264v2. https://arxiv.org/abs/2502.00264v2

**BibTeX**

```
@misc{zhang2025beyond,
  title = {{Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion}},
  author = {Binchi Zhang and Zaiyi Zheng and Zhengzhang Chen and Jundong Li},
  year = {2025},
  eprint = {2502.00264},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.00264v2}
}
```

## 이 논문의 용어

- [Frobenius norm](https://refivu.com/terms/8b20cfffe432-frobenius-norm)
- [RoBERTa](https://refivu.com/terms/f42b278690e5-roberta)
- [euclidean distance](https://refivu.com/terms/d709f3cd41c0-euclidean-distance)
- [Hungarian algorithm](https://refivu.com/terms/0d512d80548f-hungarian-algorithm)
- [layer normalization](https://refivu.com/terms/7af9eccdb60d-layer-normalization)
- [Theorem 4.1](https://refivu.com/terms/5490ca501b92-theorem-4-1)
- [optimal transport](https://refivu.com/terms/ce65c388d297-optimal-transport)
- [Named Entity Recognition (NER)](https://refivu.com/terms/3ea226163909-named-entity-recognition-ner)
- [CoLA](https://refivu.com/terms/8381ed275c42-cola)
- [Micro F1-Score](https://refivu.com/terms/b0de24fb7199-micro-f1-score)
- [Fisher-weighted averaging](https://refivu.com/terms/b644fc734359-fisher-weighted-averaging)
- [Kabsch algorithm](https://refivu.com/terms/b32ed8fa2dce-kabsch-algorithm)
- [linear mode connectivity](https://refivu.com/terms/98daad6a2c02-linear-mode-connectivity)
- [Orthogonal Procrustes problem](https://refivu.com/terms/b75f36f03f70-orthogonal-procrustes-problem)
- [parameter matching](https://refivu.com/terms/ef8b32d1a165-parameter-matching)
- [self-attention layer](https://refivu.com/terms/3feb48def3e4-self-attention-layer)
- [vision transformers (ViTs)](https://refivu.com/terms/af3c60e7c9a9-vision-transformers-vits)

## 다른 논문 해설

- [Graph Generative Pre-trained Transformer](https://refivu.com/papers/f6ca3fa0-e807-499d-af61-83b0cd89bf26-graph-generative-pre-trained-transformer.md)
- [GraphGPT: Generative Pre-trained Graph Eulerian Transformer](https://refivu.com/papers/b7702171-4518-41e4-a866-b27e70e436fb-graphgpt-generative-pre-trained-graph-eulerian-transformer.md)
- [Pretraining Generative Flow Networks with Inexpensive Rewards for Molecular Graph Generation](https://refivu.com/papers/4786573c-5464-44b3-8cf8-f543f3486470-pretraining-generative-flow-networks-with-inexpensive.md)
- [Residual Matrix Transformers: Scaling the Size of the Residual Stream](https://refivu.com/papers/649ad69b-40d7-44c6-8c92-55c66fc6bd14-residual-matrix-transformers-scaling-the-size-of-the.md)
- [ESPFormer: Doubly-Stochastic Attention with Expected Sliced Transport Plans](https://refivu.com/papers/a1464a35-3450-4660-9922-86a321dc3d18-espformer-doubly-stochastic-attention-with-expected-sliced.md)
- [Enhancing Certified Robustness via Block Reflector Orthogonal Layers and Logit Annealing Loss](https://refivu.com/papers/22759dba-8acc-4931-b7ad-558084002987-enhancing-certified-robustness-via-block-reflector.md)
- [Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models](https://refivu.com/papers/53c06b07-254d-422a-b1cb-fa6d8acfc98b-devil-is-in-the-details-density-guidance-for.md)
- [Diverse Prototypical Ensembles Improve Robustness to Subpopulation Shift](https://refivu.com/papers/978c2747-2461-43d9-99fd-7e88322b5e8e-diverse-prototypical-ensembles-improve-robustness-to.md)
- [Model Immunization from a Condition Number Perspective](https://refivu.com/papers/f7c4337e-7f54-4991-8403-b3d43f2d840e-model-immunization-from-a-condition-number-perspective.md)
- [Targeted Unlearning with Single Layer Unlearning Gradient](https://refivu.com/papers/934d3f2d-7c0e-48fc-9eef-40b6045f7b2a-targeted-unlearning-with-single-layer-unlearning-gradient.md)
- [ExpProof : Operationalizing Explanations for Confidential Models with ZKPs](https://refivu.com/papers/955d0052-77f4-4bc7-b355-c7f4132c0bdf-expproof-operationalizing-explanations-for-confidential.md)
- [MedRAX: Medical Reasoning Agent for Chest X-ray](https://refivu.com/papers/73202cd4-6ec5-4155-8644-846b59a4dfa2-medrax-medical-reasoning-agent-for-chest-x-ray.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/eddce632-59b1-4107-92e8-464c397de398-beyond-the-permutation-symmetry-of-transformers-the-role)
