<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mundher's blog]]></title><description><![CDATA[Mundher Al-Shabi]]></description><link>https://mundher.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 21:25:10 GMT</lastBuildDate><atom:link href="https://mundher.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Build Privacy into LLM Agents Without Breaking Their Brains]]></title><description><![CDATA[I've been spending a lot of time lately building autonomous agents with ReAct and RAG frameworks. The shift from stateless chatbots to stateful systems that can actually execute tools is incredibly us]]></description><link>https://mundher.com/how-to-build-privacy-into-llm-agents-without-breaking-their-brains</link><guid isPermaLink="true">https://mundher.com/how-to-build-privacy-into-llm-agents-without-breaking-their-brains</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 19 Jul 2026 13:57:32 GMT</pubDate><content:encoded><![CDATA[<p>I've been spending a lot of time lately building autonomous agents with ReAct and RAG frameworks. The shift from stateless chatbots to stateful systems that can actually execute tools is incredibly useful. But it immediately introduces a massive headache: data privacy.</p>
<p>Agents need rich context to perform complex reasoning. But if you hand over unredacted PII to a third-party model provider, you've already lost. From a regulatory perspective, egress equals processing.</p>
<p>A lot of folks try to slap post-LLM guardrails on their systems. They intercept the payload after the model generates a response and try to scrub it. This is fundamentally inadequate for privacy.</p>
<p>Sending the data to external hardware is already a data breach. Furthermore, post-generation interception is highly vulnerable to relay tampering. An adversarial relay can silently rewrite a safety-aligned response before a tool executes it.</p>
<p>So, what's the pragmatic fix? You have to shift to deterministic, infrastructure-level enforcement before the prompt ever hits the model.</p>
<h3>The Problem With Simple Masking</h3>
<p>I put this data mitigation layer directly in the agent's hot path as a separate middleware layer. It operates completely independently of the model weights or system prompts. I don't use a secondary LLM for this; I rely on rigid, rule-based logic and high-performance regex.</p>
<p>You need deterministic speed at this interception layer. It ensures auditability and keeps latency exceptionally low.</p>
<p>This matters because the attack surface for agentic systems is expanding fast. Attackers easily bypass naive blocklists using scrambled text or synonym substitution.</p>
<p>The scariest threat right now is indirect prompt injection. An attacker can hide malicious instructions in a PDF that your RAG system blindly retrieves. Your agent then acts on behalf of the attacker, using your user's permissions.</p>
<p>We also have to defend against multi-turn <strong>Crescendo attacks</strong>. These use benign queries that gradually escalate over several conversational turns to trick the model's safety filters.</p>
<p>When scrubbing data before it hits the API, simple masking is a trap. Replacing everything with a generic <code>[REDACTED]</code> tag destroys the task semantics. It completely paralyzes the model's ability to do mathematical reasoning or maintain vector embeddings.</p>
<p>Instead, I've been implementing typed placeholders. I replace sensitive spans with semantically meaningful tags, like <code>&lt;Health_Info_1&gt;</code>, right on the edge device.</p>
<p>The cloud model maintains its contextual coherence and logical reasoning using these typed placeholders. The raw secrets simply never leave the local device.</p>
<h3>Securing Legacy APIs and Continuous Evaluation</h3>
<p>Sometimes, you have to hit a legacy API or database that strictly validates data formats. In those cases, typed placeholders fail. That's when I reach for <strong>Format-Preserving Encryption (FPE)</strong>.</p>
<p>FPE scrambles the data into mathematically secure ciphertext but keeps the original length and format. A 16-digit credit card number stays a valid 16-digit number, keeping your schemas happy.</p>
<p>To test all this, static point-in-time audits are basically useless. LLMs are non-deterministic, so you have to build continuous privacy evaluations directly into your CI/CD pipeline.</p>
<p>I treat red-teaming as an automated engineering control. My deployment pipelines simulate multi-turn injections and check if the agent leaks synthetic data. If it does, the release is automatically blocked.</p>
<p>Ultimately, this is how you handle the realities of <strong>GDPR</strong> and strict privacy guidelines. By confining identifiable data to internal environments using deterministic pre-model redaction, you massively reduce your legal exposure. It's the most practical way I've found to build secure agents right now.</p>
]]></content:encoded></item><item><title><![CDATA[Stacking Agent Memory: Checkpoints, Status Boards, and Active Context]]></title><description><![CDATA[I love the idea of autonomous coding agents. But one of the quickest ways to hit a wall when setting them up is the infinite context problem. Your context window is finite, but the work you want the a]]></description><link>https://mundher.com/stacking-agent-memory-checkpoints-status-boards-and-active-context</link><guid isPermaLink="true">https://mundher.com/stacking-agent-memory-checkpoints-status-boards-and-active-context</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sat, 04 Jul 2026 10:02:54 GMT</pubDate><content:encoded><![CDATA[<p>I love the idea of autonomous coding agents. But one of the quickest ways to hit a wall when setting them up is the infinite context problem. Your context window is finite, but the work you want the agent to do just keeps going.</p>
<p>Hitting that hard token limit means the system either crashes or starts evicting vital instructions. The most practical fix for this is memory compaction.</p>
<h2><strong>What is memory compaction?</strong></h2>
<p>Memory compaction isn't just asking the model to "summarize this chat." It is the process of condensing past conversational history into a dense, meaningful representation of state.</p>
<p>Why bother? Because it keeps your agent running autonomously without burning through massive amounts of API credits. It preserves the exact intent and state needed for an AI to actually execute over long periods.</p>
<h2><strong>The anatomy of the problem</strong></h2>
<p>When you compress context, you have to decide what survives the cut. You absolutely must preserve the overall intent, the current execution state, and historical progress.</p>
<p>We are fighting strict constraints here. We have hard token limits, we need low retrieval latency, and we have to balance accuracy against abstraction. You usually achieve this through a mix of entity extraction and structured state formatting.</p>
<h2><strong>Three timeframes of a complete system</strong></h2>
<p>If you look closely at how production systems handle this, you realize they rarely pick just one compaction method. Instead, they use a stacked memory architecture that operates across three distinct timeframes.</p>
<h3>The Checkpoint Layer (Long-Term)</h3>
<p>This is the macro layer. It holds the overall project map, the ultimate goal, and major milestones.</p>
<p>You don't feed this massive block of text into every prompt—it’s too expensive and distracting for the model. Instead, you only pull the checkpoint when the agent switches major tasks, starts a brand-new session, or needs to recover from a crash. It acts as an anchor to re-orient the system when it needs to see the whole board.</p>
<h3>The Status Board Layer (Mid-Term)</h3>
<p>Think of this as the agent's active work session, functioning essentially as a strict Kanban board. It tracks exactly what got done today and what’s currently blocking progress.</p>
<p>This layer is referenced constantly while the agent is working. It forms a bridge between the giant checkpoint map and the immediate task. By clearly separating "Done" from "Blocked," it forces clarity and stops the model from hallucinating progress it hasn't actually made yet.</p>
<h3>The Active Context Layer (Short-Term)</h3>
<p>This is the micro layer, and it is pure execution. It throws out all the historical baggage and focuses on one thing: what the agent needs to know right this second to write the next line of code.</p>
<p>This layer only tracks immediate constraints, active variables, and the specific file that is currently open. Because it strips away the past and the future, it’s incredibly token-efficient. It keeps the agent locked onto the immediate micro-task without getting distracted by previous mistakes or overarching project goals.</p>
]]></content:encoded></item><item><title><![CDATA[Smart LLM Routing]]></title><description><![CDATA[Building LLM apps is easy, but scaling them without setting a pile of money on fire is hard. You really don't need the massive brainpower of GPT-5 for every single user query.
Routing is how we fix th]]></description><link>https://mundher.com/smart-llm-routing</link><guid isPermaLink="true">https://mundher.com/smart-llm-routing</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Fri, 26 Jun 2026 16:44:16 GMT</pubDate><content:encoded><![CDATA[<p>Building LLM apps is easy, but scaling them without setting a pile of money on fire is hard. You really don't need the massive brainpower of GPT-5 for every single user query.</p>
<p>Routing is how we fix this. The concept is simple: dynamically direct incoming prompts to the most appropriate model based on the query itself.</p>
<p>This solves the classic engineering trilemma by saving expensive tokens for hard problems while reducing latency for simple tasks. I've been tinkering with different routing architectures lately, and I've noticed they naturally build on top of each other across four distinct levels of complexity.</p>
<h2>Level 1: Just use an if-statement</h2>
<p>The absolute simplest approach is using hardcoded logic to route the prompt before it ever touches a neural network. My favorite technique here is context length routing.</p>
<p>You just count the tokens before generation. If it's under 8k, I route it to a local Llama 3 8B instance running on my Mac. If it's over 100k, I hand it off to a model with a massive context window like Gemini 3.5 Pro.</p>
<p>You can also use regex to scan for keywords like "SQL" or "Python" to instantly trigger a specialized coding model. It costs nothing and has zero latency.</p>
<p>The catch? It’s incredibly fragile. A prompt like "Tell me a joke about Python" will falsely trigger your coding route, which means we need a slightly smarter approach to understand intent.</p>
<h2>Level 2: Embedding-based semantic routing</h2>
<p>To fix the fragility of regex, we have to move beyond exact keyword matches and actually evaluate the meaning of the prompt. This is where semantic routing steps in.</p>
<p>You define routing paths using a handful of exemplar sentences and convert them into vector embeddings. When a new query hits your API, you embed it and calculate the cosine similarity against your predefined paths.</p>
<p>I highly recommend checking out libraries like <code>semantic-router</code> for this. It's surprisingly fast if you run a tiny embedding model like <code>all-MiniLM-L6-v2</code> locally on your CPU.</p>
<p>But as smart as semantic routing is, it still has a ceiling. Your accuracy depends entirely on maintaining a vector space and curating great exemplar data, which eventually becomes a maintenance bottleneck.</p>
<h2>Level 3: Using a model to pick the model</h2>
<p>When embeddings aren't enough, you can use an actual machine learning model to act as a traffic cop. The classic approach is fine-tuning a lightweight transformer like BERT to classify queries into specific intent buckets.</p>
<p>If you don't have a dataset to train BERT yet, you can use the "LLM-as-a-router" fallback. Just ask a fast, cheap model like Claude Haiku or Gemini Flash to read the query and output a JSON route.</p>
<p>A prompt like "Categorize this query as MATH, CREATIVE, or CHAT and output only the category name" works wonders. Constrained generation keeps the router from hallucinating.</p>
<p>Here is my favorite trick for this level. Use that LLM router to log 10,000 synthetic routing decisions, then use those logs to fine-tune a tiny BERT model so you can drop your routing latency back to practically zero.</p>
<h2>Level 4: Cascading and escalation</h2>
<p>Even with a perfect classifier, picking a single model upfront isn't always the right move. Cascading routing fixes this by dynamically escalating to a more capable model mid-flight.</p>
<p>In a single-turn setup, you send the query to the cheapest model first and have it score its own output. If the confidence score is low, you throw away the bad generation and escalate the prompt to a heavier frontier model.</p>
<p>You can also do this statefully across a conversation. Start a chat session with a small, local model and monitor the state to see if it gets stuck.</p>
<p>If the conversation hits five continuous turns without resolving, or the user repeatedly types "No, that's not what I meant," you pull the ripcord. You pass the entire context history to an advanced model like GPT-5 to step in, figure out the mess, and finish the job.</p>
]]></content:encoded></item><item><title><![CDATA[Using Simulators to Evaluate Multi-Turn AI Agents]]></title><description><![CDATA[Building a multi-turn conversational AI is surprisingly easy right now. Evaluating it is incredibly hard. For single-turn tasks, a standard static dataset works fine: you just feed in a prompt and ass]]></description><link>https://mundher.com/using-simulators-to-evaluate-multi-turn-ai-agents</link><guid isPermaLink="true">https://mundher.com/using-simulators-to-evaluate-multi-turn-ai-agents</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Fri, 19 Jun 2026 15:27:05 GMT</pubDate><content:encoded><![CDATA[<p>Building a multi-turn conversational AI is surprisingly easy right now. Evaluating it is incredibly hard. For single-turn tasks, a standard static dataset works fine: you just feed in a prompt and assert the output against a spreadsheet of expected answers. However, that approach completely falls apart in multi-turn chat because conversations are stateful and branch in unpredictable ways.</p>
<p>If your agent decides to ask a clarifying question instead of giving an immediate answer, a static dataset has no way to respond, and the test just breaks. Because of this, developers often default to manual human QA, which is painfully slow, or they rely almost entirely on online testing.</p>
<p>Testing in production by shipping it and monitoring live interactions is tempting, but it's incredibly risky. You don't want to discover that a minor prompt tweak broke your fallback routing just because it frustrated hundreds of real users first. The feedback loop is too slow, and burning real user goodwill is expensive.</p>
<p>My solution to this lately is building a "Simulation User"—an LLM specifically prompted to act as a human talking to my AI agent. This accelerates the evaluation loop dramatically, lets me test specific personas, and solves the headache of managing mock data for tool integrations.</p>
<h2>Bootstrapping personas from real data</h2>
<p>You can dictate a simulator's behavior, goals, and communication style just by tweaking its system prompt. But instead of guessing what your users will say, I always prefer to bootstrap these personas directly from actual historical chat logs. You can mine anonymized data to extract common intents, weird phrasings, and actual edge cases, then use those insights to automatically generate scenario prompts for the simulator.</p>
<p>I like setting up a few distinct personas to really stress-test the agent. For example, there's the "Happy Path" user who is clear and concise, contrasted with the "Chaotic" user who uses slang, gives partial info, and constantly changes the subject. I also throw in a "Frustrated" customer to specifically test the agent's empathy, de-escalation, and fallback routing. By combining historical data with defined personas, I can deterministically test the agent across thousands of highly realistic scenarios.</p>
<h2>Grading the results with LLM-as-a-judge</h2>
<p>Once your Simulator and Agent are chatting, you can automate the process to spin up 100 concurrent conversations in minutes. But this introduces a new bottleneck: manual QA. Every time I tweak an agent's system prompt, I risk breaking something else in a regression, and I absolutely do not want to read 100 simulated transcripts manually to see if they worked.</p>
<p>Instead, I take the completed conversation logs between the agent and the simulator and pipe them straight into an LLM-as-a-judge workflow for evaluation. I do this because it's the only practical way to scale complex, qualitative grading across hundreds of test runs without blocking the release cycle. I just hand the judge model the transcript and a strict rubric to evaluate task completion (did they reach the goal?), turn count (was it too slow or redundant?), and tone (did the agent stay polite and within guardrails?). Hooking this up to a CI pipeline means developers get instant, quantitative metrics every time they push code.</p>
<h2>Solving the tool integration headache</h2>
<p>Evaluating the back-and-forth chat is only half the battle. Real AI agents actually take action by executing database lookups and hitting APIs. Testing this without spamming production databases or writing brittle mock servers is a huge pain.</p>
<p>My simulation environment solves this by intercepting the agent's tool calls at runtime—like <code>lookup_order_status(123)</code>. Instead of hitting a real database, I have the framework use a fast, cheap LLM to generate a plausible mock JSON response on the fly.</p>
]]></content:encoded></item><item><title><![CDATA[Why Grep Won't Save Your RAG Pipeline]]></title><description><![CDATA[I’ve been reading through a recent paper titled "Is Grep All You Need? How Agent Harnesses Reshape Agentic Search". It’s a provocative piece with a premise I normally love. The authors claim that simp]]></description><link>https://mundher.com/why-grep-won-t-save-your-rag-pipeline</link><guid isPermaLink="true">https://mundher.com/why-grep-won-t-save-your-rag-pipeline</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Tue, 09 Jun 2026 15:17:22 GMT</pubDate><content:encoded><![CDATA[<p>I’ve been reading through a recent paper titled "<a href="https://arxiv.org/abs/2605.15184">Is Grep All You Need? How Agent Harnesses Reshape Agentic Search</a>". It’s a provocative piece with a premise I normally love. The authors claim that simple lexical tools like <code>grep</code> and regular expressions consistently outperform complex vector databases for AI agents.</p>
<p>I am a massive fan of boring, foundational technology. But while this paper makes one excellent point, its overarching conclusion is fundamentally flawed.</p>
<h2>Stacking the deck for grep</h2>
<p>The paper's central claim about the superiority of <code>grep</code> is built on a heavily stacked deck. The authors evaluated their claims using a tiny 116-question subset of a benchmark focused on long-horizon conversational memory.</p>
<p>While <code>grep</code> is great at finding specific dates in a chat log, this dataset is wildly unrepresentative of the challenges we face building real RAG systems. Navigating dense technical documentation or parsing legal contracts requires semantic understanding, which is exactly where <code>grep</code> fails.</p>
<p>Worse, the authors pre-processed their data into a highly structured format optimized for regex. They essentially solved the hardest part of the problem beforehand. It is entirely unsurprising that a tool designed for exact pattern matching wins when the data has been explicitly formatted into exact patterns.</p>
<h2>The semantic and scalability walls</h2>
<p>If you try to use this approach in a real-world application right now, you will immediately hit two walls. The first is semantic flexibility. If a user asks your agent about "termination clauses," but the document uses the phrase "cancellation conditions," a simple <code>grep</code> returns nothing.</p>
<p>The second wall is scalability. <code>grep</code> requires a full linear scan of your text. While that works for small local datasets, it falls apart against enterprise corpora. Running broad regex scans over hundreds of thousands of documents is computationally expensive and slow. Your agents will quickly exhaust their token budgets and spike latency trying to triage massive, unstructured shell outputs.</p>
<h2>Breaking down the middle ground</h2>
<p>The most frustrating aspect of this paper is the false dichotomy it presents. It assumes you must choose between computationally expensive dense vector search or unscalable, linear shell commands.</p>
<p>We shouldn't regress to linear shell commands when there is an established, robust middle ground. If we actually want to build practical tools, here are three better approaches you can use right now.</p>
<h3>Pure BM25</h3>
<p>BM25 uses an inverted index, meaning a search across millions of documents is nearly instantaneous. Better yet, it actually ranks the results based on term frequency.</p>
<p>This gives you the speed and precision of keyword matching without forcing your agent to do the heavy lifting of sorting through endless shell output.</p>
<h3>Agent-Weighted Hybrid Search</h3>
<p>You don't actually have to choose between lexical and semantic search. You can easily run both BM25 and a standard vector search in parallel.</p>
<p>The fun part is using a lightweight AI agent to dynamically choose the weights of each based on the query. If a user asks for a specific "error code 502", the agent cranks up the BM25 weight; if they ask a conceptual question, it leans heavily on the vector search.</p>
<h3>Vectorless RAG</h3>
<p>I won't rehash my <a href="https://mundher.com/vectorless-rag">full deep-dive on Vectorless RAG here</a>, but the TL;DR is to throw out the vector database entirely and replace it with an LLM-driven reasoning loop.</p>
<p>Instead of arbitrary chunking, you parse your document into a semantic JSON tree. The agent reads this "Table of Contents," reasons about which section holds the answer, and fetches the exact, unfragmented text.</p>
]]></content:encoded></item><item><title><![CDATA[Harnessing Conversational AI]]></title><description><![CDATA[I’ve been spending the last few weeks messing around with open-weight models to build conversational interfaces.
By now, the new reality is obvious: generating natural language is no longer the bottle]]></description><link>https://mundher.com/harnessing-conversational-ai</link><guid isPermaLink="true">https://mundher.com/harnessing-conversational-ai</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 24 May 2026 18:53:21 GMT</pubDate><content:encoded><![CDATA[<p>I’ve been spending the last few weeks messing around with open-weight models to build conversational interfaces.</p>
<p>By now, the new reality is obvious: generating natural language is no longer the bottleneck. Models can spit out incredibly fluent dialogue for practically zero cost.</p>
<p>The real scarce resources in 2026 are token budgets, API rate limits, and the model's context window.</p>
<p>Managing those exact constraints is why harness engineering has become the defining trend for conversational AI this year.</p>
<h2>Why harnesses matter right now</h2>
<p>An agent harness is everything surrounding an AI model that grounds it in reality and ties it to a specific conversational flow.</p>
<p>Think of it like a dog's walking harness. It anchors the conversational agent to prevent it from drifting wildly off-topic, hallucinating fake policies, or bankrupting your token budget with endless loops.</p>
<p>As an industry, we are aggressively shifting from trying to write the perfect "system prompt" to building robust execution environments.</p>
<p>I’m finding that building the right harness is the only way to deploy reliable chat interfaces, especially if you want to run smaller models locally on constrained hardware.</p>
<h2>Anatomy of a conversational harness</h2>
<p>Unlike traditional machine learning harnesses, which are basically glorified test suites, a conversational harness manages the live interaction loop.</p>
<p>It wraps the core chat loop and provides concrete tool registries. This is how you give your model safe access to execute external APIs—like checking a user's order status or fetching live weather data—without letting it make unauthorized state changes.</p>
<p>A massive part of this is context management. You need primitives that automatically compact older conversation history to protect the model's limited context window during long chat sessions.</p>
<p>You also need strict guardrails. I always implement hard limits to kill responses if a bot starts repeating itself or triggers too many internal tool calls before answering the user.</p>
<p>Another trick I love is deterministic execution. Don't let a black-box AI handle sensitive data collection.</p>
<p>When a user needs to authenticate or enter a credit card, the harness should intercept that intent. Offload that predictable task to traditional UI components, securely process it, and hand control back to the AI.</p>
<h2>Adapting systems for chat agents</h2>
<p>This requires a total mindset shift because we actually have to design our backend APIs to be agent-friendly.</p>
<p>Standardization is a massive multiplier here. If your internal APIs return predictable, constrained data, it requires far less attention for a local model to parse the results and reply to the user.</p>
<p>My favorite technique right now is prompt-injecting through API error messages.</p>
<p>Instead of an API just returning a 400 error to the bot, I engineer my endpoints to return specific remediation steps. If an order lookup fails, the error tells the bot, "Ask the user to confirm their 5-digit zip code." It acts as a hidden prompt injection that guides the model to self-heal the conversation.</p>
<p>You also need just-in-time context. Don't front-load your entire company FAQ and overwhelm the system prompt.</p>
<p>A smart harness waits to inject the return policy into the context window until the user actually asks about refunds.</p>
]]></content:encoded></item><item><title><![CDATA[Vectorless RAG]]></title><description><![CDATA[If you’ve built anything with LLMs in the past couple of years, you’ve probably wired up a Retrieval-Augmented Generation (RAG) pipeline. The playbook is burned into our brains: take a PDF, smash it i]]></description><link>https://mundher.com/vectorless-rag</link><guid isPermaLink="true">https://mundher.com/vectorless-rag</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 17 May 2026 10:04:37 GMT</pubDate><content:encoded><![CDATA[<p>If you’ve built anything with LLMs in the past couple of years, you’ve probably wired up a Retrieval-Augmented Generation (RAG) pipeline. The playbook is burned into our brains: take a PDF, smash it into 512-token chunks, compute embeddings, shove them into a vector DB, and run a cosine similarity search when a user asks a question.</p>
<p>It works... until it doesn’t.</p>
<p>I’ve been banging my head against the wall with traditional RAG lately, especially on dense technical documentation. Blindly slicing a document into "chunks" obliterates the author's narrative flow. Worse, semantic similarity is a terrible proxy for factual relevance. Just because a chunk <em>sounds</em> like the query doesn't mean it holds the answer.</p>
<p>Lately, I’ve been experimenting with a totally different approach: <strong>Vectorless RAG</strong> (sometimes called Reasoning-based RAG). It throws out the vector database entirely. Instead of static math, it uses an LLM to perform agentic, context-aware retrieval.</p>
<p>Here’s a breakdown of how it works, what the trade-offs are, and how this exact same pattern is quietly taking over codebase search tools like Claude Code.</p>
<h2>How Vectorless RAG Works</h2>
<p>Vectorless RAG treats retrieval as an iterative reasoning task. It’s basically teaching an LLM how to read a book: look at the table of contents, find the right chapter, read it, and see if you have the answer.</p>
<h3>Phase 1: The "In-Context" Tree Index</h3>
<p>Instead of artificial chunking, we parse the document into a semantic, JSON-based hierarchy—essentially a highly detailed Table of Contents. This tree structure lives right in the LLM's context window.</p>
<ul>
<li><p><strong>Nodes:</strong> Chapters or sections become nodes.</p>
</li>
<li><p><strong>Metadata:</strong> Every node gets a <code>node_id</code>, a title, a brief summary, and pointers to the raw data (like page or line numbers).</p>
</li>
<li><p><strong>Hierarchy:</strong> Nodes contain sub-nodes, mapping out the whole document recursively.</p>
</li>
</ul>
<p>Because we chunk by <em>meaning</em> (sections/chapters) rather than arbitrary token counts, we avoid context fragmentation entirely.</p>
<h3>Phase 2: The Agentic Retrieval Loop</h3>
<p>When a query comes in, the agent doesn't embed it. It reads the tree and executes a loop:</p>
<ol>
<li><p><strong>Read the ToC:</strong> Fetch the tree (just the structure and summaries, not the full text).</p>
</li>
<li><p><strong>Reasoning:</strong> Evaluate the user's intent. Which node logically contains the answer?</p>
</li>
<li><p><strong>Extract:</strong> Fetch the exact, unfragmented text for that specific <code>node_id</code>.</p>
</li>
<li><p><strong>Evaluate:</strong> Ask: "Is this enough to answer the question?" If yes, generate the response. If no, go back to step 1 and pick a different node based on what was just learned.</p>
</li>
</ol>
<h2>The Claude Code Parallel: Vectorless Codebase Search</h2>
<p>The shift away from vector DBs isn't just for PDFs. I've noticed the exact same architectural shift happening in developer tools. Look at how Anthropic's Claude Code navigates massive local repositories. It doesn't rely on embedded code snippets; it operates as an agent (Understand → Plan → Act → Verify).</p>
<p>Here is how Claude Code mirrors the Vectorless RAG pattern:</p>
<table>
<thead>
<tr>
<th>RAG Concept</th>
<th>Claude Code Implementation</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Semantic Initialization</strong></td>
<td>Parses <code>package.json</code>/<code>Cargo.toml</code> to build a dependency graph; recursively hunts for <code>CLAUDE.md</code> files to bootstrap architectural rules without loading the whole repo.</td>
</tr>
<tr>
<td><strong>High-Speed Discovery</strong></td>
<td>Ditches semantic search for fast bash utilities: uses <code>bfs</code> for structural mapping and <code>ugrep</code> for near-zero latency string matching.</td>
</tr>
<tr>
<td><strong>Code Intelligence</strong></td>
<td>Doesn't just match text; uses LSP-backed intelligence (AST parsing) to "jump to definition" and trace actual execution flows deterministically.</td>
</tr>
<tr>
<td><strong>Context Management</strong></td>
<td>Aggressively prunes noise. If a search returns hundreds of hits, it auto-compacts the logs down to core function signatures to save context tokens.</td>
</tr>
</tbody></table>
<h2>The Trade-Offs: Is it worth it?</h2>
<p>Vectorless RAG solves the semantic mismatch problem, but it introduces new constraints. Here is the pragmatic breakdown.</p>
<h3>The Good</h3>
<ul>
<li><p><strong>True Relevance:</strong> Queries are about intent. An agent can deduce that "how to handle errors" maps to a specific chapter, even if the semantic overlap is low.</p>
</li>
<li><p><strong>Zero Fragmentation:</strong> You get whole, coherent sections of text. Hallucinations drop significantly.</p>
</li>
<li><p><strong>Handles Cross-References:</strong> Traditional RAG chokes on "see Appendix G" because the text lacks similarity to the target data. An agent just looks up Appendix G in its ToC.</p>
</li>
<li><p><strong>Infrastructure:</strong> You can rip out your vector database entirely.</p>
</li>
</ul>
<h3>The Bad</h3>
<ul>
<li><p><strong>Latency is high:</strong> A vector lookup takes milliseconds. An LLM reading a JSON tree and executing a multi-step reasoning loop takes seconds. You have to design your UI around this delay.</p>
</li>
<li><p><strong>It gets expensive:</strong> Pumping a massive ToC into the prompt for <em>every</em> query, plus the tokens for the reasoning loop, burns through API credits much faster than a static vector search.</p>
</li>
<li><p><strong>Scale Limits:</strong> You can't put the ToC of a million documents into a prompt. For massive corpora, you still need a traditional search pass to pre-filter down to a handful of relevant documents before the agent takes over.</p>
</li>
</ul>
<h2>Final Thoughts</h2>
<p>Vectorless RAG is a fascinating shift. By treating documents like structured narratives instead of bags of embeddings, we unlock a level of precision that traditional RAG struggles to match.</p>
<p>While I wouldn't use it to filter Wikipedia, for deep, accurate Q&amp;A on complex specs or codebase engineering, agentic retrieval is rapidly becoming the new standard. If you're building local coding agents or high-stakes document tools, it's time to start experimenting with reasoning loops over static vector math.</p>
]]></content:encoded></item><item><title><![CDATA[Thoughts on Advanced Chunking Strategies for RAG]]></title><description><![CDATA[I’ve been thinking a lot recently about the "chunking problem" in Retrieval-Augmented Generation. If you've played around with the llm CLI tool or built anything with vector embeddings, you've probabl]]></description><link>https://mundher.com/thoughts-on-advanced-chunking-strategies-for-rag</link><guid isPermaLink="true">https://mundher.com/thoughts-on-advanced-chunking-strategies-for-rag</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Mon, 04 May 2026 08:30:00 GMT</pubDate><content:encoded><![CDATA[<p>I’ve been thinking a lot recently about the "chunking problem" in Retrieval-Augmented Generation. If you've played around with the llm CLI tool or built anything with vector embeddings, you've probably hit the exact wall I described in my recent two-part series on the topic.</p>
<p>In the first piece, All You Need is a Good Chunking, I described the "meat cleaver" approach: slicing documents arbitrarily by character or token count. It’s the easiest way to get a prototype running, but it’s fundamentally broken. It destroys context. When you feed these broken, out-of-context chunks to an LLM, the result is hallucination and confusion.</p>
<p>My follow-up piece dives into how we move past the meat cleaver and pick up the scalpel. Here is how I'm thinking about the three state-of-the-art approaches I outlined:</p>
<h2>Semantic Chunking</h2>
<p>This is my current go-to for most of my personal projects. The math here—calculating cosine similarity between sentence embeddings to find "valleys" in the topic—is incredibly cheap to run.</p>
<p>If you're using an embedding model like all-MiniLM-L6-v2 locally, you don't even need a GPU; it runs blazingly fast on a Mac M-series chip. I’ve built prototypes using sqlite-vec (the successor to sqlite-vss) where I just store the individual sentences and their embeddings in a SQLite database, and then run a quick Python script to group them based on similarity drops. It's a massive upgrade over fixed-size chunking and costs fractions of a cent.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6521465d01084867e22bd198/5ceb7b48-0e0c-4620-be38-1608e07307e5.png" alt="" style="display:block;margin:0 auto" />

