{"slug": "previous-token-prediction-based-llm-near-exact-prompt-reconstruction", "title": "Previous-Token Prediction Based LLM Near-Exact Prompt Reconstruction", "summary": "Researchers introduced PTP (Previous-Token Prediction), a black-box method for near-exact prompt reconstruction from LLM outputs, trained entirely on synthetic data from the target model without auxiliary aids or access to weights/logits. The inverse model, trained via previous-token prediction, outperforms prior work across token-based evaluation metrics and generalizes across datasets and different LLMs.", "body_md": "# Computer Science > Computation and Language\n\n[Submitted on 31 Jul 2026]\n\n# Title:PTP: Previous-Token Prediction based LLM Inversion for Near-Exact Prompt Reconstruction\n\n[View PDF](/pdf/2607.29378)\n\n[HTML (experimental)](https://arxiv.org/html/2607.29378v1)\n\nAbstract:Large language models (LLMs) generate text by auto-regressively sampling the next token. This inherently leads to a many-to-many mapping between prompts and responses, complicating the task of inferring prompts from observed outputs. Prior work on LLM inversion frames prompt recovery as a semantic reconstruction task. They rely on fine-tuning pretrained sequence-to-sequence models on large external datasets--and requiring access to model weights or logits--to generate semantically plausible prompts. In contrast, we present a functional approach to inverting a given LLM in a black-box setting, without auxiliary aids. We train an explicit inverse language model entirely from scratch on data synthetically generated from the target LLM itself. 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. Moreover, it naturally supports diverse prompt reconstructions through sampling, whereby all such prompts induce similar responses under the forward, target LLM. Our approach generalises across datasets and exhibits transferability in reconstructing prompts from responses generated by different LLMs. Further, across the set of token based evaluation metrics for prompt and response reconstructions, our approach outperforms prior work.\n\n### References & Citations\n\nLoading...\n\n# Bibliographic and Citation Tools\n\nBibliographic Explorer\n\n*(*[What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))\nConnected Papers\n\n*(*[What is Connected Papers?](https://www.connectedpapers.com/about))\nLitmaps\n\n*(*[What is Litmaps?](https://www.litmaps.co/))\nscite Smart Citations\n\n*(*[What are Smart Citations?](https://www.scite.ai/))# Code, Data and Media Associated with this Article\n\nalphaXiv\n\n*(*[What is alphaXiv?](https://alphaxiv.org/))\nCatalyzeX Code Finder for Papers\n\n*(*[What is CatalyzeX?](https://www.catalyzex.com))\nDagsHub\n\n*(*[What is DagsHub?](https://dagshub.com/))\nGotit.pub\n\n*(*[What is GotitPub?](http://gotit.pub/faq))\nHugging Face\n\n*(*[What is Huggingface?](https://huggingface.co/huggingface))\nScienceCast\n\n*(*[What is ScienceCast?](https://sciencecast.org/welcome))# Demos\n\n# Recommenders and Search Tools\n\nInfluence Flower\n\n*(*[What are Influence Flowers?](https://influencemap.cmlab.dev/))\nCORE Recommender\n\n*(*[What is CORE?](https://core.ac.uk/services/recommender))# arXivLabs: experimental projects with community collaborators\n\narXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.\n\nBoth individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.\n\nHave an idea for a project that will add value for arXiv's community? [ Learn more about arXivLabs](https://info.arxiv.org/labs/index.html).", "url": "https://wpnews.pro/news/previous-token-prediction-based-llm-near-exact-prompt-reconstruction", "canonical_source": "https://arxiv.org/abs/2607.29378", "published_at": "2026-08-11 20:14:15+00:00", "updated_at": "2026-08-11 20:41:47.774801+00:00", "lang": "en", "topics": ["large-language-models", "artificial-intelligence", "natural-language-processing"], "entities": ["PTP"], "alternates": {"html": "https://wpnews.pro/news/previous-token-prediction-based-llm-near-exact-prompt-reconstruction", "markdown": "https://wpnews.pro/news/previous-token-prediction-based-llm-near-exact-prompt-reconstruction.md", "text": "https://wpnews.pro/news/previous-token-prediction-based-llm-near-exact-prompt-reconstruction.txt", "jsonld": "https://wpnews.pro/news/previous-token-prediction-based-llm-near-exact-prompt-reconstruction.jsonld"}}