English

Language Model Inversion through End-to-End Differentiation

Computation and Language 2026-02-12 v1 Artificial Intelligence

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 1010 and 8080 for targets of length 2020, for several white-box LMs (out-of-the-box).

Keywords

Cite

@article{arxiv.2602.11044,
  title  = {Language Model Inversion through End-to-End Differentiation},
  author = {Kevin Yandoka Denamganaï and Kartic Subr},
  journal= {arXiv preprint arXiv:2602.11044},
  year   = {2026}
}

Comments

24 pages, 5 figures, under review

R2 v1 2026-07-01T10:32:12.075Z