<h2>Neural Chunking</h2>
<p>This is a fascinating approach that I haven't experimented with as much yet. Using a custom BERT model specifically trained for sequence classification and boundary detection makes a ton of sense for highly structured documents.</p>
<p>I really appreciate that tools like Chonkie are bundling this. The barrier to entry for running specialized NLP models used to be configuring a massive PyTorch pipeline; now it's just a pip install away. The latency overhead is a real trade-off, though, especially if you are trying to ingest documents on the fly.</p>
<h2>Agentic Chunking</h2>
<p>This is the absolute gold standard for quality, and it's where things get really interesting from a prompt engineering perspective.</p>
<p>I noted in the original post that this is "exorbitantly expensive," but the math on that is actually changing rapidly. A year ago, using GPT-4 for this would have completely blown your API budget. Today? Running an agentic "proposition extraction" pipeline using Gemini 1.5 Flash or Claude 3.5 Haiku is shockingly affordable.</p>
<p>I've been running experiments piping messy documents through these fast, cheap models, prompting them to rewrite the text into self-contained propositions before embedding them. It solves the "pronoun problem" (where a chunk starts with "He did it" and the embedding model has no idea who "He" is) beautifully.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6521465d01084867e22bd198/f426f5b5-3b58-4e9a-a0f4-093805e47204.png" alt="" style="display:block;margin:0 auto" />

