DEPT: Decoupled Embeddings for Pre-training Language Models

## Abstract

Abstract Language model pre-training benefits from diverse data to enhance performance across domains and languages. However, training on such heterogeneous corpora requires extensive and costly efforts. Since these data sources vary lexically, syntactically, and semantically, they cause negative interference or the “ curse of multilinguality ”. We propose a novel pre-training framework to alleviate this curse. Our method, DEPT , decouples embeddings from the transformer body while simultaneously training the latter in multiple contexts. DEPT enable training without a shared global vocabulary and: (1) can train robustly and effectively under significant data heterogeneity, (2) reduces token embedding parameters by up to 80% and the communication costs by 𝟔𝟕𝟓 × \mathbf{675\times} for billion-scale models, (3) enhances model generalization and plasticity in adapting to new languages and domains, and (4) permits training with custom optimized vocabularies per data source. We demonstrate DEPT ’s potential via the first vocabulary-agnostic federated multilingual pre-training of a 1.3 \mathbf{1.3} billion -parameter model, limiting its embedding size to 102.4 \mathbf{102.4} million instead of 𝟓𝟏𝟐 \mathbf{512} million.

## 1 Introduction

Language models (LMs) rely on large data volumes to generalize across tasks (Radford et al., ), contexts (Brown et al., ), and languages (Pires et al., ; Artetxe et al., ; Zhao et al., ). Incorporating more data during pre-training effectively enhances models’ generalization and language acquisition (Hoffmann et al., ). However, scaling pre-training datasets leads to a more heterogeneous mix of data sources, such as different domains and languages, posing challenges to LMs. Issues like Negative interference (Wang et al., ), where diverse sources compete for model capacity, and the Curse of Multilinguality (Conneau et al., ), where more languages yield diminishing returns, can emerge when increasing heterogeneous sources. The latter notably affects LMs’ performance on low-resource languages (Conneau et al., ; Magueresse et al., ).

Addressing these challenges requires efforts to prevent divergence and train performant models. Multilingual models like BERT (Devlin et al., ), XLM (Conneau et al., ), and mT5 (Xue et al., ) are sensitive to language sampling ratios during pre-training, necessitating temperature tuning of sampling distributions for each model-tokenizer pair. This process requires training numerous models to find a temperature that optimizes validation perplexity across languages. Other models, like Llama, address heterogeneous data with meticulous ”language-specific heuristics and model-based filters” (Dubey et al., ). These solutions are costly, requiring extensive Hyperparameter Optimization (HPO), and restrictive, potentially leading to vocabulary dilution (Rust et al., ) and sub-optimal cross-lingual and domain performance (Chang et al., ). For example, while using up to $150\,000$ tokens may be beneficial for English (Tao et al., ), multilingual models often allocate only $250\,000$ tokens to hundreds of languages, causing vocabulary dilution, capacity contention, and under-representation of low-resource languages (Magueresse et al., ).

In this paper, we propose a novel pre-training pipeline designed to address the challenges of training on heterogeneous data, including the *curse of multilinguality*. Observing that custom vocabularies enhance performance across languages (Rust et al., ) and domains (McLeish et al., ), we suggest partially or fully *decoupling* the *embedding space* from the transformer body during pre-training. This allows optimization of embedding matrices for specific contexts, with the transformer body learning abstract representations from these specialized spaces. We introduce Decoupled Embeddings for Pre-Training (DEPT) in three variants (see Fig. 1.right), each increasingly leveraging the local context of data sources, ultimately enabling pre-training with distinct domains/languages, embedding matrices, and vocabularies. For instance, it allows training with an effective embedding size of $400\,000$ while instantiating only $50\,000$ token embeddings at any time.

A standard pre-training pipeline trains a model over random samples drawn from a carefully balanced distribution of all data sources simultaneously, using shared embeddings. In contrast, DEPT handles heterogeneous data sources as follows: (1) It tokenizes data sources independently, using either a shared global vocabulary or a specialized vocabulary per source; (2) It randomly initializes LM parameters; (3) It trains the model iteratively over random subsets of the sources (see Section 2).

Figure: Figure 1: Left: Standard centralized pre-training couples the global Embedding Layer (EL) and Transformer Body (TB) while training over random samples from a mixture of data sources with a shared vocabulary.. Right: DEPT offers three variants (Spec, Trim, Glob), decoupling TB from EL, which is specialized (S-EL for Spec), trimmed (T-EL for Trim), or global (G-EL for Glob). These methods (see Section 2.1) are part of the pre-training stage in a practical LM pipeline, followed by continued pre-training and downstream fine-tuning.
Refer to caption: x1.png

In summary, our work brings the following scientific contributions:

- 1.
DEPT offers a solution to train an effective transformer body without shared global embeddings, avoiding the time, electricity, and carbon-intensive HPO tuning.
- 2.
DEPT-based transformer bodies show better generalization, achieving lower perplexities on validation and out-of-distribution data. DEPT models also excel in model plasticity, effectively adapting to new languages or domains.
- 3.
DEPT reduces the memory requirements of token embedding matrices by a factor of $\tfrac{|\mathcal{V}_{k}|}{|\mathcal{V}|}\times d_{\mathrm{model}}$, where $\mathcal{V}_{k}$ is a data source’s vocabulary size and $\mathcal{V}$ the global vocabulary size. For multilingual models, this can save up to $\mathbf{80\%}$ in embedding-matrix size, reducing $\mathbf{409}$M parameters for our billion-scale model.
- 4.
DEPT is communication-efficient in distributed settings, with communication costs up to $\mathbf{675\times}$ lower than standard distributed data parallelism (Zhao et al., ) and $25\%$ lower than Local SGD (Stich, ) for billion-scale models. Additionally, DEPT enables training vocabulary-agnostic federated pre-training for the first time.

## 2 Decoupled Embeddings For Pre-training ( DEPT )

Previous works attribute the curse of multilinguality to capacity contention, vocabulary dilution (Conneau et al., ), and suboptimal tokenization (Rust et al., ). While the transformer body is vocabulary-agnostic, these issues impact embeddings. We propose decoupling embeddings during training, enabling custom parameters to reduce capacity contention and custom vocabularies to avoid vocabulary dilution and suboptimal tokenization.

We argue that training the transformer body without shared embeddings is feasible. Our intuition is based on evidence that: (a) transformers adapt to new languages by re-learning embeddings (Artetxe et al., ); (b) syntactic similarity is more important for multilingual performance than subword sharing (Pires et al., ); (c) periodically re-initializing embeddings enhances model plasticity (Chen et al., ). These findings suggest transformer body performance is partly independent of embeddings, allowing potential decoupling.

We propose DEPT, enabling model training on multiple heterogeneous data sources with unique vocabularies and linguistic features. Instead of mixing data sources, they are distributed as isolated data silos, akin to clients in cross-silo Federated Learning (FL) (McMahan et al., ). DEPT trains on each silo and aggregates their contributions similar to FL client models. This work explores progressive forms of contextual specialization, investigating if an LM can converge in multiple contexts without a shared (1) output vocabulary, (2) embedding matrices, or (3) tokenization.

### 2.1 Method

Akin to federated and meta-learning algorithms, DEPT optimizes a global set of parameters $\theta$ (the transformer body) along with optional token and positional embeddings $\phi,\psi$ across data sources $S$. DEPT trains *iteratively*, selecting a subset $S_{t}\subset S$ for each iteration (federated round) $t$. On each data source ($k\in S_{t}$), DEPT performs inner-loop optimization InnerOPT, e.g., SGD, *independently*. After each iteration, it aggregates the transformer body of $|S_{t}|$ trained models using the outer-loop optimizer OuterOPT, e.g., FedAvg. We present three variants for handling the token and positional embeddings $\phi$ and $\psi$, offering progressively stronger embedding-space specialization, and compare them in Section 2.4.

We start with distributed training methods like FedAvg, embodied by Glob. Each data source receives a global transformer body and global embeddings (token and positional). Then, it trains the body and embeddings on the local data distribution. The updated model (transformer body and embeddings) is then aggregated with models from other data sources via OuterOPT, allowing Glob’s use in both federated and centralized settings. From Glob, we design the variants below to further decouple embeddings from the body and summarize the entire DEPT pipeline in Algorithm 1.

Figure: Algorithm 1 Decoupled Embedding for Pre-Training (DEPT) variants: Glob Trim Spec

- Trim
Partially-decoupled: Each data source is assigned the global transformer and embeddings; it then trims the token embeddings by selecting only tokens in its local vocabulary $\mathcal{V}_{k}$, restricting the model’s input and output space. During OuterOPT, the token embeddings are projected to the global vocabulary and aggregated.
- Spec
Fully-decoupled: Each data source is assigned the global transformer body. It then randomly initializes specialized token and position embeddings when first sampled. In subsequent iterations, these embeddings are used to train on the data source. However, they are never aggregated. Spec can thus accommodate any local vocabulary, including ones built with a custom and optimized tokenizer.

