不靠反向传播,用潜在后验优化提示词来引导模型行为
Elicitation without Backpropagation: Steering Model Behavior by Optimizing the Latent Posterior
- 通过潜在后验建模,将提示词优化转化为对先验样本的采样与重要性加权
- 无需前向传播或反向传播,单次采样可支持多个目标函数的高效优化
- 适用于需要快速响应多目标引导的场景,如生成质量控制、语法正确性约束
在变换器行为的潜在后验模型中,下一个词的概率分布来自基于上下文的潜在预测模型后验,经混合生成延续。我们利用该模型在贝叶斯滤波变换器(BFTs)中的精确性——这些BFTs在分层先验序列上元学习得到——提出一种新方法:后验前缀调优(PPT),用于从变换器中“诱出”期望行为:给定对延续的效用函数,寻找能使预期效用最高的提示。对于一个BFT,诱出目标可分解为潜在后验形式,其梯度仅需从先验样本中估计即可。PPT优化一个硬提示分布的参数:先通过预测蒙特卡洛(PMC)从BFT中一次性抽取先验样本,再以这些样本为基础,通过重要性采样估计梯度。整个优化过程不进行变换器前向计算,也不对变换器进行反向传播;且先验样本与效用无关,因此一套样本即可支持任意数量效用函数的诱出,边际成本极低。我们在贝塔-伯努利和强化瓮模型的BFT上,针对三种效用函数(逆交叉熵、频率匹配、Dyck有效性)验证了PPT的有效性。
原文摘要 · Abstract (English)
In the \emph{latent posterior model} of transformer behavior, the next-token distribution arises from a posterior over latent predictive models conditioned on the context, mixed to generate continuations. We exploit this model in settings where it is exact, namely Bayes-filtered transformers (BFTs) meta-learned on sequences from a hierarchical prior, to introduce \textbf{Posterior Prefix Tuning (PPT)}, a new method for \emph{eliciting} behavior from a transformer: given a utility function on continuations, find a prompt under which the transformer generates continuations of high expected utility. For a BFT, the elicitation objective factors through the latent posterior, and the gradient of this objective can be estimated from samples of the prior alone. PPT optimizes the parameters of a distribution over hard prompts: it draws prior samples once from the BFT via predictive Monte Carlo (PMC), then estimates the gradient by importance sampling against them. The optimization performs no transformer forward passes and no backpropagation through the transformer, and the prior samples are utility-independent, so a single set of samples drives elicitation against any number of utilities at negligible marginal cost. We validate PPT on Beta--Bernoulli and reinforced urn BFTs across three utility families (reverse cross-entropy, frequency matching, Dyck validity).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。