D-CPT Law: Domain-specific Continual Pre-Training Scaling Law for Large Language Models

Continual Pre-Training (CPT) on Large Language Models (LLMs) has been widely used to expand the model's fundamental understanding of specific downstream domains (e.g., math and code). For the CPT on domain-specific LLMs, one important question is how to choose the optimal mixture ratio between the general-corpus (e.g., Dolma, Slim-pajama) and the downstream domain-corpus. Existing methods usually adopt laborious human efforts by grid-searching on a set of mixture ratios, which require high GPU training consumption costs. Besides, we cannot guarantee the selected ratio is optimal for the specific domain. To address the limitations of existing methods, inspired by the Scaling Law for performance prediction, we propose to investigate the Scaling Law of the Domain-specific Continual Pre-Training (D-CPT Law) to decide the optimal mixture ratio with acceptable training costs for LLMs of different sizes. Specifically, by fitting the D-CPT Law, we can easily predict the general and downstream performance of arbitrary mixture ratios, model sizes, and dataset sizes using small-scale training costs on limited experiments. Moreover, we also extend our standard D-CPT Law on cross-domain settings and propose the Cross-Domain D-CPT Law to predict the D-CPT law of target domains, where very small training costs (about 1% of the normal training costs) are needed for the target domains. Comprehensive experimental results on six downstream domains demonstrate the effectiveness and generalizability of our proposed D-CPT Law and Cross-Domain D-CPT Law.

Paper

References (57)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer sFHX5/10 · confidence 3/52024-07-11

Summary

This work proposes a domain-specific scaling law to optimize mixture ratio between the general domain training corpus and the specific domain corpus. The authors considered several parameterizations and experimented on six different downstream domains such as code, math, and Medical. The result show that D-CPT Law has a high fitting accuracy across various model sizes, dataset sizes, and mixture ratios. Furthermore, the proposed cross-domain D-CPT Law reduced training costs while maintaining high performance in predicting domain-specific continual pre-training results.

Strengths

1. The paper proposes a domain-specific scaling that can more efficiently determine thec optimal mixture ratio between general and domain-specific corpora. The experiments demonstrate its effectiveness. 2. The paper presents three applications of D-CPT Law that may be of interest and benefit to the community.

Weaknesses

1. The models are limited to the Qwen series, which are relatively small in size. This makes it unclear whether similar results would be observed with larger models.

Questions

1. The author stated, "we test the validation loss every 1,000 steps and the total training steps are 20k." How did you determine the step parameters, such as 1,000 and 20,000? 2. You defined five parameterizations and demonstrated that L3 is the best through experiments. Could there be other parameterizations better than L3? In other words, is it possible to theoretically prove that L3 is the optimal D-CPT Law?

Rating

5

Confidence

3

Soundness

2

Presentation

3

Contribution

3

Limitations

The authors state several limitations and will consider addressing them in their future work.

Reviewer rpUb6/10 · confidence 5/52024-07-11

Summary

This work explore the data mixture scaling law ( D-CPT Law) between the general corpus and the downstream domain-corpus for the continual pre-training of large language model.They also extend the fitted standard D-CPT Law on cross-domain settings and propose the Cross-Domain D-CPT Law to predict the D-CPT law of target domains. D-CPT Law could be applied on three important scenarios: optimal mixture on the trade-off between general and domain-specific abilities, optimal mixture for limited domain-specific data, and resource allocation setting, which is useful in practice.

Strengths

1.This work experimented and analyzed on three scenarios including optimal mixture on the trade-off between general and domain-specific abilities, optimal mixture for limited domain-specific data, and resource allocation setting, which is useful in practice 2. D-CPT Law considered both the in-domain setting and the cross-domain setting with a new involved parameter K, which provide a reference for the unseen domain data mixing. 3. The analysis on the selected fitting function is comprehensive and make sense.

Weaknesses

This work focus on the data mixing scaling law for the continue pre-training phase of LLM. However, I think this work didn’t specifically have any design for the continue pre-training. The setting for the final scaling Function (Equation 6) have not mentioned any specific for continue pre-training. As the author mentioned , Equation 6 is supposed to transform into the Chinchilla Scaling Law (which is for a LLM training from scratch) when r is fixed.

Questions

1.Could you explain why this scaling law function is for continue pre-training? 2.In Equation 7, the newly involved parameter K, why is also in a similar power law pattern? The domain-specific learnable coefficient might be a much different dimension with the total number of model parameters and training data. 3.How many combination did you choose for the experiments? There are many between the data sizes from 0.1B to 26B. The way the portfolio is chosen has an impact on the on the average results.

Rating

6

Confidence

5

Soundness

3

Presentation

3

Contribution

3

