Abstract
Modern safety alignment techniques like RLHF aim to prevent neural networks from generating harmful content. However, this work investigates whether the underlying architectures of models like Transformers and Diffusion models are mathematically capable of producing any arbitrary output. By analyzing the property of surjectivity—where every point in the output space has a corresponding input—we show that most modern architectures are "almost always" surjective. This suggests that safety fine-tuning may be fundamentally unable to prevent adversarial "jailbreaks" at a structural level.
Introduction
As generative AI systems scale, ensuring they do not produce harmful or copyrighted content has become a primary concern. Current approaches rely heavily on "safety alignment" during training. However, a critical theoretical question remains: is it possible to guarantee that a model cannot produce a specific output?
This paper addresses this by examining the surjectivity of neural networks. If a network is surjective, its range covers the entire output space, meaning for any target output, there exists an input that produces it. If modern architectures are inherently surjective, then "jailbreaking" is not merely a failure of current filters but a mathematical property of the model's design.
Methodology
The study utilizes differential topology to analyze neural network layers as smooth, continuous functions. Unlike standard optimization-focused research, this approach allows for rigorous proofs regarding the range of these functions.
Key mathematical tools employed include:
- Brouwer’s Fixed Point Theorem: Applied to demonstrate that "Pre-LayerNorm" configurations—standard in modern Transformers—render the resulting layers surjective.
- Degree Theory and Homotopy: Used to analyze complex layers like MLPs and Linear Attention by deforming them into simpler, known surjective functions.
- Probabilistic Formalism: The authors prove that surjectivity holds "almost always," meaning it applies to all parameter configurations except for a set of measure zero.
To validate these theoretical findings, the authors used a gradient-descent-based heuristic (Algorithm 1) to "invert" models. For instance, they successfully found input embeddings for GPT-2 that forced it to output specific 38-word sentences from future news articles not present in its training data.
Key Results: The Surjectivity of Modern Architectures
The analysis reveals that many common architectural choices directly contribute to surjectivity. Notably, the "Pre-LayerNorm" structure, where LayerNorm precedes a residual connection, acts as a "surjectivity engine." While standard Softmax Attention or ReLU-based MLPs may not be surjective on their own, the addition of Pre-LayerNorm or the use of LeakyReLU activations ensures the entire block covers the output space.
The findings imply that Transformers, Diffusion models (using deterministic ODE solvers), and common robotics policy networks are all surjective. This suggests that "train-for-safety" paradigms like RLHF are likely insufficient as a sole defense, as they cannot mathematically eliminate harmful outputs from the model's potential range.
Discussion and Limitations
While the theoretical proofs are robust in continuous embedding space, practical LLMs operate on discrete tokens. Although "suffix-injection" attacks suggest the gap between continuous embeddings and discrete tokens is narrowing, mapping an adversarial embedding back to human-readable text remains a challenge.
Furthermore, the existence of a "jailbreak" input does not imply it is easy to find. The computational complexity of finding a pre-image can be high. Future research is needed to determine the minimum information an attacker requires to reconstruct problematic inputs, such as how many tokens of a copyrighted work are needed to elicit the remainder.
Conclusion
This work demonstrates that the very building blocks of modern AI—residual connections, LayerNorm, and specific activations—make models behaviorally "uncageable." Surjectivity decouples risk from capability; no matter how well-aligned a model's training data is, the potential for any output remains an inherent property of the architecture.
Summary updated