<h2>The Takeaway</h2>
<p>I strongly stand by my golden rule: Don't use Agentic chunking if Semantic gets the job done.</p>
<p>Start with the dumbest thing that could possibly work. If token limits fail, upgrade to semantic chunking. Only pull out the heavy LLM-based agentic chunking if you are working with incredibly messy data and your retrieval metrics prove you actually need it.</p>
]]></content:encoded></item><item><title><![CDATA[All You Need is a Good Chunking]]></title><description><![CDATA[If you’ve spent any time building Retrieval-Augmented Generation (RAG) prototypes, you inevitably hit the exact same wall. You wire up a great embedding model, point it at an excellent local LLM, and ]]></description><link>https://mundher.com/all-you-need-is-a-good-chunking</link><guid isPermaLink="true">https://mundher.com/all-you-need-is-a-good-chunking</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 03 May 2026 09:50:05 GMT</pubDate><content:encoded><![CDATA[<p>If you’ve spent any time building Retrieval-Augmented Generation (RAG) prototypes, you inevitably hit the exact same wall. You wire up a great embedding model, point it at an excellent local LLM, and the answers are still completely useless.</p>
<p>The culprit is almost always the chunking strategy. The core tension of RAG is chunk size: small chunks give you precise search hits, while large chunks give the LLM the surrounding context it needs to actually understand the text.</p>
<p>If you just naively slice a document up by character count, you end up chopping crucial sentences in half. You feed the LLM broken context, and it confidently hallucinates a response.</p>
<p>I’ve been looking at three distinct ways to fix this—Sentence, Recursive, and Hierarchical chunking—and the tooling ecosystem around them is finally getting genuinely interesting.</p>
<h2>Sentence chunking: respecting grammatical boundaries</h2>
<p>A sentence chunker tries to break text strictly at natural boundaries like periods or exclamation points. It splits the document into individual sentences, and then greedily batches them together until it hits your token limit.</p>
<p>Historically, the standard way to do this in LangChain was by dragging in massive Natural Language Processing libraries like spaCy or NLTK. I always hated this approach. Pulling in hundreds of megabytes of heavy NLP dependencies just to find a period feels absurdly wasteful.</p>
<p>This is why I’ve been really enjoying Chonkie. It’s a newer, ultra-lightweight library that handles sentence chunking perfectly while only requiring an 11MB base install. It runs exponentially faster than the older NLP approaches and respects your token limits beautifully.</p>
<h2>Recursive chunking: the pragmatic default</h2>
<p>Recursive chunking is the absolute gold standard for general-purpose text. Instead of a single rule, it uses a prioritized waterfall of separators.</p>
<p>It first tries to split by double newlines (<code>\n\n</code>) to get natural paragraphs. If a paragraph exceeds your token limit, it falls back to single newlines (<code>\n</code>), then spaces, and finally individual characters.</p>
<p>LangChain’s <code>RecursiveCharacterTextSplitter</code> does exactly this using standard string operations, which means it executes incredibly fast on virtually any hardware. Chonkie also ships with a highly optimized recursive chunker that pairs neatly with your specific LLM's tokenizer.</p>
<p>Because it prioritizes newlines, it perfectly preserves Markdown headers, bulleted lists, and code blocks. Unless you have a specific reason not to, this should be your default strategy.</p>
<p>The catch is that grammatical chunkers fail spectacularly on structured text. If you feed them Markdown lists or code blocks that lack periods, they completely mangle the formatting. I only use this approach for massive walls of unstructured prose, like podcast transcripts or raw audio logs.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6521465d01084867e22bd198/aeeea1ef-6e26-4440-a5e7-f0c063b3c01d.png" alt="" style="display:block;margin:0 auto" />

