<?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: Gioia Zheng</title>
    <description>The latest articles on DEV Community by Gioia Zheng (@gioiazheng).</description>
    <link>https://dev.to/gioiazheng</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%2F3609618%2F40b5ba8f-6a36-4c2a-8855-3b285071df4a.png</url>
      <title>DEV Community: Gioia Zheng</title>
      <link>https://dev.to/gioiazheng</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gioiazheng"/>
    <language>en</language>
    <item>
      <title>When RAG Failure Labels Depend on Retrieval Depth</title>
      <dc:creator>Gioia Zheng</dc:creator>
      <pubDate>Fri, 04 Sep 2026 16:03:55 +0000</pubDate>
      <link>https://dev.to/gioiazheng/when-rag-failure-labels-depend-on-retrieval-depth-50bl</link>
      <guid>https://dev.to/gioiazheng/when-rag-failure-labels-depend-on-retrieval-depth-50bl</guid>
      <description>&lt;h2&gt;
  
  
  The question
&lt;/h2&gt;

&lt;p&gt;When retrieval depth changes, do our RAG failure labels still describe the same phenomenon?&lt;/p&gt;

&lt;p&gt;That question came up while looking at a small controlled run in &lt;a href="https://gioiazheng.github.io/projects/rag-observatory/" rel="noopener noreferrer"&gt;rag-observatory&lt;/a&gt;. I was not trying to prove that one retrieval setting is better than another. The narrower goal was to check whether a diagnostic label remains interpretable when the retrieval configuration changes underneath it.&lt;/p&gt;

&lt;p&gt;This matters because failure labels can feel more concrete than aggregate scores. A label like &lt;code&gt;retrieval_noise&lt;/code&gt; sounds like an error category. But in an evaluation pipeline, a label is still a measurement produced by a configuration, an annotation rule, and a piece of code. If any of those changes, the meaning of the label can move too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Controlled setup
&lt;/h2&gt;

&lt;p&gt;The run used BEIR SciFact test data, with the first 20 sorted test queries in the diagnostic sample. It compared two retrieval-depth settings: &lt;code&gt;retrieval_top_k=1&lt;/code&gt; and &lt;code&gt;retrieval_top_k=5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The important control is that retrieval depth was the only main changed variable. The same query set, BM25 retriever implementation, top-1 context policy, deterministic extractive answer rule, and qrels-based evaluator were held fixed. In other words, the run asked a simple question: if the candidate pool gets deeper, what happens to the measured labels?&lt;/p&gt;

&lt;p&gt;The generator in this run was deliberately boring: it selected text from the first retrieved document. That makes the experiment less like a full production RAG benchmark, but more useful as a diagnostic check. The point was to isolate how retrieval depth affects trace-level measurements before adding more moving parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;p&gt;The retrieval hit metric improved slightly when the run moved from &lt;code&gt;top_k=1&lt;/code&gt; to &lt;code&gt;top_k=5&lt;/code&gt;. A trace counted as a retrieval hit if at least one qrels-relevant SciFact document appeared in the retrieved candidate set.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Retrieval hit&lt;/th&gt;
&lt;th&gt;&lt;code&gt;retrieval_noise&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Failure-labelled traces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;retrieval_top_k=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;13/20 (0.650)&lt;/td&gt;
&lt;td&gt;7/20&lt;/td&gt;
&lt;td&gt;7/20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;retrieval_top_k=5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;14/20 (0.700)&lt;/td&gt;
&lt;td&gt;20/20&lt;/td&gt;
&lt;td&gt;20/20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The surprising part is not the hit-rate change. Going deeper can surface one more relevant document. The surprising part is the binary &lt;code&gt;retrieval_noise&lt;/code&gt; label: it moved from 7 out of 20 traces to 20 out of 20 traces.&lt;/p&gt;

&lt;p&gt;At first glance, that could be misread as "the &lt;code&gt;top_k=5&lt;/code&gt; configuration is much noisier, therefore worse." That is too quick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the label became unstable
&lt;/h2&gt;

&lt;p&gt;In this experiment, &lt;code&gt;retrieval_noise&lt;/code&gt; is a heuristic label. It fires when at least one retrieved document is annotated as not relevant. That rule is useful as an inspection signal, but it is not an objective truth about whether the whole answer failed.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;top_k=1&lt;/code&gt;, the candidate set contains one document. The label fires only if that one document is irrelevant. With &lt;code&gt;top_k=5&lt;/code&gt;, the candidate set contains five documents, so the chance of including at least one irrelevant document is much higher. The label can saturate even when the deeper retrieval set also includes useful evidence.&lt;/p&gt;

&lt;p&gt;This is the measurement issue: a binary "any irrelevant document" rule changes its behavior when the number of retrieved documents changes. The trace may be more complete, and the hit rate may be slightly better, while the noise label becomes less comparable across configurations.&lt;/p&gt;

&lt;p&gt;The result does not mean &lt;code&gt;retrieval_top_k=5&lt;/code&gt; is worse. It means that this particular label is sensitive to the retrieval depth and the decision rule used to create it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for RAG evaluation
&lt;/h2&gt;

&lt;p&gt;For RAG evaluation, a failure label should travel with its configuration. Reporting "&lt;code&gt;retrieval_noise&lt;/code&gt; increased" without also reporting &lt;code&gt;retrieval_top_k&lt;/code&gt;, the definition of noise, and the context-selection rule can be misleading.&lt;/p&gt;

