FoNE: フーリエ特徴を用いた単一トークン数値埋め込みの高精度化
FoNE: Precise Single-Token Number Embeddings via Fourier Features
February 13, 2025
著者: Tianyi Zhou, Deqing Fu, Mahdi Soltanolkotabi, Robin Jia, Vatsal Sharan
cs.AI
要旨
大規模言語モデル(LLM)は通常、数値を複数のトークンで表現するため、モデルはこれらのトークンを集約して数値を解釈する必要があります。この断片化は、学習と推論の両方を非効率にし、数値関連のタスクにおけるモデルの性能に悪影響を及ぼします。事前学習済みのLLMが数値トークンに対してフーリエ的な特徴を内部で学習しているという観察に着想を得て、我々はフーリエ数値埋め込み(FoNE)を提案します。FoNEは、数値をそのフーリエ特徴とともに埋め込み空間に直接マッピングする新しい手法です。FoNEは各数値を1つのトークンとして、1桁あたりわずか2次元の埋め込みでエンコードし、断片化なしに数値を効果的に捉えます。このコンパクトな表現は、学習と推論の両方を加速します。従来のサブワードや桁ごとの埋め込みと比較して、FoNEは計算オーバーヘッドを削減するだけでなく、加算、減算、乗算などのさまざまな数値タスクにおいてより高い精度を達成します。6桁の10進数加算において、FoNEは99%の精度を達成するために必要なデータ量がサブワードや桁ごとの埋め込みの64分の1であり、数値あたりのトークン数もそれぞれ3分の1、6分の1です。さらに、FoNEは加算、減算、乗算の10万以上のテスト例で100%の精度を達成する唯一の手法です。コードと可視化はhttps://fouriernumber.github.io/で公開されています。
English
Large Language Models (LLMs) typically represent numbers using multiple
tokens, which requires the model to aggregate these tokens to interpret
numerical values. This fragmentation makes both training and inference less
efficient and adversely affects the model's performance on number-related
tasks. Inspired by the observation that pre-trained LLMs internally learn
Fourier-like features for number tokens, we propose Fourier Number Embedding
(FoNE), a novel method that directly maps numbers into the embedding space with
their Fourier features. FoNE encodes each number as a single token with only
two embedding dimensions per digit, effectively capturing numerical values
without fragmentation. This compact representation accelerates both training
and inference. Compared to traditional subword and digit-wise embeddings, FoNE
not only reduces computational overhead but also achieves higher accuracy
across various numerical tasks including addition, subtraction and
multiplication. On 6-digit decimal addition, FoNE requires 64times less data
to achieve 99% accuracy than subword and digit-wise embeddings while using
3times and 6times fewer tokens per number, respectively. Furthermore,
FoNE is the only method that yields 100% accuracy on over 100,000 test examples
for addition, subtraction, and multiplication. The codes and visualization are
available at https://fouriernumber.github.io/.Summary
AI-Generated Summary