HackerPapers

arXiv:2405.15012cs.CL

Extracting Prompts by Inverting LLM Outputs

Collin Zhang, John X. Morris, Vitaly Shmatikov

Abstract

We consider the problem of language model inversion: given outputs of a language model, we seek to extract the prompt that generated these outputs. We develop a new black-box method, output2prompt, that learns to extract prompts without access to the model's logits and without adversarial or jailbreaking queries. In contrast to previous work, output2prompt only needs outputs of normal user queries. To improve memory efficiency, output2prompt employs a new sparse encoding techique. We measure the efficacy of output2prompt on a variety of user and system prompts and demonstrate zero-shot transferability across different LLMs.

arXiv comments
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.LGMachine Learning

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Mar 2025 to Feb 2026. Found in 1 HN submission from May 2024 to May 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • Not as trivially as the forwards direction, unsurprisingly information is lost, but better than you might expect. See for example https://arxiv.org/pdf/2405.15012

      gpmView on HNParent context

    • Do they even need inputs to train on outputs by inferring inputs? Swear I’ve seen papers about this. Not to mention training reward models to grade the output… they could absolutely get around the “we don’t train on your inputs” Also, doesn’t Claude Code count every input as…

      bionhowardView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.