Limitations

As the authors have stated comprehensive in the limitation Section, I have no further comments for this part.

Reviewer rpUb2024-08-12

I thoroughly looked at the author's response, and the score remained unchanged.

Reviewer ycBX7/10 · confidence 4/52024-07-14

Summary

For continual pretraining of domain-specific large language models, an important question is how to choose the optimal mixture ratio between the general corpus and the downstream domain corpus. This paper proposes to fit the scaling law for domain-specific continual pre-training (D-CPT Law), using small-scale training costs to predict the general and downstream performance of arbitrary model sizes, data sizes, and data mixture ratios. They also extend it to Cross-Domain D-CPT Law to reduce training costs for the target domain. The paper shows empirical evidence for the effectiveness and applications of the Laws.

Strengths

- Discovered that model performance can be predicted given the data mixture ratio between general and domain-specific corpus and a few other factors in domain-specific language model training. - Proposed essential requirements of the scaling law formula, compared multiple parametrization of the scaling law, and proposed a parametrization that extends the Chinchilla Scaling Law. - Extended the law to cross-domain scenarios and described its features. - Empirically verified the effectiveness, model size generalizability, and dataset size generalizability of the proposed methods.

Weaknesses

- The paper lacks a comparison between applying the proposed laws and performing a grid search over hyperparameters. How much computation is saved in various applications?

Questions

- Is it possible to fit a set of parameters in the scaling law, such that all independent variables can change their values? - How many different $(N, D, r)$ are needed to fit the parameters in the D-CPT Law formula?

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors addressed the limitations well in Appendix A.

Authorsrebuttal2024-08-10

Summarization on the Responses

Thanks for handling/reviewing our submitted manuscript: "D-CPT Law: Domain-specific Continual Pre-Training Scaling Law for Large Language Models". We would like to thank the reviewers for their insightful and constructive comments and suggestions. By addressing each of the issues raised by the reviewers, we believe that the quality and clarity of our D-CPT Law can be improved a lot. The major responses are summarized as follows: (1). We have carefully discussed the advantages and reasons for the choice of the formula of D-CPT Law (See Reviewer rpUb. Q1 and Reviewer sFHX. Q2). (2). We have additionally compared the additional parameterizations of D-CPT Law and Cross-Domain D-CPT Law and discussed the advantages ours in detail (See Reviewer rpUb.Q1&Q2, Reviewer sFHX. Q2). (3). We have discussed the advantages and reasons behind the choice of Qwen-1.5 series and the model sizes in detail (See Reviewer sFHX.Weakness). (4). We have provided more clarification on the experimental settings of our main experiments (See Reviewer ycBX.Q2, Reviewer rpUb. Q3, and Reviewer sFHX.Q1). (5). We have conducted additional experiments to compare the compute budget of grid search with the D-CPT Law, further demonstrating the efficiency of the D-CPT Law (See Reviewer ycBX.Weakness). (6). We have provided more clarification on the reasons behind the design of D-CPT Law in the context of domain-specific continual pre-training (See Reviewer rpUb.Weakness). (7). We have provided a more detailed analysis and clarification on the independent variables in the D-CPT Law (See Reviewer ycBX.Q1). Again, we would like to sincerely thank you very much for these constructive comments and evaluation for our manuscript.

Authorsrebuttal2024-08-10

Looking forward to feedback on the Responses

Dear Reviewers: Hello! Since the discussion period has started, we would like to kindly ask you to take a look at our responses and reevaluate our work based on our clarifications. Please let us know whether our response addresses your concerns or whether there is any further detail we can provide to help address them. We appreciate your time and consideration!

Authorsrebuttal2024-08-12

Looking forward to Feedback as Discussion Deadline Approaches

Hi, we sincerely thank you very much for these constructive comments and evaluation of our manuscript. As the discussion phase will be closed on Aug 13 11:59 pm AoE, we would like to kindly ask you to take a look at our responses and reevaluate our work based on our clarifications. Please let us know whether our response addresses your concerns or whether there is any further detail we can provide to help address these concerns. Thank you again for dedicating your time to reviewing our paper.

Authorsrebuttal2024-08-12

Looking forward to Feedback as Discussion Deadline Approaches

Hi, we sincerely thank you very much for these constructive comments and evaluation of our manuscript. As the discussion phase will be closed on Aug 13 11:59 pm AoE, we would like to kindly ask you to take a look at our responses and reevaluate our work based on our clarifications. Please let us know whether our response addresses your concerns or whether there is any further detail we can provide to help address these concerns. Thank you again for dedicating your time to reviewing our paper.

Reviewer sFHX2024-08-13

Thank you for your responses. After reviewing the rebuttal, I will maintain the previous score.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC