DillanJC/geometric_safety_features: v1.0.0 - Geometric Safety Features for AI Boundary Detection

Read full text
Authors: Dillan Coghlan
Cited by: 0

Abstract

Geometric Safety Features v1.5.0: A Pipeline for Topological Analysis of AI Model Uncertainty This release contains the complete, validated Geometric Safety Features pipeline (Phases 0-5), a novel methodological toolkit for diagnosing instability and uncertainty in AI models through the geometric analysis of their internal embedding spaces. What It Does:The software implements a multi-phase, k-NN-based feature extraction pipeline that moves beyond analyzing model outputs to measure the structural geometry of a model's latent representations. It transforms embedding vectors into interpretable geometric signatures, including static neighborhood properties, dynamic flow fields, trajectory dynamics, and—most critically—local topological constraints. The Key Discovery:Our analysis reveals a counter-intuitive, powerful signal: model uncertainty and safety risk are most strongly predicted by constrained local topology, not by high variance. Topology > Flow > Static Geometry: Features measuring the dimensionality and shape of local neighborhoods (Phase 5) are more predictive than those measuring attraction strength (Phase 1) or scatter (Phase 0). Strongest Signal: The participation_ratio (a measure of how many local dimensions participate in variance) shows a negative correlation with safety (r ≈ -0.53 in borderline regions). Lower values indicate higher risk. Interpretation: Unsafe or uncertain model responses tend to arise from regions of the embedding space that are geometrically "thin" or "narrow"—like corridors where small perturbations lead to large behavioral changes. Implementation & Features:The unified pipeline (mirrorfield.geometry.compute_safety_diagnostics) computes over 20 features across five conceptual phases: Phase 0 (Tier-0): Static k-NN geometry (knn_std_distance, knn_max_distance). Phase 1: Density flow primitives (local_gradient_magnitude, gradient_direction_consistency). Phase 2: "Weather system" dynamics (turbulence_index, thermal_gradient). Phase 3: Trajectory analysis for generative models (drift_rate, curvature). Phase 4: Rule-based mapping to interpretable AI cognitive states (e.g., Searching, Constrained). Phase 5: Topological shape descriptors (participation_ratio, spectral_entropy, local_dimensionality). Usage:The tool is designed for AI safety researchers and practitioners. It can be used to: Stratify evaluation: Identify high-risk "borderline" prompts where models are most likely to flip. Diagnose model states: Determine if a model is operating in a Confident, Uncertain, or Searching regime. Detect data artifacts: Investigate the geometric fingerprints of potential training data corruption (e.g., poisoning). Provide a novel signal for robustness benchmarks and safety evaluations. Citation:If you use this software in your research, please cite the associated Zenodo record.

Fields of Study & Subjects

Adversarial Robustness in Machine Learning Explainable Artificial Intelligence (XAI) Topological and Geometric Data Analysis

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
18 January 2026
Document type
Preprint