BAMBINO-LM: (Bilingual-)Human-Inspired Continual Pre-training of BabyLM (2024)

Abstract: Children from bilingual backgrounds benefit from interactions with parents and teachers to re-acquire their heritage language. In this paper, we investigate how this insight from behavioral study can be incorporated into the learning of small-scale language models. We introduce BAMBINO-LM, a continual pre-training strategy for BabyLM that uses a novel combination of alternation and PPO-based perplexity reward induced from a parent Italian model. Upon evaluation on zero-shot classification tasks for English and Italian, BAMBINO-LM improves the Italian language capability of a BabyLM baseline. Our ablation analysis demonstrates that employing both the alternation strategy and PPO-based modeling is key to this effectiveness gain. We also show that, as a side effect, the proposed method leads to a similar degradation in L1 effectiveness as human children would have had in an equivalent learning scenario. Through its modeling and findings, BAMBINO-LM makes a focused contribution to the pre-training of small-scale language models by first developing a human-inspired strategy for pre-training and then showing that it results in behaviours similar to that of humans.

heading: 1 Introduction
text: The recently held BabyLM challenge (Warstadt et al., 2023) explores pretraining of language models using a constrained dataset analogous to the linguistic exposure of a 13-year-old English-speaking child. In this paper, we extend the BabyLM challenge to a bilingual setting, drawing inspiration from parent-child interactions in heritage language acquisition (Lohndal et al., 2019). Immigrant children in western societies, who may have acquired their home language at a young age, can sometimes need to re-acquire the same language during the school years when the language becomes a minority. These heritage speakers typically benefit from an extended exposure to the minority language at
home or in the community, owing largely to feedback and stimuli provided by parents and family members (Montrul, 2010). This observation about child bilingualism is in line with the behaviorist theory for child language development (Demirezen, 1988).
Inspired by this line of work, we ask the following research question in the context of computational language modeling:
Can a small-scale language model trained on the majority language (e.g. English) be continually pre-trained on the minority language, leveraging the feedback of a second model that is fluent in the latter language?
To address this question, we introduce ‘Bilingual language Acquisition Modeling Based on INterleaved Optimization of Language Models (BAMBINO-LM)’, a novel continual pretraining strategy that uses a combination of alternation and proximal policy optimization (PPO) using a reward from a second model playing the parent role (i.e., a large language model pre-trained in the minority language). We experiment with BabyLM trained on English, and continually pretrain this model on an assumed second language, Italian.In its connection to cognitive processing, our work makes the following contributions:
• BAMBINO-LM draws inspiration from bilingual language acquisition and learns from interactions with a second model by incorporating a perplexity-based reward for language model pre-training. To the best of our knowledge, this is the first work to use PPO-based modeling for language acquisition in BabyLM.
• We show that BAMBINO-LM can acquire Italian to a reasonable degree with some expected
1
degradation in its English capability. The findings hint at a common learning trajectories for second language acquisition shared by language models and humans.

heading: 2 Related Work
text: Pre-training small-scale language models is an emerging field that has garnered some interest from the language acquisition community. BabyBERTa (Huebner et al., 2021) is an early adaptation to this scenario. Warstadt et al. (2023) introduce the BabyLM challenge to provide an atypically small dataset for benchmarking small-scale language models. This shared task enables research in not only language acquisition but also sampleefficient pre-training. In the case of our paper, we do not focus on sample efficiency but instead describe ways to enhance the ability of a second language via continual pre-training.
Our work is conducted in a setup similar to Yadavalli et al. (2023), where a tiered first/second language acquisition process is attempted. Samuel (2023) also experiments with a teacher-student setting but only tests the approach on English tasks. Evanson et al. (2023) is another closely related work, which investigates the learning trajectory of large-scale language models by probing their syntactic and semantic capabilities at each step.
Conventionally in language generation for natural language processing, the design of feedback signals is commonly discussed in the context of knowledge distillation (Calderon et al., 2023). Recently, reinforcement learning from human feedback (RLHF) utilizes human preferences for serving reward signals when dealing with sparse training labels (Christiano et al., 2017; Stiennon et al., 2020), and has been shown successful for generative tasks such as dialogues and summarization. This approach is further extended in Bai et al. (2022) by using AI feedback (RLAIF) to remove the dependency on human preference data, leading to better scalability and signal availability. The approach we take in this paper mostly falls within the latter camp, but generally departs from all prior efforts in the way the parent model’s perplexity is used to signal the conformity of the child model’s generation. This is in contrast to sequencelevel knowledge distillation (Kim and Rush, 2016) where teacher’s generation is used to guide the learning process.

