Source-linked AI summary
Importance Scoring of Transformer Attention Heads in Learning Tabular Data
Ahmad Jad Allah, Kazi F. Akhter, Md. Kamrozzaman Bhuiyan, Manar D. Samad
TL;DR
Tabular transformer architecture에는 attention head와 layer 선택에 관한 확립된 지침이 부족해, 이 환경에서 head 수준의 기여도에 대한 근거가 제한적이다. 이 논문은 tabular dataset 전반에서 attention-head importance score를 평가하고, 72.5%의 사례에서 가장 낮은 score의 head를 제거하는 방식이 가장 강건하다는 결과를 제시한다.
문제
Tabular transformer에는 layer와 head를 선택하는 표준 방식이 없으며, tabular data에 대한 head-pruning 방법도 충분히 탐구되지 않았다.
방법
이 논문은 activation representation에서 attention-head importance score를 계산하고, 이를 soft dynamic tuning과 head removal의 지침으로 사용한다.
결과
160개 사례 중 72.5%에서 head를 importance score가 낮은 순서에서 높은 순서로 점진적으로 제거했을 때 가장 강건했다.
시사점 및 한계
Head importance score는 redundancy를 식별하고 interpretability와 model compression을 지원할 수 있지만, 중요한 head의 분포는 dataset과 layer에 따라 다르다.
시사점 및 한계
모든 실험이 단일 tabular transformer architecture인 TransTab을 사용하므로, transformer architecture 전반으로 결론을 일반화하는 데 한계가 있다.
Abstract
from arXiv · showhide
Computationally demanding and opaque deep learning models can be better understood and optimized by analyzing how they transform data. While deep transformers have been widely studied in computer vision and natural language processing, their application in tabular data remains relatively underexplored. This paper presents one of the first applications of an importance-scoring metric to interpret multi-head transformer models in learning from tabular data. Experiments conducted on 40 diverse tabular datasets demonstrate robustness to head drops based on the proposed head importance score. In 72.5\% of experimental examples, the model remains most resilient to performance drops when heads with the lowest importance scores are gradually removed. In contrast, removing the most important attention head first results in the greatest reduction in classification performance. A closer look at individual head importance scores across six attention layers reveals that important heads are scattered across layers, with no consistent layer-specific trends. In contrast to the image and language domains, the importance of individual attention heads varies considerably across tabular datasets with different schemas and feature spaces. The proposed importance score can improve efficiency and redundancy within transformer architectures. We make the source code for measuring the importance of individual attention heads publicly available.
1 서론
Transformers는 language와 vision 분야에서 광범위하게 연구되어 왔지만, tabular data에 대해서는 상대적으로 충분히 탐구되지 않았다. Transformer models는 여러 tabular task에서 성공을 거두었지만, 성능–계산 비용 최적화에 대한 연구는 여전히 부족하다.
- 연구 동기: Tabular transformer 연구는 language와 vision 응용 분야의 광범위한 연구에 비해 여전히 제한적이다.이 대목은 구조화된 행·열 데이터와 Transformers가 주로 도입되고 광범위하게 평가되어 온 분야를 대비한다.
- 연구 동기: Transformers는 tabular classification, transfer learning, missing-value imputation에서 성공을 거두었다 [11].이러한 응용은 tabular dataset에 transformer models의 활용이 확대되고 있음을 보여준다.
- 연구 공백: Tabular transformer architecture는 성능–계산 비용 절충을 최적화하지 않은 채 large language model에서 가져와 적용되는 경우가 많다.Language-data transformer를 대상으로 weight pruning이 연구되었지만, tabular learning에서의 관련 최적화는 그만큼 광범위하게 탐구되지 않았다.
2 관련 연구
기존 transformer 연구는 주로 language에 집중했으며 고정된 layer-and-head 구성을 사용하는 경우가 많았다. 이에 따라 tabular data에서 head 수준의 중요도 분석이 필요하다. 본 논문은 Michel et al. 의 loss-sensitivity metric을 적용해 tabular learning에 구현하고 코드를 공개한다.
- 동기: Multi-head attention은 서로 다른 head가 다양한 입력 패턴을 포착하도록 하므로, architecture의 redundancy를 이해하고 제어하려면 개별 head의 기여도를 파악하는 것이 중요하다.본 논문은 주로 language data를 대상으로 multi-head transformer를 연구해 온 기존 문헌과 대비해 이 분석을 제시한다.
- Transformer architecture: Transformer architecture는 여러 domain에서 attention layer와 head의 수를 고정하는 방식이 일반적이었다. 예를 들어 original transformer는 6개 layer와 8개 head를 사용했고, BERT는 12개 layer와 12개 head를 사용했다.이러한 경직된 구성은 모든 head를 상호 교환 가능한 것으로 취급하기보다 개별 head의 기여도를 검토하게 한다.
- 기존 head-importance 연구: Michel et al. 은 이미 학습된 transformer language model에서 redundant head를 식별하고 제거하기 위한 loss-sensitivity metric을 도입했다.이들의 구현은 공개되지 않았으므로, 본 논문은 해당 metric을 재구현하고 tabular learning에 맞게 조정한다.
- 논문의 기여: 본 논문은 서로 다른 feature space를 갖는 tabular dataset을 학습하는 multi-head transformer의 redundancy를 연구하기 위해 head-importance scoring을 적용한다.Importance score는 training 중 head activation을 동적으로 조정하며, 이후 attention layer 전반에서 head를 누적적으로 제거하는 데 사용된다.
- 탐색적 분석: 또한 본 논문은 탐색적 분석으로 attention-head activation을 동적으로 soft-tuning하는 방법을 살펴본다.이 메커니즘은 head importance 측정 및 조정된 구현 공개와 함께 본 논문의 기여로 제시된다.
3 방법론
방법론은 gradient-weighted activation에서 attention-head importance를 정량화하고, 해당 score를 사용해 training 중 continuous head gate를 조정한다. 실험에는 tabular data를 위해 설계된 six-layer, 48-head transformer인 TransTab을 사용한다.
- Tabular-data setting: 이 접근법은 heterogeneous tabular data를 대상으로 하며, 각 row가 균일한 pixel이나 순차적인 word가 아니라 type과 scale이 서로 다른 d개의 feature column을 포함한다.이러한 schema와 feature-space diversity가 tabular transformer에 특화된 importance analysis의 필요성을 뒷받침한다.
- Head importance scoring: head importance score는 각 head가 training loss에 기여하는 정도를 해당 activation과 loss gradient의 expected absolute inner product 로 추정한다.absolute value는 방향과 무관하게 influence magnitude를 포착하며, minibatch 추정값은 training sample 전체에서 누적되고 정규화된다.
- Activation tuning: Continuous gate는 개별 head activation을 scale하며, normalized importance score를 사용해 training 중 head를 동적으로 조절한다.방법은 Ew-epoch warmup 동안 unity gate로 시작한 뒤 dataset-wide score를 계산하고 gate를 업데이트한다. ϵ = 10^-8은 0으로 나누는 것을 방지한다.
- Model configuration: 실험에는 six attention layer와 layer당 eight head를 갖춰 총 48 heads를 이루는 TransTab 과 dropout이 적용된 256-dimensional ReLU feedforward network를 사용한다.Feature name과 categorical value는 pre-trained BERT 에서 도출한 embedding을 사용해 표현한다.
4 실험 및 평가
실험에서는 soft-tuning 비교, training 후 random head drop, head importance에 따라 순서를 정한 cumulative drop을 포함한 여덟 가지 head-dropping 시나리오를 평가한다. 모델은 validation data로 선택하고, held-out test data에서 AUC를 사용해 평가하며, multiclass dataset에는 one-vs-rest macro averaging을 적용한다.
- 실험 사례: 여덟 가지 실험 사례에서 soft tuning, training 후 random head drop, 중요도가 낮은 순서에서 높은 순서로 정렬한 cumulative head removal을 비교한다.처음 두 사례에서는 head removal을 수행하지 않아 고정된 performance score가 산출되고, 다음 두 사례에서는 training 이후에만 head를 무작위로 제거한다.
- 평가 프로토콜: 모델은 70:20:10의 training, validation, test split을 사용하며, validation으로 최적 모델을 선택하고 held-out test data로 최종 평가를 수행한다.평가 metric은 AUC이며, multiclass dataset에서는 one-vs-rest macro averaging으로 계산한다.
5 결과
40개의 서로 다른 tabular dataset에서 중요도가 가장 낮은 attention head부터 점진적으로 제거하는 방식이 대체로 가장 견고했으며, 중요 head를 제거하면 AUC가 가장 크게 저하됐다. 또한 activation tuning의 효과는 dataset에 따라 달랐고, 중요 head가 특정 layer에 일관되게 집중되는 양상은 나타나지 않았다.
- 전체 견고성: 160개의 dataset-and-drop-level 사례 중 72.5%에서 중요도 점수가 낮은 head부터 높은 head 순으로 점진적으로 제거하는 방식이 더 우수했다.평가는 40개 dataset에서 누적 drop level 10, 20, 30, 40 head를 대상으로 수행됐다.
- 전체 견고성: 가장 중요한 head를 제거하면 중요도가 가장 낮은 head를 제거할 때보다 AUC 감소폭이 유의하게 컸으며, random removal은 중간 수준의 견고성을 보였다.Figure 2는 no-tuning, no-dropping 기준 대비 40개 dataset에서의 평균 percentage AUC 변화를 보고한다.
- Dataset별 효과: Soft activation tuning이 견고성에 미치는 효과는 일관되지 않았다. Pendigits에서는 head-drop 견고성을 높였지만, eye movements를 포함한 일부 dataset에서는 최종 classification 성능을 저하시켰다.Pendigits와 eye-movements의 상반된 사례는 tuning의 효과 여부가 dataset 구조에 의해 결정될 수 있음을 보여준다.
- Layer별 중요도: 중요한 attention head는 여섯 개 layer 전체에 분산되어 있었으며, dataset이나 실험 사례에 따라 특정 layer에 일관되게 집중되지 않았다.이는 vision model에서 보고된 hierarchical layer pattern과 대조되며, 해석과 compression에 importance score를 활용하는 근거가 된다.
6 결론
이 논문은 tabular-data transformer model에서 개별 attention head를 해석하기 위한 importance score를 개발하고 평가한다. 결과는 일관된 layer-level 순서나 hierarchy 없이 head 기여도가 dataset에 따라 크게 달라짐을 보여준다.
- 이 논문은 tabular data를 학습하는 multi-head transformer에서 개별 attention head의 기여도를 해석하기 위한 importance score를 개발하고 평가한다.
- 개별 attention head는 동일하게 기여하지 않으며, 그 영향은 tabular dataset에 따라 크게 달라진다.
- Attention layer에서는 head-level 기여도 측면에서 일관된 ordering이나 hierarchy가 나타나지 않으며, 실험에는 단일 tabular transformer architecture가 사용된다.