<?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: Rugved Chandekar</title>
    <description>The latest articles on DEV Community by Rugved Chandekar (@rugvedrc).</description>
    <link>https://dev.to/rugvedrc</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%2F4051189%2F7ba116de-066f-45bd-a41f-d9d4e0ddf036.jpg</url>
      <title>DEV Community: Rugved Chandekar</title>
      <link>https://dev.to/rugvedrc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rugvedrc"/>
    <language>en</language>
    <item>
      <title>Accepted at IEEE AIC 2026: Uncertainty-Aware Attention for Clinical AI</title>
      <dc:creator>Rugved Chandekar</dc:creator>
      <pubDate>Tue, 28 Jul 2026 11:37:40 +0000</pubDate>
      <link>https://dev.to/rugvedrc/accepted-at-ieee-aic-2026-uncertainty-aware-attention-for-clinical-ai-2n8g</link>
      <guid>https://dev.to/rugvedrc/accepted-at-ieee-aic-2026-uncertainty-aware-attention-for-clinical-ai-2n8g</guid>
      <description>&lt;h1&gt;
  
  
  Accepted at IEEE AIC 2026: Uncertainty-Aware Attention for Clinical AI
&lt;/h1&gt;

&lt;p&gt;AI models in medical imaging are reaching human-level accuracy, but in hospital settings, a major obstacle remains: &lt;strong&gt;black-box predictions&lt;/strong&gt;. Most deep learning models produce binary decisions without explaining &lt;em&gt;why&lt;/em&gt; or indicating &lt;em&gt;how confident&lt;/em&gt; they are.&lt;/p&gt;

&lt;p&gt;In my upcoming paper accepted at the &lt;strong&gt;IEEE AIC 2026 Conference&lt;/strong&gt;, I developed a framework from the Department of Information Technology at &lt;strong&gt;Government College of Engineering, Chhatrapati Sambhajinagar&lt;/strong&gt; designed to bridge this clinical trust gap.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Why High Accuracy Isn't Enough for Healthcare
&lt;/h2&gt;

&lt;p&gt;Standard Convolutional Neural Networks (CNNs) output a diagnosis even when image quality is poor or signs of disease are subtle. A doctor cannot distinguish whether an AI model is making a careful, evidence-based prediction or simply making a high-confidence guess.&lt;/p&gt;

&lt;p&gt;Missing a diagnosis (a false negative) in conditions like pediatric pneumonia can delay life-saving treatment. To make AI clinically useful, systems must fulfill two requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Explainability&lt;/strong&gt;: Highlighting &lt;em&gt;where&lt;/em&gt; the model is looking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uncertainty Quantification&lt;/strong&gt;: Knowing when to say &lt;em&gt;"I am unsure — flag this for a human radiologist."&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  High-Level Approach: Dual Attention + MC Dropout
&lt;/h2&gt;

&lt;p&gt;My framework combines two complementary mechanisms to address both explainability and reliability:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Dual Attention (Channel + Spatial)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Channel Attention&lt;/strong&gt;: Learns which feature representations (e.g., texture vs edge patterns) carry the highest diagnostic signal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spatial Attention&lt;/strong&gt;: Focuses the model's receptive field on lung regions while dimming out irrelevant background anatomy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Monte Carlo Dropout for Clinical Triage
&lt;/h3&gt;

&lt;p&gt;Rather than turning off dropout during inference, I kept dropout active to execute multiple stochastic passes per image. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High variance across passes indicates high model uncertainty.&lt;/li&gt;
&lt;li&gt;By setting an uncertainty threshold at the 95th percentile, the system automatically flags doubtful cases for human review.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Results &amp;amp; Impact
&lt;/h2&gt;