We emphasize that DEPT replaces the standard pipeline for broad pre-training (Fig. 1) preceding continued pre-training or adaptation phases (Dubey et al., ).
Inspired by distributed SGD methods, Algorithm 1 can operate in parallel, matching the user’s computational capabilities.
Given DEPT’s reduced communication, it is also suitable for low-bandwidth settings like cross-silo FL.

### 2.2 On Trimmed Embedding Aggregation ( Trim )

The global token embeddings $\phi\in\mathbb{R}^{|\mathcal{V}|\times d_{\mathrm{model}}}$, where $|\mathcal{V}|$ is the global vocabulary size and $d_{\mathrm{model}}$ the embedding dimension, are trimmed using an indicator matrix $\mathcal{I}_{k}\in R^{|\mathcal{V}_{k}|\times V}$:

$$ $\mathcal{I}_{k}(i,j)=\begin{cases}1,&\text{if the }j\text{-th global token corresponds to the }i\text{-th local token in }\mathcal{V}_{k}\\ 0,&\text{otherwise},\end{cases}$ (1) $$

which selects relevant rows of $\phi$ for the trimmed embeddings $\phi_{k}\in\mathbb{R}^{|\mathcal{V}_{k}|\times d_{\mathrm{model}}}$ of source $k$:

$$ $\phi_{k}=\mathcal{I}_{k}\phi.$ (2) $$

After inner-loop optimization (InnerOPT), the trimmed embedding matrices $\phi_{k}$ are aggregated. We create a matrix $\hat{\phi}_{k}\in\mathbb{R}^{V\times d_{\mathrm{model}}}$, initialized with zeros (padding) for tokens in $\mathcal{V}\setminus\mathcal{V}_{k}$, and use $\mathcal{I}_{k}^{\top}\in\mathbb{R}^{V\times|\mathcal{V}_{k}|}$ to project $\phi_{k}$ back to the global shape:

$$ $\hat{\phi}_{k}=\mathcal{I}_{k}^{\top}\phi_{k},$ (3) $$

when using FedAvg as the OuterOPT procedure, zero-padded tokens are ignored during aggregation to prevent interference from non-shared tokens across data sources.

### 2.3 On Positional Embedding Specialization ( Spec )

Unlike the other variants, we specialize both the token $\phi$ and positional embeddings $\psi$ for Spec based on evidence showing that subword sharing is less important than syntactic and typographic elements (Pires et al., ). Without positional embedding specialization, Spec is equivalent to Trim when vocabularies $\{\mathcal{V}_{k}\}_{k=1}^{K}$ are disjoint with $\mathcal{V}=\cup_{k=1}^{K}\mathcal{V}_{k}$. Spec thus makes no assumptions on the nature of the tokens it receives, allowing it to be completely vocabulary and sequence-length agnostic.
This unique property of Spec enables federated learning without knowledge of the underlying data or agreements regarding tokenization.

### 2.4 Variants Assumptions and Benefits

In most scenarios, practitioners can deploy any of our proposals, obtaining an improved transformer body over past approaches, with a breakdown of their memory and communication costs shown in Table 1.
However, some settings are appropriate for a given variant.

Glob closely resembles a standard pre-training pipeline. While it doesn’t explicitly decouple embeddings from the transformer body, they become increasingly decoupled with each step since only tokens present locally affect the embeddings. As a communication-efficient form of SGD, Glob reduces communication costs. However, it requires sufficient knowledge of the data to construct a global vocabulary, risking vocabulary dilution and capacity contention.

Trim uses the same assumptions as Glob and can be deployed in similar settings. It additionally reduces memory requirements for the token embeddings to the data source’s needs ($d_{\mathrm{model}}\times\mathcal{V}_{k}$), also further lowering communication costs proportional to this reduction. Such savings are significant for multilingual models, given their embedding matrices (Chen et al., ), e.g., mT5, mBART (Xue et al., ; Lewis et al., ) allocate $40\%-80\%$ of parameters to embeddings. Since our models use tied weights, Trim restricts their output space, unlike Glob. Experimentally, this has a slight but inconsistent impact on perplexity.

Spec allows pre-training across data sources without a shared vocabulary, offering all Trim benefits with full local adaptation. Communication costs are further reduced proportionally to the size of the token and position embeddings since Spec transfers only the transformer body to the outer optimizer. This decoupling enables vocabulary-agnostic training. The lack of shared embeddings makes Spec ideal for training a performant transformer body, e.g., on private data, and then performing continued pre-training to obtain global embeddings.

**Table 1: Memory and communication costs of DEPT, where: $\mathcal{M}$ is the number of model parameters; $|\mathcal{V}|$ is the global vocabulary size; $\overline{|\mathcal{V}_{k}|}$ is the mean data source vocabulary size; $d_{\mathrm{model}}$ is the embedding dimension; $N_{\mathrm{local}}=N/T$ is the number of local steps done per iteration for a total number steps $N$; $\mathcal{L}$ is the sequence length. Spec brings further reductions over Trim by not sharing token or position embeddings. Concrete numbers for our models (see Table 6) are shown in Table 7.**
| Method | Memory Cost | Per-step Comms Cost | Vocab Agnostic |
| --- | --- | --- | --- |
| STANDARD | $\mathcal{O}(\mathcal{M}$) | $\mathcal{O}(\mathcal{M})$ | $\times$ |
| GLOB | $\mathcal{O}(\mathcal{M}$) | $\mathcal{O}$$(\frac{\mathcal{M}}{N_{\mathrm{local}}})$ | $\times$ |
| TRIM | $\mathcal{O}(\mathcal{M}-(|\mathcal{V}|-\overline{|\mathcal{V}_{k}|})d_{\mathrm{model}})$ | $\mathcal{O}$$(\frac{\mathcal{M}-(|\mathcal{V}|-\overline{|\mathcal{V}_{k}|})d_{\mathrm{model}}}{N_{\mathrm{local}}})$ | $\times$ |
| SPEC | $\mathcal{O}(\mathcal{M}-(|\mathcal{V}|-\overline{|\mathcal{V}_{k}|})d_{\mathrm{model}})$ | $\mathcal{O}$$(\frac{\mathcal{M}-(|\mathcal{V}|+\mathcal{L})d_{\mathrm{model}}}{N_{\mathrm{local}}})$ | ✓ |

## 3 Evaluation

In our evaluation of DEPT we aim to answer the following research questions.

- RQ1
Does DEPT allow us to scale the number of training tokens from heterogeneous data past standard training?
- RQ2
Does DEPT improve efficiency, in terms of memory and training times?
- RQ3
Does DEPT improve zero-shot generalization to out-of-distribution data?
- RQ4
Does DEPT improve model plasticity when learning new distributions?

### 3.1 Experimental Setup

For our experimentation, we train decoder-only transformers with $12$ and $24$ blocks, while for our federated application, we train a billion-scale model. Our OuterOpt optimizer is parameter averaging (McMahan et al., ; Stich, ) while our InnerOpt is AdamW (Loshchilov & Hutter, ). Full experimental details relating to our architecture and training hyperparameters (Tables 6 and 7), dataset, and baseline implementation are available in Appendix A.

#### 3.1.1 Multi-domain and Multilingual Methodology

To evaluate DEPT on multi-domain data, we use The Pile (Gao et al., ), containing $22$ subsets from various domains. We select 16 subsets, the ones without copyright concerns, as our $K$ data sources in Algorithm 1, using GitHub (GH), DeepMind Mathematics (DM), Wikipedia (WK), Common Crawl (CC), PubMed Abstracts (PA), PubMed Central (PC), USPTO Backgrounds (UO), NIH Exporter (NH), FreeLaw (FL), Enron Emails (ENR), EuroParl (EP), Stack Exchange (SE), Philosophy Papers (PP), ArXiv (AR), Project Gutenberg (GU), and Hacker News (HN). We use Ubuntu IRC (UI) as our out-of-distribution dataset.

For multilingual data, we use a subset of MC4 (Xue et al., ), including a mix of high, medium, and low-resource languages with: English (EN), Italian (IT), and Chinese (ZH) as high-resource languages; Serbian (SR) and Malay (MS) as medium-resource languages; and Swahili (SW), Urdu (UR), and Latin (LA) as low-resource languages.
When using custom tokenizers, we follow prior work (Rust et al., ) and train unigram SentencePiece (Kudo & Richardson, ) tokenizers with a $50\,257$ vocabulary for each data source.

#### 3.1.2 Baselines

We compare DEPT against standard pre-training methods used in previous works (Conneau et al., ).
For multilingual data we employ temperature-weighted sampling (Devlin et al., ) with $\alpha=0.3$ as well as uniform and proportional sampling.
Here $\alpha=0.3$ represents a compromise found effective in prior work (Devlin et al., ; Conneau et al., ; Xue et al., ), used as the default pre-training method for multilingual models.
For multi-domain data, we consider uniform and proportional sampling.
Given the random sampling of data sources in Algorithm 1, baselines with uniform sampling are closest to DEPT.

Additionally, we compare against the “pre-training with active forgetting” (ACT) methodology (Chen et al., ), which aims to improve plasticity and generalization by regularly resetting the embedding matrix to a random initialization.
While Chen et al. () transfer monolingual models to other languages, we only reuse their pre-training phase due to our different setting. Like Spec,
ACT does not produce a fully trained embedding matrix.

