BabyBear: Cheap inference triage for expensive language models

Leila Khalili, Yao You, John Bohannon
5/24/2022
cs.CLcs.LGcs.PF

Official code: PrimerAI/primer-research (19 stars, Python, last commit 2026-01-08).

Abstract

Transformer language models provide superior accuracy over previous models but they are computationally and environmentally expensive. Borrowing the concept of model cascading from computer vision, we introduce BabyBear, a framework for cascading models for natural language processing (NLP) tasks to minimize cost.

Show full abstract

The core strategy is inference triage, exiting early when the least expensive model in the cascade achieves a sufficiently high-confidence prediction. We test BabyBear on several open source data sets related to document classification and entity recognition. We find that for common NLP tasks a high proportion of the inference load can be accomplished with cheap, fast models that have learned by observing a deep learning model. This allows us to reduce the compute cost of large-scale classification jobs by more than 50% while retaining overall accuracy. For named entity recognition, we save 33% of the deep learning compute while maintaining an F1 score higher than 95% on the CoNLL benchmark.

View on arXivView PDF

Code Implementations(1)

195Python, Jupyter NotebookFeb 7, 202210 months ago

Similar Papers

Cite this paper

@article{khalili2022babybear,
  title  = {BabyBear: Cheap inference triage for expensive language models},
  author = {Leila Khalili and Yao You and John Bohannon},
  year   = {2022},
  eprint = {2205.11747},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.11747}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.11747.svg)](https://codeofpaper.com/paper/2205.11747)

Discussion