Fox-1: Open Small Language Model for Cloud and Edge

Zijian Hu, Jipeng Zhang, Rui Pan, Zhaozhuo Xu, Salman Avestimehr, Chaoyang He, Tong Zhang, Stripelis, Dimitris, Yao, Yuhang, Avestimehr, Salman, Zhang, Tong, He, Chaoyang · DOI

TL;DR

The paper introduces Fox-1, a 1.6 billion parameter Small Language Model (SLM) designed for efficient cloud and edge deployment. It achieves competitive performance with larger models through a novel 3-stage data curriculum, a deeper architecture, and Grouped Query Attention (GQA), while also releasing its weights under an open-source license to democratize LLM access.

What Problem Does This Paper Address?

Training large language models (LLMs) is incredibly resource-intensive, requiring vast amounts of data, compute, and energy. This high cost limits participation for many researchers and makes widespread deployment challenging, hindering the democratization of advanced AI. While Small Language Models (SLMs) offer a promising alternative, there's a need to further optimize their training and architecture to achieve comparable performance to much larger models without incurring prohibitive costs. Specifically, the paper explores how to improve pre-training efficiency and data organization within SLMs.

Methods

Fox-1's development involved several key innovations:

  • 3-Stage Data Curriculum: Instead of a monolithic pre-training approach, Fox-1 uses a staged curriculum. This involves gradually increasing the sequence length of training data from 2K to 8K tokens across three stages. This strategy aims to improve efficiency and long-context capabilities.
  • Deeper Architecture: Fox-1 features a deeper network structure (32 self-attention layers) compared to many contemporary SLMs of similar size. This is inspired by research suggesting deeper networks can improve reasoning abilities.
  • Expanded Vocabulary: A significantly larger vocabulary size (256K tokens) is used. This is hypothesized to improve downstream performance by encoding more information per token and reducing out-of-vocabulary issues.
  • Shared Embeddings: To manage the parameter count associated with the large vocabulary, input and output embedding layers are shared. This reduces the model's size by approximately 30.49%.
  • Grouped Query Attention (GQA): This attention mechanism is employed to improve training and inference speed and reduce memory usage by sharing key-value heads across query heads.
  • Pre-normalization: RMSNorm is used for pre-normalization, chosen for its efficiency over LayerNorm in modern LLMs.

Datasets

The training data for Fox-1 is extensive, totaling 3 trillion tokens. It's organized into three stages:

  • Stage 1: Primarily uses a sampled subset of Common Crawl data (1.05T tokens) with a 2K sequence length.
  • Stage 2: Incorporates a broader range of data, including more Common Crawl, Books, C4, Math, Papers, Wiki, Code, Science Text, and WebQ&A datasets (1.58T tokens) with sequence lengths of 4K-8K.
  • Stage 3: Focuses on high-quality data, including instruction-following and rewritten book datasets (62B tokens), with 4K-8K sequence lengths.

For evaluation, Fox-1 was tested on standard benchmarks including ARC Challenge, HellaSwag, TruthfulQA, MMLU, Winogrande, and GSM8k.

Key Insights and Ideas

  • Curriculum Learning for SLMs: The 3-stage data curriculum, particularly the gradual increase in sequence length, appears to be a crucial factor in achieving efficient pre-training and good long-context performance for SLMs.
  • Vocabulary Size Matters: A larger vocabulary (256K) is shown to be beneficial, potentially improving downstream performance and inference efficiency by packing more information into each token.
  • Architectural Choices for Efficiency: The combination of a deeper network, GQA, and shared embeddings demonstrates that careful architectural design can yield high performance in SLMs without excessive parameter counts.
  • Democratization through Openness: Releasing the model weights under the Apache 2.0 license is a significant step towards making advanced LLM research and development more accessible to the broader community.

Key Results

Fox-1-1.6B demonstrates strong performance across several benchmarks, often matching or exceeding models with more parameters:

  • Benchmark Performance: Fox-1 achieves competitive or superior results compared to models like Gemma-2B, Qwen1.5-1.8B, StableLM-2-1.6B, and OpenELM1.1B on standard LLM benchmarks.
  • GSM8k: Fox-1 achieved 36.39% on GSM8k, outperforming all baselines.
  • MMLU: It surpassed Gemma-2B, StableLM-2-1.6B, and OpenELM 1.1B on MMLU, despite being half the size of Gemma-2B.
  • Inference Efficiency: Fox-1 exhibits high throughput, exceeding 200 tokens per second, and requires less GPU memory (3703MiB) compared to some of its peers like Qwen1.5-1.8B and Gemma-2B.

Limitations and Future Work

  • English-Only: The current Fox-1 model is English-only. Future work could explore expanding its multilingual capabilities.
  • Data Quality in Stage 3: While Stage 3 focuses on high-quality data, the paper notes that machine-generated datasets are incorporated, which can sometimes introduce biases or limitations.
  • Further Optimization: The paper suggests that continued research into training curricula and architectural improvements can further enhance SLM capabilities. The open release of Fox-1 is intended to facilitate this ongoing research within the community.

Summary updated

BibTeX
@misc{hu2024fox,
  author = {Zijian Hu and Jipeng Zhang and Rui Pan and Zhaozhuo Xu and Salman Avestimehr and Chaoyang He and Tong Zhang and Stripelis, Dimitris and Yao, Yuhang and Avestimehr, Salman and Zhang, Tong and He, Chaoyang},
  title = {{Fox-1: Open Small Language Model for Cloud and Edge}},
  year = {2024},
  eprint = {2411.05281},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.05281},
}
Figure