#### 3.1.3 Evaluating Generalization and Plasticity

The key characteristics of interest for multi-domain and multilingual pre-training are model generalization and plasticity. Generalization refers to the model’s ability to perform well on out-of-distribution (OOD) data, whether in-domain or out-of-domain. We assess in-domain generalization by testing the model on the test set of each data source used during training, while OOD generalization is evaluated with unseen datasets.

To ensure fair comparison, we examine methods that produce a global embedding matrix, such as Glob and Trim, and those that do not, like Spec and ACT, after a phase of continued pre-training or adaptation (Dubey et al., ) lasting $15\%-19\%$ of the total pre-training steps. To isolate the effect of embeddings from the transformer body, this phase is done twice: once using randomly initialized embeddings and once using global embeddings if available. Randomly initialized embeddings allow us to evaluate transformer body by itself.

Plasticity refers to the model’s ability to quickly and effectively adapt to a new domain, either to reach a target performance with minimal steps or to achieve the highest possible performance.
We evaluate the plasticity of DEPT models by training them on new data, such as a different domain or language, and the most heterogeneous subset of the training data, as determined by the size of its local vocabulary in the shared global vocabulary.

### 3.2 Results

Our experimental results indicate that DEPT can serve as a viable alternative to conventional pre-training pipelines by allowing the training under highly heterogeneous data sources and by building a better transformer body to serve as a foundation model.

#### 3.2.1 DEPT Is Robust To Data Heterogeneity (RQ1)

Figure: (a)
Refer to caption: x3.png

Our experiments show DEPT is highly robust to multilingual and multi-domain data heterogeneity. As shown in Fig. 2, it is more resilient to activation divergence and model norm increases—factors that can cause model divergence or stop perplexity improvements (Zhang et al., ). Models trained with DEPT maintain lower activation norms due to the regularization effect of OuterOpt (see Algorithm 1). All three variants handle heterogeneous data distributions well, enabling comparable pre-training steps without activation, norm, or perplexity spikes. This stability allows DEPT to outperform baselines in generalization and plasticity. For fairness, we always compare checkpoints with the lowest validation perplexity.

#### 3.2.2 DEPT Improve Training Efficiency (RQ2)

The large improvements in communication efficiency of DEPT compared to standard DDP, enabled us to perform all of our experiments on poorly connected servers combining our resources with those of cloud providers. When using Trim, we were able to reduce the global embedding matrix size by $8\%$ to $32\%$ for multilingual data and by $2\%$ to $78\%$ for The Pile, with the $78\%$ reduction being obtained for the mathematics subset. Furthermore, when using a custom vocabulary per data source on MC4, Spec shows its benefits in allowing DEPT to train our $12$-block transformer much faster on multilingual data due to the improved throughput brought by its $80\%$ reduction in embedding parameters.
When used to enable the training of a parameter-efficient and vocabulary-agnostic billion-scale model, shown in Fig. 4, Spec enables cross-lingual transfer via the body of the transformer alone, allowing data sources not previously sampled to quickly catch-up in perplexity to the rest of the cohort. This is despite a $24\%$ reduction in total parameters and $30\%$ reduction in communicated parameters. Full details on efficiency improvements are shown in Table 7.

#### 3.2.3 DEPT Improves Zero-shot Generalization (RQ3)

**Table 2: Validation perplexity (lower is better) for our $12$-block models trained on MC4 when using continued pre-training starting from randomly-initialized embeddings. DEPT provides a better transformer body for all languages, outperforming baselines by up to $20\%$.**
| Name | In-Distribution |  | Out-of-Distribution |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | ZH | UR | MS | IT | SR | LA | EN | SW | Avg (In) |  | EL | HI | DE | Avg (Out) |
| UNIF | $154.8$ | $38.2$ | $96.8$ | $83.8$ | $73.3$ | $63.0$ | $112.7$ | $62.8$ | $88.9$ |  | $4600.3$ | $5660.9$ | $1339.2$ | $3866.8$ |
| T($\alpha=0.3$) | $129.5$ | $34.5$ | $88.0$ | $75.4$ | $65.2$ | $56.3$ | $103.7$ | $56.8$ | $78.9$ |  | $3996.0$ | $4219.2$ | $1076.3$ | $3097.1$ |
| PROP | $84.6$ | $26.8$ | $64.8$ | $55.1$ | $47.1$ | $41.1$ | $77.6$ | $42.4$ | $56.7$ |  | $2514.7$ | $3340.3$ | $672.5$ | $2175.8$ |
| ACT | $96.1$ | $28.8$ | $71.3$ | $60.4$ | $52.3$ | $44.9$ | $85.6$ | $46.3$ | $62.8$ |  | $2412.5$ | $2450.2$ | $715.9$ | $1859.5$ |
| GLOB | $67.7$ | $\mathbf{22.4}$ | $\mathbf{53.7}$ | $\mathbf{46.0}$ | $\mathbf{38.6}$ | $\mathbf{33.9}$ | $\mathbf{65.4}$ | $\mathbf{35.2}$ | $\mathbf{46.8}$ |  | $1676.5$ | $2308.3$ | $559.5$ | $1514.7$ |
| TRIM | $\mathbf{67.7}$ | $22.8$ | $55.2$ | $47.5$ | $39.7$ | $35.1$ | $67.2$ | $36.3$ | $47.9$ |  | $1911.0$ | $2547.7$ | $567.4$ | $1675.4$ |
| SPEC | $69.5$ | $23.0$ | $55.4$ | $47.8$ | $40.3$ | $34.7$ | $68.1$ | $36.3$ | $48.4$ |  | $\mathbf{1578.8}$ | $\mathbf{2232.1}$ | $\mathbf{544.7}$ | $\mathbf{1451.9}$ |
| Min Imp (%) | $\mathbf{17.8}$ | $\mathbf{14.2}$ | $\mathbf{14.5}$ | $\mathbf{13.2}$ | $\mathbf{14.4}$ | $\mathbf{14.6}$ | $\mathbf{12.2}$ | $\mathbf{14.4}$ | $\mathbf{14.6}$ |  | $\mathbf{20.8}$ | $\mathbf{-4.0}$ | $\mathbf{15.6}$ | $\mathbf{9.9}$ |
| Max Imp (%) | $\mathbf{20.0}$ | $\mathbf{16.4}$ | $\mathbf{17.1}$ | $\mathbf{16.5}$ | $\mathbf{18.0}$ | $\mathbf{17.5}$ | $\mathbf{15.7}$ | $\mathbf{17.0}$ | $\mathbf{17.5}$ |  | $\mathbf{34.6}$ | $\mathbf{8.9}$ | $\mathbf{19.0}$ | $\mathbf{21.9}$ |

**Table 3: Validation perplexity (lower is better) for our $12$-block models trained on MC4 when using continued pre-training starting from a pre-trained embedding matrix. DEPT wins $6$ out of $11$ comparisons, losing for higher resource languages against proportional and temperature-weighted sampling, which emphasize them more during pre-training. When comparing against Table 2, we observe that DEPT wins the other $5$ comparisons when starting from random embeddings, indicating that this gap is driven by the embedding space being fitted to the high-resource languages despite the baselines having a worse transformer body.**
| Name | In-Distribution |  | Out-of-Distribution |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | ZH | UR | MS | IT | SR | LA | EN | SW | Avg (In) |  | EL | HI | DE | Avg (Out) |
| UNIF | $57.8$ | $21.0$ | $46.5$ | $40.0$ | $33.6$ | $29.4$ | $57.5$ | $30.3$ | $39.5$ |  | $1365.7$ | $1698.8$ | $385.5$ | $1150.0$ |
| T($\alpha=0.3$) | $45.5$ | $20.6$ | $41.5$ | $31.0$ | $\mathbf{31.7}$ | $\mathbf{29.3}$ | $46.1$ | $31.1$ | $34.6$ |  | $1087.6$ | $\mathbf{1419.4}$ | $321.9$ | $\mathbf{943.0}$ |
| PROP | $44.4$ | $23.9$ | $44.3$ | $\mathbf{25.2}$ | $36.5$ | $33.4$ | $\mathbf{38.3}$ | $36.4$ | $35.3$ |  | $1299.5$ | $1583.6$ | $\mathbf{285.5}$ | $1056.2$ |
| GLOB | $\mathbf{40.1}$ | $\mathbf{15.5}$ | $\mathbf{30.1}$ | $39.6$ | $39$ | $29.7$ | $40.5$ | $24.6$ | $\mathbf{32.4}$ |  | $\mathbf{823.4}$ | $1737.3$ | $335.1$ | $965.3$ |
| TRIM | $41.9$ | $16.2$ | $31.3$ | $41.3$ | $40.8$ | $30.8$ | $42$ | $25.6$ | $33.7$ |  | $855.2$ | $1725.0$ | $345.6$ | $975.3$ |
| Min Imp (%) | $\mathbf{5.6}$ | $\mathbf{21.4}$ | $\mathbf{24.6}$ | $-63.9$ | $-28.7$ | $-5.1$ | $-9.7$ | $\mathbf{15.5}$ | $\mathbf{2.6}$ |  | $\mathbf{21.4}$ | $-22.4$ | $-21.1$ | $-3.4$ |
| Max Imp (%) | $\mathbf{9.7}$ | $\mathbf{24.8}$ | $\mathbf{27.5}$ | $-57.1$ | $-23.0$ | $-1.4$ | $-5.7$ | $\mathbf{18.8}$ | $\mathbf{6.4}$ |  | $\mathbf{24.3}$ | $-21.5$ | $-17.4$ | $-2.4$ |