&lt;p&gt;Evaluated on &lt;strong&gt;5,856 pediatric chest X-rays&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;97.18% Overall Accuracy&lt;/strong&gt; (with &lt;strong&gt;96.73% Sensitivity&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clinical Triage Concentration&lt;/strong&gt;: Flagging just &lt;strong&gt;5.8%&lt;/strong&gt; of total cases captured &lt;strong&gt;43% of all actual model errors&lt;/strong&gt; — allowing radiologists to focus their review where human expertise is needed most.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual Interpretability&lt;/strong&gt;: Grad-CAM heatmaps confirmed that attention maps focus strictly on lung opacities rather than background artifacts.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Looking Ahead
&lt;/h2&gt;

&lt;p&gt;This work demonstrates that combining attention mechanisms with uncertainty estimation significantly improves the safety and interpretability of AI in healthcare. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Paper accepted for presentation at **IEEE AIC 2026&lt;/em&gt;&lt;em&gt;. Full publication details and code repository will be released following the conference proceedings.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Rugved Chandekar (&lt;a href="https://rugved.me" rel="noopener noreferrer"&gt;rugved.me&lt;/a&gt;) · IEEE AIC 2026 Paper Author&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>healthcare</category>
    </item>
    <item>
      <title>How I Cut LLM Token Usage by 99% — 3 Production Engineering Steps</title>
      <dc:creator>Rugved Chandekar</dc:creator>
      <pubDate>Tue, 28 Jul 2026 11:23:00 +0000</pubDate>
      <link>https://dev.to/rugvedrc/how-i-cut-llm-token-usage-by-99-3-production-engineering-steps-4752</link>
      <guid>https://dev.to/rugvedrc/how-i-cut-llm-token-usage-by-99-3-production-engineering-steps-4752</guid>
      <description>&lt;p&gt;At Idyllic Services, I was working on an automated candidate sourcing system running LLM calls at scale. One iteration consumed &lt;strong&gt;200,000+ tokens&lt;/strong&gt; (costing ₹15–20 per run) and took &lt;strong&gt;6 minutes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I redesigned the pipeline architecture to cut token consumption by &lt;strong&gt;~99% down to 5,000 tokens&lt;/strong&gt; and reduced execution time to &lt;strong&gt;90 seconds&lt;/strong&gt;. Here is the exact 3-step breakdown of how I did it.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. RAG Integration, Semantic Routing &amp;amp; Caching
&lt;/h2&gt;

&lt;p&gt;The biggest inefficiency was dumping full candidate histories and long job descriptions into every single prompt. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RAG Memory Retrieval&lt;/strong&gt;: I integrated Qdrant vector database to store conversation history and candidate data. Instead of sending 15,000 tokens of raw history, nearest-neighbor search retrieved only the top 2–3 relevant snippets (~400 tokens) per step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic Routing&lt;/strong&gt;: Instead of sending every request to expensive LLMs, I implemented semantic routing to direct deterministic tasks to fast regex or local Python scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SHA-256 Response Caching&lt;/strong&gt;: For repeat queries (same JD, same candidate profile), I cached responses using prompt content hashes — making duplicate runs &lt;strong&gt;cost 0 tokens&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. TOON Format (Token-Oriented Object Notation)
&lt;/h2&gt;

&lt;p&gt;JSON has massive syntactic overhead (braces, quotes, repeated keys). When sending structured arrays of candidate data to LLMs, this overhead is pure waste.&lt;/p&gt;

&lt;p&gt;I switched the prompt payload format to &lt;strong&gt;TOON (Token-Oriented Object Notation)&lt;/strong&gt;, which declares keys once as a header row:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# JSON (before) — 847 tokens for 5 candidates:
[
  {"name": "Rahul Sharma", "skills": ["Python", "AWS"], "yoe": 4},
  {"name": "Priya Patil",  "skills": ["React", "Node"],  "yoe": 2}
]

# TOON (after) — 290 tokens for 5 candidates:
{name | skills | yoe}
Rahul Sharma | Python, AWS | 4
Priya Patil  | React, Node | 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: 30–40% baseline token reduction on all structured payloads with zero information loss.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Removing LLMs from Loops · Batch API Calls
&lt;/h2&gt;

&lt;p&gt;The original codebase called the LLM &lt;em&gt;once per candidate&lt;/em&gt; inside a &lt;code&gt;for&lt;/code&gt; loop (50 candidates = 50 separate API calls, each carrying full instructions).&lt;/p&gt;

&lt;p&gt;I replaced the sequential loop with a &lt;strong&gt;single structured batch prompt&lt;/strong&gt;:&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;# BEFORE: LLM inside a loop (50 API calls = 200K tokens)
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Score candidate:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;JD: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;full_jd&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Candidate: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# AFTER: Single batched call (1 API call = ~5K tokens)
&lt;/span&gt;&lt;span class="n"&gt;batch_prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build_batch_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jd_toon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;candidates_toon&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;all_scores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch_prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary of Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Optimization&lt;/th&gt;
&lt;th&gt;Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;RAG + Routing + Caching&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-95% memory tokens, 0 tokens on repeats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TOON Format&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-30% to -40% payload overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Batch API Calls&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;50 calls → 1 call (Runtime: 6 min → 90 sec)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Final Outcome&lt;/strong&gt;: &lt;strong&gt;200,000 tokens → 5,000 tokens (~99% reduction)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Rugved Chandekar (&lt;a href="https://rugved.me" rel="noopener noreferrer"&gt;rugved.me&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

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