Baby’s CoThought: Leveraging Large Language Models for Enhanced Reasoning in Compact Models

Zheyu Zhang, Yang Han, Bolei Ma, David Rügamer, Ercong Nie

Abstract

Large Language Models (LLMs) demonstrate remarkable performance on a variety of natural language understanding (NLU) tasks, primarily due to their in-context learning ability. This ability could be applied to building babylike models, i.e. models at small scales, improving training efficiency. In this paper, we propose a "CoThought" pipeline, which efficiently trains smaller "baby" language models (BabyLMs) by leveraging the Chain of Thought prompting of LLMs. Our pipeline restructures a dataset of less than 100M in size using GPT-3.5-turbo, transforming it into task-oriented, human-readable texts that are comparable to the school texts for language learners. The BabyLM is then pretrained on this restructured dataset in a RoBERTa fashion. In evaluations across 4 benchmarks, our BabyLM outperforms the vanilla RoBERTa in 10 linguistic, NLU, and question-answering tasks by more than 3 points, showing a superior ability to extract contextual information. These results suggest that compact LMs pretrained on small, LLM-restructured data can better understand tasks and achieve improved performance.

Introduction

Training state-of-the-art language models typically necessitates massive datasets, often reaching trillions of tokens. In contrast, human children acquire complex linguistic capabilities from a significantly smaller "dataset" of environmental interactions—estimated at roughly 100 million tokens by age 13. The BabyLM Challenge seeks to bridge this gap by developing sample-efficient models that learn effectively from limited data.

A primary obstacle in training small-scale models is the fragmented nature of raw datasets, which often consist of disconnected sentences lacking strong semantic or logical ties. This makes it difficult for compact models to learn contextual relationships and reasoning. To address this, we propose the CoThought pipeline, which utilizes a "teacher" LLM to transform messy raw data into high-quality, task-oriented educational material for a "student" model.

Methodology: The CoThought Pipeline

The CoThought pipeline shifts the pretraining paradigm from raw text prediction to learning from "taskified" data.

The CoThought pipeline: Restructuring raw data into task-oriented lessons using an LLM teacher.

1. Creative NLU-Example Generation (CNLU-EG)

The pipeline selects five random sentences from the raw dataset and prompts GPT-3.5-turbo to act as a teacher. The LLM is tasked with:

  • Planning: Weaving the sentences into a coherent narrative.
  • Paragraph Construction: Writing a story based on the generated plan.
  • Task Labeling: Identifying specific NLU tasks (e.g., Sentiment Analysis, Intent Classification) within the text and providing accurate labels.

2. Quality Control and Scoring

To ensure data quality, a separate zero-shot prompt is used to score the coherence of the generated paragraphs on a scale of 1 to 10. Only examples achieving a score of $\ge 7.0$ are retained for the final training set.

3. Pretraining

The resulting dataset, formatted as [Reasoning Plan] + [Example Paragraph + Task], is used to pretrain a RoBERTa-base model. This "BabyLM" learns by observing the teacher's reasoning process and the structured tasks, rather than just predicting masked tokens in isolation.

Experimental Results

The BabyLM model was evaluated against a vanilla RoBERTa-base baseline across several benchmarks, including BLiMP (linguistic minimal pairs), GLUE (standard NLU), and MSGS (linguistic generalization).

Performance comparison on linguistic reasoning tasks between CoThought-trained BabyLM and baseline.

The CoThought-trained model demonstrated significant improvements over the baseline:

  • Linguistic Reasoning: On the BLiMP Supplement, the model achieved massive gains, notably +32.13 points on Subject-Auxiliary Inversion and +28.10 points on QA Congruence.
  • General NLU: Performance on GLUE tasks like BoolQ and MNLI improved by over 5 points.
  • Overall Gains: Across all evaluated tasks, the CoThought model averaged a 2.2-point improvement over the baseline using the same volume of raw data.

Qualitative analysis suggests the model developed a superior grasp of discourse structure, becoming significantly better at distinguishing between complete-sentence answers and fragments in question-answering tasks.

Discussion and Conclusion

The success of CoThought highlights "taskification" as a powerful catalyst for pretraining. By leveraging the In-Context Learning and Chain of Thought abilities of LLMs, we can create a "curriculum" that is far more digestible for smaller architectures.

While effective, the current approach is dependent on the specific "teacher" LLM (GPT-3.5-turbo) and was tested only on encoder-only architectures. Future research will explore the impact of different teacher models and the applicability of CoThought to causal (decoder-only) models. Nonetheless, these results demonstrate that compact models pretrained on LLM-restructured data can achieve significantly enhanced reasoning capabilities.

Summary updated

BibTeX
@misc{zhang2023babys,
  author = {Zheyu Zhang and Yang Han and Bolei Ma and David Rügamer and Ercong Nie},
  title = {{Baby’s CoThought: Leveraging Large Language Models for Enhanced Reasoning in Compact Models}},
  year = {2023},
  eprint = {2308.01684},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.01684},
}
Figure