Rep2Text: Decoding Full Text from a Single LLM Token Representation

Haiyan Zhao, Zirui He, Fan Yang, Ali Payani, Mengnan Du · DOI

Abstract

Recent advancements in Large Language Models (LLMs) have raised questions about the internal representations they generate. This paper introduces Rep2Text, a framework demonstrating that a single "last-token" hidden state—the vector immediately preceding next-token prediction—retains enough compressed information to reconstruct over half of the original input sequence. Our findings reveal that LLMs function as potent information bottlenecks, preserving high-level semantic meaning even when exact syntax is lost. This work has significant implications for model interpretability and data privacy.

Introduction

While LLMs are ubiquitous, their internal mechanisms remain largely opaque. A central concept is the information bottleneck: as a model processes a sequence, it compresses the input into a series of mathematical vectors. Previous research into "inverting" these representations typically utilized entire sequences of vectors. Rep2Text addresses a more challenging question: can the original input be recovered from just the final token's representation? Understanding this is vital for interpretability—identifying what information the model prioritizes—and privacy, as it determines if sensitive data can be extracted from isolated model activations.

Methodology

The Rep2Text framework consists of two primary components designed to decompress a hidden state back into human-readable text:

  1. The Adapter: A trainable two-layer Multi-Layer Perceptron (MLP) featuring gated skip connections. The adapter maps the hidden state from a "target" model (e.g., Llama-3) into the embedding space of a "decoding" model, effectively translating internal representations into a format the decoder can process.
  2. The Decoding LLM: A standard LLM that receives the projected embeddings and autoregressively reconstructs the input text token-by-token.
The Rep2Text architecture, illustrating the flow from the target model's hidden state through the Adapter to the Decoding LLM.

The authors evaluated two training regimes: adapter-only fine-tuning (with a frozen LLM) and joint fine-tuning (using LoRA). Results indicated that the adapter alone performs the majority of the reconstruction task.

Experimental Setup

The framework was trained and evaluated using The Pile (Wikipedia), with 640K sequences for adapter training and 960K for joint fine-tuning. To assess generalization, the authors tested the system on Out-of-Distribution (OOD) Clinical Notes—fictional medical data generated by GPT-4-mini to mimic the MIMIC-III dataset.

Key Results and Insights

Layer-wise Information Density

Information is not uniformly distributed across the model's depth. Analysis shows that early-to-middle layers (L10–L15) are optimal for literal, word-for-word recovery. In deeper layers, representations become increasingly abstract, prioritizing thematic "topic" information over specific syntactic details.

Layer-wise inversion performance across various metrics, showing a peak in literal recovery (ROUGE) at middle layers.

Performance Metrics

  • Recovery Rate: For 16-token sequences, Rep2Text recovered approximately 50% of original tokens (ROUGE-1 ~0.48–0.52).
  • Semantic Integrity: Despite lower literal recovery for longer sequences, the Topic Score (evaluated by an LLM-as-a-judge) remained consistently high, often exceeding 0.90. This suggests the "gist" of the input is almost always preserved.
  • Sequence Length Sensitivity: Performance degrades as input length increases. While 8-token sequences are nearly perfectly recoverable, 64-token sequences see ROUGE-1 scores drop to ~0.3, though the general topic remains identifiable.

The Platonic Representation Hypothesis

The framework successfully decodes representations even when the target and decoding models differ (e.g., Llama-3.1-8B decoding Mistral-7B). This supports the hypothesis that different models converge on a shared, "platonic" method of representing semantic concepts.

Privacy Implications

The ability to recover 13% of OOD medical notes with high fidelity poses a significant privacy risk. If model activations (hidden states) are exposed, sensitive input data could potentially be reconstructed by an adversary using similar inversion techniques.

Conclusion and Future Work

Rep2Text proves that a single token representation is a "leaky" bottleneck. However, the method currently faces a "16-token wall," where reconstruction quality drops significantly for longer sequences. Future research will explore decoding representations from models engaged in complex reasoning tasks to determine if internal "chains of thought" can be externalized into readable text.

Summary updated

BibTeX
@inproceedings{zhao2026rep,
  author = {Haiyan Zhao and Zirui He and Fan Yang and Ali Payani and Mengnan Du},
  title = {{Rep2Text: Decoding Full Text from a Single LLM Token Representation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OET7WYchkH},
}
Figure