Back
2026

AI Safety / Research

HyperGuard Diffusion

A safety research suite that detects unsafe prompts by modelling diffusion-LLM hidden-state trajectories in hyperbolic space.

View repository

dLLM

model family

Lorentz

latent geometry

AUROC

core evaluation

Python
PyTorch
Diffusion LLMs
Hyperbolic Geometry

Overview

HyperGuard studies safety signals that emerge inside diffusion-based language models while they iteratively denoise a response. Instead of judging only the final text, the system captures intermediate hidden states, treats them as a trajectory, and learns the boundary between safe and unsafe behaviour.

Challenge

Diffusion language models expose a very different generation process from autoregressive LLMs. The project needed a way to turn high-dimensional, step-dependent activations into a stable signal that could separate benign prompts from jailbreaks and other unsafe inputs.

Outcome

The repository delivers an end-to-end research pipeline for probe extraction, Lorentz-space projection, hyperbolic SVDD training, cached or live evaluation, and comparisons with Euclidean baselines. It also brings together DiffuGuard, DIJA attack experiments, layer analysis, and multimodal extensions.

Technical approach

From the research question to a working system.

  1. 01

    Capture mean-pooled hidden states at selected denoising steps from LLaDA-style models.

  2. 02

    Project 4,096-dimensional probes onto a Lorentz hyperboloid and learn a soft safety boundary with hyperbolic SVDD.

  3. 03

    Evaluate held-out prompts with AUROC, AUPR, attack-success rate, and full confusion-matrix metrics.