Manuscript Offprint

arXiv:2609.39880

PassGPT+: Leveraging Linguistic Priors for Password Modeling

Rajneesh Anand, Neeraj Lakshmanan, Masoud Yari

Abstract

Passwords remain the dominant online authentication mechanism, and understanding how humans choose them is essential for defensive strength estimation and attack simulation alike. Recent learning-based approaches such as PassGAN and PassGPT have shown that deep generative models can learn password structure directly from leaked corpora. However, both train from random initialization on password data alone. The role of linguistic prior knowledge in password modeling, and what it reveals about how humans create secrets, remains largely underexplored. Here, we address this gap with PassGPT+, which adapts the linguistic prior of GPT-2 to password observations through character-aware tokenization. We also introduce PassDiffusion, the first absorbing-state discrete diffusion model for password generation, as a probe of whether non-autoregressive approaches are competitive. On the RockYou benchmark, PassGPT+ recovers 22.53% of held-out passwords at 10810^{8} guesses, a 16% relative gain over PassGPT, and retains 79% of this match rate when transferred without retraining to a disjoint 2020 leak dataset, demonstrating that linguistic priors capture persistent regularities of human password generation. PassDiffusion underperforms by two to three orders of magnitude, indicating that autoregressive modeling is

*Corresponding author

Email address: may322@lehigh.edu (Masoud Yari) substantially better matched than iterative denoising to the discrete, exact-match nature of password generation.

Keywords: password guessing, language models, transfer learning, GPT-2, discrete diffusion, authentication security

1. Introduction

Passwords continue to serve as the most widely used authentication mechanism across digital platforms, despite the availability of alternative technologies such as biometrics and hardware tokens [1, 2]. Their dominance is largely due to their simplicity, ease of deployment, and familiarity among both users and developers. However, this widespread reliance on passwords comes with a serious downside: large-scale password leaks have repeatedly shown that users tend to pick weak and predictable passwords [3, 4]. As these leaked datasets grow in size and frequency, they provide attackers with a rich source of information that can be used to crack password hashes and compromise user accounts.

Traditionally, password guessing has been carried out using rule-based tools such as HashCat [5] and John the Ripper [6], which apply heuristics like dictionary attacks, leet speak transformations, and word concatenation to expand a base dictionary into a large pool of candidate passwords. While these tools are remarkably efficient at generating matches quickly, they are fundamentally limited by the scope of their hand-crafted rules. Extending them requires specialized expertise and manual effort, and each rule set can only capture a specific subset of the password space [7, 8].

To move beyond these limitations, researchers have turned to deep learning. [9] introduced PassGAN, the first approach to use Generative Adversarial Networks (GANs) for password guessing. PassGAN uses the Improved Wasserstein GAN (IWGAN) [10] framework to learn the distribution of real passwords from the RockYou leak without requiring any prior knowledge about password structures. Although PassGAN showed that machine learning could autonomously discover password patterns, it suffered from issues such as low sample unique-ness and the inability to provide explicit probability estimates over generated passwords.

More recently, [11] proposed PassGPT, an autoregressive language model based on the GPT-2 architecture [12] that is trained from scratch on password leaks. PassGPT addressed several of PassGAN's shortcomings by modeling the conditional distribution of characters in a password, enabling features like guided generation under arbitrary constraints and explicit probability estimation. PassGPT was shown to outperform PassGAN by guessing roughly 20% more previously unseen passwords. Follow-up work such as PagPassGPT [13] further improved upon PassGPT by incorporating pattern structure information to guide the generation process. Other approaches have explored normalizing flows [14], recurrent neural networks [15], and more recently, adversarial ranking frameworks [16] for password guessing.

However, a key aspect that remains underexplored in the existing literature is the role of prior beliefs in password modeling. Both PassGAN and PassGPT train their respective architectures from random initialization using only password data. This means that models must learn all sequential pattern recognition from scratch, ignoring the rich linguistic structures and semantic rules that humans naturally rely on when creating passwords. Without incorporating this prior knowledge into the statistical model, existing models may struggle to generalize beyond the specific datasets on which they were trained, missing the underlying cognitive logic that often drives password formulations [17, 18, 19].

Our contributions.. In this work, we investigate whether the priors encoded in the foundation models extend to the domain of password guessing. We show that considering the prior knowledge encoded in the foundation model on password observations in training our model significantly outperforms PassGPT's from scratch strategy, demonstrating that the sequential structure encoded in large-scale language priors captures regularities of human-chosen passwords. We provide a systematic comparison across the seven approaches: PassGAN, PassGAN*, PassGPT, PassVQT, HashCat Best64, PassDiffusion, and our model

PassGPT+ on the RockYou benchmark, analyzing match rates, uniqueness of generated passwords, and the role of training configuration choices such as the number of update epochs and the inclusion of duplicate passwords. We discuss the architectural and inductive-bias differences that drive the observed performance gains, offering practical guidance for future work on foundation-model-based password modeling.

(a)

Figure

(b)

Figure 1: Proposed architectures for password generation. (a) PassGPT+: a 12-layer causal Transformer decoder that adapts a variant of GPT-2 architecture and is trained using its weights through character-level tokenization. Input characters are mapped to GPT-2 BPE token IDs and processed through 12 masked self-attention blocks (12 heads, head dim 64) with feed-forward expansion (4× hidden dim), layer normalization, and residual connections. Generation is seeded with a random in-distribution character rather than the standard BOS token, avoiding out-of-distribution initialization. (b) PassDiffusion (or PassDiff): an absorbing-state discrete diffusion model for password generation. A real password x0x_0 is corrupted via forward masking q(xt∣x0)q(x_t \mid x_0) over T=1000T = 1000 timesteps, producing a progressively masked sequence xtx_t. A bidirectional Transformer encoder (6 layers, 8 heads, hidden dim 256) conditioned on timestep tt learns to predict x0x_0 from xtx_t. At inference, passwords are generated by iterative reverse unmasking over 200 steps from a fully masked sequence.

References (40)