从隐藏状态恢复输入文本:基于梯度的解码器专用语言模型反演研究
Recovering Input Text from Hidden States: Study of Gradient-Based Inversion of Decoder-Only Language Models
AI总结:
研究解码器专用语言模型最后层隐藏状态的反演问题,提出连续嵌入空间优化方法,通过离散损失评估恢复正确性,发现高频功能词是主要失败原因,内容词几乎完美恢复。
摘要:
本文研究隐藏状态反演问题:从解码器专用语言模型的最后层隐藏状态恢复原始输入token序列。我们不将反演视为一次性重建,而是将其作为连续嵌入空间优化进行研究,其中软代理在搜索过程中被驱动向泄露目标,而不进行任何硬token投影,仅在内部循环结束时提交一个token。这一设计选择有两个主要关注点。首先,保持优化完全在连续空间中暴露了丰富的内部信号:真实token的秩轨迹、每个位置的损失曲线以及提交时测量的离散损失。其次,离散损失允许通过累积离散损失评估恢复的正确性。我们进一步分析哪些token破坏了重建,并发现明显的类别不对称性:嵌入矩阵密集区域中带空格前缀的高频功能词主导了失败,而内容词几乎完美恢复。在10-token的C4提示上,随着候选窗口扩大,精确匹配率从66.9%上升到97.5%(平均相似度0.994),证实大多数错误是可恢复的接近命中而非真正歧义。与已发布的SIPIT参考比较表明:每步硬投影更快,但连续公式使优化可观察且其失败可检测。结果表明,GPT-2的最后层隐藏状态与原始文本一样敏感。
英文摘要:
This work studies the hidden-state inversion problem: recovering the original input token sequence of a decoder-only language model from its last-layer hidden states. Rather than treating inversion as a one-shot reconstruction, we study it as a continuous embedding-space optimisation in which a soft proxy is driven towards the leaked target without any hard-token projection during the search, and a token is committed only once, at the end of the inner loop. This design choice has two consequences which are the main focus of this paper. First, keeping the optimisation entirely in continuous space exposes a rich set of internal signals: rank trajectories of the ground-truth token, per-position loss curves, and a discrete loss measured at commit time. Second, the discrete loss allows assessing the correctness of recovery via cumulative discrete loss. We further analyse which tokens break the reconstructions and find a sharp categorical asymmetry: space-prefixed, high-frequency function words in dense regions of the embedding matrix dominate the failures, while content-bearing tokens are recovered almost perfectly. On 10-token C4 prompts the exact-match rate rises from 66.9% to 97.5% (mean similarity 0.994) as the candidate window is widened, confirming that most errors are recoverable near-misses rather than genuine ambiguities. A comparison with the released SIPIT reference situates these findings: per-step hard projection is faster, but the continuous formulation is what makes the optimisation observable and its failures detectable. The results show that last-layer hidden states of GPT-2 are as sensitive as the original text.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。