fnet-base

Maintained By
google

FNet-base

PropertyValue
LicenseApache 2.0
PaperFNet: Mixing Tokens with Fourier Transforms
Training DataC4 Dataset
ArchitectureTransformer variant with Fourier transforms

What is fnet-base?

FNet-base is an innovative transformer model that replaces traditional attention mechanisms with Fourier transforms, offering significant computational efficiency gains while maintaining strong performance. The model was developed by Google Research and trained on the C4 dataset, achieving 0.58 accuracy on masked language modeling (MLM) and 0.80 on next sentence prediction (NSP) tasks.

Implementation Details

The model was trained on 4 cloud TPUs in Pod configuration for one million steps with a batch size of 256. It uses a vocabulary size of 32,000 tokens and implements both MLM and NSP objectives. The training process involved Adam optimizer with a learning rate of 1e-4 and included 10,000 steps of warmup.

  • Sequence length: 512 tokens
  • Masking procedure: 15% tokens masked with 80% [MASK], 10% random tokens, 10% unchanged
  • Preprocessing: Lowercased text, SentencePiece tokenization

Core Capabilities

  • Achieves 93% of BERT-base's performance while being 32% faster in fine-tuning
  • Strong performance on GLUE benchmark tasks
  • Efficient preprocessing and inference without attention masks
  • Suitable for sequence classification, token classification, and question answering

Frequently Asked Questions

Q: What makes this model unique?

FNet-base's key innovation is replacing the attention mechanism with Fourier transforms, which significantly reduces computational complexity while maintaining most of BERT's performance capabilities.

Q: What are the recommended use cases?

The model is best suited for tasks that utilize whole sentence processing, such as sequence classification, token classification, and question answering. It's not recommended for text generation tasks, where models like GPT-2 would be more appropriate.

🍰 Interesting in building your own agents?
PromptLayer provides Huggingface integration tools to manage and monitor prompts with your whole team. Get started here.