<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Billie M</title>
    <description>The latest articles on DEV Community by Billie M (@billiem).</description>
    <link>https://dev.to/billiem</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4026133%2F586d7cf8-31f9-42d7-85f6-83acd83fa619.png</url>
      <title>DEV Community: Billie M</title>
      <link>https://dev.to/billiem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/billiem"/>
    <language>en</language>
    <item>
      <title>Your embedding axes can move while cosine neighbours stay put</title>
      <dc:creator>Billie M</dc:creator>
      <pubDate>Sun, 12 Jul 2026 16:30:49 +0000</pubDate>
      <link>https://dev.to/billiem/your-embedding-axes-can-move-while-cosine-neighbours-stay-put-377f</link>
      <guid>https://dev.to/billiem/your-embedding-axes-can-move-while-cosine-neighbours-stay-put-377f</guid>
      <description>&lt;p&gt;An embedding can look substantially different after an orthogonal change of basis, even though its cosine similarities have not changed. I built a small browser instrument that makes that mismatch visible: the points move, the axes change, and every phrase keeps the same five cosine neighbours.&lt;/p&gt;

&lt;p&gt;The measured numerical drift stays below &lt;code&gt;2e-15&lt;/code&gt; across 180 short phrases embedded into 384 dimensions with MiniLM. That is the narrow result. It is not a claim that every transformation preserves an embedding, or that individual axes can never be useful.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://billiem.uk/posts/embedding-tours/interactives/embedding-tours/" rel="noopener noreferrer"&gt;working embedding-tours instrument is on billiem.uk&lt;/a&gt;. It is not embedded here. Open it to cycle through raw coordinate pairs, PCA pairs and a seeded grand tour, then use the basis control in raw-coordinate mode to switch between the original and orthogonally transformed coordinates.&lt;/p&gt;

&lt;h2&gt;
  
  
  One geometry, very different coordinates
&lt;/h2&gt;

&lt;p&gt;The raw-coordinate view is where the central comparison is easiest to see. In the original basis, the instrument moves through coordinate pairs: dimensions 1 and 2, then 2 and 3, and onwards. Switching the basis applies the same orthogonal transformation to every vector. The resulting coordinate tour can look quite different because the individual coordinates have changed.&lt;/p&gt;

&lt;p&gt;The cosine-neighbour structure has not changed. A shared orthogonal change of basis preserves dot products, lengths, distances and cosines. In this experiment, all five cosine neighbours are retained for every phrase.&lt;/p&gt;

&lt;p&gt;That makes the visual difference useful precisely because it is a little unsettling. The raw coordinates supplied by the model do not have a unique claim on the neighbour geometry. Another basis can produce a different-looking tour while representing the same cosine relationships.&lt;/p&gt;

&lt;p&gt;This is also the limited point behind work on the &lt;a href="https://arxiv.org/abs/1707.04662" rel="noopener noreferrer"&gt;interpretability of embedding coordinates&lt;/a&gt;. It does not follow that axes are always meaningless. It follows that cosine structure alone does not privilege the particular raw axes I happened to receive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three tours answer different questions
&lt;/h2&gt;

&lt;p&gt;The instrument has two datasets: a deterministic eight-dimensional synthetic dataset and the 384-dimensional phrase embeddings. Both can be viewed in three modes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Raw coordinates&lt;/strong&gt; move through axis-aligned coordinate pairs. This is the mode with the original-versus-rotated basis comparison.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PCA pairs&lt;/strong&gt; put the highest-variance directions first. That ordering does not make those directions the true semantic axes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grand tour&lt;/strong&gt; views move through more general projection planes rather than staying aligned with the raw axes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not three labels over the same picture. They produce meaningfully different views of the same dataset. The selection controls also let you follow one point and inspect its original-space neighbours while the projection changes.&lt;/p&gt;

&lt;p&gt;The distinction between the first and third modes already has established names. The &lt;a href="https://ggobi.github.io/tourr/articles/intro.html" rel="noopener noreferrer"&gt;&lt;code&gt;tourr&lt;/code&gt; project&lt;/a&gt; describes cycling through axis-aligned views as a little tour. Daniel Asimov's &lt;a href="https://doi.org/10.1137/0906011" rel="noopener noreferrer"&gt;1985 grand-tour paper&lt;/a&gt; describes moving through two-dimensional projections of multidimensional data more generally.&lt;/p&gt;

&lt;p&gt;I found that history after starting with the simpler coordinate-pair animation. I had not invented a new visualisation technique. I had independently reached the entrance to an existing family of ideas, which was probably the coolest part of the experiment.&lt;/p&gt;

&lt;p&gt;There is much more complete work in this area. &lt;a href="https://distill.pub/2020/grand-tour/" rel="noopener noreferrer"&gt;Distill used the grand tour to inspect neural-network activations&lt;/a&gt;, and the recent &lt;a href="https://arxiv.org/abs/2605.04306" rel="noopener noreferrer"&gt;dtour project&lt;/a&gt; provides a broader browser interface for steering through high-dimensional data and embeddings. My instrument is not a replacement for either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Motion gives more partial views, not the missing dimensions
&lt;/h2&gt;

&lt;p&gt;Every frame remains a two-dimensional projection. Animating the projection does not recover everything lost when hundreds of dimensions are placed on a flat screen. It gives more partial views.&lt;/p&gt;

&lt;p&gt;That limitation matters when watching clusters appear, separate or overlap. The tour can show how structure changes across projection planes, but it does not turn the screen into a faithful view of the complete high-dimensional space.&lt;/p&gt;

&lt;p&gt;The basis switch is the sharpest version of that warning. A projection can change dramatically while the measured cosine-neighbour geometry stays fixed. The picture moved; the neighbour relationships did not.&lt;/p&gt;

&lt;p&gt;The experiment stayed deliberately small: two datasets, three projection modes, a basis comparison, selection and playback controls. I do not expect a researcher to find a new technique in it. It may help another developer who is still learning and finds embeddings confusing, or it may just be satisfying to watch the structure move. I think the narrow result is worth seeing either way.&lt;/p&gt;




&lt;p&gt;This article was adapted with AI assistance from &lt;a href="https://billiem.uk/posts/embedding-tours/" rel="noopener noreferrer"&gt;an original article on billiem.uk&lt;/a&gt;. The original article was reviewed before publication.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
