Word Matters: What Influences Domain Adaptation in Summarization? (2024)

Abstract: Domain adaptation aims to enable Large Language Models (LLMs) to generalize domain datasets unseen effectively during the training phase. However, factors such as the size of the model parameters and the scale of training data are general influencers and do not reflect the nuances of domain adaptation performance. This paper investigates the fine-grained factors affecting domain adaptation performance, analyzing the specific impact of ‘words’ in training data on summarization tasks. We propose quantifying dataset learning difficulty as the learning difficulty of generative summarization, which is determined by two indicators: wordbased compression rate and abstraction level. Our experiments conclude that, when considering dataset learning difficulty, the cross-domain overlap and the performance gain in summarization tasks exhibit an approximate linear relationship, which is not directly related to the number of words. Based on this finding, predicting a model’s performance on unknown domain datasets is possible without undergoing training. Source code and scripts are available at https://github.com/li-aolong/ Word-Matters.

heading: 1 Introduction
text: With the continuous development of Large Language Models (LLMs), remarkable capabilities have been demonstrated in knowledge comprehension (Thirunavukarasu et al., 2023a; Sun et al., 2023), logical reasoning (Hao et al., 2023; Miao et al., 2023), problem-solving (Chan et al., 2023; Talebirad and Nadiri, 2023), and other aspects (Zhao et al., 2023; Wen et al., 2023).
As a result, LLMs have been widely applied to various summarization tasks on different domains to improve productivity like law (Shukla et al., 2022), medicine (Veen et al., 2023), finance (Li
∗These authors are both First Author. †Corresponding author
et al., 2023) and so on, including both natural and social science study (Glickman and Zhang, 2024; Xu et al., 2024). However, when LLMs are applied to specific domains, it often necessitates the selection of corresponding domain-specific knowledge bases for training (Zhang et al., 2023; Cui et al., 2024; Thirunavukarasu et al., 2023b; Yu et al., 2021). This results in a limitation where a model trained in one domain struggles to be effectively applied in others (Dada et al., 2023), leading to a waste of resources.
This constraint arises from the disparity in the distribution between the training data and the target domain data (Zhang et al., 2022). In light of this limitation, effective methods must be taken to fix the gap and then enhance the model’s adaptability and efficiency in summarization tasks. Domain adaptation aims to train a model from multiple source domains, enabling it to generalize well to unseen domains (Li et al., 2018; Dou et al., 2019). Consequently, enhancing domain adaptation performance is a key objective for large-scale models in improving downstream tasks (Zhou et al., 2021a). It is worthwhile to explore which factors can affect the domain adaptation performance (Wang et al., 2021).
Schaeffer et al. (2023) proposes that metrics based on nonlinear or non-contiguous tokens are crucial to a model demonstrating emergent abilities and that ROUGE-L-Sum shows sharper variations. This has inspired us to consider the performance changes of models in domain adaptation from the perspective of more granular units. Tokens typically do not possess complete semantics, whereas words are the basic language units with specific meanings or functions. Therefore, we consider exploring the impact on model performance in domain adaptation from the perspective of words.
Summarization tasks involve generating concise texts that encapsulate the main components of longer documents, considering factors such
13236
as coherence, information diversity, and coverage scope (Alomari et al., 2022). This differs from other downstream tasks like machine translation (Klimova et al., 2022) and classification (Bird et al., 2020). Fatima et al. (2022) note that reducing summary extractors’ size or compression ratio can lead to losing vital content, features, concepts, and other significant information. Therefore, we explore how the degree of information extraction between input documents and target summaries impacts domain adaptation performance in summarization tasks.
This paper investigates how words impact the domain adaptation of summary tasks. We first introduce two indicators, compression rate, and abstraction level, to quantify the learning difficulty of datasets, thereby more accurately reflecting the performance gain of models. Then, we identify two key aspects affecting domain adaptation: crossdomain overlap and word count, hypothesizing a linear relationship between them and model performance. Experiments are conducted with models of various sizes on summarization datasets from four domains. The results indicate that the crossdomain overlap exhibits an approximately linear relationship with performance gain when considering dataset learning difficulty. In contrast, word count shows no significant correlation. Based on this linear relationship, it is possible to predict model performance without undergoing training by using the cross-domain overlap calculated from the dataset. Our contributions can be summarized as follows:
• We propose two factors affecting the domain adaptation of summarization tasks: (1) Learning difficulty coefficient of the dataset more accurately reflects the performance gain; (2) Cross-domain overlap directly represents the closeness between the source and target domains.
• Our experiments show that cross-domain overlap has an approximately linear relationship with performance gains based on the learning difficulty coefficient, revealing the connection between datasets and domain adaptation from the perspective of words.
• We demonstrate that without undergoing training, it is possible to predict a model’s performance on unknown domain datasets solely based on the learning difficulty coefficient
and cross-domain overlap. This provides a resource-efficient and rapid validation method for models regarding domain adaptation.

