Controlled Text Generation via Language Model Arithmetic

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Dekoninck, Jasper, Fischer, Marc, Beurer-Kellner, Luca, Vechev, Martin
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913255819051008
author Dekoninck, Jasper
Fischer, Marc
Beurer-Kellner, Luca
Vechev, Martin
author_facet Dekoninck, Jasper
Fischer, Marc
Beurer-Kellner, Luca
Vechev, Martin
contents As Large Language Models (LLMs) are deployed more widely, customization with respect to vocabulary, style, and character becomes more important. In this work, we introduce model arithmetic, a novel inference framework for composing and biasing LLMs without the need for model (re)training or highly specific datasets. In addition, the framework allows for more precise control of generated text than direct prompting and prior controlled text generation (CTG) techniques. Using model arithmetic, we can express prior CTG techniques as simple formulas and naturally extend them to new and more effective formulations. Further, we show that speculative sampling, a technique for efficient LLM sampling, extends to our setting. This enables highly efficient text generation with multiple composed models with only marginal overhead over a single model. Our empirical evaluation demonstrates that model arithmetic allows fine-grained control of generated text while outperforming state-of-the-art on the task of toxicity reduction. We release an open source easy-to-use implementation of our framework at https://github.com/eth-sri/language-model-arithmetic.
format Preprint
id arxiv_https___arxiv_org_abs_2311_14479
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Controlled Text Generation via Language Model Arithmetic
Dekoninck, Jasper
Fischer, Marc
Beurer-Kellner, Luca
Vechev, Martin
Computation and Language
As Large Language Models (LLMs) are deployed more widely, customization with respect to vocabulary, style, and character becomes more important. In this work, we introduce model arithmetic, a novel inference framework for composing and biasing LLMs without the need for model (re)training or highly specific datasets. In addition, the framework allows for more precise control of generated text than direct prompting and prior controlled text generation (CTG) techniques. Using model arithmetic, we can express prior CTG techniques as simple formulas and naturally extend them to new and more effective formulations. Further, we show that speculative sampling, a technique for efficient LLM sampling, extends to our setting. This enables highly efficient text generation with multiple composed models with only marginal overhead over a single model. Our empirical evaluation demonstrates that model arithmetic allows fine-grained control of generated text while outperforming state-of-the-art on the task of toxicity reduction. We release an open source easy-to-use implementation of our framework at https://github.com/eth-sri/language-model-arithmetic.
title Controlled Text Generation via Language Model Arithmetic
topic Computation and Language
url https://arxiv.org/abs/2311.14479