Confident Adaptive Language Modeling

Tal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani, Dara Bahri +3 more
7/14/2022
cs.CLcs.LG

No official code found. Best implementation: vikhyat/calm-contrastive-decoding (11 stars, last commit 2023-09-21).

Abstract

Recent advances in Transformer-based large language models (LLMs) have led to significant performance improvements across many tasks. These gains come with a drastic increase in the models' size, potentially leading to slow and costly use at inference time. In practice, however, the series of generations made by LLMs is composed of varying levels of difficulty. While certain predictions truly benefit from the models' full capacity, other continuations are more trivial and can be solved with reduced compute. In this work, we introduce Confident Adaptive Language Modeling (CALM), a framework for dynamically allocating different amounts of compute per input and generation timestep. Early exit decoding involves several challenges that we address here, such as: (1) what confidence measure to use; (2) connecting sequence-level constraints to local per-token exit decisions; and (3) attending back to missing hidden representations due to early exits in previous tokens. Through theoretical analysis and empirical experiments on three diverse text generation tasks, we demonstrate the efficacy of our framework in reducing compute -- potential speedup of up to $\times 3$ -- while provably maintaining high performance.

View on arXivView PDF

Code Implementations(1)

Confident Adaptive Language Modeling 🫶 Contrastive Decoding

111Python, Jupyter NotebookSep 21, 20233 years ago

Similar Papers

Cite this paper

@article{schuster2022confident,
  title  = {Confident Adaptive Language Modeling},
  author = {Tal Schuster and Adam Fisch and Jai Gupta and Mostafa Dehghani and Dara Bahri and Vinh Q. Tran and Yi Tay and Donald Metzler},
  year   = {2022},
  eprint = {2207.07061},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.07061v2}
}

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/2207.07061.svg)](https://codeofpaper.com/paper/2207.07061)

Discussion