heading: 2 Related Work
text: Domain Adaptation (DA) has emerged as a crucial methodology for enhancing model performance across varying domains (Farahani et al., 2020). DA aims to enhance the performance of LLMs in a target domain, where annotated data may be scarce or absent, by leveraging knowledge from a related domain with a sufficient amount of labeled data (Farahani et al., 2020). Many methods have been developed to tackle the out-of-domain adaptation issue (Zhou et al., 2021b; Fan et al., 2021; Cha et al., 2021; Wang et al., 2022; Ling et al., 2023). There are three pivotal strategies related to our work: (1) Continual pre-training, (2) Alignment of distributions, and (3) Adaptation tuning.
Continual Pre-training Continual pre-training uses similar training objectives as continual selfsupervised training to update pre-trained models with new data instead of retraining from scratch (Gupta et al., 2023). Continual pre-training is studied for domain adaptation where the new dataset comes from a new domain, which is referred to as continual domain-adaptive pre-training (DA-training) (Gururangan et al., 2021; Scialom et al., 2022; Ke et al., 2023a). DAP-training methods can achieve better results by training LLMs with a large unlabeled domain corpus before endtask fine-tuning (Alsentzer et al., 2019; Lee et al., 2019; Gururangan et al., 2020; Ke et al., 2023b). However, the effectiveness of this method is contingent upon the relevance of the pre-trained LLMs to the target domain and requires substantial domainspecific data to achieve optimal performance.
Alignment of Distributions Aligning the statistical attribution of the source and target domains to match their distributions has emerged as a principal method (Peng et al., 2019; Nguyen-Meidine et al., 2020). The general way of aligning the distributions is by minimizing the distance between domains. The most used distance measures in domain adaptation are maximum mean discrepancy, Kullback-Leibler divergence, and contrastive domain discrepancy (Long et al., 2015; Ganin and Lempitsky, 2015). The strength of this approach lies in its theoretical rigor and the potential for precise domain alignment. Nevertheless, the challenge
of selecting appropriate distance metrics and the computational complexity of these calculations can pose significant obstacles. Compared with this, we adopt word-based statistical metrics to calculate the similarity between texts from different domains directly.
Adaptation Tuning LLMs may not capture sufficient knowledge for specific tasks or domains even when trained on vast amounts of general text data. Adapting models to a smaller, domain-specific dataset can significantly improve their performance in that specific area. Here are three primary methods for adapting LLMs: (1) Prompt engineering has shown its power to quickly adapt LLMs to unseen domains without updating the inner parameters. Prompts define unseen tasks with or without several illustrative examples to LLMs in natural language (Ben-David et al., 2022; Kojima et al., 2023). Continuous prompts are sequences of tokens attached with the input sentence that can be learned from the downstream dataset by prompt tuning (Ye et al., 2022; Vu et al., 2022; Razdaibiedina et al., 2023). Su et al. (2022) demonstrate the transferability of continuous prompts in both crosstask as well as cross-model settings; (2) Adapter fine-tuning, such as Low-rank adapters (Hu et al., 2021) and DyLora (Valipour et al., 2023), adds a small number of extra parameters to LLMs to enhance performance without major modifications; (3) Full fine-tuning is still the most fundamental and wildly used method to improve the model’s adaptation performance. Instruction fine-tuning has proven to be highly successful in enhancing the model’s adaptation capabilities (Chung et al., 2022; Menick et al., 2022; Wei et al., 2022; Huang et al., 2023). However, how to select suitable data to cultivate LLMs’ adapting capacity and predict transferring results remain a problem.

