TL;DR
This paper introduces a novel, efficient two-stage distillation method to convert powerful token-based Large Language Models (LLMs) into Byte Language Models (BLMs). This approach significantly reduces the massive data requirements for training BLMs from scratch, enabling comparable performance with substantially less data and computational cost.
What Problem Does This Paper Address?
Traditional LLMs rely on tokenization, which involves breaking text into subword units. While effective, this process can introduce biases and limitations, especially when dealing with noisy or out-of-vocabulary text. Byte Language Models (BLMs), which operate directly on raw bytes, offer a more granular and potentially robust alternative, free from tokenization artifacts. However, training BLMs from scratch requires enormous amounts of data (trillions of bytes), making them prohibitively expensive. Existing methods that try to initialize BLMs with weights from token-based LLMs still struggle to close the performance gap. This paper addresses the challenge of efficiently transferring the capabilities of well-trained token-based LLMs to BLMs without the need for extensive, costly training from scratch.
Methods
The authors propose a two-stage distillation framework:
- Progressive Knowledge Distillation (Stage 1): This stage focuses on aligning the byte-level student model with the token-based teacher model. It involves three key steps:
- Embedding Alignment: Minimizing the difference between byte span embeddings and teacher token embeddings to bridge the representational gap.
- Joint Distillation: Synchronizing hidden states and logits between the student and teacher models using token-level outputs.
- Boundary Learning: Training a "Routing Module" to predict byte boundaries, mimicking the teacher's tokenization behavior. This stage results in a student model that can process raw bytes and generate in the token space.
- Byte-Level Supervised Fine-Tuning (Stage 2): This stage transitions the model to end-to-end byte generation. It involves replacing the token-based language model head with byte-level "Dechunk" and "Decoder" modules and fine-tuning the model using a next-byte prediction objective.
The authors also introduce a "one-byte lookahead" mechanism in the routing module for better boundary prediction and explore two decoding strategies (Joint Boundary Prediction - JBP, and Multi-Byte Prediction - MBP), ultimately favoring JBP for its robustness.
Datasets
- Training Data: The authors utilize the FineWeb dataset for both stages.
- Stage 1: A 30B byte subset.
- Stage 2: An additional 95B bytes.
- Total training data: Approximately 125B bytes.
- Evaluation Benchmarks: The models are evaluated on a suite of standard NLP benchmarks, including:
- HellaSwag
- PIQA
- ARC-Easy
- ARC-Challenge
- WinoGrande
- OpenBookQA
- MMLU
- GSM8K (for reasoning tasks)
Key Insights and Ideas
- Data Efficiency is Key: The core insight is that a carefully designed distillation process can achieve comparable performance to token-based LLMs with orders of magnitude less byte data than training from scratch. This makes BLMs much more accessible.
- Two-Stage Curriculum is Crucial: Separating representation alignment (Stage 1) from end-to-end byte generation (Stage 2) is vital. Stage 1 acts as a critical bridge, allowing the byte model to first "understand" the token space before fully committing to byte-level output.
- Boundary Learning is Non-Trivial: Accurately predicting byte boundaries is essential for byte-level models. The authors show that simply mimicking whitespace is insufficient and propose a more robust "one-byte lookahead" mechanism and explore strategies like "Trim Data" and "Whitespace Penalty" to improve boundary prediction.
- Teacher Model Scale Doesn't Always Help: Surprisingly, using a significantly larger teacher model for distillation didn't consistently improve results. This suggests that highly distilled "frontier" models already possess dense, optimized latent spaces, and larger teachers might introduce more noise than benefit.
- Mamba2 Encoder Advantage: The Mamba2 encoder shows superior performance in the byte-level alignment stage compared to a standard Transformer, likely due to its ability to compress long byte sequences into meaningful latent states more effectively.
Key Results
- High Performance Retention: The distilled BLMs retain over 92% of the teacher models' performance on benchmarks like MMLU, with an average performance drop of only 1.15-2.80 points for Llama-3.2 3B and Qwen-3 4B.
- Significant Data Reduction: The proposed method achieves this with approximately 125B bytes of training data, a substantial reduction compared to the trillions of bytes typically required for training BLMs from scratch. For instance, their H-Net distillation requires 30B bytes for Stage 1, compared to 189B for a previous H-Net distillation approach.
- Robustness: The distilled models show improved resilience to character-level perturbations compared to their token-based counterparts, especially in Stage 1, demonstrating the intrinsic benefits of byte-level modeling.
- Competitive with Baselines: The proposed method outperforms or is competitive with existing byte-level distillation baselines like BLT, ALM, and H-Net Distill, often with less data.
Limitations and Future Work
- Robustness Trade-off: While Stage 1 models show good robustness, Stage 2 models exhibit a slight decrease, particularly on perturbed benchmarks like AntSpeak. This suggests a potential trade-off between overall performance and robustness during fine-tuning. The authors propose mitigation strategies like "Trim Data" and "Whitespace Penalty" to address this.
- Decoding Strategy Impact: While JBP is favored for reasoning, MBP shows marginal gains on some common-sense tasks, indicating potential for further exploration in decoding strategies.
- Future Work: The authors suggest exploring further post-training techniques like On-Policy Distillation to enhance the student model's capabilities, which they demonstrate can further boost performance. They also highlight the need for continued research into balancing structural adherence and robustness in byte-level LLMs.
Summary updated