Saved in:
Bibliographic Details
Main Authors: He, Jerry Zhi-Yang, Pandey, Sashrika, Schrum, Mariah L., Dragan, Anca
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.01768
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929699373973504
author He, Jerry Zhi-Yang
Pandey, Sashrika
Schrum, Mariah L.
Dragan, Anca
author_facet He, Jerry Zhi-Yang
Pandey, Sashrika
Schrum, Mariah L.
Dragan, Anca
contents To deliver high-quality, personalized responses, large language models (LLMs) must effectively incorporate context -- personal, demographic, and cultural information specific to an end-user. For example, asking the model to explain Newton's second law with the context "I am a toddler" should produce a response different from when the context is "I am a physics professor". However, leveraging the context in practice is a nuanced and challenging task, and is often dependent on the specific situation or user base. The model must strike a balance between providing specific, personalized responses and maintaining general applicability. Current solutions, such as prompt-engineering and fine-tuning, require collection of contextually appropriate responses as examples, making them time-consuming and less flexible to use across different contexts. In this work, we introduce Context Steering (CoS) -- a simple, training-free decoding approach that amplifies the influence of the context in next token predictions. CoS computes contextual influence by comparing the output probabilities from two LLM forward passes: one that includes the context and one that does not. By linearly scaling the contextual influence, CoS allows practitioners to flexibly control the degree of personalization for different use cases. We show that CoS can be applied to autoregressive LLMs, and demonstrates strong performance in personalized recommendations. Additionally, we show that CoS can function as a Bayesian Generative model to infer and quantify correlations between open-ended texts, broadening its potential applications.
format Preprint
id arxiv_https___arxiv_org_abs_2405_01768
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Context Steering: Controllable Personalization at Inference Time
He, Jerry Zhi-Yang
Pandey, Sashrika
Schrum, Mariah L.
Dragan, Anca
Computation and Language
Artificial Intelligence
To deliver high-quality, personalized responses, large language models (LLMs) must effectively incorporate context -- personal, demographic, and cultural information specific to an end-user. For example, asking the model to explain Newton's second law with the context "I am a toddler" should produce a response different from when the context is "I am a physics professor". However, leveraging the context in practice is a nuanced and challenging task, and is often dependent on the specific situation or user base. The model must strike a balance between providing specific, personalized responses and maintaining general applicability. Current solutions, such as prompt-engineering and fine-tuning, require collection of contextually appropriate responses as examples, making them time-consuming and less flexible to use across different contexts. In this work, we introduce Context Steering (CoS) -- a simple, training-free decoding approach that amplifies the influence of the context in next token predictions. CoS computes contextual influence by comparing the output probabilities from two LLM forward passes: one that includes the context and one that does not. By linearly scaling the contextual influence, CoS allows practitioners to flexibly control the degree of personalization for different use cases. We show that CoS can be applied to autoregressive LLMs, and demonstrates strong performance in personalized recommendations. Additionally, we show that CoS can function as a Bayesian Generative model to infer and quantify correlations between open-ended texts, broadening its potential applications.
title Context Steering: Controllable Personalization at Inference Time
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2405.01768