Abstract
Despite emerging research on Language Models (LM), few approaches analyse the invertibility of LMs. That is, given a LM and a desirable target output sequence of tokens, determining what input prompts would yield the target output remains an open problem. We formulate this problem as a classical gradient-based optimisation. First, we propose a simple algorithm to achieve end-to-end differentiability of a given (frozen) LM and then find optimised prompts via gradient descent. Our central insight is to view LMs as functions operating on sequences of distributions over tokens (rather than the traditional view as functions on sequences of tokens). Our experiments and ablations demonstrate that our DLM-powered inversion can reliably and efficiently optimise prompts of lengths $10$ and $80$ for targets of length $20$, for several white-box LMs (out-of-the-box).
Abstract (translated)
尽管有关语言模型(Language Models, LM)的研究不断涌现,但很少有方法分析LM的逆向可解性。也就是说,给定一个LM和期望的目标输出序列,确定哪些输入提示可以产生该目标输出仍然是一个悬而未决的问题。我们将这个问题表述为经典的基于梯度的优化问题。首先,我们提出了一种简单的算法,以实现给定的(冻结的)LM在端到端上的可微分性,然后通过梯度下降法找到最优的输入提示。我们的核心见解是将LM视为作用于令牌分布序列上的函数(而不是传统的将其视为作用于令牌序列上的函数)。实验和消融研究表明,在几个白盒语言模型中,我们基于DLM的逆向方法可以可靠且高效地优化长度为10和80的输入提示,以实现目标输出长度为20的目标。
URL
https://arxiv.org/abs/2602.11044