<?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: Emil</title>
    <description>The latest articles on DEV Community by Emil (@emilcelestix).</description>
    <link>https://dev.to/emilcelestix</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3854662%2F89eddb70-e33b-41fc-86ac-96d64e64f5cf.png</url>
      <title>DEV Community: Emil</title>
      <link>https://dev.to/emilcelestix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emilcelestix"/>
    <language>en</language>
    <item>
      <title>Why Traditional RAG Scores 0% on Multi-Hop Queries — and What Two Lines of Code Changed</title>
      <dc:creator>Emil</dc:creator>
      <pubDate>Mon, 13 Apr 2026 18:57:14 +0000</pubDate>
      <link>https://dev.to/emilcelestix/why-traditional-rag-scores-0-on-multi-hop-queries-and-what-two-lines-of-code-changed-2eb7</link>
      <guid>https://dev.to/emilcelestix/why-traditional-rag-scores-0-on-multi-hop-queries-and-what-two-lines-of-code-changed-2eb7</guid>
      <description>&lt;p&gt;## The Problem Nobody Talks About&lt;/p&gt;

&lt;p&gt;Ask your RAG system: "What award did the director of Inception win?"&lt;/p&gt;

&lt;p&gt;This requires two hops:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inception → Christopher Nolan&lt;/li&gt;
&lt;li&gt;Christopher Nolan → Academy Award&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp3m8modfdb98no44pk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp3m8modfdb98no44pk6.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your retrieval engine does hop 1 fine. But hop 2? The embedding of the original query is nowhere near "Academy Award" in vector space. The answer sits at rank 665. Your top-20 retrieval window never sees it.&lt;/p&gt;

&lt;p&gt;We tested this systematically on HotpotQA fullwiki — 5.2M Wikipedia articles, 500 multi-hop questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every traditional method scored 0% Hit@20.&lt;/strong&gt; BM25. Dense retrieval. Rerankers. All of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What If the Query Could Change Shape?
&lt;/h2&gt;

&lt;p&gt;In 1958, Daniel Koshland proposed the induced-fit model of enzyme binding. Unlike the rigid "lock and key" model, enzymes change their shape to fit the substrate.&lt;/p&gt;

&lt;p&gt;We applied the same principle to retrieval.&lt;/p&gt;

&lt;p&gt;At each hop, IFR mutates the query embedding based on what it just found. The query literally reshapes itself to reach the next piece of evidence.&lt;/p&gt;

&lt;p&gt;Query → [hop 1: find Film X] → mutate → [hop 2: find director] → mutate → [hop 3: find award] → found&lt;/p&gt;

&lt;h2&gt;
  
  
  The Drift Problem
&lt;/h2&gt;

&lt;p&gt;This sounds elegant on paper. In practice, v1 was a disaster.&lt;/p&gt;

&lt;p&gt;67% of failures came from &lt;strong&gt;catastrophic drift&lt;/strong&gt; — the query mutated so aggressively that by hop 3, it had lost &amp;gt;80% of its original meaning. It was finding documents, but completely wrong ones.&lt;/p&gt;

&lt;p&gt;We tested 8 drift correction approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PID controllers&lt;/li&gt;
&lt;li&gt;Sentinel beams&lt;/li&gt;
&lt;li&gt;Moving anchors&lt;/li&gt;
&lt;li&gt;Drifting anchors&lt;/li&gt;
&lt;li&gt;Threshold tuning&lt;/li&gt;
&lt;li&gt;Hierarchical traversal&lt;/li&gt;
&lt;li&gt;Attention-based edge weighting&lt;/li&gt;
&lt;li&gt;Swarm coordination (Boids)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most made things worse. The winner was embarrassingly simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Blend 50% of original query at every hop
&lt;/span&gt;&lt;span class="n"&gt;query_vector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;mutated&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;

&lt;span class="c1"&gt;# Hard reset if drift exceeds threshold
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;cosine_sim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query_vector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;query_vector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two lines of code. nDCG went from 0.197 to 0.317 (+61%).&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmark Results
&lt;/h2&gt;

&lt;p&gt;Tested on HotpotQA fullwiki: 5.2M Wikipedia articles, 500 questions, 3 random seeds, single RTX 3060.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;R@5&lt;/th&gt;
&lt;th&gt;R@10&lt;/th&gt;
&lt;th&gt;MRR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RAG-rerank baseline&lt;/td&gt;
&lt;td&gt;0.337&lt;/td&gt;
&lt;td&gt;0.337&lt;/td&gt;
&lt;td&gt;0.548&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IFR-hybrid+CE&lt;/td&gt;
&lt;td&gt;0.366&lt;/td&gt;
&lt;td&gt;0.366&lt;/td&gt;
&lt;td&gt;0.554&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Delta&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+2.9% (p=0.0002)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+2.9%&lt;/td&gt;
&lt;td&gt;+0.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;R@5 = R@10 because IFR surfaces all retrievable targets within the top 5 — ranks 6–10 add no new hits at this difficulty level.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Scaling: O(1) latency — 100x data growth = 1.1x latency growth. Beam traversal takes ~10ms on the full 5.2M corpus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Three Layers Beat Perfect Traversal
&lt;/h2&gt;