heading: 3 Methods
text: Figure 1 shows the two phases of BAMBINOLM. The learning phase involves continual pretraining a small-scale language model (baby model B) whose initial pre-training was originally done on English data, while the feedback phase involves interactions with the Italian language model (parent model P). During the learning phase, pre-training for B is continued by employing causal language modeling on Italian data. Causal language modeling (CLM), also known as next token prediction, is a standard technique to train a decoder-only model. The objective is defined as follows:
LCLM = − 1
|x|
|x|∑
i=0
logP(xt | x0, . . . , xt−1).
There are two architectural innovations in BAMBINO-LM:
Feedback phase based on PPO We construct prompt x by selecting the first k tokens from the training example and solicit output yB = B(x) from the baby model. We then use Proximal Policy Optimization (PPO) where B’s parameters are updated according to a clipped surrogate objective (Schulman et al., 2017). This objective moderates the updates to the policy, facilitating stable and efficient learning by incorporating a clipping mechanism. Its definition is given as follows:
LPPO = Êt [ min ( rt(θ)Ât, clip(rt(θ); ϵ)Ât )] ,
with θ being the model parameters and rt(θ) defined as:
rt(θ) = πθ(at|st) πθold(at|st) .
In the autoregressive setting of language modeling, θ controls the generation of tokens based on the given state or context st. The probability ratio rt(θ) quantifies the change in the likelihood of selecting action at (the next token), under the updated policy parameters compared to the previous parameters θold. This ratio provides understanding on the impact of parameter updates on the policy’s behavior, ensuring that changes do not excessively deviate from the previous policy, thereby maintaining training stability. The clipping mechanism, defined by clip(rt(θ); ϵ), restricts rt(θ) within the bound [1 − ϵ, 1 − ϵ], mitigating the risk of large policy updates that could lead to divergence.
The advantage function, Ât = R+ γV (st+1)− V (st), which reflects the relative gains of selecting at given st. This function guides the optimization process by favoring actions that lead to better than expected outcomes.
The reward R for the advantage function is then calculated using the following function:
R(yB) = α
β(PPLP(yB)− τ) , (1)
where α and β are parameters, PPLP represents the perplexity of the parent model P for the sequence yB, and τ is a threshold value for perplexity. We use the following formulation of perplexity:
PPL(x) = exp
  |x|∑
i=0
logP(xt | x0, . . . , xt−1)   .
Alternating run We adopt an alternating run strategy between the learning and feedback phases, which is summarized in Algorithm 1. The rationale behind this is two-fold: 1) this strategy simulates frequent interactions between a child and its parent through dialogues, which has been our main motivation behind this study; 2) using multiple rewards is shown beneficial for reinforcement learning (Dann et al., 2023). To expand on the second point, our findings further suggest that using perplexity as a reward can lead to exploitation when baby model B attempts to produce similar utterances to those coming from parent model P . Without this strategic alternation between CLM and PPO, the pre-training tends to produce undesirable behaviours such as repeating words.
Algorithm 1 BAMBINO-LM Training. 1: procedure TRAIN(D,B,P) 2: Input: pre-training dataset D, baby model
B, and parent model P . 3: rCLM, rPPO ← 10, 2 4: r ← rCLM + rPPO 5: for i, x ∈ enumerate(D) do 6: if i%r < rCLM then 7: perform CLM step 8: else 9: yB ← B(x[1..k])
10: reward← R(yB) 11: perform PPO step 12: end if 13: end for 14: end procedure

heading: 4 Experiment Setup
text: Mimicking their process to create the BabyLM challenge corpus (Warstadt et al., 2023), we create an Italian dataset that is comparable in size to the strict-small track of the challenge, and perform identical preprocessing1. Table 1 shows the statistics of the Italian language dataset. A cursory quality check was conducted to ensure that the dataset was in a readable format.
For the choice of the baby model, we use English baseline OPT-125m (Zhang et al., 2022) model for the strict-small track provided by the BabyLM organizers. For the parent model, we
1https://github.com/babylm/babylm_data_ preprocessing; Accessed on 13th May, 2024.
use gpt2-small-italian model by de Vries and Nissim (2021). Using the Italian dataset described above, we conduct continual pretraining over 10 epochs, consisting of 10 learning phase steps followed by 2 feedback phase steps. We use k = 5 to solicit the first few tokens for prompting the baby model. All models are trained using HuggingFace’s transformer (Wolf et al., 2020) and trl (von Werra et al., 2020) library.
For downstream tasks, we use four Italian language tasks in UINAUIL (Basile et al., 2023) and four English language tasks in GLUE (Wang et al., 2018). The tasks were selected primarily based on computational constraints for the project. We also include BLiMP (Warstadt et al., 2020) for that it is used in the original BabyLM challenge. All tasks are conducted in a zero-shot classification setting.

