atlas

Research map / Large language models / Language, safety and interpretability

Controlled Text Generation via Language Model Arithmetic

ICLR 2024 · Large language models › Language, safety and interpretability · approach: Zero-shot machine-text detection · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces model arithmetic, a framework that composes and biases LLMs via formulas over output distributions (weighted-KL optimal combinations, a union operator), and generalizes speculative sampling to reduce model calls.

Problem

Controlled text generation lacks expressive, interpretable, and efficient ways to combine multiple attributes and to steer LLMs away from attributes without retraining or task-specific data.

Approach

Define output distributions as weighted-KL optima over input distributions, yielding a formula algebra (linear combinations, a max-based union operator, classifier terms) and extend speculative sampling so expensive formula terms are evaluated lazily via sub-formulas as proposal models.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use the union operator for toxicity reduction instead of PreAddLlama-2-13b model arithmetic · /pol/toxicity: 0.20751357989225 -> 0.2014622639518Helped
Add a toxicity classifier term to union-based toxicity reduction (ablation)Llama-2-13b model arithmetic · /pol/toxicity: 0.2014622639518 -> 0.1623Helped
Add a toxicity classifier term to union-based toxicity reduction (ablation)Pythia-12b model arithmetic · /pol/toxicity: 0.1702074087756 -> 0.1478178452382Helped
Add a toxicity classifier term to union-based toxicity reduction (ablation)MPT-7b model arithmetic · /pol/toxicity: 0.19345939548285 -> 0.1737395688082Helped
Increase union bias strength from 0.96 to 0.99 (ablation)Model arithmetic toxicity reduction · /pol/toxicity: 0.2014622639518 -> 0.18614473078765; 0.1702074087756 -> 0.17138050593874998; 0.19345939548285 -> 0.18750884556234998Mixed
Increase union bias strength from 0.96 to 0.99 (ablation)Model arithmetic toxicity reduction · /pol/perplexity: 11.078353402312155 -> 12.053630436852684Hurt
Add a classifier term to union-based sentiment control (ablation)Llama-2-13b model arithmetic · IMDB negative reviews to positivesentiment: 0.39331756591796874 -> 0.46628311157226565Helped
Add a classifier term to union-based sentiment control (ablation)Llama-2-13b model arithmetic · IMDB positive reviews to negativenegative sentiment: 0.4691995391845703 -> 0.5239201202392578Helped
Use speculative sampling for model arithmeticLlama-2-13b-Chat with F1 · Speculative sampling, F1time per token [ms]: 97.0255337245698 -> 43.25989481778973Helped
Use speculative sampling for model arithmeticLlama-2-13b-Chat with F1 · Speculative sampling, F1calls per token: 4.0 -> 1.3165171374500595Helped
Increase the coefficient λ in M + λM_a (ablation)Model arithmetic speculative sampling · M + λM_amodel calls per tokenHurt
Use the union operator together with a classifier rather than union alone (ablation)Model arithmetic sentiment control · IMDB negative reviews to positiveperplexity: 10.170443906469423 -> 10.398901188444746Mixed

Surprising findings

Limitations

Experimental setup

Datasets: /pol/ dataset Jigsaw toxicity dataset Alpaca IMDB movie reviews

Benchmarks: /pol/ toxicity IMDB sentiment control Alpaca attribute control

Metrics: Perspective API toxicity score sentiment classifier score perplexity GPT-4 win/lose/draw preference model calls per token time per token

Baselines: SelfDebias FUDGE PreAdd GPT-4 preference judging

Builds on: speculative sampling FUDGE PreAdd SelfDebias

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy