LENS: 트랜스포머의 LayerNorm과 소프트맥스를 학습 가능한 정규화 상태로 대체하기
LENS: Replacing LayerNorm and Softmax in Transformers with Learnable Normalization States
한국어 초록
LayerNorm과 어텐션 소프트맥스는 트랜스포머의 핵심 연산이다. 그러나 하드웨어에서 이 연산들을 일반 행렬 곱(GEMM)으로 효율적으로 구현하기는 어렵다. 이 때문에 ASIC이나 FPGA에 구현한 NPU 같은 최신 하드웨어 가속기에서는 전용 연산 유닛에 많은 하드웨어 자원이나 칩 면적을 사용한다. 본 연구는 LayerNorm, 소프트맥스와 그 대안에 관한 선행 연구를 바탕으로 학습 가능한 정규화 상태(LENS) 프레임워크를 제안한다. 관련 방법의 공통 구조를 추출해 LayerNorm을 매우 작은 다층 퍼셉트론(MLP)으로 다시 구성하고, 같은 방법을 소프트맥스에도 적용한다. 이렇게 트랜스포머의 더 많은 연산을 GEMM으로 처리해 하드웨어에 적합한 아키텍처를 구성한다. 비전 트랜스포머(ViT)의 이미지 분류와 Pythia 모델의 자기회귀 언어 모델링에서 LENS를 평가했으며, WikiText와 LAMBADA에서 일반화 성능도 평가했다. 여러 비전 실험에서 기준선과 같거나 더 높은 성능을 보였으며, 나머지 비전 및 언어 실험에서도 기준선 성능의 대부분을 유지했다. 이 결과는 LayerNorm과 소프트맥스를 대체할 때 사람이 직접 설계한 정규화 함수와 어텐션 함수 외에도 선택지가 있음을 시사한다. LENS는 또한 자원이 제한된 가속기용 트랜스포머 아키텍처를 연구할 기반을 제공한다.
원문 초록
LayerNorm and attention Softmax are critical operations in Transformers. However, they cannot be efficiently mapped to General Matrix Multiplication (GEMM) computations on hardware. Therefore, modern hardware accelerator designs, such as NPUs on ASIC/FPGA, consume a large amount of hardware resources or chip area to implement their specific arithmetic units. Building on previous work about LayerNorm, Softmax, and their alternatives, we introduce Learnable Normalization States (LENS), a framework that reformulates LayerNorm as tiny MLPs by abstracting a common structure from related methods and extends this method to Softmax, which moves more of the computation in Transformers to GEMM as a hardware-friendly architecture. We evaluate LENS on image classification with Vision Transformers (ViT) and autoregressive language modeling with Pythia models, including generalization tests on WikiText and LAMBADA. Across these tasks, LENS matches or exceeds baseline performance in several vision settings and retains most of the baseline performance in the remaining vision and language experiments. These findings may suggest that hand-designed normalization and attention functions are not the only choice as alternatives to LayerNorm and Softmax. LENS also provides a basis for exploring Transformer architectures for resource-limited accelerators.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.
저자 비고
arXiv Comments
Source code is available at: https://github.com/liuyh-Horizon/LENS