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).


翻译:尽管语言模型(LM)的研究日益兴起,但鲜有方法分析语言模型的可逆性。具体而言,给定一个语言模型和一个期望的目标输出词元序列,确定何种输入提示能产生该目标输出仍是一个未解决的问题。我们将此问题形式化为经典的基于梯度的优化问题。首先,我们提出一种简单算法,实现给定(冻结)语言模型的端到端可微分性,随后通过梯度下降寻找优化后的提示。我们的核心洞见在于将语言模型视为在词元分布序列上操作的函数(而非传统上视为在词元序列上操作的函数)。我们的实验与消融研究表明,对于多个白盒语言模型(开箱即用),我们基于可微分语言模型(DLM)的逆向方法能够可靠且高效地优化长度为 $10$ 和 $80$ 的提示,以生成长度为 $20$ 的目标序列。

0
下载
关闭预览

相关内容

迈向透明人工智能(AI):可解释性语言模型综述
专知会员服务
15+阅读 · 2025年9月29日
【NTU博士论文】让语言模型成为更类人的学习者
专知会员服务
23+阅读 · 2025年9月23日
【博士论文】语言模型与人类偏好对齐,148页pdf
专知会员服务
32+阅读 · 2024年4月21日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
Arxiv
0+阅读 · 2月3日
Arxiv
0+阅读 · 1月28日
VIP会员
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员