Fairy2i: 실제 LLM에서 모든 매개변수를 {±1, ±i}로 양자화하여 복소수 LLM 학습하기
Fairy2i: Training Complex LLMs from Real LLMs with All Parameters in {pm 1, pm i}
December 2, 2025
저자: Feiyu Wang, Xinyu Tan, Bokai Huang, Yihao Zhang, Guoan Wang, Peizhuang Cong, Tong Yang
cs.AI
초록
대규모 언어 모델(LLM)은 인공 지능 분야에 혁명을 일으켰으나, 그 방대한 메모리 및 계산 요구량으로 인해 과감한 양자화가 필수적이며, 이로 인해 표현이 점차 이론적 한계인 1비트에 가까워지고 있다. iFairy와 같은 복소수 값 LLM은 실수 값 대비 낮은 비트 표현 구현에 유리하지만, 처음부터 다시 학습해야 하므로 사전 학습된 실수 값 기반 모델의 방대한 생태계를 활용할 수 없다는 한계가 있다. 본 연구에서는 사전 학습된 실수 값 계층을 동등한 광의 선형 복소수 형태로 변환하여 기존 체크포인트를 재사용하면서도 극단적으로 낮은 비트 양자화를 가능하게 하는 범용 프레임워크인 Fairy2i를 제안한다. 실수 함수와 광의 선형 함수 간의 무손실 수학적 동등성을 증명함으로써 표준 트랜스포머를 복소수 영역으로 변환하고, 1의 네제곱근으로 구성된 고효율 코드북을 활용한 위상 인식 양자화 기법을 적용한다. 더 나아가, 양자화 오차를 반복적으로 최소화하는 재귀적 잔차 양자화 메커니즘을 도입하여 효율적인 곱셈 없는 누적 방식으로 추론을 수행할 수 있도록 한다. Fairy2i가 LLaMA-2 7B 모델의 성능을 유효 2비트 정밀도에서 완전 정밀도 기준선과 거의 유사한 수준으로 복원하며, 최첨단 실수 값 이진 및 삼진 양자화 방법들을 크게 능가함을 입증한다. 본 연구는 복소수 연산의 표현 효율성과 사전 학습 모델의 실용적 유용성 간의 간극을 해소하며, 일반 범용 하드웨어에서의 효율적인 추론을 위한 새로운 길을 제시한다.
English
Large language models (LLMs) have revolutionized artificial intelligence, yet their massive memory and computational demands necessitate aggressive quantization, increasingly pushing representations toward the theoretical limit of a single bit. While complex-valued LLMs, such as iFairy, offer a superior chance for low-bit representation compared to real-valued counterparts, they require training from scratch, preventing the utilization of the vast ecosystem of pre-trained real-valued foundation models. Here we present Fairy2i, a universal framework that transforms pre-trained real-valued layers into an equivalent widely-linear complex form, enabling extremely low-bit quantization while reusing existing checkpoints. By proving a lossless mathematical equivalence between real and widely-linear maps, we convert standard Transformers into the complex domain and employ a phase-aware quantization scheme with a highly efficient codebook of fourth roots of unity. Furthermore, we introduce a recursive residual quantization mechanism that iteratively minimizes quantization error, allowing inference to proceed via efficient multiplication-free accumulation. We demonstrate that Fairy2i restores the performance of LLaMA-2 7B at an effective 2-bit precision to levels nearly comparable with full-precision baselines, significantly outperforming state-of-the-art real-valued binary and ternary quantization methods. This work bridges the gap between the representational efficiency of complex-valued arithmetic and the practical utility of pre-trained models, paving a new way for efficient inference on commodity hardware.