Technology · Discipline

Gaussian-kernel cluster analysis

A per-cluster length scale from a histogram median, then potential depth, curvature, escape probability, superposition, interference and entanglement as field metrics over an embedding cluster.

CUDA · Inference FabricEmbedding cluster healthCPU reference twins
One cluster's potential
kernel width: the cluster's own length scalenearest cluster
  • 256bins in the shared-memory histogram that finds the median distance
  • 0.4%resolution of that median, held in 10 KB of shared memory
  • 2,000members, the most the CPU spectral metrics will report on

A length scale from a histogram median

One family of my cluster metrics treats a cluster of embeddings as a field rather than a point set. Each member contributes a Gaussian kernel of its distance, the width of the kernel is a per-cluster length scale, and the shape of the resulting potential describes the cluster. The family runs in the Inference Fabric's CUDA engine and is told in Physics as a lens on embeddings.

The length scale is a constant times the median pairwise distance of the cluster, clamped to a documented range. A per-cluster scale makes the metrics independent of the embedding model's units. A tiled kernel bins every distance into a shared-memory histogram and reads the midpoint from the cumulative counts, a histogram median instead of a sort.

Sort
  • store every pairwise distance
  • sort them
  • take the middle one
Histogram in shared memory

the first bin whose running count crosses half; the error is one bin width

Five metrics in one pass, one tiled

The field metrics come from that scale in two kernels. A streaming pass over the members produces five of them, and the one quadratic metric is tiled and bounded.

One streaming pass reads the well
escape: the gap to the nearest cluster, over the scale

Superposition and interference come from the same pass: the spread of member distances and the mean cosine to the centroid. Both stay unclamped; their sign carries information.

All pairs · one tiled kernel

Entanglement, the mean off-diagonal kernel, from the upper triangle only. The Gram matrix is never formed.

Illustrative cross-section: one cluster's potential and a smaller neighbour.

Three metrics kept off the GPU

Three spectral metrics do need the Gram matrix, so they exist as CPU reference code with an explicit limit.

Six field metrics
GPU, every member
›
Three spectral metrics
CPU, need the Gram matrix
the wall: nothing reported beyond
Members per cluster, illustrative scale. The three are coherence index, spectral width and peak count.

I left three metrics off the GPU until they can run without a hidden cap.