GPT, But Backwards: Exactly Inverting Language Model Outputs
On the map: LLM safety and security → Machine unlearning
Abstract (arXiv)
The task of reconstructing unknown textual inputs to language models is a fundamental auditing primitive that allows us to assess the model's vulnerability to a range of security issues, including stealing hidden system prompts, detecting backdoors, and leaking private data. Existing inversion works assume access to differing levels of information (e.g. requiring input-output examples, the model parameters, intermediate activations or output logits) but oftentimes fail to fully reconstruct the desired input. In this paper, we present the Sparse One-hot Discrete Adam (SODA) algorithm, a search-based inversion method that can accurately reconstruct the input text, given white-box access to the language model and its output. Our experiments demonstrate for the first time that exact language model inversion is possible on both natural language and random inputs. Indeed, SODA achieves respectively 98% and 79% reconstruction rates on inputs with lengths up to 10 tokens. Furthermore, we show that input length and vocabulary size have a far greater impact on the probability of a successful reconstruction than the size of the language model itself, thus allowing us to scale to models from 33M to 3B parameters.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Machine unlearning, one of 12 directions in LLM safety and security. Builds on 35 of its 50 references that are in the map. First posted on arXiv 2 Jul 2025.
Builds on
35 of 50 references.
References · 35
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2024Qwen2.5 Technical Reportcited by 4,713
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2021Ethical and social risks of harm from Language Modelscited by 957
- 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Promptscited by 520
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agentscited by 476
- 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
23 more
- 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 358
- 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 329
- 2021Gradient-based Adversarial Attacks against Text Transformerscited by 233
- 2020Information Leakage in Embedding Modelscited by 199
- 2023Text Embeddings Reveal (Almost) As Much As Textcited by 189
- 2023Automatically Auditing Large Language Models via Discrete Optimizationcited by 187
- 2023Open Sesame! Universal Black Box Jailbreaking of Large Language Modelscited by 128
- 2024Improved Techniques for Optimization-Based Jailbreaking on Large Language Modelscited by 98
- 2023Sentence Embedding Leaks More Information than You Expect: Generative Embedding Inversion Attack to Recover the Whole Sentencecited by 81
- 2023Language Model Inversioncited by 66
- 2022Toward Human Readable Prompt Tuning: Kubrick's The Shining is a good movie, and a good prompt too?cited by 49
- 2024Prompt Stealing Attacks Against Large Language Modelscited by 39
- 2024Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Samplingcited by 33
- 2024Trojan Detection in Large Language Models: Insights from The Trojan Detection Challengecited by 14
- 2025Prompt Inversion Attack against Collaborative Inference of Large Language Modelscited by 14
- 2025Better Language Model Inversion by Compactly Representing Next-Token Distributionscited by 9
- 2024InversionView: A General-Purpose Method for Reading Information from Neural Activationscited by 7
- 2024DORY: Deliberative Prompt Recovery for LLMcited by 7
- 2023Input Reconstruction Attack against Vertical Federated Large Language Modelscited by 5
- 2024Reverse Prompt Engineeringcited by 5
- 2024Was it Slander? Towards Exact Inversion of Generative Language Modelscited by 3
- 2024Uncovering Hidden Intentions: Exploring Prompt Recovery for Deeper Insights into Generated Textscited by 2
- 2024Advancing Prompt Recovery in NLP: A Deep Dive into the Integration of Gemma-2b-it and Phi2 Modelscited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.