heading: 3 What and How does Word Influence Domain Adaptation?
text: In this section, we explore how words can affect aspects of domain adaptation and their impact. We first hypothesize that datasets of varying learning difficulties affect model performance and investigate the influence of words on the learning difficulty of target domain datasets. We propose two indicators to reflect the learning difficulty of datasets: Compression Ratio and Abstraction Level. Secondly, from the perspective of words, we propose two aspects that could affect domain adaptation:
cross-domain overlap and word count. Finally, we hypothesize a linear relationship between these aspects and domain adaptation performance based on dataset learning difficulty. This hypothesis is tested in subsequent experiments.

heading: 3.1 Word Influence On Target Domain Dataset Learning Difficulty
text: We assume that different datasets have varying levels of learning difficulty, and training models on datasets with low learning difficulty can lead to higher metric improvements on the test set. In contrast, the metric improvement is relatively small for datasets with high learning difficulty. To quantitatively assess the learning difficulty of datasets for the generative summarization task, we introduce two indicators: Compression Ratio and Abstraction Level.
Compression Ratio The Compression Ratio reflects the learning difficulty of a dataset in terms of form, which describes the degree of length reduction of the original text relative to the generated text. A higher compression Ratio indicates a more challenging dataset because the model needs to compress the content of the original documents to a greater extent, which places a higher demand on the model’s text comprehension and information extraction capabilities. The Compression Ratio α for a dataset containing n samples is represented as the average Compression Ratio across all samples and is calculated using the following formula:
α = 1
n
n∑
i=1
|Di| |Si| , (1)
where |Di| and |Si| represent the word count of the i-th document and summary in the dataset, respectively.
Abstraction Level Considering only the Compression Ratio cannot fully reflect the dataset’s learning difficulty. For example, if the reference summaries in the dataset are verbatim excerpts of specific sentences from the source document, even though the Compression Ratio may be high, the model only needs to learn to copy parts of the document to achieve high performance. This is a straightforward extractive pattern and does not truly reflect the model’s summarization capability. Therefore, we introduce Abstraction Level that reflects the learning difficulty of a dataset in terms of content, which we define as the reciprocal of
the average ROUGE score between the original documents in the test set and the corresponding summaries, with the formula represented as follows:
β = n
n∑ i=1 ROUGE(di,si)
(2)
ROUGE is essentially a method for calculating overlap. We argue that the overlap between documents and summaries can, to some extent, represent the co-occurrence of knowledge within the dataset. A lower ROUGE value indicates lower content relevance between the document and the summary, making improving performance on that dataset. Hence, we use the reciprocal of Abstraction Level to reflect the learning difficulty of the dataset in terms of content.
Learning Difficulty Coefficient According to the proposed two indicators influencing dataset learning difficulty, we define a dataset’s learning difficulty coefficient λ as the product of Compression Ratio and Abstraction Level, represented by the following formula:
λ = αβ (3)

heading: 3.2 Possible Impact Aspects Cross Different Domains Based on Words
text: We investigate the influence of words on domain adaptation performance. Due to the limitations of the original metric for summarization tasks, such as ROUGE, in reflecting how well a model generalizes across different domains, we introduce an evaluation metric suitable for assessing domain adaptation performance and explore the potential factors that might affect this metric.
Summarization Gain The commonly used evaluation metric in summarization tasks, ROUGE, reflects performance on a specific dataset, whereas the performance of domain adaptation is more evident in the change in absolute performance. Therefore, we employ the ROUGE gain as a fundamental measure of domain adaptation performance, with the formula as follows:
Gain = ROUGEfine-tuned−ROUGEbase, (4)
where ROUGEbase represents the original model’s ROUGE value calculated through direct
inference on the test set, while ROUGEfine-tuned represents the ROUGE value obtained after the model has been fine-tuned.
Cross-domain Overlap When considering performance adaptation across different domains, intuitively, they are more similar if there are more overlapping words between datasets from different domains. We assume this similarity can lead to performance improvement in domain adaptation. We propose cross-domain overlap to characterize the word-level overlap ratio between different domains. For source domain S containing n datasets and target domain T containing m datasets, the formula for cross-domain overlap is expressed as follows:
γ = 1 n ·m n∑
i=1
m∑
j=1
∑l k=1Count(w Tj k , Si)
|Si| (5)
where Si and Ti represent the i-th dataset for the domain S and T respectively, l is the total number of unique words in Tj , w Tj k represents the k-th unique word in Tj , and Count(w Tj k , Si) is the number of occurrences of word wTji in Si.
Word Count Word count refers to the total number of words across all samples in a dataset. Generally, the larger the number of training set samples within a specific range, the better the model performance. However, whether a higher total word count in all samples is also beneficial is worth exploring. Therefore, we consider word count as one aspect affecting the model’s domain adaptation performance.

