In the landscape of Large Language Models (LLMs), the quality and diversity of pre-training data are paramount. Most data is scraped from the web, leading to significant redundancy. Traditionally, researchers address this through hard deduplication, which involves identifying and deleting duplicate or near-duplicate documents.
A recent paper from Tencent AI Lab, "SoftDedup: an Efficient Data Reweighting Method for Speeding Up Language Model Pre-training," challenges this binary approach. They argue that deleting data is suboptimal and propose a "soft" reweighting scheme that preserves information while mitigating the negative effects of redundancy.
The Problem with Hard Deduplication
Standard deduplication tools like MinHashLSH operate on a "keep or delete" basis. While effective at reducing dataset size, this approach suffers from several drawbacks:
- Information Loss: Even documents flagged as duplicates often contain unique nuances or contexts that are lost upon deletion.
- Rigid Thresholds: Redundancy exists on a spectrum. Hard deduplication requires a fixed similarity threshold, which can be difficult to tune perfectly.
- Uniform Weighting: Once a document is kept, it is treated with the same importance as a completely unique document, ignoring its relative "commonness" in the broader corpus.
The SoftDedup Approach
SoftDedup introduces the concept of Data Commonness to quantify how redundant a document is relative to the rest of the dataset. Instead of a binary filter, it uses a continuous reweighting scheme.
Measuring Commonness
The method utilizes a simple 4-gram language model (trained via KenLM) to estimate the probability of each document. Documents with high probability are considered to have high commonness.
Soft Reweighting and Sampling
Rather than deleting high-commonness documents, SoftDedup assigns them a lower sampling weight ($W(x)$). This weight is inversely proportional to the document's commonness: $W(x) \propto 1/p(x)^T$, where $T$ is a temperature hyperparameter.
To scale this to billions of tokens, the authors partition the data into $K$ "quantiles" based on commonness. During pre-training, the model samples from these bins according to their assigned weights, ensuring that rare, "uncommon" data is seen more frequently than repetitive "common" data.
Experimental Setup and Results
The researchers evaluated SoftDedup across three versions of the Common Crawl dataset (RedPajama, SlimPajama, and Falcon RefinedWeb), each representing different levels of prior hard deduplication. They trained 1.3B parameter models and tested them on perplexity and 12 downstream tasks.
Key Findings
- Significant Speedup: SoftDedup reached the same perplexity as baseline models while requiring 26% to 39% fewer training steps.
- Improved Accuracy: On the RedPajama dataset, SoftDedup improved average few-shot downstream accuracy by 1.77% over the baseline.
- Effectiveness on Clean Data: Even on highly deduplicated sets like Falcon RefinedWeb, SoftDedup provided performance gains, indicating that "soft" redundancy persists even after rigorous "hard" cleaning.
- Low Overhead: Computing commonness is computationally inexpensive. For a 40-billion token corpus, the process took only 7 hours on 4 CPU cores—a negligible fraction of the total LLM training budget.
Conclusion
SoftDedup demonstrates that treating data redundancy as a weighting problem rather than a filtering problem leads to more efficient and effective LLM pre-training. By down-weighting common data instead of deleting it, models can better utilize their training budget to learn from diverse and rare information. This approach offers a scalable, low-cost method for accelerating the development of high-performance language models.
Summary updated