**Table 4: Validation perplexity (lower is better) for our $12$-block models trained on MC4 when using continued pre-training starting from randomly-initialized embeddings. DEPT provides a better transformer body for all languages, outperforming baselines by up to $19.3\%$.**
| Name | NH | GH | PA | UO | FL | ENR | EP | WK | CC | SE | PC | PP | DM | AR | GU | HN | UI<br>(OOD) | Avg |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| UNIF | $44.7$ | $9.2$ | $43.4$ | $32.7$ | $31.4$ | $24.1$ | $27.1$ | $58.4$ | $\mathbf{86.6}$ | $24.6$ | $25.1$ | $\mathbf{64.4}$ | $5.1$ | $16.5$ | $\mathbf{66.7}$ | $\mathbf{55.8}$ | $141.0$ | $44.5$ |
| Prop | $32.1$ | $7.0$ | $30.7$ | $23.9$ | $22.3$ | $17.5$ | $19.7$ | $41.6$ | $\mathbf{64.2}$ | $18.3$ | $19.0$ | $\mathbf{48.5}$ | $4.7$ | $13.0$ | $\mathbf{50.5}$ | $42.0$ | $72.9$ | $31.1$ |
| ACT | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ | $-$ |
| GLOB | $\mathbf{26.2}$ | $\mathbf{6.1}$ | $\mathbf{24.9}$ | $\mathbf{19.7}$ | $\mathbf{18.0}$ | $\mathbf{14.2}$ | $16.3$ | $\mathbf{34.0}$ | $\mathbf{53.6}$ | $\mathbf{15.5}$ | $\mathbf{16}$ | $\mathbf{40.2}$ | $\mathbf{4.5}$ | $\mathbf{11.2}$ | $\mathbf{41.9}$ | $\mathbf{34.6}$ | $\mathbf{58.8}$ | $\mathbf{25.6}$ |
| TRIM | $27.7$ | $6.4$ | $26.4$ | $21.0$ | $19.1$ | $14.8$ | $16.7$ | $36.0$ | $56.6$ | $16.3$ | $16.9$ | $42.1$ | $\mathbf{4.5}$ | $11.7$ | $43.7$ | $36.2$ | $66.1$ | $27.2$ |
| SPEC | $27.2$ | $6.2$ | $25.8$ | $20.5$ | $18.8$ | $14.5$ | $\mathbf{16.2}$ | $35.1$ | $55.5$ | $16.0$ | $16.5$ | $41.1$ | $\mathbf{4.5}$ | $11.5$ | $43.1$ | $35.7$ | $63.5$ | $26.6$ |
| Min Imp (%) | $\mathbf{13.7}$ | $\mathbf{8.6}$ | $\mathbf{14.0}$ | $\mathbf{12.1}$ | $\mathbf{14.3}$ | $\mathbf{15.4}$ | $\mathbf{15.2}$ | $\mathbf{13.5}$ | $\mathbf{11.8}$ | $\mathbf{10.9}$ | $\mathbf{11.1}$ | $\mathbf{13.2}$ | $\mathbf{4.3}$ | $\mathbf{10.0}$ | $\mathbf{13.5}$ | $\mathbf{13.8}$ | $\mathbf{9.3}$ | $\mathbf{12.5}$ |
| Max Imp (%) | $\mathbf{18.4}$ | $\mathbf{12.9}$ | $\mathbf{18.9}$ | $\mathbf{17.6}$ | $\mathbf{19.3}$ | $\mathbf{18.9}$ | $\mathbf{17.8}$ | $\mathbf{18.3}$ | $\mathbf{16.5}$ | $\mathbf{15.3}$ | $\mathbf{15.8}$ | $\mathbf{17.1}$ | $\mathbf{4.3}$ | $\mathbf{13.8}$ | $\mathbf{17.0}$ | $\mathbf{17.6}$ | $\mathbf{19.3}$ | $\mathbf{17.7}$ |

**Table 5: Validation perplexity (lower is better) for our $24$-block models trained on The Pile when performing continued pre-training starting from a pre-trained embedding matrix. DEPT wins $10$ out of $17$ comparisons. When comparing against Table 4, we can observe that DEPT wins the other $7$ comparisons when starting from random embeddings, indicating that the embedding space drives this gap despite the baselines having a worse transformer body.**
| Name | NH | GH | PA | UO | FL | ENR | EP | WK | CC | SE | PC | PP | DM | AR | GU | HN | UI<br>(OOD) | Avg |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| UNIF | $21.6$ | $5.5$ | $20.4$ | $16.9$ | $15.0$ | $11.1$ | $13.4$ | $27.1$ | $44.4$ | $13.2$ | $13.6$ | $34$ | $\mathbf{4.3}$ | $10.1$ | $35.2$ | $29.1$ | $51.6$ | $21.6$ |
| PROP | $21.7$ | $\mathbf{4.7}$ | $19.2$ | $16.0$ | $\mathbf{13.5}$ | $12.6$ | $15.8$ | $24.7$ | $38.8$ | $\mathbf{11.7}$ | $\mathbf{12.0}$ | $36.8$ | $\mathbf{4.3}$ | $\mathbf{8.8}$ | $34.2$ | $28.6$ | $\mathbf{43.1}$ | $20.4$ |
| GLOB | $19.8$ | $5.5$ | $19.4$ | $15.6$ | $15.6$ | $12.1$ | $13.8$ | $25.6$ | $41.4$ | $12.9$ | $13.3$ | $33.5$ | $4.5$ | $10.1$ | $38.1$ | $29.2$ | $58.2$ | $21.7$ |
| TRIM | $\mathbf{19.0}$ | $4.9$ | $\mathbf{18.2}$ | $\mathbf{15.3}$ | $14.8$ | $\mathbf{10.0}$ | $\mathbf{11.3}$ | $\mathbf{23}$ | $\mathbf{37.3}$ | $11.8$ | $12.8$ | $\mathbf{30.2}$ | $4.4$ | $9.8$ | $\mathbf{32.9}$ | $\mathbf{26.7}$ | $47.6$ | $\mathbf{19.4}$ |
| Min Imp (%) | $\mathbf{8.3}$ | $-17.0$ | $-1.0$ | $\mathbf{2.5}$ | $-15.6$ | $-9.0$ | $-3.0$ | $-3.6$ | $-6.7$ | $-10.3$ | $-10.8$ | $\mathbf{1.5}$ | $-4.7$ | $-14.8$ | $-11.4$ | $-2.1$ | $-35.0$ | $-6.4$ |
| Max Imp (%) | $\mathbf{12.0}$ | $-4.3$ | $\mathbf{5.2}$ | $\mathbf{4.4}$ | $-9.6$ | $\mathbf{9.9}$ | $\mathbf{15.7}$ | $\mathbf{6.9}$ | $\mathbf{3.9}$ | $-0.9$ | $-6.7$ | $\mathbf{11.2}$ | $-2.3$ | $-11.4$ | $\mathbf{3.8}$ | $\mathbf{6.6}$ | $-10.4$ | $\mathbf{4.9}$ |

When starting from an equal point with randomly initialized matrices, Tables 2 and 4 show that DEPT variants significantly outperform all baselines across all validations sets for multilingual and multidomain data source on high and low-resource subsets. Min and max improvements are calculated by taking the worst and the best DEPT variant, respectively, and comparing it against the best-performing baseline. This outperformance shows that DEPT can produce superior transformer bodies that generalize better. Crucially, Trim is comparable to Glob despite significant reductions in parameter counts and communication costs during pre-training, indicating that out-of-vocabulary mistakes do not have a significant impact on the transformer body training. Furthermore, Spec is very similar in effectiveness to Glob and Trim despite never sharing token embeddings across data sources. This allows it to reduce communication costs further over trim proportional to the difference between the size of the global vocabulary and the size of the local data source vocabulary.

As can be seen from Tables 3 and 5, DEPT variants with global embeddings tend to outperform their standard pre-training and active forgetting (ACT) counterparts when undergoing continued pre-training from a pre-trained embedding matrix, winning $16$ out of $28$ total comparisons. Crucially, since DEPT variants win all comparisons when starting from random, this is indicative that the transformer body is superior to that produced by standard pre-training methods, and more accurate embedding matrices induce the $12/28$ losses. For the multilingual data, DEPT variants tend to lose for high-resource languages while outperforming lower-resource languages, an artifact of the sampling policy used by the standard approaches favoring high-resource languages. Trim continues to perform similarly to Glob, making it a direct parameter and communication-efficient substitute for the class of algorithms, which includes FedAvg and Local SGD.

#### 3.2.4 DEPT Improves Model Plasticity (RQ4)

