Scaling Monosemanticity explores the space of features geometrically: two features are close when the cosine similarity of their feature vectors (the decoder columns) is high. Close features tend to share meaning. Comparing SAEs of different sizes trained on the same activations, the paper also sees feature splitting: one feature of a smaller SAE corresponds to several more specific features of a larger SAE that sit near it, and the larger SAE also contains features with no counterpart nearby in the smaller one.
Decoder matrices have shape , one column per feature, as in the paper.
nearest_features(W_dec, i, k)
k features most cosine-similar to feature i, excluding i itself, as a list of (index, cosine) tuples sorted by decreasing cosine; ties go to the smaller index.split_map(W_small, W_large, tau)
W_small has shape and W_large shape , with the same .tau, the larger feature is a child of it; otherwise the larger feature is new.(children, new): children is a dict mapping every smaller-SAE index (all of them, including those with no children) to the sorted list of its children, and new is the sorted list of new larger-SAE features.ValueError if any decoder column has zero norm.