heading: 5 Results
text: Table 2 shows a significant improvement in Italian downstream tasks for BAMBINO-LM as compared with the BabyLM baseline. Specifically, we achieve an average improvement of 0.1197 (0.3416→ 0.4613) without substantial differences in English classification tasks. However, we notice an expected decrease of 0.0752 (0.6255→ 0.5503) in the English language BLiMP dataset. These observations are in line with Yadavalli et al. (2023) which show that native child-directed speech can lead to negative cross-lingual transfer and impede L2 acquisition depending on the choice of L1.
In Table 3 we examine two ablated versions of our model: (a) w/o PPO: Trained solely on the CLM objective with no feedback phase; (b) w/o
2https://www.gutenberg.org/ebooks/bookshelf/ 353
3https://dumps.wikimedia.org/itwiki/
alternating: Use BAMBINO-LM with no alternating runs. Instead, it trains with the CLM objective for the first 85% of each epoch and then switches to the PPO objective for the remaining 15%.
Removing the interactive feedback mechanism (w/o PPO) and the alternating strategy (w/o alternating) significantly decreases Italian performance compared to our primary model. On UINAUIL tasks, the average score drops from 0.4613 to 0.4000 (w/o PPO) and 0.3513 (w/o alternating). However, we do not observe significant improvements in performance in both the English language task sets (GLUE and BLiMP). For GLUE tasks, the average scores remain consistent, with 0.4373 for BAMBINO-LM, 0.4375 for w/o PPO, and 0.4357 for w/o alternating. On the BLiMP dataset, the average scores are 0.5503 for BAMBINO-LM and 0.5554 for w/o PPO.
These results indicate that PPO modeling and alternating runs are both crucial for improving the bilingual ability of BAMBINO-LM without negatively impacting English performance. Furthermore, the lack of significant changes in English scores reinforces that these strategies enhance bilingual capabilities without compromising performance on existing benchmarks.

heading: 6 Conclusion
text: This paper introduces BAMBINO-LM, a continual pre-training strategy mimicking the process of sec-
ond language acquisition in an interactive setting. BAMBINO-LM uses a two-phase approach: it incorporates reward from a parent Italian model into a PPO-based mechanism and alternates this procedure together with causal language modeling based on Italian language text. Our experiments demonstrate systematic improvement in Italian with a marginal but expected decrease in English, which echoes the past results in second language acquisition for large language models (Evanson et al., 2023). These findings highlight the efficacy of our approach in enhancing bilingual capabilities while maintaining performance in the original language.
In future work, we aim to explore the effect of alternative metrics and different reward learning mechanisms that better align with human feedback behaviors. This also includes exploring rewards that capture linguistic quality and provide direct, “constructive” corrections to the model output which is commonly known as an effective learning strategy for language development. Although BAMBINO-LM was applied for second language learning with Italian as an example, the method must be validated for other languages, especially languages that are distant from English or those that use a different set of tokens. The degradation in the performance of the first language, English,
points to the potential of alternating with language modeling for the first language.
Limitations
The approach relies on the availability of a base model in a language, English in our case. Although we download Italian language datasets from known Italian sources, we do not explicitly validate the language of the text. We use the PPO model as is, and do not experimentally tune its parameters. Similarly, using perplexity as a metric for computing rewards may not be the optimal solution, as perplexity itself is influenced by many factors of the parent model.
Ethics Statement
The paper uses publicly available datasets for training and evaluation that do not possess known harms. The evaluative tasks are typical language learning tasks. However, the resultant models are not tested for harmful or biased content.

heading: Acknowledgment
text: Zhewen Shen conducted this research as a part of UNSW Sydney’s Taste of Research Program.

heading: Future Work
text: In future work, we aim to explore the effect of alternative metrics and different reward learning mechanisms that better align with human feedback behaviors. This also includes exploring rewards that capture linguistic quality and provide direct, “constructive” corrections to the model output which is commonly known as an effective learning strategy for language development. Although BAMBINO-LM was applied for second language learning with Italian as an example, the method must be validated for other languages, especially languages that are distant from English or those that use a different set of tokens. The degradation in the performance of the first language, English,
points to the potential of alternating with language modeling for the first language. Limitations
The approach relies on the availability of a base model in a language, English in our case. Although we download Italian language datasets from known Italian sources, we do not explicitly validate the language of the text. We use the PPO model as is, and do not experimentally tune its parameters. Similarly, using perplexity as a metric for computing rewards may not be the optimal solution, as perplexity itself is influenced by many factors of the parent model