Finally, we investigate how plastic DEPT models are in adapting to either a new data source or to the most heterogeneous subset of the pre-training set Figure 3 fig shows the perplexity adaptation plots when starting from a random initialization on: the full pre-training set (serving as a baseline), the data source with the smallest vocabulary (SW), or new languages (HI,DE). DEPT variants are always the fastest to adapt to each data source and provide the lowest final perplexity; for the full pre-training set, we use perplexity taken over all language validation sets.

Figure: (a)
Refer to caption: x5.png

## 4 Related Work

### 4.1 Multilingual LLMs Training

Large language models (LLMs), even those pre-trained mainly with English data, show some cross-lingual alignment due to ”incidental bilingualism” (Briakou et al., ) and cross-lingual data sharing (Choenni et al., ) in the training sets. An intuitive way to enhance multilingual capacity is to increase the size of multilingual data during pre-training (Le Scao et al., ). However, the imbalanced distribution and varying quality of training data across languages (Ding et al., ) lead to uneven multilingual capabilities, which quickly degrade for extremely low-resource languages (Lai et al., ). A common solution involves supervised parallel data in pre-training—e.g., XLM (Conneau & Lample, ) and PaLM2 (Anil et al., ). Other strategies include Knowledge Transfer (Zhang et al., ; Wang et al., ; Zhang et al., ), Knowledge Accumulation, and Domain Adaptation for non-English contexts (Huang et al., ). However, these methods struggle with adaptability to truly low-resource languages (Chang et al., ; Li et al., ), and may introduce challenges like training instability and catastrophic forgetting (Kirkpatrick et al., ). Thus, we advocate for a novel pre-training pipeline that addresses language heterogeneity while improving generalization and plasticity.

The topic of constructing a proper shared vocabulary has received extensive attention from the multilingual pre-training community. Previous proposals have included tokenizing all sources simultaneously with a given temperature (Devlin et al., ), building language-clustered vocabularies (Chung et al., ). The first method is one of our baselines. In contrast, the second requires constructing language clusters, selecting the appropriate cluster count, and assuming new incoming languages will easily fit into the pre-existing structure.

### 4.2 Active Forgetting

A work similar in spirit to ours is that of Chen et al. (), introducing the concept of active forgetting into the pre-training stage by re-initializing embeddings at regular intervals. Their work shows that via this simple noise injection they can improve the plasticity of the model in adapting to new downstream tasks. Models trained in this way are meant to be easy to rewire to new languages by training a new embedding matrix.

## 5 Conclusion

In this work, we investigated pre-training Language Models (LMs) under data heterogeneity. We proposed a novel, efficient, and robust pipeline, DEPT, that allows training under significant data heterogeneity, while avoiding the model divergence problem resulted from the negative interference or curse of multilinguality. The core idea behind DEPT is to decouple the embedding space from the transformer body during pre-training. DEPT comes in three variants, each providing different levels of separation, from fully shared to fully decoupled. Our experimental results showed that DEPT: (1) enables training under significant data heterogeneity without the costs of the previous methods, (2) reduces the parameter count of the token embeddings by up to 80% (3) improves the generalization and plasticity of the model by achieving lower perplexity on validation and out-of-distribution test datasets, as well as when adapting to new languages (4) provides training with custom vocabulary per data source, allowing us to pre-train the first $\mathbf{1.3}$ billion-parameter vocabulary-agnostic federated multilingual model across high and low-resource languages.

### 5.1 Limitations & Future Work

DEPT provides a pre-training pipeline for language models meant to precede any continued pre-training, adaptation, or downstream fine-tuning. DEPT-based models, however, require a final global embedding to be used in practice. The first two variants of DEPT, namely Glob and Trim, naturally provide such global embedding at the end of pre-training, although with a different performance across the pre-training subsets compared to standard methods. Since Spec does not directly provide a means of obtaining a global embedding, future directions include devising methods to generate one. Potential approaches include zero-shot embedding matrix transfer (Mosin et al., ), vocabulary matching over the local embeddings (Xu et al., ), and devising more sample-efficient methods to train new embedding matrices. Furthermore, future work can study the internal representations that DEPT-based models build. Finally, a practical direction is scaling DEPT to bigger models and broader mixture of data sources, including larger number of languages.

#### Acknowledgments

All costs for the computation used for this work was funded by Flower Labs, and the research conducted by a team of researchers from Flower Labs and The University of Cambridge. Support for university-based researchers came from a variety of sources, but in particular, the following funding organizations are acknowledged: the European Research Council (REDIAL), the Royal Academy of Engineering (DANTE), and the Ministry of Education of Romania through the Credit and Scholarship Agency.

## Appendix A Experimental Details

### A.1 Model Architectures and Hyperparameters

**Table 6: Architectural details and vocabulary-independent hyperparameters of our models. The number of transformer blocks is denoted by #Blocks, the number of attention heads by #Heads, and the expansion ratio refers to the ratio of the hidden dimension in the feedforward layers. The total number of model parameters is $\mathcal{M}$, the vocabulary size is $|\mathcal{V}|$, and the model embedding dimension is $d_{\mathrm{model}}$. We train standard decoder-only transformers whose body ranges in size from $86.4$M to $1.2$B independent of embeddings. As we see in Table 7, the size of the embedding matrix can change the model size drastically. Our batch size is $|\mathcal{B}|$ while $|S_{t}|/|S|$ is our sampling ratios for the various data sources. The $\beta_{1},\beta_{2}$ pair are AdamW parameters while the $S_{c}$ tuple represents the parameters of the cosine scheduler that we use, including the decay alpha $\alpha$, the decay period $\eta_{\mathrm{max}}$, and the total number of sequential steps $N$. Finally, we show the number of continued pre-training steps $N_{\mathrm{CT}}$ that we use, representing $15\%$ of total steps for the $298$M model and $19.3\%$ for the $86.4$M model. All of our models use a sequence length of $2048$. We followed the hyperparameters of Sani et al. () for the billion-scale federated pre-training.**
| Type | #Blocks | $\boldsymbol{d_{\mathrm{model}}}$ | $\mathcal{M}-|\mathcal{V}|\times d_{\mathrm{model}}$ | #Heads | Exp. Ratio | $|\mathcal{B}|$ | $|S_{t}|/|S|$ | $\mathbf{(\boldsymbol{\beta_{1}},~\boldsymbol{\beta_{2}})}$ | $\mathbf{S_{C}(\boldsymbol{\alpha},~\boldsymbol{\eta_{max}},~N)}$ | $N_{\mathrm{CT}}$ |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Multi-domain | 12 | 768 | $86.4$M | 12 | 4 | 256 | $4/16$ | $(0.9,~0.95)$ | $(10^{-1},~5\times 10^{-4},~5\times 10^{3})$ | $1.2\times 10^{3}$ |
| Multi-domain | 24 | 1024 | $298.5$M | 16 | 4 | 256 | $4/16$ | $(0.9,~0.95)$ | $(10^{-1},~13.5\times 10^{-4},~13.5\times 10^{3})$ | $2.4\times 10^{3}$ |
| Multilingual | 12 | 768 | $86.4$M | 12 | 4 | 256 | $3/8$ | $(0.9,~0.95)$ | $(10^{-1},~5\times 10^{-4},~5\times 10^{3})$ | $1.2\times 10^{3}$ |
| Multilingual | 24 | 2048 | $1.2$B | 16 | 4 | 512 | $3/8$ | $(0.9,~0.95)$ | $(10^{-1},~7\times 10^{-4},~7\times 10^{4})$ | - |

