GPT, But Backwards: Exactly Inverting Language Model Outputs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Skapars, Adrians, Manino, Edoardo, Sun, Youcheng, Cordeiro, Lucas C.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915608166137856
author Skapars, Adrians
Manino, Edoardo
Sun, Youcheng
Cordeiro, Lucas C.
author_facet Skapars, Adrians
Manino, Edoardo
Sun, Youcheng
Cordeiro, Lucas C.
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2507_01693
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle GPT, But Backwards: Exactly Inverting Language Model Outputs
Skapars, Adrians
Manino, Edoardo
Sun, Youcheng
Cordeiro, Lucas C.
Machine Learning
Artificial Intelligence
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.
title GPT, But Backwards: Exactly Inverting Language Model Outputs
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2507.01693