Tianyi Zhou,
Deqing Fu,
Mahdi Soltanolkotabi,
Robin Jia,
Vatsal Sharan
tzhou029@usc.edu,
deqingfu@usc.edu,
soltanol@usc.edu,
robinjia@usc.edu,
vsharan@usc.edu
Fourier Number Embedding (FNE)
directly maps numbers into their Fourier representations, bypassing the tokenization step entirely
with Better Efficiency and Accuracy.
We train Llama-3.2-1B from scratch with different number embedding methods and evaluate its performance on various arithmetic tasks. Our Fourier Number Embedding (FNE) method demonstrates significant improvements in both data efficiency and parameter efficiency, achieving 99% accuracy with 64× less data compared to traditional embeddings. It also outperforms fine-tuned Llama-3.2 models and achieves perfect accuracy.
Figure: Comparison of accuracy trends for various arithmetic tasks with respect to model size and data size.
As discussed in our pervious work [Tianyi et al. (NeurIPS 2024)],
LLMs naturally learn Fourier Features during pre-training. With these Fourier features, models are able to perform arithmetic with perfect accuracy.
However, due to the limitation of tokenization, LLMs can only embed numbers up to 520.
Below, we provide a simplified illustration of how pre-trained LLMs embed numbers and how this leads to Fourier Number Embedding (FNE).
If you found this project useful, please cite our work as follows:
@article{zhou2024fne, title={FNE: Precise Single-Token Number Embeddings via Fourier Features}, author={Tianyi Zhou, Deqing Fu, Mahdi Soltanolkotabi, Robin Jia, Vatsal Sharan}, journal={arXiv preprint arXiv:???}, year={2025}, url={???} }