<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Embedding Translation on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/embedding-translation/</link>
    <description>Recent content in Embedding Translation on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 09 Sep 2026 02:00:00 +0000</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/embedding-translation/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Alignment</title>
      <link>http://programmer.ie/books/embeddings-from-first-principles/19-chapter/</link>
      <pubDate>Mon, 07 Sep 2026 14:10:00 +0000</pubDate>
      <guid>http://programmer.ie/books/embeddings-from-first-principles/19-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Part VI — Crossing Embedding Spaces&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-family-of-maps-ordered-by-how-much-they-can-bend-the-space&#34;&gt;A family of maps, ordered by how much they can bend the space&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The null map (&lt;code&gt;T(x) = x&lt;/code&gt;).&lt;/strong&gt; Do nothing. Always run this first. If it already scores well, your two spaces were nearly the same space to begin with (this happens for models of the same size, backbone, and objective) and any &amp;ldquo;translation&amp;rdquo; you fit is fitting noise. vec2vec&amp;rsquo;s own baseline is exactly this, and for their near-identical model pairs it reaches top-1 ≈ 1.0 — the real work is only on pairs where the null map collapses.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Orthogonal Procrustes.&lt;/strong&gt; &lt;code&gt;T&lt;/code&gt; is constrained to a rotation/reflection: &lt;code&gt;min ‖X_A R − X_B‖²&lt;/code&gt; subject to &lt;code&gt;RᵀR = I&lt;/code&gt;. Solution: &lt;code&gt;R = UVᵀ&lt;/code&gt; from the SVD of &lt;code&gt;X_Aᵀ X_B&lt;/code&gt;. Preserves all distances and angles &lt;em&gt;within&lt;/em&gt; space A — it only re-orients. Cannot fix scale or shear. Best when the two spaces are &amp;ldquo;the same shape, different pose.&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Linear regression (least squares).&lt;/strong&gt; Chapter 18. &lt;code&gt;T&lt;/code&gt; is any linear map: rotation + scaling + shear + projection. More expressive; can overfit; does not preserve within-A geometry.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;CCA (Canonical Correlation Analysis).&lt;/strong&gt; Finds paired directions in A and B that are maximally &lt;em&gt;correlated&lt;/em&gt;; aligns in that shared subspace. Naturally handles different dimensions and discards directions with no counterpart. Good when the two spaces share a subspace but also have private structure. Note it maximizes correlation, which is not the same as preserving retrieval &lt;em&gt;rank&lt;/em&gt; — highly correlated shared directions can still reorder near-ties.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Relative representations (&amp;ldquo;re-express, don&amp;rsquo;t map&amp;rdquo;).&lt;/strong&gt; Instead of fitting a map at all, replace every vector by its list of cosine similarities to a fixed set of shared anchor items (&lt;a href=&#34;https://arxiv.org/abs/2209.15430&#34;&gt;Moschella et al., 2023&lt;/a&gt;). That representation is invariant to rotation and rescaling by construction, so two spaces expressed this way become directly comparable — no &lt;code&gt;T&lt;/code&gt; to fit. The cost: it needs a shared anchor set (texts embedded in both spaces — paired data by another name), and the invariance holds &amp;ldquo;under the same data and modeling choices.&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Learned nonlinear map (small MLP).&lt;/strong&gt; &lt;code&gt;T&lt;/code&gt; is a 2–3 layer network. Most expressive; needs the most anchors; highest overfitting risk; hardest to reason about. Use only if the linear family measurably plateaus below your target.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Map&lt;/th&gt;&#xA;          &lt;th&gt;What it can do&lt;/th&gt;&#xA;          &lt;th&gt;Overfitting risk&lt;/th&gt;&#xA;          &lt;th&gt;Best when&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Null &lt;code&gt;T(x) = x&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;nothing — run it first&lt;/td&gt;&#xA;          &lt;td&gt;none&lt;/td&gt;&#xA;          &lt;td&gt;the two spaces were already nearly one&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Orthogonal Procrustes&lt;/td&gt;&#xA;          &lt;td&gt;rotation / reflection only; preserves within-A distances and angles&lt;/td&gt;&#xA;          &lt;td&gt;low (closed form)&lt;/td&gt;&#xA;          &lt;td&gt;&amp;ldquo;same shape, different pose&amp;rdquo;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Linear regression&lt;/td&gt;&#xA;          &lt;td&gt;rotation + scale + shear + projection&lt;/td&gt;&#xA;          &lt;td&gt;medium; can overfit&lt;/td&gt;&#xA;          &lt;td&gt;scale or shear differ; anchors plentiful&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;CCA&lt;/td&gt;&#xA;          &lt;td&gt;align a maximally-correlated shared subspace; drop private directions&lt;/td&gt;&#xA;          &lt;td&gt;medium&lt;/td&gt;&#xA;          &lt;td&gt;the spaces share a subspace but also have private structure&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Relative representations&lt;/td&gt;&#xA;          &lt;td&gt;re-express every vector as cosines to shared anchors — no &lt;code&gt;T&lt;/code&gt; fitted&lt;/td&gt;&#xA;          &lt;td&gt;n/a&lt;/td&gt;&#xA;          &lt;td&gt;you have a shared anchor set and want rotation/scale invariance for free&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Nonlinear MLP&lt;/td&gt;&#xA;          &lt;td&gt;an arbitrary map&lt;/td&gt;&#xA;          &lt;td&gt;highest (~10⁶ params)&lt;/td&gt;&#xA;          &lt;td&gt;the linear family measurably plateaus below target (or unpaired optimization needs the flexibility)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;The ordering is deliberate: &lt;strong&gt;try the most constrained map that meets your preservation target.&lt;/strong&gt; A rotation that gets you to 0.85 retrieval agreement is better than an MLP that gets you to 0.87, because the rotation has fewer ways to be wrong on data you have not seen. The recent cross-encoder alignment work reinforces this: vec2vec&amp;rsquo;s nonlinear translator and mini-vec2vec&amp;rsquo;s &lt;em&gt;linear&lt;/em&gt; one reach comparable coarse quality, and the linear one is far cheaper and more stable (&lt;a href=&#34;https://arxiv.org/abs/2510.02348&#34;&gt;Dar, 2025&lt;/a&gt;). Where nonlinearity earns its keep is not representational capacity but &lt;em&gt;optimization robustness in the unpaired regime&lt;/em&gt; — when there are no anchors to regress on, the extra flexibility helps the alignment converge, not the final map express more.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Retrieval Is Not Geometry</title>
      <link>http://programmer.ie/books/embeddings-from-first-principles/25-chapter/</link>
      <pubDate>Wed, 09 Sep 2026 01:50:00 +0000</pubDate>
      <guid>http://programmer.ie/books/embeddings-from-first-principles/25-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Research Coda — What Alignment Really Preserves&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-result-that-looks-like-success&#34;&gt;The result that looks like success&lt;/h2&gt;&#xA;&lt;p&gt;Suppose a bridge translates vectors from space A into space B. On a held-out set, the true B-space counterpart appears in the translated vector&amp;rsquo;s top ten &lt;strong&gt;99.7%&lt;/strong&gt; of the time.&lt;/p&gt;&#xA;&lt;p&gt;That sounds finished.&lt;/p&gt;&#xA;&lt;p&gt;Now ask a different question: does the translated vector have the same ten neighbors as the native B-space vector?&lt;/p&gt;&#xA;&lt;p&gt;The answer can be barely &lt;strong&gt;59%&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Should a Translation Preserve?</title>
      <link>http://programmer.ie/books/embeddings-from-first-principles/26-chapter/</link>
      <pubDate>Wed, 09 Sep 2026 02:00:00 +0000</pubDate>
      <guid>http://programmer.ie/books/embeddings-from-first-principles/26-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Research Coda — What Alignment Really Preserves&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;preserve-the-geometry-is-not-a-complete-instruction&#34;&gt;&amp;ldquo;Preserve the geometry&amp;rdquo; is not a complete instruction&lt;/h2&gt;&#xA;&lt;p&gt;A bridge translates vectors from space A into space B.&lt;/p&gt;&#xA;&lt;p&gt;The natural instinct is to say:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Preserve the source geometry while you translate.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;That sounds obviously correct. If two source points are close, keep them close. If two source points are far apart, keep them far apart. Preserve pairwise cosine, distances, neighborhoods.&lt;/p&gt;&#xA;&lt;p&gt;But Chapter 16 established something uncomfortable: different encoders do not merely rotate the same universe. They can disagree on neighborhoods, density, rank order, hard distinctions, and calibration.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
