Decision Potential Surface: A Theoretical and Practical Approximation of Large Language Model Decision Boundary

Zi Liang, Zhiyao Wu, Haoyang Shang, Yulin Jin, Qingqing Ye, Huadi Zheng, Peizhao Hu, Haibo Hu

TL;DR

This paper introduces the Decision Potential Surface (DPS), a novel theoretical framework that maps out the complex decision boundaries of Large Language Models (LLMs) by analyzing the log-likelihood gap between the top two generated sequences. To make this concept computationally practical, the authors develop $K$-DPS, a finite-sampling algorithm with rigorous error bounds that allows researchers to geometrically visualize and analyze critical LLM behaviors like safety alignment and machine unlearning for the first time.

What Problem Does This Paper Address?

In traditional machine learning, a model's decision boundary—the subspace where different classification outcomes have equal probability—is a foundational tool for understanding robustness, generalization, and internal behavior. However, calculating this boundary for modern LLMs is computationally impossible.

Because LLMs generate text autoregressively (token-by-token) over massive vocabularies, the sequence-level output space grows exponentially ($V^{N_r}$). For instance, an 8-billion parameter model with a 32,768-token context window can produce roughly $10^{169,790}$ distinct decision regions. As a result, previous studies have been forced to either simplify the problem into toy binary classification scenarios or use the concept of decision boundaries purely as a metaphor. This paper tackles the challenge of defining and efficiently constructing a mathematically rigorous, scalable decision boundary for full-scale language models.

Methods

The authors propose the Decision Potential Surface (DPS). Instead of trying to evaluate every possible text continuation simultaneously, DPS focuses on the local pairwise competition between the top two most likely sequences for any given prompt. The Decision Potential Function (DPF) calculates the squared difference in log-likelihoods between these top two sequences. Mathematically, the authors prove that the 0-isohypse (the contour line where the surface height is exactly zero) corresponds perfectly to the true decision boundary of the LLM.

To make this tractable, they introduce $K$-DPS, an approximation algorithm that requires only $K$ independent sequence samples per input prompt. They derive explicit upper bounds for absolute error, expected error, and error concentration, proving that the approximation error shrinks predictably at a rate of $1/\sqrt{K}$. This allows practitioners to trade off computational budget (sampling size) against approximation accuracy.

Datasets

The authors validated $K$-DPS across several open-source LLMs (including Llama-3.1, Mistral, Zephyr, and the Pythia family) using a variety of standard datasets to simulate different input distributions:

  • Pre-training/Unsupervised Text: Wikipedia Mini
  • Supervised Fine-Tuning (SFT) & Alignment: Tulu-3-SFT-MIX, OpenO1-SFT, HH-RLHF, and Alpaca
  • Adversarial Safety: AdvBench (used to evaluate jailbreak prompts)
  • Machine Unlearning: The Harry Potter book series was utilized as the "forget" corpus, paired with a Wikipedia subset as the "retain" set.

Key Insights and Ideas

  • The Top-2 Simplification is Mathematically Sound: A common misconception is that finding a multi-class boundary requires evaluating all classes at once. The authors demonstrate that a multi-class boundary is simply the union of local pairwise boundaries where the top two classes tie, justifying their focus on just the top two sequences.
  • The Geometry of Safety Alignment: Safety alignment fundamentally reshapes the model's internal decision landscape. Aligned models exhibit dramatically smoother and flatter decision surfaces, creating broad, low-potential basins that strongly favor refusal responses.
  • Jailbreaks Target "Vulnerability Spikes": Unaligned models possess narrow, high-confidence "vulnerability spikes" in their decision landscapes. Jailbreak prompts succeed by finding these sharp, hidden regions. Alignment mitigates jailbreaks by flattening these spikes entirely.
  • Visualizing Unlearning Damage: For the first time, researchers can visually inspect the side effects of machine unlearning. Naive unlearning methods (like Gradient Ascent) shatter the decision manifold into a jagged, fragmented mess, whereas proper retention training preserves structural smoothness.

Key Results

  • Rapid Convergence: Empirical testing confirmed that $K$-DPS values quickly converge to high-budget reference baselines. As shown in the paper's experiments, a sampling size of $K = 10,000$ ensures an absolute error below 64 with 90% confidence.
  • Stability Across Model Scales: The sample budget required for a stable estimation does not increase with model size. Testing across the Pythia family (70M to 1.4B parameters) revealed that for $K \ge 1,000$, the estimation discrepancy drops to machine precision ($10^{-14}$).

Limitations and Future Work

  • The Long-Generation Bottleneck: For very long, high-entropy text generation (e.g., long-form reasoning tasks up to 8K tokens), the joint probability of any single exact sequence becomes infinitesimally small (e.g., $5.86 \times 10^{-13}$ for Llama-3.1-8B). In these specific scenarios, the sample budget $K$ required to reliably capture the true top-2 sequences becomes impractically large.
  • Localized Alternatives: To circumvent this limitation in long open-ended settings, the authors suggest that future applications should rely on token-level DPS ($N_r = 1$), prefix-conditioned token-level DPS, or shorter-window sequence DPS rather than full-sequence boundaries.

Summary updated

BibTeX
@misc{liang2025decision,
  author = {Zi Liang and Zhiyao Wu and Haoyang Shang and Yulin Jin and Qingqing Ye and Huadi Zheng and Peizhao Hu and Haibo Hu},
  title = {{Decision Potential Surface: A Theoretical and Practical Approximation of Large Language Model Decision Boundary}},
  year = {2025},
  eprint = {2510.03271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.03271},
}
Figure