Abstract: Hubness, the tendency for a few points to
be among the nearest neighbours of a dispro-
portionate number of other points, commonly
arises when applying standard distance mea-
sures to high-dimensional data, often negatively
impacting distance-based analysis. As autore-
gressive large language models (LLMs) operate
on high-dimensional representations, we ask
whether they are also affected by hubness. We
first prove that the only large-scale representa-
tion comparison operation performed by LLMs,
namely that between context and unembedding
vectors to determine continuation probabilities,
is not characterized by the concentration of dis-
tances phenomenon that typically causes the
appearance of nuisance hubness. We then em-
pirically show that this comparison still leads
to a high degree of hubness, but the hubs in this
case do not constitute a disturbance. They are
rather the result of context-modulated frequent
tokens often appearing in the pool of likely
candidates for next token prediction. However,
when other distances are used to compare LLM
representations, we do not have the same the-
oretical guarantees, and, indeed, we see nui-
sance hubs appear. There are two main take-
aways. First, hubness, while omnipresent in
high-dimensional spaces, is not a negative prop-
erty that needs to be mitigated when LLMs are
being used for next token prediction. Second,
when comparing representations from LLMs
using Euclidean or cosine distance, there is a
high risk of nuisance hubs and practitioners
should use mitigation techniques if relevant.
Loading