**Table 7: Full practical breakdown of memory and communication costs of DEPT, where $N_{\mathrm{local}}=N/T$ with $T$ being the total number of dept iterations and $\overline{\mathcal{V}_{k}}$ is the average vocabulary size across data sources with standard deviation shown. Standard pre-training must have a complete embedding matrix in-memory for the entire global vocabulary during training, resulting in high memory costs for multilingual models. Furthermore, it has to communicate once per step and synchronize said embeddings. All DEPT variants provide high communication savings with Glob serving as the baseline. Trim provides additional memory and communication savings proportional to the gap between the global and average local vocabulary sizes. Finally, Spec when not using an optimized (OPT) vocabulary, provides similar benefits to Trim but further reduces communication costs proportional to the size of the token /positional embeddings. When using an optimized vocabulary, Spec can reduce the size of the embeddings further to the chosen vocabulary size.**
| Type | #Blocks | Method | $N_{\mathrm{local}}$ | $T$ | $\overline{|\mathcal{V}_{k}|}$ | $\overline{|\mathcal{V}_{k}|}\times d_{\mathrm{model}}$ | $\overline{\mathcal{M}_{k}}$ | Per-step Comms Cost |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Multilingual | $12$ | STANDARD | $5\times 10^{3}$ | $1$ | $250\,112$ | $192$M | $278$M | $278$M |
| Multilingual | $12$ | GLOB | $5\times 10^{3}$ | $1$ | $250\,112$ | $192$M | $278$M | $0.56$M |
| Multilingual | $12$ | TRIM | $5\times 10^{3}$ | $1$ | $216\,135\pm 27\,160$ | $166$M | $252$M | $0.5$M |
| Multilingual | $12$ | SPEC | $5\times 10^{3}$ | $1$ | $216\,135\pm 27\,160$ | $166$M | $252$M | $0.17$M |
| Multilingual | $12$ | SPEC-OPT | $5\times 10^{3}$ | $1$ | $50\,257\pm 0$ | $38.6$M | $125$M | $0.17$M |
| Multilingual-B | $24$ | STANDARD | $5\times 10^{3}$ | $1$ | $250\,112$ | $512.2$M | $1.71$B | $1.71$B |
| Multilingual-B | $24$ | SPEC-OPT | $7\times 10^{3}$ | $14$ | $50\,257\pm 0$ | $102.9$M | $1.3$B | $2.4$M |
| Multi-domain | $12$ | Standard | $5\times 10^{3}$ | $1$ | $50\,257$ | $38.6$M | $125M$ | $125$M |
| Multi-domain | $12$ | GLOB | $500$ | $10$ | $50\,257$ | $38.6$M | $125M$ | $0.25$M |
| Multi-domain | $12$ | TRIM | $500$ | $10$ | $45\,554\pm 9462$ | $35$M | $121M$ | $0.24$M |
| Multi-domain | $12$ | SPEC | $500$ | $10$ | $45\,554\pm 9462$ | $35$M | $121M$ | $0.17$M |
| Multi-domain | $24$ | STANDARD | $13.5\times 10^{3}$ | $1$ | $50\,257$ | $51.4$M | $350$M | $350$M |
| Multi-domain | $24$ | GLOB | $500$ | $27$ | $50\,257$ | $51.4$M | $350$M | $0.7$M |
| Multi-domain | $24$ | TRIM | $500$ | $27$ | $45\,554\pm 9462$ | $46.6$M | $345.2$M | $0.69$M |
| Multi-domain | $24$ | SPEC | $500$ | $27$ | $45\,554\pm 9462$ | $46.6$M | $345.2$M | $0.6$M |

Table 6 showcases the vocabulary-agnostic hyperparameters of our decoder-only models while Table 7 showcases vocabulary sizes, DEPT-specific parameters, memory costs, and communication costs. All our standard pre-training pipeline parameters were chosen following the recommendations of Hoffmann et al. () and MosaicML, with the sole exception of the billion-scale model where we tried to match the recent SOTA for English federated-pretraining of Sani et al. ().
When adapting models from random initialization we start with the $\eta_{\mathrm{max}}$ and decay over $N_{\mathrm{CT}}$ learning steps.We settled upon this procedure to enable quick learning embedding matrices without having to do another full training, as is often the case for language rewiring (Artetxe et al., ). When adapting from pre-initialized we start from $\eta_{\mathrm{max}}/2$ as both the model and the embeddings are reasonably well-trained.

We had to select a particular sampling ratio for the continued pre-training when using the full pre-training set rather than a single language or domain. In these cases, we settled upon uniform sampling as the natural analog of DEPT in the standard pre-training pipeline to avoid repeating experiments for all sampling strategies. Using uniform sampling tends to underestimate DEPT performance on high-resource data subsets relative to proportional and temperature-weighted baselines.

To implement the active forgetting baseline (Chen et al., ), ACT, we had to adapt the methodology to decoder-only models, which train with far fewer steps. To achieve this, we use a forgetting frequency of $500$ steps, equal to DEPT’s $N_{\mathrm{local}}$. We also use a cosine scheduler for the body with the same parameters as shown in Table 6; however, we schedule the embedding matrix independently across the $500$ steps using the same scheduler but setting $\eta^{\prime}_{\max}=500$. Finally, for continued pre-training we selected the checkpoint with the lowest validation perplexity at the end of a forgetting cycle.

### A.2 Data Sources

We quantify the lexical heterogeneity of a dataset based on lexical similarity between data sources. A simple similarity measure is the size of the intersection of subwords between vocabularies. The smaller the intersection, the more dissimilar the vocabularies, and thus the more challenging it becomes to train a shared tokenizer effectively across different domains or languages. For this section we use the size of local vocabulary as a subset of the global vocabulary as a proxy, with smaller local vocabularies indicating that the global tokenization does not serve a particular data source well.

Our default global tokenizer for multilingual data is that proposed by Xue et al. (), with $\mathcal{V}=$250\,112$$ tokens.
Owing to its diverse pre-training, the mT5 (Xue et al., ) tokenizer is a robust default choice, employed in recent works such as project Aya (Üstün et al., ). However, its coverage of hundreds of languages does come with many shortcomings relating to the capacity allocated to each language. To showcase these challenges, we carefully selected languages from distinct families in the MC4 subset, including English (EN), Italian (IT), Serbian (SR), Swahili (SW), Urdu (UR), Latin (LA), Chinese (ZH), and Malay (MS). The corresponding vocabulary sizes of our languages are as follows: $\{247\,720,211\,332,208\,391,170\,984,188\,002,220\,757,240\,566\}$. Among these, Swahili (SW) is the most heterogeneous, as determined by its small subset of $170\,984$ tokens.

Our global tokenizer for English data was trained on The Pile and proposed by Black et al. () with $\mathcal{V}=50\,257$ tokens. We selected The Pile as our multi-domain dataset for several reasons. The Pile is a diverse, large-scale dataset specifically designed for training large language models (LLMs). Its diversity spans domains such as scientific papers, news, books, and web content, providing a comprehensive foundation for capturing varied linguistic patterns. Among the various subsets of The Pile, DM Mathematics stands out as the most heterogeneous. This subset contains only $11,090$ tokens from the global vocabulary, significantly fewer than other subsets. Here are the sizes of other subsets in terms of their unique tokens from the global vocabulary: $\{49\,362,49\,783,46\,766,49\,469,49\,700,47\,865,48\,720\}$ $\{11\,090,44\,249,42\,957,44\,432,49\,992,49\,841,47\,687,49\,961,46\,825\}$. While this indicates much lower heterogeneity than multilingual settings, vocabulary choice may still impact highly specialized model capabilities such as mathematical reasoning.

#### A.2.1 Tokenization Considerations

One of the major challenges when representing multiple data sources with a single tokenizer is vocabulary dilution. A tokenizer that aims to cover multiple languages or domains often needs to adopt many short subwords to maximize coverage. This increases the tokenizer fertility (i.e., the number of tokens produced per unit of text) (Rust et al., ) and also raises the overall description length — the total number of tokens required to represent the same data. This trade-off negatively affects the compression ratio, as the same amount of information requires more tokens, reducing the model’s sample efficiency (Tao et al., ). When non-uniform sampling ratios are used during pre-training, high-resource languages tend to have better fertility than low-resource languages. This means high-resource languages are better represented in the vocabulary, and their tokens are more likely to be shared across the model’s parameters, improving their performance. In contrast, low-resource languages suffer from poor fertility, where their unique vocabulary tokens are underrepresented, leading to worse performance. For example, Swahili (SW) and Urdu (UR) are low-resource languages that face these challenges. Our Spec method allows us to avoid many of these issues by providing an optimized vocabulary to a data source, at the cost of losing a shared vocabulary and updating several embedding matrices. An alternative approach is to cluster vocabularies (Chung et al., ) to obtain subword sharing between more relevant languages. However, this requires that participating data source are known in advance, do not change significantly, and that the appropriate number of clusters is also known.

## Appendix B Additional Results

