GPT, but in reverse: exactly inverting language model outputsGPT, But Backwards: Exactly Inverting Language Model Outputs
Translation in progress — untranslated text is omitted.
Researchers from the University of Manchester and other institutions propose a white-box search algorithm, SODA, which can exactly recover the original input from the output logits of a language model, achieving a 79.5% exact reconstruction rate for random inputs of up to 10 tokens, a 4-fold improvement over the previous strongest method. The method can recover natural language inputs of up to 17 tokens with zero false positives, with a reconstruction rate of 95.7% for natural language inputs; the difficulty of recovery depends mainly on input length and vocabulary size rather than parameter count, and the experiments cover models from 33M to 3B parameters. A proof of concept shows that SODA found 6 backdoor triggers in a poisoned Pythia-1.4B within 1000 iterations, and recovered 139 PII tokens from synthetic user conversations, including 9 passwords and 15 ID numbers.
- Exactly reconstructing the original input from LLM output text or logits is a key primitive for auditing and forensics, but existing methods cannot do it reliably, and the reconstruction result cannot even produce the target output again.
- The authors formalize exact inversion as a discrete optimization problem and propose SODA: it runs an improved version of Adam (debiasing correction, weight decay, periodic state reset and reinitialization) on a continuous relaxation of the one-hot input, constructing the objective function from the output text or top-k logits.
- On the Random dataset, SODA exactly reconstructs 79.5% (length ≤10), which the authors call 4 times that of the strongest baseline; natural language inputs are easier to invert (NL ID 95.7%); exposing only the top-1 logit already yields a considerable reconstruction rate; and they demonstrate recovery of 139 PII tokens and 6 backdoor triggers.
- The authors point out that the method requires white-box access to weights, limiting it to open-source models or internal audits; the text-only setting assumes greedy decoding; exact match decreases as the input gets longer and the length must be specified in advance; experiments cover only decoder-only models within 3B parameters, and MoE is untested.
The authors provide the method for exactly recovering the input from the output logits and success rate data; model services that expose logits in their API can use this to assess the risk of input leakage.