&lt;p&gt;Raw beam search R@5 = 0.309. With cross-encoder reranking: 0.366 (+5.7 points).&lt;/p&gt;

&lt;p&gt;The insight: drift noise scores high against the mutated query but low against the original. So the cross-encoder naturally filters it. Trying to eliminate drift at the beam level gives diminishing returns. The multi-layer pipeline is the actual solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations (We're Honest)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The 50% blend ratio is empirical. We don't have a principled method for setting it.&lt;/li&gt;
&lt;li&gt;Tested only on HotpotQA fullwiki. Other multi-hop benchmarks needed.&lt;/li&gt;
&lt;li&gt;Single GPU (RTX 3060). Not benchmarked at enterprise scale.
---&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Question for the community:&lt;/strong&gt; &lt;br&gt;
We fixed drift with a static 50% anchor blend — but this feels like a brute-force solution. Has anyone worked on adaptive blending that adjusts the anchor weight based on query complexity or hop distance? Curious what approaches you've tried.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/emil-celestix/celestix-ifr" rel="noopener noreferrer"&gt;github.com/emil-celestix/celestix-ifr&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Beyond Static RAG: Using 1958 Biochemistry to Beat Multi-Hop Retrieval by 14%</title>
      <dc:creator>Emil</dc:creator>
      <pubDate>Wed, 01 Apr 2026 04:16:13 +0000</pubDate>
      <link>https://dev.to/emilcelestix/beyond-static-rag-using-1958-biochemistry-to-beat-multi-hop-retrieval-by-14-4hfn</link>
      <guid>https://dev.to/emilcelestix/beyond-static-rag-using-1958-biochemistry-to-beat-multi-hop-retrieval-by-14-4hfn</guid>
      <description>&lt;p&gt;Standard Retrieval-Augmented Generation (RAG) often falls short on complex, multi-hop questions because it relies on static "lock and key" query matching. If the information needed to answer a query is semantically distant from the original text, standard vector search simply won't find it.&lt;/p&gt;

&lt;p&gt;We've developed Induced-Fit Retrieval (IFR), a dynamic graph traversal approach that mutates the query vector at every step to discover semantically distant but logically connected information.&lt;/p&gt;

&lt;p&gt;The Core Results&lt;br&gt;
We ran our prototype through a rigorous test suite of 30 queries across multiple graph sizes, up to 5.2 million atoms.&lt;/p&gt;

&lt;p&gt;14.3% higher nDCG@10 compared to a competitive RAG-rerank baseline.&lt;/p&gt;

&lt;p&gt;15% Multi-hop Hit@20 in scenarios where traditional RAG methods scored 0%.&lt;/p&gt;

&lt;p&gt;O(1) Latency Scaling: Latency remains near 10ms whether searching 100 atoms or 5.2 million.&lt;/p&gt;

&lt;p&gt;Why Biochemistry?&lt;br&gt;
The system is inspired by Daniel Koshland’s 1958 "induced fit" model. In biology, enzymes change shape upon encountering a substrate to improve binding.&lt;/p&gt;

&lt;p&gt;IFR applies this to Information Retrieval: instead of a static query vector, the vector mutates at each hop based on the visited node's embedding. This allows the query to follow the "curved manifolds" of high-dimensional embedding space that a fixed vector cannot reach.&lt;/p&gt;

&lt;p&gt;Lessons from the Data&lt;br&gt;
Transparency is key to research, so we are also sharing our failures:&lt;/p&gt;

&lt;p&gt;Catastrophic Drift: 67% of our failures occurred because the query mutated too aggressively, losing its original intent.&lt;/p&gt;

&lt;p&gt;The Solution: v2 will implement an "Alpha Floor" to preserve at least 50% of the original query signal at all times.&lt;/p&gt;

&lt;p&gt;We have open-sourced the prototype, our 18 raw JSON result logs, ablation studies, and full technical reports.&lt;/p&gt;

&lt;p&gt;Check out the repo on GitHub:&lt;br&gt;
&lt;a href="https://github.com/emil-celestix/celestix-ifr" rel="noopener noreferrer"&gt;https://github.com/emil-celestix/celestix-ifr&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>python</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