heading: 3.3 How to influence?
text: We posit that the metrics of cross-domain overlap and Word Count notably influence domain adaptation performance, particularly when accounting for dataset learning difficulty. The higher the crossdomain overlap, the more similarity between the source domain’s data and the target domain’s data. Consequently, the model is more likely to leverage data from source domains to learn knowledge that is closer to the target domain, resulting in better adaptation to that domain. Regarding Word Count, it is intuitive to assume that a larger training dataset size, and consequently a higher Word Count, leads to better model performance. However, whether this correlation consistently extends to domain adaptation performance remains an open question for investigation.
LD-Gain When dataset learning difficulty is factored into domain adaptation performance, for more challenging datasets, a model should require a smaller performance gain to achieve the same level of performance as when difficulty is not considered since the dataset’s complexity impedes the model’s ability to generalize across domains. Hence, we hypothesize that cross-domain overlap and Word Count are linearly related to the product of dataset learning difficulty and performance gain, which is referred to LD-Gain. The proposed hypotheses are as follows:
Hypothesis1 :γ ∝ λGain = LD-Gain, Hypothesis2 :WC ∝ λGain = LD-Gain,
(6) where WC represents Word Count. The following experiments section will verify the two hypotheses.

heading: 4 Experiments
text: We use four summarization datasets, CNN/Daily Mail (Hermann et al., 2015), PubMed (Cohan et al., 2018), SamSum (Gliwa et al., 2019) and WikiHow (Koupaee and Wang, 2018), each originating from the news, science, conversation, and general domains respectively. Due to the significant differences in the number of samples across different datasets, we sample 35,000 samples from the CNNDM, PubMed, and WikiHow datasets for the training set while retaining the entire SAMSum dataset. We sample 500 test samples from all the test sets of these datasets. The detailed statistical data of the datasets are shown in Table 1.
To verify the above two hypotheses, we configure different experimental setups for cross-domain overlap and Word Count. All experiments are based on the Bloom (Scao et al., 2022) and Llama2 (Touvron et al., 2023) series of models. Due to resource constraints, different experiments use models of various sizes. The prompts used to train the Llama2 and Bloom models are presented in appendix A.

heading: 4.1 Setup for Cross-domain Overlap
text: Cross-domain overlap is calculated between the different source and target domains. Considering the potential impact of the number of source domains on the results, we set up two experiments: singledomain adaptation and multi-domain adaptation.
Single-domain Adaptation Single-domain adaptation refers to training on a single source domain and testing on different target domains. We first test the basic performance of models on test sets across four domains and then fine-tune the models using training sets from the three domains, excluding the test set domain. For a model, this results in having models trained on three single-domain datasets, which are then tested for their performance on the test sets. Finally, we calculate the change in performance. The Bloom-1.1B, Bloom-3B, and Llama-2 7B models are trained on 4 RTX 3090 GPUs in this experiment. For the Bloom-1.1B and 3B models, we conduct full-parameter fine-tuning for one epoch with a learning rate 2e-5 and a batch size of 4. For the Llama2-7B model, we use LoRA (Hu et al., 2021) for fine-tuning over three epochs, with the other hyperparameters remaining unchanged.
Multi-Domain Adaptation Multi-domain adaptation refers to training on multiple source domains. When one of the four domain datasets is selected as the test set, the datasets from the other three domains are combined to serve as the training set. In this experiment, we use the Bloom-1B and 3B models. The basic performance of the two models on the four domain test sets has already been tested in the single-domain adaptation, so we use the mixed dataset from the three domains, excluding the test set domain, for training to calculate the performance change. The training hyperparameters are the same as those used in the single-domain adaptation.

