Researchers reverse-engineer LLM prompts by training a model to predict the previous token

Previous-Token Prediction Based LLM Inversion for Prompt Reconstruction

LLM inversion has usually meant fine-tuning sequence-to-sequence models on large external datasets, with access to weights or logits, to produce semantically plausible prompts. This paper instead trains an inverse language model from scratch on data synthesized by the target LLM itself, using previous-token prediction as the mirror of forward next-token prediction. Working fully black-box, it reconstructs prompts near-exactly, supports diverse sampled reconstructions that all elicit similar responses, transfers across datasets and models, and beats prior work on token-based metrics.

Analogous to forward next-token prediction, our inverse model is trained using previous-token prediction, establishing a generative link between the forward and inverse processes that enables faithful prompt reconstruction.
  1. henry2023

    Wondering if you can input an uncensored response and then backwardly compose a prompt that effectively jailbreaks the given model.

  2. rodhruv

    I don’t think it’s nearly as impressive as it is hyped to be:

    They only ever evaluate on 100 prompts, and the error bars on their headline metrics are +-4-5.

    The headline result (65%) only applies to Qwen3-0.6B chat; for GPT-4o, it’s 11%, and for Llama-2, 17%.

    It’s fine-tuned on 400 ShareGPT prompts, and I suspect most of the gains are due to learning the ShareGPT prompt format. Indeed, if fine-tuned on a different dataset, it only achieves 11%.

    The paper also has several misleading claims, like calling it “black-box” (needs the tokenizer) or “data-free” (only during pretraining, but see their own appendix).

  3. totetsu

    Imagine if you could take the AI marketing slop, or political smear campaigns, texts, and Images, and see the misanthropic sludge that was used as a prompt to generate it.

More from this day

2026-11-19