&lt;p&gt;A more stable diagnostic design would make the measurement less binary. For example, instead of only asking whether any irrelevant document appears, the report could include a graded noise measure: how many retrieved documents were irrelevant, where they appeared in the ranking, and whether a relevant document was also present. It could also report stability across several &lt;code&gt;k&lt;/code&gt; values, not only one comparison.&lt;/p&gt;

&lt;p&gt;The broader lesson is that failure analysis should be versioned like the rest of an evaluation pipeline. The dataset slice, retrieval configuration, labelling heuristic, scorer, and report format all shape the final diagnosis. If those choices are not recorded, the label becomes hard to compare across runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;This is a small diagnostic run, not a general benchmark result. The sample contains 20 SciFact test queries, and the experiment does not claim statistical significance.&lt;/p&gt;

&lt;p&gt;The result should not be automatically generalized to every dataset, retriever, reranker, generator, or RAG pipeline. It also does not show that a higher retrieval hit rate always improves generation quality. In this setup, generation was intentionally deterministic and extractive, because the focus was measurement sensitivity rather than end-to-end answer quality.&lt;/p&gt;

&lt;p&gt;The safest reading is narrow: on this controlled SciFact run, a binary &lt;code&gt;retrieval_noise&lt;/code&gt; heuristic changed sharply when retrieval depth changed from 1 to 5. That is enough to justify treating the label as configuration-dependent evidence, not as a standalone ground-truth category.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next experiment
&lt;/h2&gt;

&lt;p&gt;The next useful step is to make the diagnostic less brittle. I would compare several retrieval depths, keep both binary and graded noise measures, and track whether the same query receives the same failure interpretation across &lt;code&gt;k&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I would also separate candidate-pool noise from context noise. A retrieved irrelevant document is different from an irrelevant document that is actually passed to the generator. Those should not be collapsed into one label if the goal is to explain where the pipeline failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence
&lt;/h2&gt;

&lt;p&gt;The verified SciFact evidence for this note is the committed report and runner. The Hugging Face link below is the public toy trace dataset that accompanies the project, not the raw SciFact trace output.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/GioiaZheng/rag-observatory" rel="noopener noreferrer"&gt;rag-observatory repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/GioiaZheng/rag-observatory/blob/main/docs/reports/2026-07-25-scifact-retrieval-depth.md" rel="noopener noreferrer"&gt;SciFact retrieval-depth report&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/GioiaZheng/rag-observatory/blob/main/scripts/run_scifact_config_sensitivity.py" rel="noopener noreferrer"&gt;SciFact config-sensitivity runner&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/GioiaZheng/rag-observatory/blob/main/docs/failure_taxonomy.md" rel="noopener noreferrer"&gt;Failure taxonomy note&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/datasets/GioiaZheng/rag-observatory-toy-traces" rel="noopener noreferrer"&gt;Public toy trace dataset on Hugging Face&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>rag</category>
      <category>research</category>
    </item>
    <item>
      <title>My First Step Into Cybersecurity</title>
      <dc:creator>Gioia Zheng</dc:creator>
      <pubDate>Thu, 13 Nov 2025 10:24:56 +0000</pubDate>
      <link>https://dev.to/gioiazheng/my-first-step-into-cybersecurity-52a</link>
      <guid>https://dev.to/gioiazheng/my-first-step-into-cybersecurity-52a</guid>
      <description>&lt;p&gt;Hi! I’m Gioia.&lt;br&gt;
I study Computer Science &amp;amp; AI, and recently I realized I know &lt;em&gt;basically nothing&lt;/em&gt; about cybersecurity — so I’m starting from zero.&lt;/p&gt;

&lt;p&gt;I’m writing this mostly for myself, so I don’t forget what I’m doing and maybe stay motivated. If someone else is also learning, even better.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Why security?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Nothing dramatic.&lt;br&gt;
I just got curious.&lt;/p&gt;

&lt;p&gt;When you study CS, you always hear about “vulnerabilities”, “attacks”, “broken authentication”, etc…&lt;br&gt;
But I never really understood &lt;em&gt;how&lt;/em&gt; things break.&lt;/p&gt;

&lt;p&gt;So I want to learn enough to stop feeling lost.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;My plan (very simple)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I’m keeping it small and manageable:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;• TryHackMe basics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Just the beginner rooms. No pressure.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;• Web security basics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Understand how websites work, simple attacks, HTTP, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;• Maybe CTF later&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Only when I’m ready. No rush.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;What I’ll write here&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Nothing fancy.&lt;br&gt;
Just small notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what I learned today&lt;/li&gt;
&lt;li&gt;what confused me&lt;/li&gt;
&lt;li&gt;things I want to remember&lt;/li&gt;
&lt;li&gt;tiny progress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More like a learning journal than a “tutorial”.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Goal&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Honestly?&lt;br&gt;
Just &lt;strong&gt;keep learning without giving up after two weeks&lt;/strong&gt;.&lt;br&gt;
If I manage that, I’ll be happy.&lt;/p&gt;




&lt;p&gt;That’s it for my first post.&lt;br&gt;
If you're also learning, feel free to say hi. 😊&lt;/p&gt;




</description>
      <category>cybersecurity</category>
      <category>beginners</category>
      <category>learning</category>
      <category>tryhackme</category>
    </item>
  </channel>
</rss>