heading: 4.2 Setup for Word Count
text: To minimize the interference of other factors in investigating the relationship between word count and domain adaptation, we use only one domain dataset, CNNDM, for training. Then, we test on the same domain’s test set and the test sets of the other three domains to observe the impact of word count on the results. The CNNDM training set is evenly divided into ten chunks, each used for training in separate stages. Training is conducted in ten stages, starting with the first chunk as the training set. In
subsequent stages, each phase uses the training set from the previous stage plus the next chunk, continuing until the final stage, where the entire dataset of the source domain is used for training. Each stage involves training for one epoch.

heading: 5 Results and Analysis
text: We analyze the results from different perspectives. Both single-domain and multi-domain experiment results supported our hypothesis that cross-domain overlap is linearly correlated with performance.
Due to this finding, we could make a quantitative prediction about the transferred result of certain given training and evaluating datasets. On the other hand, we found that word count is unrelated to domain adaptation, which further emphasizes the significance of choosing high-quality data rather than a large amount of data.
To solidify the universality of our findings, we conduct a prediction study and it turns out that our hypothesis can successfully predict domain adaptation performance with cross-domain overlap. There is only a slight gap between our prediction data and observed data.

heading: 5.1 Cross-domain overlap is linearly correlated with performance
text: Single-Domain Adaptation The results of the single-domain adaptation for Llama2-7B are shown in Table 2, and the results of Bloom-1.1B and 3B are shown in Table 5 and Table 6 of Appendix B. The compression rate, abstraction level, and the learning difficulty coefficient calculated based on them only relate to the test set. Therefore, these indicators remain constant for the same test set,
even if the training set changes. Similarly, the base ROUGE value of the model on the test set also remains unchanged.
Figure 1 illustrates the relationship between cross-domain overlap and LD-Gain for three different models. It can be observed that when there is a low overlap between the target domain and the source domain, the model fails to generalize well to the target domain. Conversely, the model performance tends to exhibit significant improvement when there is high vocabulary overlap. We also utilize another similarity calculation method, BERTScore (Zhang et al., 2019), to replace ROUGE values in computing LD-Gain. The results for single-domain adaptation on bloom-3b and llama2-7b are depicted in the figure 5 of Appendix C. We observe that the relationship between LD-Gain computed based on BERTScore and cross-domain overlap is similar to the results obtained with ROUGE-based calculations. Based on this discovery, we believe that there exists a linear correlation between vocabulary overlap and model performance gain, factoring in dataset learning difficulty.
Multi-Domain Adaptation Table 3 presents the results obtained by training with multiple domain data and testing with a single domain. It can be observed that the ROUGE improvement of Bloom1B on CNNDM is 0.19, which is smaller than 0.52 compared to the improvement on PubMed. However, the learning difficulty coefficient for the CNNDM test set is higher at 261.85, exceeding the value of 92.96 for PubMed. Therefore, the LDGain of the model on CNNDM, adjusted by the learning difficulty coefficient, is higher than that of PubMed.
The relationship between cross-domain overlap and LD-Gain for multi-domain adaptation is illustrated in Figure 2a. We also combine the results of single-domain and multi-domain adaptation and plot them in a single graph, as shown in Figure 2b.
It can be observed that as the cross-domain overlap increases, the model’s actual gains gradually increase. This finding reveals that cross-domain overlap has a linear relationship with performance in domain adaptation.

heading: 5.2 Word count is not related to performance
text: The word count results are presented in Table 4. It can be observed that the word count within a chunk is relatively similar, indicating that the word count can be controlled by increasing the number of chunks. On the other hand, the overlap within a domain does not vary significantly. It remains stable within a small range, allowing for the observation of the relationship between overlap and performance across different domains.
The visual results from Figure 3 demonstrate that there is no clear upward or downward trend in model performance across different domains as the word count increases. Instead, there is oscillation within a specific range. The fluctuations are most prominent for the target domains CNNDM and SAMSum, which remain relatively stable within a specific range. Consequently, we conclude that the influence of word count on domain adaptation performance is unrelated. There are instances where performance may even decline with an increase in word count.
Meanwhile, we also calculate the overlap of each chunk to observe whether there is still a linear relationship between the improvement of model performance and overlapping data at different domains. Although the cross-domain overlap is relatively similar within the same domain, a linear correlation exists between cross-domain overlap and LD-Gain across different domains. Specifically, the model exhibits higher actual gains as the cross-domain overlap increases.