**Table 8: Validation perplexity (lower is better) for our $12$-block models trained on The Pile when performing continued pre-training starting from a randomly-initialized embedding matrix. DEPT can train a superior transformer body, outperforming all baselines across all subsets by up to $28\%$.**
| Name | NH | GH | PA | UO | FL | ENR | EP | WK | CC | SE | PC | PP | DM | AR | GU | HN | UI<br>(OOD) | Avg |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| UNIF | $63.0$ | $12.1$ | $61.9$ | $44.1$ | $45.2$ | $36.3$ | $47.9$ | $81.8$ | $115.9$ | $33.2$ | $32.4$ | $91.8$ | $5.8$ | $21.6$ | $91.2$ | $75.0$ | $198.1$ | $62.2$ |
| PROP | $58.6$ | $11.4$ | $57.2$ | $41.3$ | $42.2$ | $33.6$ | $43.1$ | $75.2$ | $108.2$ | $31.0$ | $30.3$ | $85.4$ | $5.7$ | $20.4$ | $85.6$ | $70.9$ | $168.0$ | $57.0$ |
| ACT | $126.7$ | $20$ | $124.8$ | $79.9$ | $82.1$ | $66.3$ | $124.2$ | $147.7$ | $191.6$ | $55.4$ | $61.2$ | $180.1$ | $7.4$ | $33.8$ | $150.8$ | $123.9$ | $377.8$ | $114.9$ |
| GLOB | $44.5$ | $9.3$ | $43.0$ | $32.0$ | $32.1$ | $25.9$ | $31.4$ | $58.5$ | $83.9$ | $23.8$ | $23.1$ | $64.6$ | $\mathbf{5.1}$ | $16.2$ | $66.4$ | $54.7$ | $114.6$ | $42.9$ |
| TRIM | $43.3$ | $8.8$ | $41.8$ | $31.2$ | $30.7$ | $24.6$ | $29.4$ | $56.2$ | $\mathbf{82.3}$ | $\mathbf{23.4}$ | $\mathbf{22.6}$ | $\mathbf{62.7}$ | $5.1$ | $\mathbf{16.0}$ | $\mathbf{64.1}$ | $\mathbf{53.2}$ | $\mathbf{99.0}$ | $\mathbf{40.8}$ |
| SPEC | $\mathbf{42.1}$ | $\mathbf{8.7}$ | $\mathbf{40.6}$ | $\mathbf{30.3}$ | $\mathbf{29.8}$ | $\mathbf{23.8}$ | $\mathbf{28.0}$ | $\mathbf{54.8}$ | $87.0$ | $24.9$ | $23.8$ | $67.5$ | $5.2$ | $16.8$ | $69.1$ | $57.1$ | $124.2$ | $43.2$ |
| Min Imp (%) | $\mathbf{24}$ | $\mathbf{19}$ | $\mathbf{25}$ | $\mathbf{23}$ | $\mathbf{24}$ | $\mathbf{23}$ | $\mathbf{27}$ | $\mathbf{22}$ | $\mathbf{20}$ | $\mathbf{20}$ | $\mathbf{21}$ | $\mathbf{21}$ | $\mathbf{8}$ | $\mathbf{18}$ | $\mathbf{19}$ | $\mathbf{20}$ | $\mathbf{26}$ | $\mathbf{24}$ |
| Max Imp (%) | $\mathbf{28}$ | $\mathbf{24}$ | $\mathbf{29}$ | $\mathbf{27}$ | $\mathbf{29}$ | $\mathbf{29}$ | $\mathbf{35}$ | $\mathbf{27}$ | $\mathbf{24}$ | $\mathbf{25}$ | $\mathbf{25}$ | $\mathbf{27}$ | $\mathbf{11}$ | $\mathbf{22}$ | $\mathbf{25}$ | $\mathbf{25}$ | $\mathbf{41}$ | $\mathbf{28}$ |

**Table 9: Validation perplexity (lower is better) for our $12$-block models trained on The Pile when performing continued pre-training starting from a pre-trained embedding matrix. DEPT performs worse than for the $24$-block trained on The Pile and than for our $MC4$ models. However, when considering Table 8, we can observe it wins all comparisons by wide margins when starting from a randomly initialized embedding matrix, indicating that this gap is driven by the embedding space being fitted to the high-resource languages despite the baselines having a worse transformer body.**
| Name | NH | GH | PA | UO | FL | ENR | EP | WK | CC | SE | PC | PP | DM | AR | GU | HN | UI<br>(OOD) | Avg |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| UNIF | $31.9$ | $7.6$ | $30.5$ | $24.2$ | $23.2$ | $\mathbf{18.1}$ | $\mathbf{20.5}$ | $41.2$ | $64.6$ | $18.9$ | $19.2$ | $49.4$ | $\mathbf{4.9}$ | $13.6$ | $51.7$ | $42.6$ | $68.4$ | $31.2$ |
| PROP | $32.7$ | $\mathbf{6.6}$ | $29.5$ | $23.4$ | $\mathbf{21.3}$ | $20.8$ | $27.8$ | $\mathbf{38.4}$ | $\mathbf{57.9}$ | $\mathbf{17.0}$ | $\mathbf{17.2}$ | $56.8$ | $5.0$ | $\mathbf{12.0}$ | $\mathbf{51.2}$ | $42.8$ | $81.8$ | $31.9$ |
| GLOB | $30.2$ | $7.1$ | $29.8$ | $22.9$ | $23.7$ | $20.0$ | $21.9$ | $41.6$ | $61.8$ | $17.9$ | $19.6$ | $48.0$ | $5.2$ | $13.7$ | $54.1$ | $42.2$ | $90.7$ | $32.4$ |
| TRIM | $\mathbf{29.5}$ | $6.9$ | $\mathbf{29.2}$ | $\mathbf{22.4}$ | $23.0$ | $19.4$ | $21.1$ | $40.8$ | $60.6$ | $17.4$ | $19.2$ | $\mathbf{46.7}$ | $5.1$ | $13.4$ | $52.4$ | $\mathbf{41.0}$ | $\mathbf{81.1}$ | $\mathbf{31.1}$ |
| Min Imp (%) | $\mathbf{5.4}$ | $\mathbf{-7.0}$ | $-1.2$ | $2.0$ | $-11.2$ | $-10.5$ | $-6.7$ | $-8.3$ | $-6.8$ | $-5.1$ | $-13.8$ | $\mathbf{3.0}$ | $-5.5$ | $-14.3$ | $-5.6$ | $\mathbf{0.9}$ | $-32.7$ | $-3.7$ |
| Max Imp (%) | $\mathbf{7.5}$ | $\mathbf{-4.0}$ | $1.0$ | $4.3$ | $-7.9$ | $-7.5$ | $-2.9$ | $-6.2$ | $-4.7$ | $-2.6$ | $-11.4$ | $\mathbf{5.6}$ | $-4.2$ | $-11.5$ | $-2.3$ | $\mathbf{3.8}$ | $-18.6$ | $\mathbf{0.3}$ |

## Appendix C Applications

### C.1 Federated Pre-Training of LLMs on Multilingual Population

The challenges of training under data heterogeneity have come back into focus with recent forays into federated pre-training (Douillard et al., ; Sani et al., ; Charles et al., ; Research, ), triggered in equal parts by privacy concerns, compute sharing, and the search for more data in previously untapped reservoirs.

The way in which datasets are curated, filtered, and combined has a significant impact on the performance of LLMs ((Long et al., )). Determining the best methods for data curation, filtering, and mixing from various sources requires extensive experimentation to identify configurations that optimize performance on target evaluation metrics ((Meta, )). Consequently, the specific details of these processes are often closely guarded by leading LLM developers. Despite careful dataset preparation, data heterogeneity remains inevitable due to the inherent imbalance in data sources. One of the most prominent imbalances is in language representation. For instance, only about 5% of the pre-training data for Llama3 is non-English, covering over 30 languages, which results in lower expected performance in non-English contexts ((Meta, )). A similar performance disparity across languages has also been observed with GPT-4 ((Achiam et al., )).

Current datasets used for pre-training are highly geographically concentrated to a few areas of the globe (Faisal et al., ), providing the so-called high-resource languages, with high-quality domain-specific data being available predominantly in such languages (Magueresse et al., ). Such datasets are collected from internet sources and then curated (Brown et al., ; Dubey et al., ). However, bottlenecks in the rate of high-quality data generation (Villalobos et al., ) and copyright concerns (Grynbaum & Mac, ) have led to large organizations making deals with private data providers such as publishers (OpenAI, ; Patel & Palazzolo, ) in order to meet the demand of ever-growing models.

Federated pre-training as a methodology allows the model to be taken directly to the training data, potentially enabling training under privacy concerns or legislation which limits data movement (Woisetschläger et al., ). While this has obvious applications for collaborative training of LMs, it can also be applied by a single organization as a drop-in replacement for mini-batch SGD during pre-training (Douillard et al., ), which eliminates dataset movement while massively lowering the communication frequency of model training compared to Data-parallel algorithms (Rajbhandari et al., ) which need to synchronize gradients every batch. The version of the algorithm used in a centralized setting, mathematically equivalent to Federated Averaging (McMahan et al., ), has alternatively been known as: (a) communication-efficient SGD (Yu et al., ), (b) Local SGD (Stich, ; Ortiz et al., ), or (c) as a specific variant of the REPTILE (Nichol et al., ) meta-learning algorithm. Under these various methodologies, it has been shown to: (a) confer a linear speedup to convergence similar to increasing batch size, (b) provide better generalization to models compared to standard large-batch training, (c) enable meta-learning across various tasks.

While the current centralized pre-training recipe may be stabilized with great effort, such measures are largely impractical in federated training scenarios where the participants refuse to offer full control over their data to a third party or where the underlying training distribution may shift as new participants enter a federation or old ones exit. Furthermore, the complexity of the current pipeline is impractical to all except the best-funded organizations even in a centralized training context.

The inability to directly inspect data sources in a federated context makes it impossible to construct a dedicated vocabulary for a data mixture, ensure a standard curation pipeline on a per-sample basis, or to strongly control data sampling rates across all sources. Motivated by this extreme setting, we aim to construct a pre-training procedure which is capable of learning from multiple highly heterogeneous data sources without model divergence while providing a foundation model with greater generalization and more plasticity in adapting to new data.

## Appendix D Training Under Data Heterogeneity

Training LLMs such as Llama 3 (Dubey et al., ) requires extensive manual tuning, heuristics, and model-based data selection procedures. This effort aims to achieve the desired mix of categories, such as general knowledge, mathematics, coding, and multilingual data.

This complexity arises due to the wide range of capabilities required by LMs and the risk of negative interference across domains and languages. Current pre-training methodologies are prone to divergence unless data sampling ratios can be meticulously curated based on the characteristics of the data and it’s fit to the model’s distribution at any given time (Dubey et al., ). Multi-domain ratios are manually curated for downstream performance, requiring extensive and expensive tuning, while multilingual pre-training often employs temperature-weighted sampling (Devlin et al., ; Conneau et al., ; Xue et al., ) due to the vast number of languages involved,