<h2>Hierarchical chunking: throwing vision models at PDFs</h2>
<p>What happens when your source material is a messy corporate PDF full of tables and multi-column layouts? Recursive chunkers completely choke on these because the line breaks are essentially arbitrary.</p>
<p>Hierarchical chunking treats the document as a visual structure rather than a flat string. It identifies where a table or a section lives, and injects a "breadcrumb trail" of context into every single chunk. A tiny bullet point gets permanently tagged with its parent path, like <code>[Annual Report → Financials → Q3]</code>.</p>
<p>IBM’s Docling is currently the most compelling tool I’ve seen for this. It uses vision-language AI models (like Granite-Docling) to perform layout analysis on raw PDFs before doing any text splitting. Its <code>HybridChunker</code> ensures a table is never split across chunks and that context is perfectly preserved.</p>
<p>The trade-off here is hardware. Running vision models over a 100-page PDF will absolutely punish your unified memory and spike your ingestion costs. It is computationally heavy, but if you need to reliably query financial reports or complex contracts, it is practically mandatory.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6521465d01084867e22bd198/289da387-8ab1-46fd-930f-4c25c4e32789.png" alt="" style="display:block;margin:0 auto" />

<h2>The verdict</h2>
<p>Choosing the right chunking method dictates the ceiling of your entire RAG pipeline. Here is my current mental model for picking one:</p>
<table>
<thead>
<tr>
<th>Strategy</th>
<th>Best Tools</th>
<th>Ideal Use Case</th>
<th>Compute Cost</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Recursive</strong></td>
<td>Chonkie</td>
<td>Markdown, articles, general documentation.</td>
<td>Extremely Low</td>
</tr>
<tr>
<td><strong>Sentence</strong></td>
<td>Chonkie</td>
<td>Audio transcripts, chat logs, unstructured prose.</td>
<td>Low</td>
</tr>
<tr>
<td><strong>Hierarchical</strong></td>
<td>Docling</td>
<td>Complex PDFs, legal contracts, financial tables.</td>
<td>High (Requires Vision AI)</td>
</tr>
</tbody></table>
<p>Start with a recursive chunker around 500 tokens. It's fast, cheap, and handles 90% of what most people are trying to build.</p>
<p>Only upgrade to heavy, structure-aware tools like Docling when you actually observe your pipeline failing to read tables or losing the plot on complex documents.</p>
]]></content:encoded></item><item><title><![CDATA[AI Agent Experience (AX)]]></title><description><![CDATA[In an article I recently co-authored, we argued that a fundamental shift is underway in product design. The traditional principles of User Experience (UX), which rest on direct user control and manipulation, are becoming obsolete with the rise of tru...]]></description><link>https://mundher.com/ai-agent-experience-ax</link><guid isPermaLink="true">https://mundher.com/ai-agent-experience-ax</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Mon, 14 Jul 2025 16:00:13 GMT</pubDate><content:encoded><![CDATA[<p>In an article I recently co-authored, we argued that a fundamental shift is underway in product design. The traditional principles of User Experience (UX), which rest on direct user control and manipulation, are becoming obsolete with the rise of true AI agents.</p>
<p>Here is a summary of our main points:</p>
<blockquote>
<p>We defined this new paradigm as "Agent Experience" (AX), where the user’s role evolves from an active operator to a supervisor. Unlike simple assistants like Siri, true AI agents can independently manage complex, multi-step goals. This means users will no longer navigate intricate workflows but will instead state their objectives and oversee the AI's execution.</p>
<p>Our article posits that designers must now build "cockpits" or dashboards for monitoring and intervention, rather than step-by-step task flows. In this new world, natural language becomes the primary interface, and the core design challenge is to establish trust by ensuring the user remains the ultimate authority with clear pathways to step in and manage their AI counterparts. We concluded that the companies that succeed will be those that best empower users to supervise these increasingly autonomous systems confidently.</p>
</blockquote>
<p><a target="_blank" href="https://www.productvoyagers.com/p/ai-agent-experience-ax">Read the Full Article Here</a></p>
]]></content:encoded></item><item><title><![CDATA[The Messy Reality of Evaluating GenAI Systems]]></title><description><![CDATA[For years, evaluating traditional machine learning models, while never simple, followed a well-trodden path. Your team knew the drill: assemble a labeled dataset, define success with metrics like precision and recall, and track performance. The core ...]]></description><link>https://mundher.com/the-messy-reality-of-evaluating-genai-systems</link><guid isPermaLink="true">https://mundher.com/the-messy-reality-of-evaluating-genai-systems</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 29 Jun 2025 14:41:55 GMT</pubDate><content:encoded><![CDATA[<p>For years, evaluating traditional machine learning models, while never simple, followed a well-trodden path. Your team knew the drill: assemble a labeled dataset, define success with metrics like precision and recall, and track performance. The core of the work was getting the data right to build a predictable, robust system.</p>
<p>Then came the Generative AI explosion. Suddenly, the old playbook feels inadequate. We're no longer just predicting a "churn" vs. "no churn" label. We’re generating nuanced text for marketing, complex code for features, and intricate product designs. The very definition of a "good" output has become subjective and context-dependent.</p>
<p>This paradigm shift is forcing us to rethink evaluation from the ground up. For those on the front lines building these products, this isn't just an academic exercise; it's a critical bottleneck to shipping reliable software.</p>
<h2 id="heading-the-two-worlds-of-genai-evaluation-closed-and-open-ended"><strong>The Two Worlds of GenAI Evaluation: Closed and Open-Ended</strong></h2>
<p>The first step to building a coherent strategy around GenAI is to distinguish between the two fundamental types of tasks your system might be performing.</p>
<h3 id="heading-closed-ended-predictions"><strong>Closed-Ended Predictions:</strong></h3>
<p>This is familiar territory. The model's job is to produce a specific, constrained output. Because there's a definite "right" answer, we can lean on our traditional toolkit.</p>
<p><strong>Example:</strong> You're building a feature to automatically categorize incoming support tickets ("Billing Issue", "Technical Glitch", "Feature Request").</p>
<p><strong>Why it's closed-ended:</strong> There's a predefined, finite set of correct labels.</p>
<p><strong>How you measure it:</strong> You can use <strong>precision</strong> (of all the tickets we labeled "Billing Issue," how many actually were?) and <strong>recall</strong> (of all the actual "Billing Issue" tickets, how many did we find?). These are clear, quantifiable KPIs you can build dashboards around and track release over release.</p>
<h3 id="heading-open-ended-predictions"><strong>Open-Ended Predictions:</strong></h3>
<p>This is where the real challenge begins. Think of tasks where there are many possible "good" answers.</p>
<p><strong>Example:</strong> You're launching an AI-powered feature that summarizes long customer feedback emails for internal teams.</p>
<p><strong>Why it's open-ended:</strong> A 500-word email can be summarized effectively in dozens of different ways. Which one is best? It depends on what the reader needs to know.</p>
<p><strong>The problem:</strong> Simple one-to-one comparisons with a "golden" summary in a test set are no longer sufficient. This is the core challenge for teams building the next generation of AI-powered features.</p>
<h2 id="heading-the-evaluation-toolkit-for-open-ended-generation"><strong>The Evaluation Toolkit for Open-Ended Generation</strong></h2>
<p>While the problem is complex, we're not flying completely blind. The field has developed several methods to bring structure to this ambiguity.</p>
<h3 id="heading-the-classics-bleu-and-rouge"><strong>The Classics: BLEU and ROUGE</strong></h3>
<p>These metrics are your first-line, automated tools. They compare the words and phrases in the model's output to one or more human-written reference examples.</p>
<p>Let's take our feedback summarizer feature. Suppose the original feedback is: <em>"The new dashboard is visually appealing, but the process to export reports is now much slower and requires three extra clicks. I also can't find the date filter easily."</em></p>
<p><strong>Reference Summary:</strong> "User likes the new dashboard's look but finds report exporting slower and the date</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td></td><td><strong>Generated Summary</strong></td><td><strong>The Takeaway</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>A (High ROUGE score)</strong></td><td>"User says the dashboard's look is good but exporting reports is slow and the date filter is hard to find."</td><td>This scores well because it uses many of the same keywords. It's a good initial signal for factual recall, often useful for CI/CD checks to prevent basic regressions.</td></tr>
<tr>
<td><strong>B (Low ROUGE score)</strong></td><td>"The user praised the UI redesign. However, they reported significant workflow regressions, specifically with export speed and filter visibility."</td><td>This summary is arguably <em>more useful</em> because it synthesizes the feedback with more professional terminology. However, it would score lower on ROUGE, highlighting the limitations of relying solely on lexical metrics.</td></tr>
</tbody>
</table>
</div><h3 id="heading-the-modern-approaches-semantic-similarity-and-llm-as-a-judge"><strong>The Modern Approaches: Semantic Similarity and LLM-as-a-Judge</strong></h3>
<p>To get closer to measuring actual quality, we need more sophisticated tools.</p>
<p><strong>1. Semantic Evaluation:</strong> This measures if the <em>meaning</em> is the same, even if the words are different. In the example above, a good semantic similarity metric would score "Generated Summary B" highly against the reference because the core concepts are identical. This is a much better signal of true understanding.</p>
<p><strong>2. LLM-as-a-Judge:</strong> This is a game-changer for iterating quickly. You use a powerful LLM as a tireless, automated evaluator. As a team, you define the rubric.</p>
<p><strong>Example:</strong> To evaluate the summaries from your AI feature, you can use an API call to a "Judge" LLM with a prompt like this:</p>
<blockquote>
<p><em>You are an expert editor. Please evaluate the following AI-generated summary based on the original customer feedback.</em></p>
<p><em>Original Feedback: [Insert original email here]</em></p>
<p><em>AI-Generated Summary: [Insert summary to be evaluated here]</em></p>
<p><em>Please score the summary on a scale of 1-5 for the following criteria:</em></p>
<p><em>1.  Conciseness: Is the summary brief and to the point?</em></p>
<p><em>2.  Factual Accuracy: Does the summary correctly represent all key points from the original feedback?</em></p>
<p><em>3.  Clarity: Is the summary unambiguous and easy to understand?</em></p>
<p><em>Provide a score and a brief justification for each.</em></p>
</blockquote>
<p>This approach is faster and cheaper than constant human review and allows you to scale your evaluation based on criteria that your team defines as important for the product.</p>
<h3 id="heading-special-case-evaluating-rag-systems"><strong>Special Case: Evaluating RAG Systems</strong></h3>
<p>Retrieval-Augmented Generation (RAG) is the architecture powering most modern enterprise chatbots. It has two parts: finding the right info (Retrieval) and then using it to talk (Generation). To debug effectively, you must evaluate them separately.</p>
<ul>
<li><p><strong>Example:</strong> A customer support chatbot that answers questions based on a company's knowledge base. A user asks, "How do I get a refund for my subscription?"</p>
</li>
<li><p><strong>1. Evaluate the Retrieval:</strong> Did the system pull the correct document?</p>
<ul>
<li><p><strong>Success:</strong> The RAG system retrieves the "Refund Policy" article.</p>
</li>
<li><p><strong>Failure:</strong> The system retrieves the "Subscription Upgrade" article.</p>
</li>
<li><p><strong>The Metric:</strong> Use classic search metrics like <strong>NDCG</strong> or simple <strong>top-k hit rate</strong> (e.g., "was the correct document in the top 3 results 95% of the time?"). This tells you if your retrieval component—be it a vector database or a search API—is effective.</p>
</li>
</ul>
</li>
<li><p><strong>2. Evaluate the Generation:</strong> Assuming it found the right document, did it generate a good answer?</p>
<ul>
<li><p><strong>Success:</strong> "To get a refund, go to your Account Settings, click 'Subscription,' and follow the 'Cancel and Refund' link. You are eligible for a refund if you cancel within 14 days of purchase."</p>
</li>
<li><p><strong>Failure:</strong> "The document mentions refunds." (Accurate but useless).</p>
</li>
<li><p><strong>The Metric:</strong> Here you use the open-ended techniques: LLM-as-a-Judge to check for helpfulness, or human spot-checks.</p>
</li>
</ul>
</li>
</ul>
<p>By separating these, you can pinpoint the real problem. Is the chatbot failing because the knowledge base is bad (a content/retrieval problem) or because it's bad at explaining things (a generation problem)? This distinction is critical for assigning bugs and planning sprints.</p>
<h2 id="heading-it-all-comes-down-to-data-and-a-hybrid-approach"><strong>It All Comes Down to Data and a Hybrid Approach</strong></h2>
<p>The uncomfortable truth for any team building with AI is that the biggest challenge isn't the metrics; it's the <strong>test data</strong>. Creating a high-quality, diverse evaluation set that reflects real-world usage is an expensive, ongoing engineering and product effort. I’ve seen many teams deprioritize this, only to build evaluation systems that show green lights while the actual user experience stagnates.</p>
<p>The most successful GenAI companies, like OpenAI and Anthropic, have a core competency in data curation for evaluation. This is not a coincidence.</p>
<p><strong>An Action Plan for Teams:</strong></p>
<ol>
<li><p><strong>Treat the Test Set as a Product:</strong> It needs to be versioned, maintained, and expanded alongside your main product. This is a shared responsibility: product managers define the key use cases to cover, and engineers build the infrastructure to test against them reliably.</p>
</li>
<li><p><strong>Build a Hybrid Evaluation Dashboard:</strong> Don't rely on one number. Your team's dashboard should provide a complete picture:</p>
<ul>
<li><p><strong>Automated Metrics (ROUGE/Semantic Similarity):</strong> For a quick, directional pulse in your CI/CD pipeline.</p>
</li>
<li><p><strong>LLM-as-a-Judge Scores:</strong> For scalable, criteria-based quality checks on nuanced attributes like "helpfulness" or "brand tone."</p>
</li>
<li><p><strong>Human Feedback:</strong> A direct pipeline from a "thumbs up/down" button in the UI or periodic human reviews on critical flows.</p>
</li>
</ul>
</li>
<li><p><strong>Define "Quality" Holistically:</strong> Your team's definition of done must go beyond factual correctness. Your evaluation rubric should include:</p>
<ul>
<li><p><strong>Safety:</strong> Does it avoid harmful or inappropriate language?</p>
</li>
<li><p><strong>Tone of Voice:</strong> Does it sound like your brand?</p>
</li>
<li><p><strong>User Satisfaction:</strong> Is the user actually achieving their goal?</p>
</li>
</ul>
</li>
<li><p><strong>Deconstruct Your Systems:</strong> For multi-step systems like RAG, insist on component-level metrics. When a metric drops, you need to know <em>which part</em> of the system broke to debug efficiently.</p>
</li>
</ol>
<p>Building in the GenAI era requires a new level of rigor in how we define and measure quality. Moving past simplistic scores to a holistic evaluation framework is no longer optional—it's the core work of building AI products that are not just impressive demos, but are also reliable, safe, and genuinely useful.</p>
]]></content:encoded></item><item><title><![CDATA[The Decline of the "Prompt Expert": Why AI Is Making Prompt Engineering Obsolete]]></title><description><![CDATA[For the past few years, the rise of large language models (LLMs) has fueled a growing industry of so-called "prompt experts"—people who claim to have mastered the art of crafting precise instructions to extract the best results from AI. But as LLMs b...]]></description><link>https://mundher.com/the-decline-of-the-prompt-expert-why-ai-is-making-prompt-engineering-obsolete</link><guid isPermaLink="true">https://mundher.com/the-decline-of-the-prompt-expert-why-ai-is-making-prompt-engineering-obsolete</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 09 Feb 2025 18:07:55 GMT</pubDate><content:encoded><![CDATA[<p>For the past few years, the rise of large language models (LLMs) has fueled a growing industry of so-called "prompt experts"—people who claim to have mastered the art of crafting precise instructions to extract the best results from AI. But as LLMs become more advanced, the importance of prompt engineering is rapidly diminishing. The reality is simple: AI is getting better at understanding natural language, making elaborate prompting techniques increasingly unnecessary.</p>
<h2 id="heading-ai-is-becoming-more-intuitive">AI Is Becoming More Intuitive</h2>
<p>The early days of LLMs often required users to experiment with different phrasings to get the best results. However, modern AI models are trained on vast amounts of data and improved architectures that enable them to interpret instructions more naturally. Instead of needing a carefully structured prompt, today’s models can process vague, casual, or even slightly ambiguous commands with ease.</p>
<p>For example, early models required precise formatting, explicit step-by-step breakdowns, and structured wording. Now, newer models can infer context, understand implied meaning, and generate useful outputs without the need for complex prompt tuning. This means that instead of focusing on how to "trick" the AI into giving the best answer, users can simply ask questions as they would to a knowledgeable human.</p>
<h2 id="heading-the-overhyped-industry-of-prompt-engineering">The Overhyped Industry of "Prompt Engineering"</h2>
<p>As with any emerging technology, a subset of self-proclaimed experts have positioned themselves as gatekeepers, offering courses, guides, and consulting services on how to craft the perfect prompt. While some strategies may have been helpful in the past, the need for such expertise is rapidly fading.</p>
<p>Most prompt engineering advice boils down to common-sense practices like being clear, specifying output format, or providing context—all things that even casual users can figure out intuitively. The AI itself is improving at handling ambiguity, reducing the necessity for highly refined prompts. As a result, the idea that businesses need dedicated "prompt specialists" is becoming increasingly outdated.</p>
<h2 id="heading-the-future-conversational-ai-not-manual-tweaking">The Future: Conversational AI, Not Manual Tweaking</h2>
<p>Instead of relying on highly specific prompts, the future of LLMs is in their ability to engage in dynamic, natural conversations. AI systems are evolving to ask clarifying questions, refine their own outputs, and adapt based on user feedback. This means that rather than needing a human to master a rigid prompting technique, AI itself will adjust based on user intent.</p>
<p>Think about how we interact with human assistants: we don’t script perfect instructions in advance; we communicate, clarify, and refine our requests in real time. That’s exactly where AI is heading. The need to manually craft prompts will soon be seen as an unnecessary relic of early AI experimentation.</p>
]]></content:encoded></item><item><title><![CDATA[What Can Machine Learning Engineers Learn from Site Reliability Engineering?]]></title><description><![CDATA[Machine learning engineers transitioning from experimental models to production systems can significantly benefit from adopting principles established in Site Reliability Engineering (SRE). By integrating SRE practices, ML engineers can build systems...]]></description><link>https://mundher.com/what-can-machine-learning-engineers-learn-from-site-reliability-engineering</link><guid isPermaLink="true">https://mundher.com/what-can-machine-learning-engineers-learn-from-site-reliability-engineering</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Wed, 05 Feb 2025 10:48:39 GMT</pubDate><content:encoded><![CDATA[<p>Machine learning engineers transitioning from experimental models to production systems can significantly benefit from adopting principles established in Site Reliability Engineering (SRE). By integrating SRE practices, ML engineers can build systems that are not only accurate but also robust, scalable, and reliable. Below are key lessons drawn from SRE that directly apply to ML engineering:</p>
<hr />
<h2 id="heading-1-define-slis-and-slos-beyond-model-accuracy"><strong>1. Define SLIs and SLOs Beyond Model Accuracy</strong></h2>
<p>Traditional ML metrics like accuracy or F1 scores are insufficient for production systems. SRE emphasizes <strong>Service Level Indicators (SLIs)</strong> and <strong>Service Level Objectives (SLOs)</strong> to quantify reliability. For ML systems, this includes:</p>
<ul>
<li><p><strong>Latency</strong>: Response time for model inference.</p>
</li>
<li><p><strong>Availability</strong>: Uptime of ML APIs or services .</p>
</li>
<li><p><strong>Data Drift</strong>: Monitoring input distribution shifts that degrade model performance.<br />  By setting SLOs for these metrics, teams can prioritize reliability alongside accuracy.</p>
</li>
</ul>
<hr />
<h2 id="heading-2-automate-deployment-and-monitoring"><strong>2. Automate Deployment and Monitoring</strong></h2>
<p>SRE reduces manual toil through automation, a practice critical for ML workflows:</p>
<ul>
<li><p><strong>CI/CD Pipelines</strong>: Automate model deployment with rollback capabilities to handle faulty updates.</p>
</li>
<li><p><strong>Self-Healing Systems</strong>: Use ML to detect anomalies (e.g., data pipeline failures) and trigger remediation.</p>
</li>
<li><p><strong>Testing</strong>: Integrate automated canary testing to validate model performance in staging before full rollout.<br />  Automation minimizes human error and accelerates iteration.</p>
</li>
</ul>
<hr />
<h2 id="heading-3-prioritize-observability-for-silent-failures"><strong>3. Prioritize Observability for Silent Failures</strong></h2>
<p>ML systems often fail silently (e.g., gradual accuracy decay). SRE-inspired observability includes:</p>
<ul>
<li><p><strong>Model Metrics</strong>: Track precision/recall over time and correlate with infrastructure health.</p>
</li>
<li><p><strong>Data Lineage</strong>: Monitor data pipelines to catch preprocessing errors or missing features.</p>
</li>
<li><p><strong>Root Cause Analysis</strong>: Use tools like tracing to link model failures to specific code or data changes.<br />  Comprehensive observability helps detect issues before users are impacted.</p>
</li>
</ul>
<hr />
<h2 id="heading-4-formalize-incident-response-for-model-failures"><strong>4. Formalize Incident Response for Model Failures</strong></h2>
<p>Treat model failures like system outages using SRE incident management practices:</p>
<ul>
<li><p><strong>Runbooks</strong>: Document steps to diagnose and resolve common issues (e.g., data drift).</p>
</li>
<li><p><strong>Blameless Postmortems</strong>: Analyze failures to improve processes rather than assign blame.</p>
</li>
<li><p><strong>Escalation Paths</strong>: Define roles for triaging severe incidents (e.g., automated rollbacks vs. human intervention).<br />  Proactive incident management reduces downtime and builds trust.</p>
</li>
</ul>
<hr />
<h2 id="heading-5-design-for-resilience"><strong>5. Design for Resilience</strong></h2>
<p>SRE emphasizes building systems that withstand failures. ML engineers should:</p>
<ul>
<li><p><strong>Implement Fallbacks</strong>: Deploy simpler models (e.g., rule-based systems) as backups during outages.</p>
</li>
<li><p><strong>Redundancy</strong>: Replicate data pipelines and model servers to avoid single points of failure.</p>
</li>
<li><p><strong>Chaos Engineering</strong>: Test system resilience by intentionally injecting failures (e.g., synthetic data corruption).<br />  Resilient design ensures graceful degradation under stress.</p>
</li>
</ul>
<hr />
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>Adopting SRE principles bridges the gap between experimental ML and production-grade systems. By focusing on reliability metrics, automation, observability, and resilience, ML engineers can create solutions that are not just innovative but also dependable at scale. As ML systems grow in complexity, the SRE mindset—proactive, data-driven, and iterative—will be indispensable for maintaining performance and user trust .</p>
]]></content:encoded></item><item><title><![CDATA[The EU AI Act: First Compliance Deadline is Here]]></title><description><![CDATA[February 2 marks the first compliance deadline for the EU’s AI Act, the groundbreaking regulatory framework that officially took effect last August. This legislation sets a global precedent in defining clear boundaries for the development and deploym...]]></description><link>https://mundher.com/the-eu-ai-act-first-compliance-deadline-is-here</link><guid isPermaLink="true">https://mundher.com/the-eu-ai-act-first-compliance-deadline-is-here</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Wed, 05 Feb 2025 10:44:26 GMT</pubDate><content:encoded><![CDATA[<p>February 2 marks the first compliance deadline for the EU’s AI Act, the groundbreaking regulatory framework that officially took effect last August. This legislation sets a global precedent in defining clear boundaries for the development and deployment of artificial intelligence within the European Union.</p>
<h3 id="heading-key-provisions-and-banned-ai-applications">Key Provisions and Banned AI Applications</h3>
<p>As of today, certain AI applications are outright banned to protect fundamental rights, privacy, and societal well-being. These include:</p>
<p>❌ <strong>Social Scoring Based on Personal Behavior:</strong> AI systems that rank individuals based on their social conduct, similar to systems used in some authoritarian regimes.</p>
<p>❌ <strong>Manipulative or Deceptive AI:</strong> Technologies designed to influence user decisions through covert manipulation or exploitation of psychological vulnerabilities.</p>
<p>❌ <strong>AI Exploiting Vulnerabilities:</strong> Systems targeting individuals based on specific vulnerabilities related to age, disability, or socioeconomic status.</p>
<p>❌ <strong>Crime Prediction Based on Appearance:</strong> AI models making predictions about criminal behavior based solely on physical traits.</p>
<p>❌ <strong>Biometric AI Inferring Personal Characteristics:</strong> Technologies that deduce sensitive personal information, such as sexual orientation, from biometric data.</p>
<p>❌ <strong>Real-Time Biometric Surveillance in Public Spaces:</strong> The use of AI for continuous biometric monitoring in public areas without stringent legal oversight.</p>
<p>❌ <strong>Emotion Recognition at Work or School:</strong> AI tools aimed at analyzing emotions in professional or educational environments, which can lead to invasive surveillance.</p>
<p>❌ <strong>Facial Recognition Databases from Online Scraping:</strong> Databases created by harvesting facial images from the internet without explicit consent.</p>
<h3 id="heading-what-this-means-for-businesses">What This Means for Businesses</h3>
<p>Organizations operating within the EU or offering AI products and services in the region must ensure compliance with these regulations. Non-compliance can result in hefty fines and reputational damage. Businesses should:</p>
<ul>
<li><p><strong>Conduct thorough audits</strong> of their AI systems.</p>
</li>
<li><p><strong>Eliminate or modify</strong> prohibited functionalities.</p>
</li>
<li><p><strong>Implement robust governance frameworks</strong> to oversee AI ethics and compliance.</p>
</li>
</ul>
<h3 id="heading-looking-ahead">Looking Ahead</h3>
<p>The EU AI Act represents a significant shift towards ethical AI development and responsible deployment. As additional compliance deadlines approach, businesses must stay proactive, continuously adapting to meet evolving regulatory requirements. This new era of AI governance is not just about legal compliance—it’s about fostering trust, accountability, and fairness in technology.</p>
]]></content:encoded></item><item><title><![CDATA[Why Optimizing for Long-Term Value (LTV) Beats Just Chasing Clicks in AdTech]]></title><description><![CDATA[In the fast-paced world of digital advertising, it’s tempting to focus on the metric that’s easiest to measure: Click-Through Rate (CTR). After all, clicks provide immediate feedback, making it seem like a straightforward indicator of campaign perfor...]]></description><link>https://mundher.com/why-optimizing-for-long-term-value-ltv-beats-just-chasing-clicks-in-adtech</link><guid isPermaLink="true">https://mundher.com/why-optimizing-for-long-term-value-ltv-beats-just-chasing-clicks-in-adtech</guid><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Wed, 05 Feb 2025 10:41:20 GMT</pubDate><content:encoded><![CDATA[<p>In the fast-paced world of digital advertising, it’s tempting to focus on the metric that’s easiest to measure: Click-Through Rate (CTR). After all, clicks provide immediate feedback, making it seem like a straightforward indicator of campaign performance. But here’s the hard truth—a click doesn’t always equal value.</p>
<h3 id="heading-enter-deep-reinforcement-learning-drl">Enter Deep Reinforcement Learning (DRL)</h3>
<p>Unlike traditional models that optimize for short-term gains, such as achieving an immediate click, Deep Reinforcement Learning (DRL) takes a broader perspective. It focuses on maximizing <strong>user lifetime value (LTV)</strong>, a metric that captures the long-term financial contribution of a user.</p>
<h3 id="heading-what-does-this-mean-in-practice">🔍 What Does This Mean in Practice?</h3>
<h4 id="heading-1-beyond-the-first-click">🔥 1. Beyond the First Click</h4>
<p>DRL models evaluate how each ad impression influences not just initial clicks but also <strong>downstream actions</strong> like sign-ups, purchases, repeat visits, and brand loyalty. It shifts the focus from “Did they click?” to “Did that click lead to meaningful engagement?” By analyzing long-term user behavior, DRL ensures that ads are optimized to attract users who are more likely to convert into loyal customers.</p>
<h4 id="heading-2-handling-delayed-rewards">♻️ 2. Handling Delayed Rewards</h4>
<p>In traditional models, the value of an ad is often judged immediately after the click. DRL, however, excels in environments where <strong>rewards are delayed</strong>. Even if a user doesn’t convert right away, DRL algorithms, such as Q-learning with discount factors, track the impact of that interaction over time. This approach allows advertisers to understand the cumulative value of each ad impression, accounting for both immediate responses and future actions.</p>
<h4 id="heading-3-smarter-budget-allocation">🎯 3. Smarter Budget Allocation</h4>
<p>When advertisers chase clicks, they risk overspending on ads that generate high CTR but low conversion rates. DRL changes the game by enabling <strong>smarter budget allocation</strong>. It helps advertisers identify and invest in strategies that nurture long-term customer relationships. This leads to <strong>maximized ROI</strong>, as funds are directed toward campaigns that drive sustainable growth rather than fleeting engagement.</p>
<h3 id="heading-the-bottom-line">The Bottom Line</h3>
<p>While CTR can provide quick insights, it doesn’t capture the full story. Optimizing for <strong>long-term value</strong> through DRL allows advertisers to build deeper connections with their audience, enhance brand loyalty, and achieve greater financial returns. In the evolving landscape of AdTech, focusing on LTV isn’t just a smarter strategy—it’s the future of digital advertising.</p>
]]></content:encoded></item><item><title><![CDATA[Instead of using retrieval to enhance ChatGPT, why not use ChatGPT to improve the retrieval?]]></title><description><![CDATA[Given a query, instruct a generative model (ChatGPT) to write a passage to answer the question. The passage may contain factual errors, but it looks like a good answer!

The generated passage is passed through an Encoder (Contriever) to get the embed...]]></description><link>https://mundher.com/instead-of-using-retrieval-to-enhance-chatgpt-why-not-use-chatgpt-to-improve-the-retrieval</link><guid isPermaLink="true">https://mundher.com/instead-of-using-retrieval-to-enhance-chatgpt-why-not-use-chatgpt-to-improve-the-retrieval</guid><category><![CDATA[chatgpt]]></category><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Thu, 28 Dec 2023 11:03:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703702599369/da986bdc-a123-45d7-8a19-d9a240126b87.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<ol>
<li><p>Given a query, instruct a generative model (ChatGPT) to write a passage to answer the question. The passage may contain factual errors, but it looks like a good answer!</p>
</li>
<li><p>The generated passage is passed through an Encoder (Contriever) to get the embedding of the passage. The encoder acts like a lossy compressor, where the extra (hallucinated) details are filtered out from the embedding.</p>
</li>
<li><p>A vector to search is performed against the corpus embeddings. The most similar real documents are retrieved and returned.</p>
</li>
</ol>
<p>    <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703702594304/89f8f21f-8c99-4001-bc19-67662bb2416a.png" alt class="image--center mx-auto" /></p>
<p>Paper: <a target="_blank" href="https://arxiv.org/abs/2212.10496">https://arxiv.org/abs/2212.10496</a></p>
]]></content:encoded></item><item><title><![CDATA[In-Context Few-Shots Prompting Approach]]></title><description><![CDATA[In the Few-Shot Prompting approach, through a few demonstrations, generative models quickly adapt to a specific domain and learn to follow the task format. However, the few-shots examples are fixed for all test examples (during inference). This neces...]]></description><link>https://mundher.com/in-context-few-shots-prompting-approach</link><guid isPermaLink="true">https://mundher.com/in-context-few-shots-prompting-approach</guid><category><![CDATA[search]]></category><category><![CDATA[chatgpt]]></category><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Fri, 22 Dec 2023 10:43:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703184502346/a3fdbfb5-7f57-421c-b71e-e3f84f8782dc.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the Few-Shot Prompting approach, through a few demonstrations, generative models quickly adapt to a specific domain and learn to follow the task format. However, the few-shots examples are fixed for all test examples (during inference). This necessitates that the few-shot examples selected are broadly representative and relevant to a wide distribution of text examples.</p>
<p>In the alternative, we can have a few-more-shots, and then during the inference, we dynamically select few-shots of them and provide them to the LLM. the criteria for selecting the examples are based on their embedding similarity to the query (KNN). This method is called In-Context few-shots.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703184954001/4f29f7b1-c8e0-4619-a3fe-ceab82e77f15.png" alt class="image--center mx-auto" /></p>
<p>Paper: <a target="_blank" href="https://arxiv.org/abs/2101.06804">https://arxiv.org/abs/2101.06804</a></p>
]]></content:encoded></item><item><title><![CDATA[Is Gemini Really Better than ChatGPT?]]></title><description><![CDATA[A new third-party study finds Gemini’s Pro model achieved comparable but slightly inferior accuracy compared to the current version of OpenAI’s GPT 3.5 Turbo. However, It outperforms Mixtral on every task.
Furthermore, Gemini performed better than GP...]]></description><link>https://mundher.com/is-gemini-really-better-than-chatgpt</link><guid isPermaLink="true">https://mundher.com/is-gemini-really-better-than-chatgpt</guid><category><![CDATA[gemini]]></category><category><![CDATA[chatgpt]]></category><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Tue, 19 Dec 2023 19:27:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703013984215/a0daf859-1db1-4fa6-9532-dd75e290ad9f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A new third-party study finds Gemini’s Pro model achieved comparable but slightly inferior accuracy compared to the current version of OpenAI’s GPT 3.5 Turbo. However, It outperforms Mixtral on every task.</p>
<p>Furthermore, Gemini performed better than GPT 3.5 Turbo on particularly long and complex reasoning tasks and was also adept multilingually in tasks where responses were not filtered.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703013952791/e377d739-d506-4e66-968d-f4959dedec85.png" alt class="image--center mx-auto" /></p>
<p>source: <a target="_blank" href="https://arxiv.org/abs/2312.11444">https://arxiv.org/abs/2312.11444</a></p>
<p>However, the result on Mixteral should be taken with a grab of salt, as a user on X raised issues on the Mixteral experimental setup (<a target="_blank" href="https://x.com/fluffykittnmeow/status/1737044933339472254?s=20">https://x.com/fluffykittnmeow/status/1737044933339472254?s=20</a>)</p>
]]></content:encoded></item><item><title><![CDATA[Managing AI Risks in an Era of Rapid Progress]]></title><description><![CDATA[Prominent AI researchers, including Geoffrey Hinton, Yoshua Bengio, Stuart Russell, and others, are urging the establishment of global regulations to ensure AI is used responsibly. They propose the creation of a supervisory body, similar to the Nucle...]]></description><link>https://mundher.com/managing-ai-risks-in-an-era-of-rapid-progress</link><guid isPermaLink="true">https://mundher.com/managing-ai-risks-in-an-era-of-rapid-progress</guid><category><![CDATA[AI]]></category><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 29 Oct 2023 21:03:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1698613377749/44f3cb37-6786-44af-a591-3a9518f2d597.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Prominent AI researchers, including Geoffrey Hinton, Yoshua Bengio, Stuart Russell, and others, are urging the establishment of global regulations to ensure AI is used responsibly. They propose the creation of a supervisory body, similar to the Nuclear Energy Agency, to oversee (watchdog) the most advanced AI systems developed using high-end supercomputers. Concurrently, they recommend exempting smaller, low-risk AI models and academic studies from such regulations. This AI watchdog agency needs access to advanced AI systems before deployment to evaluate them for dangerous capabilities.</p>
<h2 id="heading-my-takeaway">My takeaway</h2>
<p>I’m up for such regulation as long as the small to mid-AI companies aren’t affected.</p>
<p>But, how would they differentiate between the smaller, low-risk AI models and the high-risk ones?</p>
<p>And how can we make countries that don’t trust each other agree on such regulations?</p>
<p>Moreover, how to enforce such regulations globally?</p>
<p>Would it be like the Climate Change Conferences where the world failed to secure a solid commitment?</p>
<p>Paper: <a target="_blank" href="https://managing-ai-risks.com/">https://managing-ai-risks.com/</a></p>
]]></content:encoded></item><item><title><![CDATA[Can LLMs Self-critiquing Their Own Answers?]]></title><description><![CDATA[Self-correction/critiquing is a methodology proposed to improve the accuracy and appropriateness of the generated content by Large Language Models (LLMs). It involves an LLM reviewing its own responses, identifying problems or errors, and revising it...]]></description><link>https://mundher.com/can-llms-self-critiquing-their-own-answers</link><guid isPermaLink="true">https://mundher.com/can-llms-self-critiquing-their-own-answers</guid><category><![CDATA[llm]]></category><dc:creator><![CDATA[Mundher Al-Shabi, PhD]]></dc:creator><pubDate>Sun, 22 Oct 2023 16:09:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1697990710760/ee0b8230-bb8c-4ef0-8e5f-66dae992f8ad.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Self-correction/critiquing is a methodology proposed to improve the accuracy and appropriateness of the generated content by Large Language Models (LLMs). It involves an LLM reviewing its own responses, identifying problems or errors, and revising its answers accordingly.</p>
<p>But, If an LLM possesses the ability to self-correct, why doesn’t it simply offer the correct answer in its initial attempt?</p>
<p>In this month (October), two research papers showed that LLMs are not yet capable of self-correcting their reasoning basically because LLMs cannot verify the solution.</p>
<p>Moreover, the iterative mode, where the question and the generated answer are feedback to the LLM over and over is degrading the quality of the answer significantly.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1697990816540/27aa85e3-f7c9-402b-b206-14b06044fe64.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-references"><strong>References:</strong></h2>
<p><a target="_blank" href="https://arxiv.org/abs/2310.01798">LARGE LANGUAGE MODELS CANNOT SELF-CORRECT REASONING YET</a>: by J Huang et. al</p>
<p><a target="_blank" href="https://arxiv.org/abs/2310.12397">GPT-4 Doesn't Know It's Wrong: An Analysis of Iterative Prompting for Reasoning Problems:</a> by K Valmeekam et. all</p>
]]></content:encoded></item></channel></rss>