heading: 5.3 Predictability
text: The preceding experiments have confirmed a linear correlation between the cross-domain overlap
and performance, taking into account dataset learning difficulty. Based on this observation, we can extrapolate performance predictions for unknown domain datasets using the results from existing domain datasets. As depicted in Figure 1a, a linear fit to the scatter plot of single-domain data yields a performance prediction trend for Bloom-1.1B in single-domain adaptation, as illustrated by the dashed line in Figure 4.
We re-sample 500 different examples, distinct from the previous datasets. Subsequently, we compute the compression ratio and abstraction level values for the four new test sets, obtaining the learning difficulty coefficient λ. Based on the metrics from the training set used in the previous single-domain experiments, we calculate the cross-domain overlap γ value. Ideally, we can use λ and γ to predict the model’s performance gain on the new dataset, thereby obtaining the predicted ROUGE value with
the formula as follows:
ROUGEpredicted = Gain+ROUGEbase,
Gain = LD-Gain
λ ,
LD-Gain = β0 + β1γ,
(7)
where β represents the parameters of the fitting line under the existing data of the model.
We conduct experiments using the Bloom-1.1B model. The results of the new dataset, along with the fitted curve, are shown in Figure 4 as scatter points and a solid line. It can be observed that the predicted fitted line and the actual experimental results’ fitted line exhibit a similar trend, with a relatively small difference. This indicates that we can estimate the performance for unseen domain datasets based on the dataset’s characteristics and existing performance results, thereby obtaining a rough performance expectation before actual inference.

heading: 6 Conclusion
text: We investigate the impact of words on domain adaptation performance in summarization tasks. We propose two indicators to represent the learning difficulty from a dataset and introduce a performance evaluation method based on learning difficulty. We find that word overlap is an essential factor affecting domain adaptation and exhibits a linear correlation with model performance. However, the influence of word count on domain adaptation does not show a regular pattern. We will investigate this phenomenon further in future work.
Furthermore, by predicting the performance of new domain data based on its cross-domain overlap with existing domains, it becomes possible to preemptively assess the model’s suitability for specific domains without the need for extensive retraining or fine-tuning. This predictive capability can significantly streamline the adaptation of language models to new domains and save many resources, finally improving their practical utility in real-world applications.

heading: 7 Limitations
text: The approaches of domain adaption mainly involve continual pre-training, alignment of distributions, and adaptation tuning. Our findings are related to the third one and, therefore, limited to discussing the influence factors of pre-training data, model parameters, and so on. For the adaptation tuning method, our paper focuses on exploring word impact on domain adaptation. Other factors, such as the quality of summarization training data, instruction diversity, and quality, are out of our consideration and may bring additional noise.
Due to resource constraints, this paper employed LoRA fine-tuning for a 7B model without investigating the effects of different fine-tuning methods on domain adaptation. In future work, we will explore in more detail the impact of dataset quality and different training methods on domain adaptation.

heading: Acknowledgements
text: We appreciate Xiaochen Liu for providing the initial inspiration for this work. This work was supported by the Joint Funds of National Natural Science Foundation of China (No. U21B2009), Major Research Plan of the National Natural Science Foundation of China (Grant No. 92370110).

heading: A The training prompts
text: The prompt used to train the Llama2 model.

 
 «SYS» You are a helpful, respectful and honest assistant. Always answer as helpfully as possible while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don’t know the answer to a question, please don’t share false information. «/SYS»
Summarize the following paragraph <Dodument> 

The prompt used to train the Bloom model.

A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user’s questions. summarize the following paragraph <Document>

heading: B Results of Bloom-1.1B and 3B
text: C Results of BERTScore

heading: 2.43 -0.08 3.30% -40.96

heading: 1.32 -0.43 1.62% -35.03

heading: 3.87 -0.26 2.90% -24.17

heading: Future Work
text: In future work, we will explore in more detail the impact of dataset quality and different training methods on domain adaptation