As illustrated in Fig. 2, pre-training on heterogeneous data can result in model activation divergence (Hoffmann et al., ), even with a sampling temperature of $\alpha=1.0$, which corresponds to proportional sampling based on dataset size. Activation divergence is a precursor to significant, often irrecoverable, increases in loss, necessitating model re-starts from earlier checkpoints with lower learning rates (Zhang et al., ). Longer training durations could be achieved by disproportionately sampling from larger, lower-quality datasets like C4 or high-resource languages like English in multilingual pre-training. Alternatively, methods like active forgetting via embedding resetting (ACT)(Chen et al., ), may artificially extend the training duration past the natural divergence point.

Previous studies show that this ”curse of multilinguality” or “negative interference” can be attributed to vocabulary dilution and capacity contention (Conneau et al., ), language-specific parameter emergence (Wang et al., ), and suboptimal tokenization (Rust et al., ). Increasing model and vocabulary size helps capacity contention (Conneau et al., ; Wang et al., ), but this requires immense hardware resources (Dubey et al., ) to shard the model across multiple GPUS. Addressing vocabulary dilution in highly multilingual models is even more challenging, as providing enough tokens for all languages would result in impractically large models (Rust et al., ). These limitations drive us to find scalable methods to incorporate broader data mixtures without significantly increasing the in-memory model size during training.

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 5
presentation: 2
questions: 1. How would the model DEPT-SPEC be used for inference? Would there first be a need to determine the used domain / language as tokenizers are separate (L129)?
2. The GLOB model seems to work best. Is there any hypothesis why this is the case? What is the implication of this fact?
3. The mentioned “Performance metrics” in all captions is always perplexity?
4. Based on which estimation is communication cost 675x lower?
soundness: 3
strengths: 1. The authors tackle an important problem. The usage of data mixtures during pre-training is not well understood but is an essential part of modern foundation models.
2. While the idea of using model averaging after an inner loop of training on dedicated subsets of data is not particularly novel, it might have a big impact on pre-training, given the encouraging results.
summary: The authors introduce the method DEPT, “Decoupled Embeddings for Pre-trained Language models,” an algorithm that trains a transformer model on heterogeneous datasets such as domains or languages individually and subsequently aggregates the parameters by averaging them. They introduce three variants where increasingly less embedding information is shared. DEPT achieves lower perplexity than baselines.
weaknesses: 1. Writing can be improved or misses important information. For example, for the experimental setup, I struggle to understand L205-311, and information on software/hardware, such as how many FLOPS  or hours training took, is missing.
2. Some claims are overstated: M-T outperforms DEPT in 5/11 datasets in Table 2. I am not convinced that Trim and Glob perform identically (L377).
3. An important additional baseline would be models trained on individual data sets. This would give insights into the advantages/disadvantages of model averaging.

---

confidence: 5
contribution: 4
initial_rating: 8
presentation: 2
questions: - [addressed] Is there any comparable experiment whose results you can compare your models against?
- [addressed] How did you perform hyperparameter search?
- [addressed] Did you perform scaling experiments?

[addressed] More than answering questions, I expect the authors to do a significant effort during the rebuttal to improve the paper's form. I would downgrade my rating if this does not happen. (I prefer to give authors a chance to amend, because I think the paper is otherwise interesting if you can get past the shortcomings of the writing.)
soundness: 4
strengths: - The setup proposed in this paper looks very satisfying, and it seems to solve several problems both in the industry and in research labs.
- The value proposition seems clear to me.
- The deployed methodology appears novel.
- The literature research looks satisfactory to me, given the scope of the paper.
summary: In this work, the authors propose to train Language Models with multiple independent tokenizer and language modeling heads (one per language or data source) but with a single Transformer backbone. One touted advantage of this approach is that each source can train on its own GPU node, with a reduced need for cross-node communications (since a significant share of the weights does not need to be replicated across them). Another touted advantage is that forcing one model to work with multiple tokenization schemes makes the model more adaptable to new languages and domains post-training, similar to how "embedding reinitialization during the training" was found to have a similar effect (at a cost that however did not warrant its use when training large models, unlike the proposed methodology that does not requiring wasting training cycles).
weaknesses: - [addressed] The paper's form is well below the required writing standards. To address this, I'd suggest specific improvements, such as:
  - Standardizing method names throughout the paper and tables (SPED vs SPEC, GlOB vs GLOB vs Glob, ...)
  - Clearly defining the performance metrics used and specifying explicitly whether lower or higher values are better
  - Adding a reference to Table 1 in the main text
  - Improving table readability by adding summary statistics (averages...), using bold or color highlighting, or splitting into multiple tables (moving some languages to an Appendix).
- [addressed] Not enough arguments are brought forward to justify the issue with diverging models during training. I have myself never experienced this phenomenon in similar setups. As such, it's difficult to rule out that it might be the result of bugs in the training code or poor hyperparameter choices, rather a general phenomenon. 
  - A better description of the exact training methodology and the hyperparameter search would help alleviate concerns, here.
  - An ablation study or an explanatory paragraph isolating factors that contribute to divergence would also help.
- [addressed] The lack of comparisons with baselines not trained by the authors is worrying. 
  - I would prefer for external baselines to be added, even if some added context is necessary to explain away unfair comparisons (could be an appendix).
- [addressed] Without devising a clear methodology to perform inference on SPEC-type models, the paper feels a bit incomplete. 
  - I'd suggest to the authors to briefly outline a proposed inference methodology for SPEC models, and to discuss the challenges and potential approaches for inference with these models in more detail.

---

confidence: 4
contribution: 4
initial_rating: 6
presentation: 3
questions: - abstract: I believe "negative interference" and "curse of multilingual" are not parallel concepts. Curse of multilingual is a special type of interference because of the training data containing many languages. 

- I don't find the authors clearly stating the "performance metrics" in Tables 1, 2, 3, 4.

- The authors are suggested to have aggregated statistics for Tables 1, 2, 3, and 4 (e.g., average) so that the authors can have a better understanding of which model generally performs the best. Additionally, the authors can bold the best number in each column.

- line 278: 50,257 instead of 50257.0

- Line 341 (b) tn the ?
soundness: 3
strengths: - The paper is well-written and easy to follow.

- The idea of decoupling embedding matrix and transformer block in pre-training within the federated learning framework is novel.

- The authors answer the raised research questions with meaningful and extensive experiments.

- The results generally confirm that DEPT can improve the generalization and plasticity of the models.
summary: This paper proposes a pre-training framework DEPT which allows the model to train without being bound to a shared global vocabulary. Three variants are introduced: Glob, Trim, and Spec. Although each pipeline has the same setting for the transformer block, the difference lies in how they deal with the embeddings. Among the three, Glob is close to the standard pre-training: a single global embedding matrix is used. Trim keeps a local embedding matrix for each data source, and each token in the matrix is also contained in the global vocabulary. With the federated learning framework, the updates of a specific token are then aggregated to the same token in the global embedding matrix. Spec is a fully decoupled version where there is a non-sharing local embedding matrix for each data source. The authors evaluate the DEPT by investigating the efficiency, generalization as well as plasticity.
weaknesses: - The data sources are not always clear given a dataset. The proposed pipeline only works if the domains are known. Otherwise, some manual or automatic clustering has to be used to create different sets of data.

- The multi-domain data is almost only in English. But for the multilingual data, the data of each language should also contain various domains. Therefore there are confounding variables. A natural question would be whether the model can generalize to the same domains across different languages.

- No downstream tasks in natural language understanding or generation are evaluated on the resulting models. But such further evaluation is important.

Meta-review: This work proposes the DEPT algorithm (Decoupled Embeddings for Pre-Trained language models) to train LMs on diverse data sources more effectively. The method iteratively trains a transformer model on different subsets of data with separate embeddings for each data type (such as domain or language); the work proposes and compares three variants of this approach. The experiments show that this approach performs well for continued pretraining in both different English domains and in the multilingual setting, and the analyses also demonstrate the method's efficiency.

Strengths:
- This paper addresses an important problem (tokenization and embedding representations over diverse data sources) and provides a compelling approach to solving this problem.
- Results are (for the most part) consistent and convincing for both the perplexity and downstream task experiments.
- The approach is more efficient than standard pretraining, as cross-node communication isn't needed during the steps where the model is trained independently on each data type (InnerOPT).
- The paper provides clear research goals beyond task performance that the experiments and analyses address, such as model efficiency and generalization.


Weaknesses: 
- Multiple reviewers raised concerns with the writing, and some details are still confusing after revisions (e.g., defining STANDARD as the continued pretraining baseline in Table 2 and then referring to it with the names based on sampling methods in Tables 3 and 4). The authors should ensure the notation and discussion are consistent and clear in the next version of the paper. This also includes other points raised by the reviewers and clarified in the rebuttal.
- Table 7 is too small to read easily and should be larger in the next version.

Decision: Accept (Oral)