Abstract
Large Language Models (LLMs) often struggle to adapt to specialized domains such as medicine or law without extensive manual annotation. This paper introduces Bonito, an open-source model designed for Conditional Task Generation (CTG). Bonito converts unannotated text into high-quality instruction tuning datasets, enabling zero-shot task adaptation. By training on the newly curated CTGA dataset, Bonito significantly outperforms standard self-supervised adaptation methods and mitigates the issue of catastrophic forgetting in instruction-tuned models.
Introduction
While general-purpose Large Language Models (LLMs) demonstrate impressive capabilities across a wide array of tasks, their performance often degrades in specialized domains. To bridge this gap, models typically undergo instruction tuning—fine-tuning on (Instruction, Input, Response) triplets. However, creating these datasets for niche fields is prohibitively expensive, requiring significant time from subject matter experts.
Traditionally, researchers have relied on "Task-Adaptive Pretraining" (TAPT), which uses self-supervised next-word prediction on domain-specific corpora. However, this approach has a significant drawback: it can lead to "catastrophic forgetting," where the model's ability to follow instructions is diminished during the adaptation process. This paper presents Bonito, a 7B-parameter model that transforms raw text into synthetic instruction tuning data, allowing models to adapt to new domains while maintaining their instruction-following logic.
Methodology
Conditional Task Generation (CTG)
The core innovation of this work is the training of Bonito for Conditional Task Generation. Unlike standard models that generate a response based on a prompt, Bonito is trained to generate a task (instruction and response) based on a provided context and a specific task attribute.
The CTGA Dataset
To train Bonito, the authors developed the CTGA (Conditional Task Generation with Attributes) dataset. This dataset consists of 1.65 million examples across 16 distinct task types, derived from 38 existing instruction tuning datasets (such as P3). The researchers "remixed" these datasets by:
- Selecting datasets that included a context passage.
- Annotating these examples with specific task types (e.g., extractive QA, natural language inference).
- Inverting the training objective: the model is given the context and a task attribute and must generate the corresponding instruction and response.
The Adaptation Workflow
Bonito simplifies the domain adaptation process into three distinct steps:
- Input: Collect unannotated text from the target domain (e.g., legal documents or medical abstracts).
- Generate: Use Bonito to generate synthetic instructions and responses based on the domain text and desired task attributes.
- Tune: Fine-tune the target LLM on this synthetic dataset to achieve domain-specific proficiency.
Experimental Evaluation
Datasets and Baselines
The researchers evaluated Bonito's effectiveness across seven datasets in three primary categories:
- Yes-No QA: PubMedQA (biomedical) and Privacy Policy QA (legal).
- Extractive QA: SQuADShifts (NYT, Amazon, Reddit).
- Natural Language Inference (NLI): Contract-NLI (legal) and Vitamin C (fact-checking).
Bonito was compared against several baselines, including zero-shot models, standard TAPT (next-word prediction), and larger models like Flan-T5-XXL (11B).
Key Results and Insights
Performance Gains
Adapting Mistral-7B and Llama 2 7B using Bonito-generated data resulted in an average improvement of 33.3 F1 points over self-supervised baselines. Furthermore, Bonito-adapted models outperformed the strong Mistral-Instruct-v2 baseline by an average of 22.1 F1 points.
Mitigating Catastrophic Forgetting
The study confirmed that standard self-supervision (TAPT) often causes a performance drop in instruction-tuned models, averaging a loss of 0.8 F1 points. By remaining within the instruction-tuning paradigm, Bonito avoids this degradation, ensuring the model retains its general utility while gaining specialized knowledge.
Efficiency and Logic
Despite being a 7B-parameter model, Bonito demonstrated the ability to "distill" complex task-creation logic. Synthetic data generated by Bonito allowed 7B models to outperform much larger models, such as the 11B Flan-T5-XXL, on several specialized benchmarks. Manual evaluations also showed that Bonito’s generated answers aligned with GPT-4o's logic between 71% and 77% of the time.
Limitations and Future Work
While Bonito represents a significant step forward, several limitations remain:
- Task Scope: The current iteration focuses primarily on QA and NLI. Future work will aim to include generative tasks like summarization and code generation.
- Hallucinations: As with all LLMs, there is a risk of generating factually incorrect synthetic data, which can impact the quality of the fine-tuned model.
- Data Dependency: The method still requires a substantial amount of unannotated domain-specific text to generate a diverse and robust synthetic dataset.
Conclusion
Bonito offers a powerful, open-source alternative to expensive manual data annotation for domain adaptation. By converting raw text into structured tasks, it enables LLMs to achieve high performance in specialized fields while preserving their core instruction-following capabilities.
Summary updated