<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Souhail Guennouni - سهيل گنوني on Medium]]></title>
        <description><![CDATA[Stories by Souhail Guennouni - سهيل گنوني on Medium]]></description>
        <link>https://medium.com/@souhailguennouni?source=rss-b8cb8c28ffa9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IhG5APe6luy3EzdRjcXrAA.png</url>
            <title>Stories by Souhail Guennouni - سهيل گنوني on Medium</title>
            <link>https://medium.com/@souhailguennouni?source=rss-b8cb8c28ffa9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 06:11:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@souhailguennouni/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When AI Challenges the Foundations of Computer Science]]></title>
            <link>https://medium.com/@souhailguennouni/when-ai-challenges-the-foundations-of-computer-science-4dbf49e67ebf?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dbf49e67ebf</guid>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 14:07:58 GMT</pubDate>
            <atom:updated>2026-10-28T14:07:58.767Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*_RIrfJytf1g5oJlxCXmjqw@2x.jpeg" /></figure><p><em>OpenAI’s claimed refutation of the Exponential Time Hypothesis could reshape our understanding of computational complexity. But the implications for AI-driven scientific discovery may be equally important.</em></p><p>On October 26, 2026, OpenAI announced that one of its internal AI models had produced a mathematical proof challenging the Exponential Time Hypothesis (ETH), a conjecture that has shaped theoretical computer science for more than 25 years.</p><p>For those outside computer science, ETH may not sound particularly important. It is not a technology we use, an algorithm we implement, or a mathematical theorem most software engineers encounter in their daily work. Yet hundreds of scientific papers rely on it to establish what computers can and cannot efficiently solve.</p><p>The interesting part is that ETH was never proven. It was a widely accepted assumption about the fundamental limits of computation, supported by decades of research but never formally established.</p><p>OpenAI now claims that its AI system has discovered an algorithm that contradicts this assumption, accompanied by a mathematical proof verified using Lean. The result is being examined by leading complexity theorists, including two of the researchers who originally introduced the hypothesis.</p><p>Around the same time, Anthropic released its own proposed refutation, adding another dimension to the discussion.</p><p>The scientific community has not yet reached a consensus on these results. But the development raises two interesting questions. Have we misunderstood some of the fundamental limits of computation? And what does it tell us about the ability of AI systems to contribute to original scientific research?</p><h3>Understanding the problem: Why computation becomes expensive</h3><p>To understand ETH, we need to start with a classical problem in computer science known as Boolean satisfiability, or SAT.</p><p>Imagine a system containing hundreds of switches, each having two possible states: ON or OFF. We also have a set of rules defining which combinations of switches are acceptable.</p><p>For example, one rule might require at least one of three switches to be ON. Another might require a different combination of switches to satisfy a particular condition.</p><p>The objective is to find a configuration that satisfies all the rules simultaneously.</p><p>A specific version of this problem, called 3-SAT, restricts each rule to at most three Boolean variables.</p><p>At first glance, the problem looks relatively straightforward. We could simply generate every possible combination and check whether it satisfies the conditions.</p><p>The difficulty is how quickly the number of combinations grows.</p><p>With 10 variables, we have 1,024 possible configurations. With 50 variables, we exceed one quadrillion. With 100 variables, the number reaches approximately 1.27 × 10³⁰.</p><p>Every additional variable doubles the search space.</p><p>This type of growth is known as exponential complexity. An exhaustive search algorithm requires O(2ⁿ) time, where n represents the number of variables.</p><p>Of course, modern SAT solvers do not simply enumerate every possible combination. They use techniques such as constraint propagation, conflict-driven clause learning, and intelligent branching to eliminate large portions of the search space.</p><p>These techniques have made SAT solvers remarkably effective for many practical applications, including hardware verification, software testing, planning, and optimization.</p><p>However, their practical efficiency does not establish that every possible instance can be solved efficiently.</p><p>Some problems remain extremely difficult as the number of variables increases.</p><p>The fundamental question is whether this difficulty comes from limitations in our algorithms or from an inherent property of the problem itself.</p><p>This is precisely what ETH attempts to address.</p><h3>The Exponential Time Hypothesis</h3><p>Introduced by Russell Impagliazzo and Ramamohan Paturi around 1999, ETH proposes that solving 3-SAT requires exponential time in the worst case.</p><p>More precisely, ETH states that no deterministic algorithm can solve every instance of 3-SAT in subexponential time, expressed mathematically as:</p><p><strong>T(n) = 2^o(n)</strong></p><p>This notation means that the exponent grows more slowly than any positive constant multiple of n.</p><p>For example, an algorithm with a running time of 2^(√n) would be subexponential, while an algorithm running in 2^(0.01n) would still be exponential.</p><p>The distinction may appear theoretical, but it is fundamental to how computer scientists classify computational problems.</p><p>ETH essentially establishes a proposed lower bound on how efficiently 3-SAT can be solved.</p><p>Over the years, researchers have used this assumption to establish conditional complexity bounds for many other problems.</p><p>Consider an optimization problem involving scheduling thousands of tasks across limited resources. A researcher might demonstrate that if this scheduling problem could be solved below a certain time complexity, the same technique could be used to solve 3-SAT in subexponential time.</p><p>Under ETH, this would imply that the proposed improvement is impossible.</p><p>Similar reasoning has been applied to graph algorithms, computational geometry, databases, and computational biology.</p><p>This is why ETH became so influential. It allowed researchers to establish meaningful limitations on algorithms without having to prove unconditional lower bounds, which are notoriously difficult to establish.</p><p>But there is an important distinction between a proven theorem and a conditional result.</p><p>A theorem established under ETH remains mathematically valid as a conditional statement. Its interpretation as a fundamental computational limitation, however, depends on ETH being true.</p><p>And ETH has never been proven.</p><p>For more than two decades, the hypothesis survived because no one had discovered an algorithm capable of contradicting it.</p><p>Until potentially now.</p><h3>What OpenAI claims to have discovered</h3><p>OpenAI’s announcement describes an AI-generated algorithm that would solve the relevant satisfiability problem in subexponential time.</p><p>If correct, this would directly contradict ETH.</p><p>The significance is not simply that the AI found a faster algorithm. Algorithmic improvements happen regularly, and even substantial improvements in execution time do not necessarily change the theoretical complexity of a problem.</p><p>For instance, improving an algorithm from O(2ⁿ) to O(1.5ⁿ) can make a considerable difference in practice, but both remain exponential.</p><p>ETH allows such improvements.</p><p>What it rules out is an algorithm whose exponent grows sublinearly with the number of variables.</p><p>That is the boundary OpenAI claims to have crossed.</p><p>The company also published a formalization of the proof using Lean, an interactive theorem prover designed to verify mathematical reasoning.</p><p>This is an important technical detail.</p><p>LLMs are probabilistic systems. They can generate convincing mathematical arguments that c\\\]ntain subtle logical errors, incorrect assumptions, or unsupported conclusions.</p><p><em>A proof assistant operates differently.</em></p><p>Lean uses a formal logical system in which mathematical statements and inference steps must satisfy strict rules. Its kernel checks that a proof establishes the specified theorem from its declared assumptions.</p><p>In principle, this allows mathematical arguments generated by AI to be subjected to deterministic verification.</p><p>However, the fact that Lean accepts a proof does not automatically mean the broader scientific claim is correct.</p><p>The formal statement must accurately represent the original conjecture. The assumptions must be appropriate, and the complexity analysis must correspond to the intended computational model.</p><p>A proof can be formally valid while proving a statement that is weaker or different from what researchers intended.</p><p>This is why the result is undergoing independent examination.</p><p>Russell Impagliazzo and Ramamohan Paturi, together with MIT professor Ryan Williams, are involved in organizing the scientific review. Their participation should not be interpreted as confirmation of OpenAI’s claim.</p><p>The objective is to establish whether the proposed algorithm and its formal proof genuinely contradict ETH.</p><p>The outcome remains open.</p><h3>What happens if ETH is false?</h3><p>A confirmed refutation would have significant implications for computational complexity theory.</p><p>Hundreds of research results rely on ETH to establish conditional lower bounds. If the hypothesis is false, researchers would need to revisit those results and determine whether the underlying limitations can be established through alternative assumptions or unconditional proofs.</p><p>This does not mean the mathematical results themselves suddenly become incorrect.</p><p>A statement of the form “if ETH is true, then this problem requires at least a certain amount of computation” remains logically valid even if ETH turns out to be false.</p><p>What disappears is the justification for treating that conditional bound as evidence of an unavoidable limitation.</p><p>More importantly, disproving ETH would reopen algorithmic research directions that were previously considered unlikely to succeed.</p><p>Problems in graph theory, optimization, and other disciplines might admit algorithms with better asymptotic complexity than researchers had assumed possible.</p><p>However, there is a difference between theoretical complexity and practical performance.</p><p>A subexponential algorithm can still require enormous computational resources.</p><p>An algorithm running in 2^(√n) time, for example, may be considerably better than 2ⁿ asymptotically, but it can remain impractical for sufficiently large inputs.</p><p>Similarly, disproving ETH would not resolve the famous P versus NP problem.</p><p>P versus NP asks whether problems whose solutions can be verified in polynomial time can also be solved in polynomial time.</p><p>A subexponential algorithm for 3-SAT would not establish a polynomial-time solution.</p><p>We would have learned something important about the limits of computation, but not necessarily discovered an efficient way to solve every difficult problem.</p><p>This distinction matters because theoretical breakthroughs often precede practical applications by many years.</p><p>In software engineering, we regularly encounter technologies that demonstrate impressive capabilities in research environments but require substantial additional work before they can be deployed reliably and economically.</p><p>Algorithmic research is no different.</p><p>A theoretical improvement establishes a new possibility. Turning it into something useful requires additional engineering, optimization, and experimentation.</p><h3>What does this tell us about AI reasoning?</h3><p>Beyond ETH itself, I find the implications for AI research particularly interesting.</p><p>For years, much of the progress in generative AI has been measured through improvements in language understanding, code generation, mathematical benchmarks, and increasingly complex reasoning tasks.</p><p>The emergence of reasoning-focused models introduced techniques that allow models to spend additional computation exploring intermediate steps, evaluating candidate solutions, and correcting errors before producing an answer.</p><p>Combined with external tools, these capabilities have enabled AI systems to tackle increasingly difficult problems.</p><p>But there is a distinction between solving a problem for which a solution is already known and producing an original mathematical discovery.</p><p>Most AI benchmarks measure performance against established answers. Even when the problems are difficult, the evaluation process generally assumes that a correct solution already exists.</p><p>Research problems are different.</p><p>There may be no known solution, no reference answer, and sometimes no established method for determining whether a proposed approach will work.</p><p>The ETH result, if confirmed, would demonstrate that an AI system can contribute to a problem at this level.</p><p>That is an important development, although I would be careful about interpreting it as evidence of general intelligence.</p><p>In my earlier article, <em>Word Models Won’t Grow Into World Models</em>, I argued that increasingly sophisticated language generation and reasoning do not necessarily imply the emergence of robust, general-purpose intelligence.</p><p><strong>I still believe that distinction matters.</strong></p><p>Producing a novel mathematical proof demonstrates a particular capability. It does not automatically establish that the underlying system possesses a general understanding of the physical world, causal reasoning across arbitrary environments, or the ability to learn continuously from real-world interaction.</p><p>Mathematics is also a particularly interesting domain for AI because its rules can be represented formally.</p><p>Unlike many real-world problems, where correctness depends on incomplete observations, changing environments, and uncertain causal relationships, mathematical reasoning can often be expressed through explicit definitions, axioms, and logical inference rules.</p><p>This creates an environment in which AI-generated solutions can be systematically explored and verified.</p><p>The combination of generative models, search algorithms, formal methods, and computational verification may therefore become particularly effective for mathematical discovery.</p><p>The model proposes candidate ideas. Search and reasoning processes explore possible solutions. Formal tools verify whether the resulting arguments satisfy the required logical constraints.</p><p>What matters is not only the intelligence of the model, but the architecture of the system around it.</p><p>This is consistent with a broader pattern we are seeing in AI engineering.</p><p>The most capable systems are increasingly those that combine foundation models with specialized tools, external memory, structured reasoning, and verification mechanisms.</p><p>The ETH announcement may be another illustration of how powerful that combination can become.</p><h3>From AI-generated answers to AI-generated knowledge</h3><p>There is another dimension to this development that deserves attention.</p><p>We have spent considerable effort improving the reliability of AI-generated answers.</p><p>Techniques such as retrieval-augmented generation, grounding, evaluation frameworks, and human-in-the-loop validation aim to reduce hallucinations and ensure that model outputs remain consistent with established knowledge.</p><p>These approaches are essential when AI systems operate in enterprise environments, particularly in regulated industries where incorrect outputs can have serious consequences.</p><p>Scientific discovery introduces a different challenge.</p><p>The objective is no longer simply to ensure that an answer is consistent with existing knowledge. It is to determine whether a new claim extends that knowledge correctly.</p><p>A retrieval system cannot validate a mathematical discovery merely by comparing it with existing publications, because the result may not exist in those publications.</p><p>Similarly, a language model evaluating another model’s reasoning cannot provide the same guarantees as a formal verification system.</p><p>This suggests that the architecture of AI systems designed for scientific discovery will need to place considerably more emphasis on formal reasoning, verification, reproducibility, and independent evaluation.</p><p>The role of human researchers also changes.</p><p>Rather than spending all their effort generating candidate solutions, they may increasingly focus on understanding, validating, and extending results proposed by AI systems.</p><p>That does not eliminate the need for scientific expertise.</p><p>On the contrary, the more capable AI becomes at generating plausible discoveries, the more important it becomes to distinguish genuine results from sophisticated errors.</p><p>The ETH case illustrates this particularly well.</p><p>OpenAI has produced a claim, a proposed algorithm, and a formal proof artifact. But the scientific community still needs to establish whether the result genuinely resolves the original conjecture and understand the mathematical ideas behind it.</p><p>There is a difference between verifying that an argument is logically consistent and understanding why a new algorithm works, what assumptions it depends on, and how its underlying principles might be generalized.</p><p>That understanding is what allows one scientific result to become the foundation for further discoveries.</p><h3>Conclusion: A different role for AI in scientific research</h3><p>Whether OpenAI’s proposed refutation of ETH is ultimately accepted or rejected, the development reflects an important evolution in the capabilities of AI systems.</p><p>We are moving beyond applications where AI primarily retrieves, transforms, or generates information based on existing knowledge.</p><p>Increasingly, AI systems are being used to explore problems for which the answers are not yet known.</p><p>Mathematics provides a particularly suitable environment for this evolution because proposed results can often be expressed and verified through formal systems.</p><p>If the ETH refutation is confirmed, it would challenge a foundational assumption in computational complexity theory and potentially reopen several areas of algorithmic research.</p><p>If the proof is rejected, the examination will still provide valuable insight into the strengths and limitations of AI-generated mathematical reasoning.</p><p>I remain cautious about interpreting individual breakthroughs as evidence that we are approaching artificial general intelligence. A system capable of producing an important mathematical result is not necessarily capable of reasoning reliably across every domain.</p><p>But I am increasingly convinced that the combination of advanced reasoning models, specialized tools, and formal verification will change how scientific research is conducted.</p><p>For decades, we have used computers to execute algorithms designed by humans. We are now exploring systems capable of contributing to the discovery of new algorithms.</p><p>The significance of this development is not simply that AI may have solved a difficult mathematical problem.</p><p>It is that AI may help us revisit assumptions about what is computationally possible, including assumptions that have guided research for decades.</p><p>And in science, challenging an established assumption can sometimes be more valuable than solving another problem within it.</p><p>⸻</p><p><strong>References</strong></p><ol><li>OpenAI — Working with academic communities to build scientific understanding, October 26, 2026.</li><li>2. OpenAI — The Exponential Time Hypothesis is False, October 2026.</li><li>3. Impagliazzo, R., Paturi, R., and Zane, F. — Which Problems Have Strongly Exponential Complexity?, 2001.</li><li>4. Public discussion and independent examination organized by Impagliazzo, Paturi, and Williams, October 2026.</li><li>5. Anthropic’s independently announced ETH refutation, October 2026.</li></ol><p><em>Note: The proposed ETH refutations are subject to independent scientific examination. The claims discussed in this article should not be interpreted as established mathematical results until that process is complete.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dbf49e67ebf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Execution Gap in Digital and AI Transformation]]></title>
            <link>https://medium.com/@souhailguennouni/the-execution-gap-in-digital-and-ai-transformation-b4b93b17e227?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4b93b17e227</guid>
            <category><![CDATA[business-transformation]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[engineering-leadership]]></category>
            <category><![CDATA[cto-as-a-service]]></category>
            <category><![CDATA[ai-transformation]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 12:58:49 GMT</pubDate>
            <atom:updated>2026-06-22T13:05:18.847Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Why transformation rarely breaks at the level of ambition — and why implementation is where leadership alignment, ownership, and enterprise maturity are truly tested.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*Zw7x1WVu5H6K4pgQvziUgQ@2x.jpeg" /></figure><p>Over more than eighteen years, my view of digital and AI transformation has been shaped from nearly every seat that matters. I began as an engineer and researcher building the underlying technology — my doctoral work was in artificial intelligence — before moving through enterprise architecture and strategy, and then into operating roles accountable not for the slide but for the outcome, including scaling a technology venture from a standing start to several hundred people. That arc, from the architecture diagram to the P&amp;L, has shown me the executive ambition, the strategy work, the engineering reality, and the operational pressure that appears when change has to move from presentation to execution.</p><p>This article is not about whether organizations need to transform. That question is no longer the hard one. Across industries, leadership teams are already investing in digital platforms, cloud, automation, data capabilities, AI use cases, and new operating models to improve performance, productivity, resilience, and competitiveness. The more important question is why so many well-designed transformations still struggle to deliver their full potential.</p><p>The numbers frame the puzzle. By most credible estimates, only about a third of digital transformations fully achieve their goals, and the ratio has barely moved in a decade. AI has raised the stakes rather than eased them: BCG’s research finds that only about<strong> one company in four is capturing meaningful value from its AI investment</strong>. The instinct is to explain that gap with technology — the wrong platform, the immature model, the integration that proved harder than expected. I have come to a different conclusion. <strong>The technology is rarely where transformation is decided</strong>.</p><p>Because in most organizations, the ambition is not the problem. The strategic intent is clear, the roadmap is structured, the business case is reviewed, and the leadership team signs off. There is visible alignment at the top around becoming more digital, more data-driven, more automated, and more responsive to customers.</p><p>The real challenge begins later, when the strategy enters the operating reality of the enterprise. That is when departmental priorities start to diverge, local objectives compete with enterprise ambition, legacy systems demand more investment than expected, and ownership stays ambiguous. Teams are asked to deliver transformation while still carrying day-to-day operational commitments. Leaders continue to support the direction, but the willingness to adjust priorities, release capacity, address technical debt, and fund foundational work does not always follow at the same speed.</p><p>This is the gap this article is about: <em>the gap between approving a transformation strategy and implementing it; between leadership support and real alignment; between launching initiatives and changing how the enterprise actually performs. </em>Digital and AI transformation is not primarily a technology race. <strong>It is an execution discipline.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*a-bNl3hAWEbshoK2Bxcefg@2x.jpeg" /></figure><p><em>Figure 1: storefront and warehouse: Value insight based on BCG’s 10 — 20 — 70 principle.</em></p><h3><strong>Strategy is signed off. Execution is where it is tested.</strong></h3><p>A transformation strategy can be logical, professionally developed, and endorsed by every leader in the room. Execution tests something deeper: whether the organization is ready to change how it prioritizes, funds, governs, owns, measures, and absorbs transformation. That is where ambition either becomes impact or remains a roadmap.</p><p>Four lessons, drawn from different vantage points, point to the same conclusion. In architecture, I learned that technical decisions are never purely technical: a shortcut taken to solve an immediate issue becomes a constraint years later, when the organization needs to scale, integrate, secure, or modernize. In engineering leadership, I learned that capable teams rarely struggle for lack of commitment — <em>they struggle because priorities move faster than decisions, dependencies are not owned, and governance is heavier than the delivery speed expected of them</em>. In product and platform work,<em> I learned that a digital experience is only as strong as the operating model behind it:</em> a customer journey can look effortless on the front end while the work behind it still runs on manual checks, spreadsheet reconciliations, and approval chains no one redesigned. And in data and AI,<em> I learned that intelligence creates value not by impressing in a demo, but by improving a decision, changing a workflow, and being trusted enough to be used.</em></p><p>Together these point to one idea: transformation is not the deployment of new technology. It is the redesign of how the enterprise performs.</p><h3><strong>Support is not alignment</strong></h3><p>At the start of a transformation, alignment often feels strong because the conversation is still at the level of ambition. Leaders agree on the need to modernize, on the importance of digital channels, automation, cloud, data, and AI, and on the direction of travel. The pressure appears when the strategy asks the organization to behave differently.</p><p>It asks one department to pause a local priority so an enterprise dependency can move. It asks a business function to own a process redesign rather than wait for technology to automate the existing process. It asks leaders to fund architecture, integration, cybersecurity, and data-quality work that may not be visible to customers but is essential for scale. It asks teams to retire familiar tools and adopt new ways of working. This is where many transformations lose momentum — not because leaders stop believing in the ambition, but because belief has not yet been converted into operating discipline.</p><p><em>Support means leaders agree with the aspiration. Alignment means they are ready to make choices.</em> A leadership committee can approve a roadmap and still delay the decisions required to make it executable. A function can support transformation in principle while protecting its own roadmap in practice. A sponsor can endorse an initiative while ownership of the actual outcome stays unclear.</p><p>The result is rarely dramatic failure. It is gradual friction. Dependencies accumulate, delivery slows, governance grows heavier, and teams spend more time coordinating than building. The roadmap stays active, but impact arrives slower than expected.</p><h3><strong>Motion is not momentum</strong></h3><p>Many organizations execute transformation as a portfolio of initiatives — a new platform, a mobile application, a cloud migration, a data product, an automation stream, an AI use case. Individually, each may be valid. Collectively, they do not automatically create transformation. That happens only when those initiatives change how decisions are made, how processes operate, how data is trusted, how risk is managed, how customers are served, and how value is measured.</p><p>A strong technology agenda can create movement. Only an operating-model shift creates momentum. External research reinforces the point. BCG’s 10–20–70 principle holds that, in AI transformation, roughly 10% of the value comes from the algorithms and about 20% from the technology and data — while the remaining 70% comes from the people and process change around them. The technology is rarely the bottleneck. The 70% is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*iVaYkruCLnEeZpi45ua62g@2x.jpeg" /></figure><p><em>Figure 2: BCG’s 10–20–70 principle for AI transformation. Source: BCG, The Leader’s Guide to Transforming with AI</em>.</p><h3><strong>Ownership is where execution usually breaks</strong></h3><p>The translation layer between strategy and execution — decision rights, ownership, governance, sequencing, funding, architecture, delivery capacity, adoption, data accountability, and value measurement — is where transformation is won or lost. When that layer is weak, transformation fragments. When it is strong, ambition converts into execution discipline. Ownership is the most common place it breaks.</p><p><em>Many initiatives have sponsors but not true owners.</em> A sponsor provides visibility and helps escalate. An owner makes decisions, accepts trade-offs, resolves ambiguity, aligns stakeholders, and stays accountable after go-live. A platform may be delivered by technology, but the process it changes belongs to the business. A data product may be built by a data team, but the definition of the metric belongs to a function. An AI use case may be developed by specialists, but the decision it influences belongs to an operational team. When ownership is ambiguous, progress depends on coordination rather than accountability — and coordination, however necessary, cannot replace it.</p><p>Consider a pattern I have seen more than once. A new customer-facing channel launches to genuine acclaim: the interface is clean, the demo is flawless, and the milestone is celebrated. Yet resolution times barely improve, because behind the polished front end the work still moves through manual checks and approval chains that were never redesigned. The channel was modernized. The work behind it was not. The organization upgraded its storefront and left the warehouse exactly as it was — and no single function owned the end-to-end outcome that would have closed the gap. This is why transformation so often slows at the interfaces between functions: the outcome depends on many, but is owned by none.</p><h3><strong>Legacy is not a side issue</strong></h3><p>Most leaders understand that legacy systems create constraints. Fewer fully account for the cost of addressing them. Legacy is not only old technology; it is accumulated business complexity expressed through systems, data, integrations, processes, controls, and habits. A digital product cannot move fast if core systems were never designed to expose reusable services. A data initiative cannot create trust if definitions differ across functions. An AI capability cannot scale on fragile, poorly governed pipelines.</p><p>Technical debt is therefore not only a technology issue — it shapes speed, cost, resilience, security, risk, and innovation capacity. McKinsey estimates that technical debt amounts to roughly 40% of the entire IT estate, that companies pay an additional 10 — 20% on every new project just to work around it, and that nearly a third of CIOs see more than a fifth of their new-product budget quietly diverted to servicing it. The same research finds the firms that actively manage it grow revenue materially faster than those that do not. The leadership implication is clear: transformation cannot scale sustainably if new capabilities are built on top of constraints no one is willing to address.</p><p>Yet because foundational work is less visible than a new channel or AI use case, it is easy to deprioritize. The organization wants the visible outcome but hesitates to fund the work that makes it sustainable — a self-limiting pattern in which the enterprise keeps investing in new capabilities while carrying forward the very constraints that will cap them. Legacy modernization is not a side activity. It is part of the transformation itself.</p><h3><strong>AI exposes enterprise maturity</strong></h3><p>AI has rightly increased the urgency of transformation. It can improve productivity, decision-making, automation, customer experience, risk detection, and knowledge work. But it also raises the bar, because it exposes the maturity of the enterprise around it: whether data is trusted, whether ownership is clear, whether processes are stable enough to improve, whether governance can move at the speed of innovation, whether architecture can support integration, whether users trust the output, and whether the organization can combine automation with human judgment. AI does not simplify organizational ambiguity. It exposes it.</p><p>This is why starting with a large use-case inventory creates activity without capability. The better starting point is to ask where intelligence can improve a real decision, workflow, risk control, or service outcome — and, critically, what must change around it for that improvement to last. The second half of that question is where AI transformation becomes real.</p><p>I have watched a promising proof of concept illustrate the point precisely. The model performed well and the business case was compelling, but the pilot stalled on the way to production: the data it relied on was fragmented across systems, no one owned the controls required to run it safely at scale, and the operational team it was meant to support had never been asked to trust its output. <em>The model was never the problem. The conditions around it were. The output may be accurate while users withhold trust; the business case may be strong while no one owns the capability after launch.</em></p><p>A pilot proves possibility. Scaling proves readiness. Pilots are protected: narrow scope, focused team, selected data, fast decisions, high executive attention. At scale, the capability has to live inside the enterprise and survive legacy systems, security and regulatory requirements, budget cycles, support models, operational handovers, and continuous change. Scaling is not a larger pilot. It is an operating-model challenge.</p><h3><strong>Portfolio discipline protects ambition</strong></h3><p>At the beginning, a broad roadmap feels ambitious: it gives every function a place in the journey, reflects leadership intent, and creates the impression of movement. Over time, if everything remains a priority, the organization congests. <em>Every initiative has a sponsor, every roadmap is urgent, every team is stretched, and no one wants to stop what they own</em>. Individually reasonable initiatives collectively exceed the capacity to execute and absorb change — because execution capacity, architecture capacity, change capacity, and leadership attention are all finite.</p><p><strong>One of the hardest leadership disciplines is therefore simplification</strong> — not as a lack of ambition, but as the discipline that protects ambition from becoming noise. The real move is to stop, sequence, and protect: stop what creates distraction, sequence what has dependencies, and protect what truly moves value. BCG’s own guidance to AI pacesetters echoes this — concentrate on three to five high-value plays rather than scattering effort across dozens of use cases. This is difficult precisely because it requires trade-offs, and trade-offs are where leadership alignment becomes real: deciding what stops so something more important can move, funding foundational work, resolving conflicts quickly instead of letting them circulate through governance forums, and protecting teams from constant reprioritization.</p><h3><strong>Go-live is not the finish line</strong></h3><p>The right platform can accelerate transformation, and the right partner can bring structure and capability. But selecting a platform is not the same as changing the enterprise. A platform does not automatically simplify a process; a system does not automatically create accountability; a tool does not automatically change behavior; a contract does not automatically generate value. The real questions begin after selection: Which processes will be redesigned? Which old tools retired? Which data becomes authoritative? Which decisions improve? Who owns the outcome after go-live, and what gets measured after the first release?</p><p><strong>Go-live is not the end of transformation</strong>. In many cases it is the beginning of the real test — and that test is adoption. Adoption is often treated as communication: training, launch messages, user guides. Those matter, but adoption is deeper than awareness. It is workflow change, ownership, incentives, and trust — whether people believe the new way of working is genuinely better, clearer, safer, or faster than the old one. If adoption is not designed early, it gets negotiated later under pressure. And when adoption is weak, organizations tend to question the tool, when the deeper issue is usually that the tool was delivered into an environment that was never prepared to change.</p><h3><strong>Conclusion: From intent to impact</strong></h3><p>This is why I see transformation leadership as an execution discipline. It is not only about setting vision; vision is necessary but not sufficient. It is not only about selecting technology; technology is essential but not sufficient. It is not only about delivery; delivery without adoption does not create full value. <em>Transformation leadership is about connecting ambition to the operating conditions that make impact possible.</em></p><p>In practice, that means starting with outcomes before tools, narrowing the portfolio before asking teams to accelerate, and clarifying ownership before execution fragments. It means treating data as an accountability system rather than only a technical asset, designing architecture intentionally because architecture determines future speed, involving users early because adoption cannot be forced at the end, scaling only what the organization is ready to absorb, and measuring value continuously rather than only at the close of a program. Above all, it means removing the friction that slows capable teams — unclear priorities, distributed ownership, unresolved dependencies, slow decisions, and constant reprioritization — not by lowering discipline, but by creating better discipline: clear priorities, clear ownership, clear decision rights, clear funding, clear architecture principles, clear measures of value, and clear protection from distraction. That is when transformation begins to move from intent to impact.</p><p>I remain optimistic, because the opportunity is real. AI, cloud, data, automation, and intelligent products can materially improve how organizations serve customers, support employees, manage risk, raise productivity, and create new value. But the organizations that capture that value will not be the ones that simply launch more initiatives, adopt more tools, or produce more roadmaps. They will be the ones that build the maturity to absorb change — connecting ambition with discipline, technology with operating-model change, data with accountability, architecture with speed, adoption with measurable value, and vision with execution maturity.</p><p><strong>Transformation is not a technology race. It is an enterprise discipline.</strong> Technology can enable transformation, but it cannot carry it alone. Real impact comes when leaders build the organization around the ambition: clear priorities, explicit ownership, trusted data, intentional architecture, empowered teams, designed adoption, measurable value, and the courage to make trade-offs.</p><p>That is when transformation stops being a roadmap. It becomes a new way for the organization to perform — and that is where ambition turns into impact.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4b93b17e227" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Word Models Won’t Grow Into World Models]]></title>
            <link>https://medium.com/@souhailguennouni/word-models-wont-grow-into-world-models-126af790d802?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/126af790d802</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[ai-world-model]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 13:50:06 GMT</pubDate>
            <atom:updated>2025-12-23T13:50:06.230Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why scaling LLMs alone is unlikely to reach AGI — and why the debate is still worth having</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmgxVP6eZqObxZqX9_UlwA.png" /></figure><p><em>A world model is an internal representation that lets an agent predict how reality evolves, especially when the agent intervenes, so it can plan, act, and update its beliefs from consequences rather than from the elegance of its explanations.</em></p><p><em>Yann LeCun has argued for this framing explicitly, proposing that autonomous intelligence requires predictive world models and planning rather than treating language generation as the core substrate.</em></p><p><em>The thesis of this article is that LLMs — despite being extraordinary — are best understood as word models optimized for plausibility in language, and that scaling them will continue to produce impressive competence without necessarily crossing the threshold into robust general intelligence, because next-token prediction does not force causal, action-grounded representations of the world.</em></p><p><em>At the same time, the “scaling optimists” are not unserious: leaders like Sam Altman and Dario Amodei point to the stubborn reliability of scaling laws and argue that increasingly capable agentic systems are near-term realities, while thinkers like Geoffrey Hinton argue that strong prediction implies deep internal structure that increasingly resembles understanding. Rather than treating this as a binary fight between camps, I’ll make the disagreement precise, anchor it in how children actually learn, and argue that the next step toward AGI is likely to be less about “bigger chat” and more about systems that learn and plan in the loop of perception → action → feedback.</em></p><h3>What do people mean by “AGI”?</h3><p>Before we go any further, it’s worth defining AGI in plain terms, because the acronym has become a magnet for hype, fear, marketing, and — sometimes — useful precision.</p><p><strong>AGI stands for Artificial General Intelligence</strong>, and most people use it to mean a system that can do <em>general-purpose intellectual work</em> at a level comparable to humans, not just in one narrow task, but across many different tasks, contexts, and domains. The “general” part is the key: it’s the difference between a system that is great at chess, or translation, or summarization, and a system that can adapt when the rules change, when the environment is unfamiliar, and when the problem has never been seen before.</p><p>A practical, reader-friendly way to think about AGI is this:</p><blockquote><strong>An AGI is an AI that can learn new tasks efficiently, reason across different contexts, plan over long horizons, and operate reliably in the real world — without needing to be retrained from scratch every time the situation changes.</strong></blockquote><p>In other words, AGI isn’t just “smart answers.” It’s <strong>robust competence under novelty</strong>.</p><p>That definition also highlights why this debate is so charged: if your definition of AGI is “passes a wide range of tests,” then scaling language models might plausibly get you there; if your definition of AGI is “an agent that can operate in open-ended environments with real consequences,” then you quickly run into questions about world models, causality, and learning from experience — because those are the ingredients that make intelligence durable rather than decorative.</p><p>And that brings us to the real topic.</p><h3>Defining a world model, without romanticizing it</h3><p>A world model is not a poetic metaphor for “the AI has a worldview,” and it isn’t merely a multimodal model that can ingest images and video; it is a predictive structure that helps an agent keep track of what is currently true, anticipate what will likely be true next, and reason about the effects of its own interventions in a way that remains coherent over time. This is why LeCun’s “<a href="https://openreview.net/pdf?id=BZ5a1r-kVsf">Path Towards Autonomous Machine Intelligence</a>” frames the challenge around a configurable predictive world model and planning at multiple time horizons — because intelligence, in the operational sense, is what happens when you can simulate futures well enough to choose actions deliberately rather than reactively.</p><p>If you accept that definition, then the central question becomes oddly simple: <strong>what kind of training signal forces a system to learn the world as a stable, causal, action-conditioned process rather than as a narrative?</strong></p><p>That question matters because narratives can be persuasive while still being false, whereas action in a real environment has a cruel property: it doesn’t care how good your story is.</p><h3>The child analogy, but this time it’s personal</h3><p>I’ve been thinking about this more than usual recently, and not in an abstract “AI discourse” way. I had a newborn not long ago, and if you’ve ever had a new child in the house, you know what happens to your attention: it becomes sharper, slower, and somehow more philosophical, because you’re suddenly watching intelligence bootstrap itself from almost nothing, right there in front of you, at 3 a.m., while the rest of the world insists on continuing at full speed.</p><p>There’s a moment that keeps returning to me, the kind of quiet moment you would never put on a slide: the baby’s gaze fixing on a face, then on a lamp, then on a moving hand, and you can almost feel the internal machinery trying to stabilize the scene. There are no words, no labels, no “training set” in the way we usually mean it, yet something is clearly happening. You see the earliest traces of prediction — of expectation — forming before language even becomes a meaningful tool.</p><p>And later, when the baby begins to reach, to grasp, to miss, to try again, it becomes even clearer that learning is not simply absorption; it is negotiation. The world pushes back. Objects behave consistently. Gravity is uncompromising. Surprise is frequent. And that stream of surprises is not a bug; it is the mechanism by which the internal model tightens.</p><p>This is where the analogy stops being sentimental and becomes instructive: <strong>a child learns inside a closed loop</strong> — observe, predict, act, receive feedback, update — and the feedback is not “a human liked your answer,” but “the world did what it always does, and your expectations were either aligned or they weren’t.”</p><p>That loop is the thing we underappreciate when we talk about scaling language models. Because language is downstream. Language is what we use to describe what already happened. A newborn is not learning the world through narrative; a newborn is learning the world through <em>consequence</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_tXMW7jRS9uGnUI9.png" /><figcaption>Fig. 1. from “Understanding World or Predicting Future? A Comprehensive Survey of World Models”</figcaption></figure><p>Once you see it this way, you can phrase the core claim in one line: <strong>scaling the first loop doesn’t automatically produce the second loop, because the second loop requires being corrected by the world, not by the distribution of human text.</strong></p><h3>Why scaling looks like the obvious path (and why that view is coherent)</h3><p>Let’s be fair to the “against” side, because dismissing them as hype merchants is both inaccurate and strategically lazy.</p><p>Sam Altman’s position, in his own words, is unusually direct: OpenAI is “confident we know how to build AGI as we have traditionally understood it,” and he predicts that AI agents could “join the workforce” and materially change company output. The thesis here is not mystical; it’s empirical: scaling has produced discontinuous jumps in capability, and there is no clear evidence that the curve is about to stop delivering meaningful improvements, especially as we surround models with tools, memory, and agentic scaffolding that convert “reasoning in text” into “work in the world.”</p><p>Dario Amodei expresses a closely related idea from a different seat: he repeatedly points to scaling laws, noting the steady progression of capability and the expectation that larger, better-trained systems will continue to climb the ladder from “barely coherent” to something closer to professional-level performance across domains. Here, the thesis is that we are watching a general-purpose competence emerge from a simple objective plus scale, and that it would be premature — perhaps historically foolish — to declare a ceiling when the last few years have been defined by people underestimating what the next round of scale unlocks.</p><p>Geoffrey Hinton adds a more conceptual defense that many practitioners intuitively feel: if you can predict the next word extremely well, you are forced to internalize meaning, structure, and some compressed model of the world, because language is not random noise — it is a high-level encoding of human reality. In that worldview, the line between “word model” and “world model” is thinner than skeptics claim, because the world’s regularities leak into language, and strong predictive performance implies strong latent structure.</p><p>And then there is the pragmatic benchmark-oriented framing, which Jensen Huang captured bluntly when he said that if AGI is defined as passing a wide range of human tests, we may see systems that clear that bar within roughly five years, while acknowledging that broader definitions tied to “understanding the human mind” remain harder to operationalize.</p><p>Those are serious arguments, and the reason they resonate is that each one connects to something real: scaling works, models are getting more useful, and definitions of AGI are slippery.</p><h3>Where my disagreement begins: the objective does not force causality</h3><p>My skepticism starts at the level of training incentives rather than capability demos.</p><p>A next-token predictor can learn to produce causal-sounding explanations because humans write causal stories, but it is not required to build a causal model that remains stable under intervention, and it is not required to keep an internal belief state that stays consistent when the environment changes or when actions have delayed consequences. If you only ever grade a student on how convincing their essays are, you can end up with someone who writes beautifully and still cannot run a project, because execution demands a different kind of internal representation — one grounded in constraints, feedback, and state.</p><p>This is why Bengio’s causality angle matters: once an agent acts, it changes the world, which means it needs to reason about interventions rather than simply infer correlations from observations, and that pushes you toward world modeling as a structural requirement rather than a stylistic preference. Even more concretely, research on robust agents learning causal world models argues that robustness under domain shifts and interventions is tied to learning causal structure, which is exactly the kind of property you want if your goal is “general.”</p><p>So when someone says “scale will get us to AGI,” my response is not “no, scaling is fake,” but rather: <strong>scale what, exactly, and with what feedback loop?</strong> Because scaling the wrong objective can make you incredibly good at something adjacent to intelligence without making you reliable when the world pushes back.</p><p>A system that is fluent at the first can still be fragile at the second, and the second is what you need when the agent is no longer chatting but operating.</p><h3>Why vision and “more modalities” are not the whole answer</h3><p>At this point, many readers will say: fine — add vision, add video, add robotics, add multimodal training, and you’ve basically added the child’s sensory stream.</p><p>It’s a good instinct, but it can still miss the deeper issue, which is not the modality but the <strong>training signal</strong>.</p><p>You can train a model on video in a way that still rewards it for producing captions, explanations, or plausible answers about the clip, and that remains language-shaped; it might improve perception and grounding, but it does not automatically create the kind of action-conditioned predictive structure that makes planning reliable. LeCun’s JEPA direction is interesting precisely because it tries to move away from “generate pixels” and “generate tokens” toward learning abstract predictive representations that could serve as a substrate for planning.</p><p>You can also see the broader industry intuition shifting toward “spatial intelligence” and world modeling, not as a branding exercise but as an admission that the physical and geometric world contains structure that language does not fully encode. Fei-Fei Li, for example, has been explicit in arguing that AI is incomplete without spatial intelligence, and her work at World Labs is positioned around building world models that can represent and generate 3D environments, which is a different ambition than “better chat.”</p><p>This doesn’t prove LLMs cannot reach AGI, but it does reveal a shared intuition among multiple leaders: <strong>there is a category of understanding — spatial, physical, embodied — that is hard to acquire from text alone, because the relevant structure is rarely written down.</strong></p><h3>The cleanest way to state my claim: LLM scaling is underdetermined with respect to agency</h3><p>If we are being intellectually honest, we should distinguish between two statements that people often collapse:</p><ol><li><strong>LLMs will keep getting more capable and economically valuable if we scale them.</strong></li><li><strong>Scaling LLMs is sufficient to produce robust general intelligence that can plan and act in open-ended environments.</strong></li></ol><p>I think (1) is already proven, and I expect it to keep being true for years, because even “word models” are revolutionary tools.</p><p>I’m skeptical of (2), because sufficiency requires that the objective forces the relevant internal structures to emerge, and next-token prediction simply does not require stable belief state, explicit uncertainty, long-horizon planning, or learning from consequences — at least not in the way the child gets it, where reality is the supervisor.</p><p>The most convincing piece of intellectual pressure on my thesis is Hinton’s argument that prediction implies understanding, because language is saturated with world structure. The most convincing counterpressure on the scaling thesis, to me, is Sutton’s “Bitter Lesson,” because it reminds us that the methods that win over decades are the ones that scale with computation and experience, not the ones that lean on human-crafted shortcuts. And that word “experience” is doing a lot of work here, because the newborn’s loop — those tiny reaches and misses and surprises — is experience-heavy in a way text training is not.</p><h3>A practical reconciliation: stop arguing about labels, start arguing about loops</h3><p>The longer I watch this debate, the more I think the real disagreement is not “LLMs good vs. LLMs bad,” but <strong>which loop we believe will dominate the next decade</strong>.</p><p>The scaling camp is betting that scale plus system scaffolding will yield agents that are “general enough” to be called AGI in practice, regardless of whether we can point to an explicit internal world model.</p><p>The world-model camp is betting that without an explicit mechanism for state, dynamics, and action-conditioned prediction — trained in a feedback loop — systems will remain brittle, because fluency is not the same as grounding.</p><p>And I think we can hold both ideas at once without contradiction: <strong>LLMs will remain central as the interface</strong>, and <strong>world models will become central as the engine</strong>.</p><h3>The kind of reflection you only get when there’s a newborn in the house</h3><p>There’s a specific kind of reflection that comes with having a new child, because you stop thinking about intelligence as an abstract property and start seeing it as a process: slow, iterative, embodied, corrected by reality, and strangely resilient.</p><p>When I watch that process up close, it becomes hard to believe that the path to AGI is simply “more text, more parameters, more tokens,” because the most important teacher in the room is not language — it is the world itself, constantly enforcing consistency.</p><p>LLMs are the most powerful language interface we’ve built, and they will keep reshaping how we work, build, and think, but if AGI is fundamentally about building stable beliefs about reality, planning under uncertainty, and learning from consequence, then it seems increasingly likely that the real leap will come when we stop treating words as the substrate and start treating the world — perceived, acted upon, and fed back — as the curriculum.</p><p>Gravity doesn’t care how coherent you sound.</p><p>And perhaps that’s the point.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=126af790d802" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Code: Redefining Software Craftsmanship in the AI Era]]></title>
            <link>https://medium.com/@souhailguennouni/beyond-code-redefining-software-craftsmanship-in-the-ai-era-da9e069fc86c?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/da9e069fc86c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-craftsmanship]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 11:15:46 GMT</pubDate>
            <atom:updated>2025-11-28T13:51:45.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQITo2D9XV-C3zEwv0jKVQ.png" /></figure><p>When I look at how we build software today, I don’t see the end of programming. I see the end of a shallow version of engineering.</p><p>AI has kicked the door open. Copilots write entire functions, generate tests, scaffold Kubernetes manifests and even propose architectures.</p><p>Andrej Karpathy’s (ex-Tesla Director of AI, founding member of OpenAI) tweet — <em>“The hottest new programming language is English”</em> — captures the mood perfectly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/0*HdMUfHa_xwxxxXwJ.png" /></figure><p>But if English is the new programming language, software craftsmanship is no longer just about typing correct syntax. In the AI era, excellence moves up the stack: from code to systems, from systems to data, and from data to socio-technical outcomes.</p><p>This is the shift I care about.</p><h3>From code-centric to system-centric craftsmanship</h3><p>Traditionally, craftsmanship meant: you know your language, your framework, your patterns. You care about naming, boundaries, tests, clean abstractions. You own the code. Actually, none of that disappears, what changes is <em>where</em> the bottleneck lives.</p><p>If an LLM can generate a decent CRUD service or a boilerplate microservice, then writing that code by hand is no longer the core value. The core value becomes:</p><ul><li>Defining the domain model and invariants precisely enough that a machine can’t “hallucinate” its way around them</li><li>Designing architectures that are observable, evolvable, and resilient,</li><li>Encoding non-functional requirements (latency, cost, security, compliance) into the lifecycle of the system.</li></ul><p>In my article on <a href="https://medium.com/@souhailguennouni/optimizing-rag-applications-from-prototype-to-production-grade-ai-retrieval-solutions-33a6e0534089">production-grade RAG systems</a>, I argued that the hard part is not “calling the model,” but building robust ingestion, retrieval, and generation pipelines that behave predictably in production. The same is now true for almost every serious AI-enabled system: the craft is in the pipeline, not in the single function.</p><p>LLMs make it easier to <em>write</em> software. They do not make it easier to own it.</p><h3>AI is the new electricity… and data is the wiring</h3><p>Andrew Ng (co-founder of Coursera and DeepLearning.AI, and founding lead of Google Brain) famously said that “AI is the new electricity,” drawing a parallel between the way electricity transformed every industry and the way AI will permeate every product and process we build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*DsOedQlLD38c8eWz" /></figure><p>If AI is electricity, then data is the wiring, breakers, and safety standards. You don’t get a reliable power grid by just adding more power plants. You get it by designing the network, controlling quality, and monitoring failures.</p><p>In my piece on <a href="https://medium.com/@souhailguennouni/optimizing-llm-performance-the-impact-of-data-quality-and-model-size-95b988cdd4ae">optimizing LLM performance</a>, I described how model size alone is meaningless without a deliberate path from “poor data” to “AI-enabled data,” where quality dimensions like accuracy, completeness and timeliness are engineered, not assumed.</p><p>That is where craftsmanship moves next:</p><ul><li>understanding how your system <em>acquires</em> data,</li><li>how that data is cleaned, labeled, versioned and governed,</li><li>how feedback loops correct both the model and the surrounding software.</li></ul><p>AI systems are not just “code that runs.” They are living organisms attached to messy, shifting data streams. A good engineer writes code; a great engineer shapes the environment that code learns from.</p><h3>Beyond scaling: research, constraints and real understanding</h3><p><a href="https://www.dwarkesh.com/p/ilya-sutskever-2?utm_source=chatgpt.com">In a recent Dwarkesh podcast</a>, Ilya Sutskever (co-founder of OpenAI, now leading Safe Superintelligence Inc.) framed the current moment as a transition “from the age of scaling to the age of research,” pointing out that today’s models still generalize much worse than humans despite their size.</p><p>Yann LeCun (Turing Award winner, former Chief AI Scientist at Meta) has been repeatedly reminding everyone that our current systems still lack four critical capabilities: understanding the physical world, persistent memory, robust reasoning, and hierarchical planning. <a href="https://www.businessinsider.com/meta-yann-lecun-ai-models-lack-4-key-human-traits-2025-5?utm_source=chatgpt.com">Business insider’s article.</a></p><p><strong>Why does this matter for craftsmanship?</strong></p><p>Because if you treat AI as a magical black box that “just works,” you will design brittle systems that collapse under real-world constraints. But if you treat AI models as powerful, <em>imperfect</em> components — with failure modes, blind spots, and context limits — you start to engineer around them:</p><ul><li>guardrails in the application layer,</li><li>retrieval and grounding strategies that control what the model can see,</li><li>evaluation harnesses and red-team datasets that stress test failure modes,</li><li>human-in-the-loop flows where it actually matters.</li></ul><p>In my work on <a href="https://medium.com/%40souhailguennouni/agentic-ai-vs-retrieval-augmented-generation-a-healthcare-perspective-91476425eafb">RAG and agentic AI</a>, I’ve consistently come back to the same idea: impact comes from combining autonomy with evidence-based precision, not from worshipping the model.</p><p>Craftsmanship in the AI era means knowing exactly what your model is good at, what it is bad at, and how your software cushions both.</p><h3>Craftsmanship extends to security, reliability and ethics</h3><p>Even before this wave of AI, I wrote that “<a href="https://medium.com/%40souhailguennouni/cybersecurity-principles-a-guide-to-secure-your-software-delivery-e25c10bd7417">most of the software we deliver is composed of components we haven’t developed ourselves</a>,” and that supply-chain and dependency risk must be first-class concerns in our delivery pipelines.</p><p>Now we are plugging in:</p><ul><li>third-party models we don’t control,</li><li>external vector databases,</li><li>SaaS orchestration layers,</li><li>continuous streams of sensitive prompts and outputs.</li></ul><p>The surface area explodes.</p><p>A “craftsman” who stops at prompt design but ignores data exfiltration, prompt injection, model abuse, or auditability is not practicing modern software excellence. DevSecOps, observability, SLOs, and runtime policy enforcement are as much part of AI craftsmanship as clever system prompts and retrieval schemas.</p><p>In other words: <strong>excellence is not only in the code; it is in the <em>consequences</em> of the code.</strong></p><h3>Practicing craftsmanship when AI writes half your code</h3><p>So what does this mean for a software engineer or architect who actually has to ship something next sprint?</p><p>It means your craft shifts into a few concrete dimensions:</p><p><strong>1. Precision of intent</strong></p><p>Karpathy’s tweet is not really about English; it’s about <em>precision</em>. To get high-quality systems out of AI tools, you must articulate:</p><ul><li>exact system behaviour,</li><li>explicit invariants,</li><li>non-functional constraints,</li><li>failure policies.</li></ul><p>Your “language” now includes architecture diagrams, test suites, contracts, specs, data contracts, and evaluation datasets. LLMs can help draft them, but you decide what is <em>true</em>.</p><p><strong>2. Data as a first-class design object</strong></p><p>From my <a href="https://medium.com/%40souhailguennouni/optimizing-rag-applications-from-prototype-to-production-grade-ai-retrieval-solutions-33a6e0534089">RAG and LLM work</a>, a pattern repeats: teams that treat data as an afterthought get brittle demos; teams that treat data as a product get stable systems.</p><p>That is craftsmanship: designing schemas that are evolvable, enforcing lineage, building labeling pipelines that can be iterated on, and instrumenting feedback to continually refine both data and models.</p><p><strong>3. Evaluation and observability as core skills</strong></p><p>Traditional craftsmanship put a lot of emphasis on unit tests, integration tests, static analysis. Keep those. But add:</p><ul><li>behavioral evaluation suites for AI features (golden sets, adversarial sets, regression baselines),</li><li>telemetry that captures not only logs and traces, but model inputs/outputs, retrieval stats and safety events,</li><li>dashboards where product, security, and engineering can see the system’s <em>behaviour</em>, not just its uptime.</li></ul><p>This is how you practice “clean code” when the code path includes a non-deterministic model.</p><p><strong>4. Responsibility for outcomes</strong></p><p>Finally, craftsmanship in this era is inseparable from responsibility. When AI features influence financial decisions, medical workflows, or access to care, “it’s what the model returned” is not an excuse. You are still accountable for bias, misuse, and harm.</p><p>That means building:</p><ul><li>meaningful consent and transparency for users,</li><li>fallbacks and overrides for edge cases,</li><li>governance loops that involve domain experts, not only engineers.</li></ul><h3>The new definition of excellence</h3><p>For a long time, “engineering excellence” was almost a proxy for “code excellence”: is this code elegant, efficient, readable, and well-tested? That lens is still necessary, but in the AI era it’s no longer sufficient.</p><p>Today, I would define excellence as the ability to <strong>design, build, and operate AI-enabled systems that behave predictably, safely, and usefully over time</strong>.</p><p>Clean code is one dimension of that, but only one. The bar is now higher and wider.</p><p>Excellence means you’re not just asking:</p><ul><li><em>Does this function look good in a diff?</em></li></ul><p>You’re also asking:</p><ul><li><em>Does this system reflect real-world constraints — latency, cost, regulation, operational load — or is it a lab toy?</em></li><li><em>Is the behaviour of the AI components grounded in curated data, with clear contracts and evaluation, or are we hoping the model “just works”?</em></li><li><em>Can we observe and debug this end-to-end, including prompts, retrieval, model calls and downstream side effects, or are we flying blind once the request hits the LLM?</em></li><li><em>Have we thought through failure modes, escalation paths, and security boundaries, or are we trusting a probabilistic component in places where only deterministic logic should live?</em></li><li><em>Does this product actually augment the people who use it — engineers, clinicians, operators, customers — or did we just bolt AI on top of an existing workflow?</em></li></ul><p>In other words, excellence shifts from <strong>crafting code in isolation</strong> to <strong>stewarding the whole system</strong>: code, data, models, prompts, pipelines, and operations as a single unit of responsibility.</p><p>AI can accelerate the “typing” part of our work. It cannot (for now) replace the judgement required to align a complex technical system with business goals, user needs, constraints, and risk. That judgement — expressed through architecture, guardrails, data quality, evaluation, and operational discipline — is what software craftsmanship looks like in the era of AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da9e069fc86c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recent Advances in AI: DeepSeek R1’s Innovative Approach to Reasoning-Focused Models]]></title>
            <link>https://medium.com/@souhailguennouni/recent-advances-in-ai-deepseek-r1s-innovative-approach-to-reasoning-focused-models-56932fbb1293?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/56932fbb1293</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[mixture-of-experts]]></category>
            <category><![CDATA[deepseek]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 06:06:38 GMT</pubDate>
            <atom:updated>2025-07-21T06:06:38.072Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPiv-gvePbVh65u8hMZmiA.png" /></figure><p><em>In the fast-paced world of artificial intelligence, where models are pushing the boundaries of reasoning — from solving complex math puzzles to generating code — </em><strong><em>DeepSeek R1</em></strong><em> stands out as a game-changer. Developed by DeepSeek AI, this open-source large language model (LLM) was first released in January 2025, with an updated version, DeepSeek-R1–0528, following in May. It’s built on the powerful DeepSeek-V3 foundation and focuses squarely on enhancing reasoning capabilities, all while keeping things efficient and accessible. But what makes it tick? Drawing from cutting-edge research, we’ll explore its key innovations, like Mixture-of-Experts architecture and reinforcement learning techniques, and compare it head-to-head with OpenAI’s GPT-4o (the engine behind ChatGPT 4o). Let’s unpack this step by step, starting from the ground up.</em></p><p>Before we dive deeper, let’s understand what DeepSeek R1 really is:</p><p>DeepSeek R1 is a specialized LLM designed to excel in reasoning tasks, such as mathematical problem-solving, coding, and logical inference. It uses advanced training methods to generate step-by-step thought processes, mimicking human-like deliberation, while being open-source and optimized for lower resource needs compared to many closed-source giants.</p><p><strong>Why now?</strong></p><p>The timing couldn’t be better. With AI models exploding in size and complexity, there’s a growing need for systems that don’t just regurgitate information but truly reason through problems. DeepSeek R1 emerges amid hardware constraints — like U.S. export limits on high-end GPUs — and a push for sustainable AI. It’s built on breakthroughs in efficient architectures and training, allowing it to rival top models without massive compute demands. This comes at a time when open-source alternatives are democratizing AI, making advanced tools available to researchers and developers worldwide, not just big tech labs.</p><p><strong>Back to basics:</strong></p><p>To appreciate DeepSeek R1’s innovations, let’s revisit the fundamentals of machine learning: models, data, and compute form the essential tripod. <strong>Models are the algorithms that process inputs to produce outputs; data is the fuel that trains them; and compute is the raw power, often from GPUs, that makes it all run.</strong></p><p>Traditional LLMs, like early transformers, relied on dense architectures where every part of the model activates for every task — think of it as using your entire toolbox for a simple screw. This works but guzzles resources. DeepSeek R1 flips the script by building on efficient designs that activate only what’s needed, trained on vast datasets but with smart optimizations to cut costs. For instance, its base, DeepSeek-V3, was trained for about $5.6 million — roughly 1/50th of what similar closed-source models might cost.</p><p>One big challenge in reasoning-focused AI is getting models to “think” step by step without hallucinating or getting stuck. DeepSeek R1 tackles this through a multi-stage training process that combines reinforcement learning with supervised fine-tuning, encouraging longer, more accurate chains of thought.</p><p><strong>It all started with efficiency:</strong></p><p>DeepSeek R1’s story begins with its roots in the DeepSeek-V3 model, which introduced a Mixture-of-Experts (MoE) architecture to handle massive scale without proportional compute. MoE splits the model into specialized “experts” that kick in only when relevant, making it sparse and speedy.</p><p><em>What is Mixture-of-Experts (MoE)?</em></p><p>MoE is a neural network design that divides the model into multiple sub-networks, or “experts,” each tuned for specific tasks or data patterns. A lightweight router decides which experts to activate for a given input, <strong>so only a fraction of the parameters (like 37 billion out of 671 billion in DeepSeek-V3) are used per token.</strong> <strong>This sparsity cuts down on unnecessary computations, boosting efficiency.</strong></p><p>In DeepSeek R1, this MoE setup is refined with fine-grained expert segmentation — breaking down feed-forward networks into smaller, more precise experts — and shared expert isolation to avoid redundancy. It’s like having a team of specialists where only the right ones join the huddle, ensuring balanced load and better performance on reasoning tasks.</p><p>Building on this, DeepSeek R1 adds Multi-Head Latent Attention (MLA) for handling long contexts without bloating memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u8ijYnwog1xXwTfZ.jpg" /><figcaption>Token Choice Routing. The routing algorithm picks the top-1 or top-2 experts with highest affinity scores for each token. The affinity scores can be trained together with model parameters. (<a href="https://research.google/blog/mixture-of-experts-with-expert-choice-routing/">Source</a>)</figcaption></figure><p><em>What is Multi-Head Latent Attention (MLA)?</em></p><p>MLA is a compression technique for the key-value (KV) cache in transformers. It projects keys and values into a lower-dimensional “latent” space across multiple heads, shrinking the cache by about 93% while supporting up to 128,000 tokens. This means the model can “remember” longer conversations or problems without choking on GPU memory — perfect for complex reasoning where context matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NPcUMJv9cROhln0Z.png" /><figcaption>Multi-head attention mechanism (<a href="https://newsletter.theaiedge.io/p/the-multi-head-attention-mechanism">Source</a>)</figcaption></figure><p>Another gem is <strong>Multi-Token Prediction (MTP)</strong>, which trains the model to forecast multiple future tokens at once.</p><p><em>What is Multi-Token Prediction (MTP)?</em></p><p>MTP involves predicting a chain of future tokens during training, using shared embeddings and independent blocks. It averages losses across predictions, speeding up convergence and improving sequential reasoning, like planning several moves ahead in chess.</p><h3><strong>The training magic: Reinforcement learning takes center stage</strong></h3><p>DeepSeek R1’s real innovation shines in its training pipeline, which emphasizes pure reinforcement learning (RL) to hone reasoning skills.</p><p>It all kicks off with Group Relative Policy Optimization (GRPO), a twist on standard RL methods.</p><p><em>Group Relative Policy Optimization (GRPO)</em></p><p>GRPO is a scalable RL algorithm that groups training trajectories by length and applies relative rewards within those groups. This encourages the model to generate longer, more thoughtful responses — like chain-of-thought (CoT) reasoning — while reducing variance in rewards for stable training.</p><p>DeepSeek R1 starts with a “zero-shot” RL phase using cold-start data, then alternates with supervised fine-tuning to polish outputs and fix issues like language mixing.<strong> This fosters emergent behaviors, such as self-reflection, where the model critiques its own steps for better accuracy.</strong></p><p>To make it scalable, DeepSeek R1 uses<strong> knowledge distillation</strong>.</p><p><em>What is Knowledge Distillation?</em></p><p>This technique transfers knowledge from a large “teacher” model to smaller “student” ones. In DeepSeek R1, it’s applied to create compact versions (from 1.5B to 70B parameters) based on Qwen or Llama architectures, maintaining high performance in math and coding while slashing deployment costs.</p><p>Co-design optimizations, like FP8 mixed-precision training and DualPipe scheduling, further boost efficiency by overlapping computations and balancing speed with accuracy.</p><h3><strong>How does it stack up? An objective look at DeepSeek R1 vs. GPT-4o</strong></h3><p>To put DeepSeek R1 in perspective, let’s compare it to GPT-4o, the powerhouse behind ChatGPT 4o. Both are transformer-based, but their approaches diverge.</p><p>Architecturally, DeepSeek R1’s MoE sparsity contrasts with GPT-4o’s dense setup, which engages all parameters (estimated 1.8 trillion) for versatility, including multimodal (text, image, audio) processing. DeepSeek R1 focuses on text-based reasoning with up to 64,000 token contexts, while GPT-4o handles 128,000 tokens and real-time interactions (as low as 232 ms responses).</p><p>In benchmarks, DeepSeek R1 shines in math: 97.3% on MATH-500 vs. GPT-4o’s 76.6%, and 79.8% on AIME 2024 (comparable to GPT-4o’s ~85–88%).</p><p>Coding? DeepSeek hits 82.6% on HumanEval (vs. GPT-4o’s 90.2%) but leads on SWE-bench Verified at 49.2%. General knowledge: 90.8% on MMLU (edging GPT-4o’s 88.7%), but GPT-4o pulls ahead on GPQA (74.8% vs. 71.5%) and multimodal tasks like MMMU (69.1%).</p><p>Efficiency-wise, DeepSeek R1 is a winner: API costs $0.55-$2.19 per million tokens vs. GPT-4o’s $5-$20, and it runs on mid-tier hardware with lower energy use. GPT-4o offers broader creativity and multimodality but at higher operational costs.</p><p>Here’s a comparison table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RtBTynFGcCBXz0FF7dSqUg.jpeg" /></figure><p>DeepSeek R1 thrives in technical, STEM-focused areas, while GPT-4o is more versatile for everyday, multimodal use. Both have room to grow — DeepSeek in prompt robustness, GPT-4o in cost efficiency.</p><p><strong><em>What this means for the future of AI</em></strong></p><p>DeepSeek R1’s blend of MoE, RL innovations, and distillation points to a more efficient, open path forward. <strong>It challenges the “bigger is always better” mindset</strong>, showing how smart algorithms can deliver top-tier reasoning without breaking the bank or the planet. As AI evolves, hybrids of these approaches could bridge gaps, fostering ethical, scalable intelligence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56932fbb1293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI in Healthcare: Transformation, Trust, and the Future of Patient Care]]></title>
            <link>https://medium.com/@souhailguennouni/ai-in-healthcare-transformation-trust-and-the-future-of-patient-care-3c47b9d15bbf?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c47b9d15bbf</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[healthtech]]></category>
            <category><![CDATA[healthcare]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Sat, 15 Feb 2025 12:41:18 GMT</pubDate>
            <atom:updated>2025-02-16T05:35:50.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TH9VuQIMDnCGt-Y5XarFA.jpeg" /></figure><p>Artificial Intelligence is transforming the healthcare, with an unprecedented accelerating rate. It has triggered intense discussions about the kind of roles AI should play.</p><p>By providing the necessary tools to enhance their expertize and expand their knowledge. The real game changer is not replacing doctors with AI working in isolation but rather having AI and doctors working together.</p><p>A recent <a href="https://economics.mit.edu/sites/default/files/2023-07/agarwal-et-al-diagnostic-ai.pdf">MIT study</a> explored how radiologists diagnose potential diseases from chest X-rays. According to the study, radiologists frequently devalued the AI’s contribution in comparison to their own judgment when they were offered predictions regarding the likelihood of sickness.</p><p>Even when the AI was right, the doctors held to their first impressions, which caused them to diagnose patients less accurately. The results of another research showed that while doctors utilizing AI help were only 76 percent accurate, which is only marginally better than the 74 percent they reached without A.I., when A.I. operated independently to diagnose patients, it achieved 92% accuracy.</p><p>This study is in its early stages and could change. More generally, however, the results show that it is currently ineffective to merely provide doctors with AI tools and hope for advances on their own. Even if AI has the potential to clearly improve patient care, doctors are still not entirely at ease with it and continue to have doubts about its usefulness.</p><p>But AI will continue to advance, and the best thing for medicine to do is to find a role for it that doctors can trust. The solution is a strategic deliberate division of labor. Instead of using human in the loop strategy by forcing both human doctors and AI to review every case side by side and trying to turn AI into a kind of a doctor’s assistant, a more effective approach is to let AI operate independently on appropriate tasks so that doctors can focus where their expertise matters.</p><h3>AI in Healthcare: A Data-Driven Transformation</h3><p>AI has been making its mark in medicine for several years; however, recent advances in machine learning (ML) and large language models (LLMs) have accelerated its impact. <strong>A 2023 McKinsey report estimated that AI-driven automation could cut healthcare administrative costs by 30%, freeing up physicians to focus on patient care.</strong> (<a href="https://www.mckinsey.com/">McKinsey, 2023</a>)</p><p>The latest <strong>New York Times (Feb 2, 2025)</strong> article highlights how AI is being used beyond back-office tasks — actively supporting clinical decisions. AI models, trained on vast datasets of medical literature, imaging scans, and patient histories, are now acting as real-time assistants to doctors. Rather than replacing expertise, AI enhances it, flagging rare conditions and offering second opinions in complex cases. (<a href="https://www.nytimes.com/2025/02/02/opinion/ai-doctors-medicine.html">New York Times, 2025</a>)</p><p>The NYT article also raises a crucial point: AI is now assisting in <strong>personalized medicine</strong>, helping tailor treatments based on genetic and lifestyle factors. It cites cases where AI-driven recommendations have led to better outcomes in cancer treatment, as AI can analyze genetic markers and suggest therapies that would have been overlooked in traditional methods.</p><p>AI also plays a major role in predictive analytics. <strong>A study published in <em>Nature Medicine</em> found that AI-powered predictive models can detect early signs of sepsis 24 hours before clinical symptoms appear, reducing mortality rates by 30%.</strong> (<a href="https://www.nature.com/articles/s41591-024-00001-4">Nature Medicine, 2024</a>)</p><p>A new study from MIT’s Economics Department (Agarwal et al., 2023) sheds further light on AI’s role in diagnosis. The study analyzed AI-assisted diagnostic systems across various medical conditions and found that <strong>AI-augmented physicians achieved a 20% reduction in diagnostic errors compared to those working without AI.</strong> (<a href="https://economics.mit.edu/sites/default/files/2023-07/agarwal-et-al-diagnostic-ai.pdf">MIT Economics, 2023</a>)</p><h3>The Doctor-AI Partnership: A Paradigm Shift</h3><p>Dr. Eric Topol, a prominent cardiologist and advocate for digital medicine, highlights in his recent analysis, <em>When Doctors With AI Are Outperformed</em>, that physicians utilizing AI consistently achieve superior outcomes compared to those who depend solely on conventional methods. (<a href="https://erictopol.substack.com/p/when-doctors-with-ai-are-outperformed">Topol, 2025</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbgDKo8RxryxriMzs5UnMw.jpeg" /><figcaption>Figure 2: AI-Enabled vs. Traditional Diagnosis Accuracy</figcaption></figure><p><strong>The essential conclusion?</strong></p><p>AI should not be viewed as a replacement for human judgment; rather, it serves as a cognitive enhancer. Here’s how it changes the game:</p><ul><li><strong>Rapidly processing extensive medical data</strong> in seconds.</li><li><strong>Identifying subtle irregularities in imaging scans</strong> that may be missed.</li><li><strong>Personalizing treatment recommendations</strong> based on empirical evidence.</li><li><strong>Recognizing rare diseases</strong> that even experienced clinicians might not immediately detect.</li></ul><p>For example, IBM’s Watson Health <strong>matched cancer patients with clinical trials, increasing enrollment rates by 30%</strong> and opening doors to new treatment pathways that otherwise might have been missed. (<a href="https://www.ibm.com/watson-health">IBM Watson Health, 2024</a>)</p><h3>The Future of AI-Augmented Healthcare</h3><p>The integration of AI into healthcare is advancing at a rapid pace, and while AI is unlikely to fully replace doctors in the immediate future, its role is evolving. AI is becoming an essential partner in medicine, enabling doctors to work in a quicker pace, make more accurate diagnoses, and offer more personalized treatments. However, <strong>it is crucial to acknowledge that AI’s widespread adoption will bring both opportunities and challenges.</strong></p><p>As AI abilities evolve, some aspects of medical practice will become increasingly automated, leading to shifts in the role of doctors. <strong>Routine diagnostic tasks</strong> and <strong>administrative burdens</strong> will be <strong>fully AI-driven</strong>, allowing doctors to focus on complex decision-making and patient-centered care.</p><p>This transformation will redefine what it means to be a doctor, highlighting the importance of <strong>critical thinking</strong>, <strong>empathy</strong>, and <strong>oversee</strong> AI-generated recommendations.</p><p>Furthermore, AI’s role in healthcare will not only be determined by technological advancements but also by regulatory, ethical, and societal considerations. Ensuring fairness, reducing algorithmic biases, and maintaining patient trust will be crucial in shaping AI’s future in medicine.</p><p>Additionally, the influence of AI in the healthcare sector will be shaped not only by technological progress but also by regulatory frameworks, ethical standards, and societal factors.</p><p>So, as AI continues to redefine medicine, the real question remains: Will we see a future where AI completely replaces doctors, or will the most effective healthcare systems be those that balance AI-driven efficiency with the irreplaceable qualities of human physicians?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c47b9d15bbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic AI vs. Retrieval Augmented Generation: A Healthcare Perspective]]></title>
            <link>https://medium.com/@souhailguennouni/agentic-ai-vs-retrieval-augmented-generation-a-healthcare-perspective-91476425eafb?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/91476425eafb</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[generative-ai-healthcare]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 06:52:50 GMT</pubDate>
            <atom:updated>2024-12-11T06:52:50.668Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qHE-cldhrE29lrcC7s5ow.jpeg" /></figure><p><em>AI is transforming healthcare, but the tool and technologies driving this transformation are often unclear. To understand where we’re going, it’s important to understand on how AI has evolved. The first wave, often referred to as </em><strong><em>predictive AI. </em></strong><em>This type of AI is</em><strong><em> </em></strong><em>focused on enabling businesses to understand and analyze data and forecast trends for better decision-making. The second wave: </em><strong><em>generative AI</em></strong><em>, which introduced the ability to generate content and create high quality human-like interactions. We are currently entering the third wave — </em><strong><em>agentic AI</em></strong><em> — where AI systems not only understand and generate information but also autonomously execute tasks and collaborate with other AI agents. This collaboration and communication marking a significant progress in the field of AI.</em></p><p><em>Two paradigms… and more</em></p><p>Two of the most prominent paradigms — the new <strong>Agentic AI</strong> and the <strong>traditional Retrieval-Augmented Generation (RAG)</strong> — are leading this evolution. While they operate within the same AI ecosystem, their roles and use cases differ significantly.</p><p><em>Agentic AI has brought autonomy forward</em>, enabling systems to act independently and proactively, while RAG enhances generative AI by <em>grounding and augmenting</em> its outputs in real-world knowledge.</p><p>Together, they form a powerful combination, capable of addressing some of the most pressing challenges in healthcare.</p><p>The distinction between these two paradigms goes beyond the technical architecture but in the use case they are designed to solve. Agentic AI is redefining autonomy in dynamic environments, highly performing in scenarios that demand continuous decision-making and adaptation, such as patient monitoring in critical care. In contrast, RAG focuses on augmenting knowledge delivery, bridging the gap between generative models and accuracy, making it essential for clinical decision support or patient education.</p><p>Both techniques propose unique capabilities, but their architectures, objectives, and use cases are tailored to different facets of healthcare innovation. Understanding the distinction between these paradigms is key to advancing AI empowered use cases for healthcare .</p><p>This article delves into the technical foundations of Agentic AI and RAG, examines their distinct healthcare applications, and explores the potential for their convergence</p><p><em>What Is Agentic AI?</em></p><p>Agentic AI systems operate autonomously, combining perception, reasoning, and action to achieve predefined goals. Unlike RAG or other traditional AI systems, Agentic systems don’t wait for instructions — they actively make decisions and take action in real-time. This makes it particularly valuable in dynamic environments like healthcare.</p><p><em>How It Works?</em></p><p>Agentic AI relies on an integrated architecture:</p><p>1.	<strong>Perception</strong>: The system collects real-time data from sensors, devices, or patient monitoring tools.</p><p>2.	<strong>Reasoning</strong>: Advanced AI models analyze this data, predict outcomes, and determine the best course of action.</p><p>3.	<strong>Action</strong>: The system executes decisions autonomously, often interfacing with medical devices or alerting healthcare professionals.</p><p>4.	<strong>Feedback</strong>: Continuous feedback loops refine the AI’s decision-making over time, ensuring adaptability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*stcx_5rOa5Cwx3BxE8NiZw.png" /><figcaption>Agentic AI Architecture</figcaption></figure><p><em>What Is Traditional RAG?</em></p><p>As discussed in my previous articles (<a href="https://medium.com/@souhailguennouni/optimizing-rag-applications-from-prototype-to-production-grade-ai-retrieval-solutions-33a6e0534089">Optimizing RAG</a>, <a href="https://medium.com/@souhailguennouni/recent-advances-in-ai-generative-ai-f704a8e1c4c0">Recent advances in AI</a>, <a href="https://medium.com/@souhailguennouni/unlocking-the-potential-of-llms-fine-tuning-1467d4b13fcc">Unlocking the potential of LLMs</a>), Retrieval-Augmented Generation (RAG) is a hybrid approach combining the strengths of large language models (LLMs) with external data retrieval. Traditional RAG is reactive — it responds to user queries by retrieving relevant information and generating contextually accurate outputs.</p><p>It consists of two main components:</p><p>1.	<strong>Retriever</strong>: Searches external knowledge bases (e.g., medical guidelines, research papers, or EHR systems) to find relevant information.</p><p>2.	<strong>Generator</strong>: Uses a language model to process this information and generate a coherent response tailored to the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-rfwX_ZSRvGj40U_.png" /><figcaption>RAG Architecture — src: <a href="https://dev.to/akeshlovescience/rag-architecture-explained-beginner-5hn4">Akesh Kumar</a></figcaption></figure><p><em>How does Agentic AI differ from RAG applications ?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*PCUDBaDDn6c15VEQibLtNw@2x.jpeg" /></figure><h3>A Healthtech Perspective on Agentic AI and RAG</h3><p>In healthcare, Agentic AI and Traditional RAG bear transformative potential, each addressing distinct challenges:</p><ul><li><strong>Agentic AI in Critical Care</strong>: Imagine an ICU in a hospital equipped with agentic AI systems. These will monitor patient vitals in real time, independently predict possible complications, and take immediate action to stabilize the patient or alert staff. That autonomy could reduce response times and, therefore, improve outcomes for life-threatening conditions like sepsis or cardiac arrest.</li><li><strong>RAG for Clinical Decision Support:</strong> On the other hand, traditional RAG is more suited for knowledge-intensive tasks, for example, when a clinician might ask about the latest treatment guidelines concerning some rare disease. Then, the system with the help of RAG has gone through updated medical literature and generated a short answer with context relevance, therefore enabling better decision-making.</li></ul><h3>Challenges and Opportunities in Healthcare</h3><p><em>Agentic AI: Rethinking Real-Time Autonomy</em></p><p>- <strong>Case</strong> <strong>Study 1: ICU Monitoring and Management</strong></p><p>Agentic AI brings tremendous upsides to any environment where continuous decision-making and rapid adaptability are needed. In ICUs, agentic systems analyze streams of patient data, predict potential deterioration, and recommend or initiate interventions. The proactive nature of these systems reduces the cognitive load on healthcare professionals while improving patient safety.</p><p>- <strong>Case Study 2: Home Healthcare Automation</strong></p><p>Agentic AI in the area of hospital-at-home programs, where it makes possible the remote monitoring and intervention of patients with chronic conditions. This technology autonomously controls medical devices or coordinates care teams to ensure continuity of care without needing constant human oversight.</p><p><em>Traditional RAG: Enhancing Knowledge Access</em></p><ul><li><strong>Case</strong> <strong>Study 1: Clinical Documentation and Education</strong></li></ul><p>RAG is good at retrieving and generating content based on clinical decisions or in teaching patients; for example, RAG can mash up EHRs and medical literature to show personalized treatment plans or other complex medical procedures in easily understood English for the sake of enlightening patients. Use Case 2: Medical Training By using RAG-powered applications, medical trainees can access interactive learning experiences tailored to their specific knowledge gaps, grounded in real-world evidence.</p><h3><strong>The Convergence of Agentic AI and RAG</strong></h3><p>While Agentic AI and RAG serve distinct purposes today, their convergence is inevitable, especially in healthcare.</p><p>Imagine a hybrid system combining the autonomy of Agentic AI with the knowledge grounding of RAG: by fusing autonomous monitoring with evidence-based guidance, such systems can deliver truly personalized, proactive care. For instance, this kind of system could be monitoring a patient’s health metrics autonomously through wearables or medical devices, spot anomalies in real time, and cross-reference huge medical databases in order to suggest personalized interventions.</p><p>This synergy will not only increase the accuracy of diagnosis but also the speed of decision-making, helping professionals in healthcare to offload routine monitoring and first-line guidance for complex cases.</p><p>The hybrid model would also bridge gaps in the accessibility of healthcare, assuring underserved populations a consistent level of high-quality virtual care. Combining Agentic AI’s strengths in decision-making with RAG’s rich contextual understanding can change the future of healthcare into a seamless, interconnected ecosystem where patient outcomes are optimized at every touchpoint.</p><h3><strong>Final Thoughts</strong></h3><p>Agentic AI and Traditional RAG represent two complementary paradigms in AI.</p><ul><li>Agentic AI excels in situations that require autonomy, real-time decision-making, and adaptability, such as ICU monitoring or robotic surgery.</li><li>Traditional RAG is really good at providing accurate, grounded responses for information-driven tasks, such as clinical decision support or patient education.</li></ul><p>Only by combining Agentic AI’s autonomy with RAG’s evidence-based precision can we really develop more intelligent systems and hence create more impact on improving outcomes for patients and empowering healthcare professionals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91476425eafb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing LLM Performance: The Impact of Data Quality and Model Size]]></title>
            <link>https://medium.com/@souhailguennouni/optimizing-llm-performance-the-impact-of-data-quality-and-model-size-95b988cdd4ae?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/95b988cdd4ae</guid>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Wed, 18 Sep 2024 15:44:23 GMT</pubDate>
            <atom:updated>2024-09-18T16:04:23.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4dyChuER3VLaoC3Z" /></figure><p><em>This article is a follow-through of my </em><a href="https://medium.com/cloud-native-daily/unlocking-the-potential-of-llms-fine-tuning-1467d4b13fcc"><em>last article</em></a><em> in which I promised to discuss a number of factors that affect the performance of LLMs, namely data quality and model size.</em></p><p><em>Nowadays, models come in different size and shape. There large models with a high number of parameters and smaller ones with fewer. In some cases, the smaller models perform better than the larger ones. While scaling models — driven by billions of parameters — can unlock unprecedented capabilities in language generation, comprehension, and reasoning. The quality, richness, and relevance of the training data play an equally vital role, often dictating the true potential of these expansive architectures. High-quality data ensures more accurate generalization, robust performance across tasks, and mitigates issues such as hallucination and bias.</em></p><p>This article delves into the direct impact of data quality and model size, exploring how high quality datasets, when paired with optimal model architecture, can improve the quality of LLMs beyond the boundaries of raw computational power.</p><h4>Why Bigger Models Aren’t Always Better?</h4><p>Large language models, like GPT-3 or GPT-4, are built with huge amounts of parameters. With larger model size comes the ability to learn more complex relationships, generalize across diverse tasks, and generate highly sophisticated text. However, without high-quality, diverse, and well-curated training data, the model’s scale becomes less effective. Large models, if trained on low-quality or biased data, can exacerbate errors, amplify biases, and produce output that lacks depth or correctness, no matter how many parameters are involved.</p><p>Model size in the context of LLMs typically refers to the number of parameters — a measure of the model’s complexity and capacity. Parameters are the weights and biases within the neural network that are adjusted during training to minimize error and improve performance. For instance, GPT-3, one of the most well-known LLMs, boasts 175 billion parameters, while newer models like GPT-4 are speculated to have even more, though exact numbers are often proprietary.</p><p><em>Does size have impact on quality?</em></p><p>Larger models generally exhibit superior performance across a variety of tasks. This is because they can capture more intricate patterns in the data, leading to better generalization and more accurate predictions. For example, GPT-4 has shown impressive performance on professional exams and complex reasoning tasks, outperforming its predecessors. However, this increase in quality comes with significant trade-offs:</p><ol><li><strong>Computational Resources</strong>: Larger models require substantial computational power for both training and inference. Training a model with hundreds of billions of parameters demands extensive GPU resources and time. Inference, or the process of generating predictions, also becomes more resource-intensive, making real-time applications challenging.</li><li><strong>Deployment and Accessibility</strong>: Due to their size, deploying large models in real-world applications can be difficult. They often require specialized infrastructure, which may not be accessible to all organizations. This has led to the development of smaller, more efficient models through techniques like model distillation and fine-tuning.</li><li><strong>Environmental Impact</strong>: The energy consumption associated with training large models is considerable, raising concerns about their environmental footprint. Researchers are actively exploring ways to make these models more energy-efficient without compromising performance.</li></ol><p>The quality of training data, the architecture of the model, and the training techniques used also play crucial roles. For instance, models like Mistral 7B and LLaMA 3 have shown that with the right training data and techniques, smaller models can achieve performance levels comparable to much larger models (s<a href="https://vectara.com/blog/top-large-language-models-llms-gpt-4-llama-gato-bloom-and-when-to-choose-one-over-the-other/">ource</a>)</p><p>In <a href="https://arxiv.org/pdf/2305.02301">this article</a>, the authors introduced a new method for training smaller, task-specific models that outperform larger language models (LLMs) while using less training data. This method, called “Distilling step-by-step,” leverages the rationales generated by LLMs as additional supervision for training smaller models within a multi-task framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MIctaSGG-pvPImAE.png" /><figcaption>Source: <a href="https://arxiv.org/pdf/2305.02301">https://arxiv.org/pdf/2305.02301</a></figcaption></figure><p>Their “Distilled step by step” approach offers a promising solution to the challenges of deploying large, compute-intensive LLMs by making smaller models more efficient and effective.</p><h4>Data Quality Considerations</h4><p>The success of LLM finetuning largely hinges on the quality of the data used. Let’s delve into the different data quality dimensions in LLM finetuning through various dimensions.</p><p><strong>Accuracy</strong> is about the correctness of the data. High accuracy ensures that the data accurately represents real-world scenarios, which is crucial for training models that produce reliable and valid outputs. In this use case, inaccurate data can lead to erroneous predictions and undermine the model’s credibility.</p><p><strong>Completeness</strong> measures whether all necessary data is present. For LLM finetuning, a complete dataset means covering all relevant aspects of the task. Incomplete data can result in models that are unable to handle certain scenarios or produce biased results due to missing information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*tDtwbTXZgFGa1u8t.png" /><figcaption>Data quality dimensions</figcaption></figure><p><strong>Consistency</strong> involves ensuring that data is uniform and free from contradictions. Consistent data is vital for training LLMs because inconsistencies can confuse the model and degrade its performance. Consistent data helps maintain the integrity of the training process and ensures the model learns coherent patterns.</p><p><strong>Timeliness</strong> refers to the relevance of data in terms of its currency. Using up-to-date data is important to ensure that the model’s outputs are relevant to current contexts. Outdated data can lead to models that are less effective in addressing contemporary issues or trends.</p><p><strong>Validity</strong> checks whether the data conforms to the required formats and standards. In the context of LLM finetuning, valid data ensures that the inputs are in a format that the model can process effectively. Invalid data can cause errors during training and reduce the overall quality of the model.</p><p><strong>Integrity</strong> ensures that the data is accurate and trustworthy throughout its lifecycle. For LLM finetuning, maintaining data integrity means that the data remains unaltered and authentic from collection through processing and storage. High data integrity is essential for building models that users can trust and rely on.</p><p>The success of modern LLMs depends heavily on data curation practices. Techniques such as de-duplication, filtering for harmful content, and balancing data across languages and topics help build robust models. Without these steps, scaling the model merely scales the problems inherent in the data.</p><p><em>What are the stages of data quality?</em></p><p>The path to achieving high-quality data is continuous and involves several distinct stages, each with its own characteristics and challenges. Let’s discuss how data evolves from being a fragmented resource to a powerful asset optimized for AI applications.</p><p>The first level of data quality hierarchy is <strong>Poor Data</strong>. This stage is marked by significant challenges, including data stored in disparate systems, leading to segregation, decentralization and incompleteness. The disorganization within these datasets renders them nearly impossible to analyze effectively. Most of organizations at this stage struggle to derive any meaningful insights, which hampers decision-making and operational efficiency.</p><p>In the next level, we encounter <strong>Good Data</strong>. While still not perfect, this stage represents an observable improvement. Data becomes more accurate and accessible, though errors and anomalies persist. Despite these issues, data is sufficiently reliable to support basic decision-making processes. However, noticeable gaps and errors remain, necessitating further refinement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ntyI_jsF0TrimYQ3.png" /><figcaption>Stages of data quality (<a href="https://www.linkedin.com/pulse/ai-operational-efficiencies-cognistx/">Source</a>)</figcaption></figure><p>As we move further up, we reach the stage of <strong>Strong Data</strong>. At this level, data accuracy improves significantly, making it reliable enough to support critical decision-making. The data is now prepared for use in AI-enabled tools and analytics, with most significant gaps and errors addressed. Organizations can confidently leverage their data for more advanced analytics and begin exploring AI applications.</p><p>The penultimate stage is <strong>Advanced Data</strong>, where data quality reaches a high level of accuracy and reliability. In this stage, AI-powered predictive analytics and machine learning models and supported, enabling organizations to make accurate projections and effective decision making. The mature data at this stage allows for AI-powered use cases to be activated and efficient, driving innovation and value creation.</p><p>At the pinnacle of data quality is <strong>AI-Enabled Data</strong>. This is the final stage of optimization of data for all AI use cases. Organizations can derive huge value through value creation and high impact use cases, gaining a significant strategic advantage. Achieving this level of data quality transforms data into a powerful asset for strategic decision-making and innovation, keeping organizations ahead of the competition.</p><p>Improving data quality is a continuous journey that requires dedication and strategic investment. By understanding and progressing through these stages, we can unlock the true value of data, driving better decisions, enhanced efficiency, enabling teams to build high-impact and high-quality AI use cases. The evolution from poor to AI-enabled data underscores the importance of investing in data quality to fully leverage the potential of AI and advanced analytics.</p><p><em>To sum up, the performance of LLMs is impacted not only by their size, but also by the quality of the data used to train them. While larger models with billions of parameters can unlock advanced capabilities comprehension and inference, their effectiveness significantly depends on high-quality, rich, and well-curated training data. This ensures accurate generalization, robust performance, and mitigates issues like bias and hallucination.</em></p><p><em>Further, building smaller and more efficient models through techniques like model distillation and fine-tuning has shown that bigger is not always better. These smaller models can achieve comparable performance to their larger counterparts if they use the right data and training techniques.</em></p><p><em>The key to maximizing the potential of LLMs is in finding the right balance between model size and data quality, to build reliable, effective, and trustworthy AI systems.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95b988cdd4ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the potential of LLMs: Fine-tuning]]></title>
            <link>https://medium.com/cloud-native-daily/unlocking-the-potential-of-llms-fine-tuning-1467d4b13fcc?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1467d4b13fcc</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Sat, 11 May 2024 14:16:27 GMT</pubDate>
            <atom:updated>2024-05-17T07:28:12.046Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBcBFUqoPzyGDQTYN0qw2A.jpeg" /></figure><p><em>Following the important evolution and the availability of open source foundation models offered by different AI companies, the opportunity of leveraging Large Language Models (LLM) for business use cases is incredible.</em></p><p><em>LLMs like GPT, Llama or Gemini have been surprisingly efficient in comprehending, generating and interacting using human language. This allowed to unlock huge opportunities of application like chatbot, unstructured data processing, content generation tolls, across industries to solve different problems.</em></p><p><em>However, while LLMs knowledge base is important, it is often general-purpose. This means that an LLM trained on a massive dataset of text and code might struggle to understand the nuances of specific domains like finance, medicine, or legal jargon. Therefore, By adapting an LLM to a particular domain, we can significantly improve its performance in several ways.</em></p><p><em>This article delves into the concept of fine-tuning, a powerful technique that customizes these models for specific domains and tasks. We explore key challenges associated with fine-tuning and propose effective solutions that will mitigate these challenges.</em></p><h4><strong>What is an LLM?</strong></h4><p>As detailed in my previous articles <a href="https://medium.com/@souhailguennouni/recent-advances-in-ai-generative-ai-f704a8e1c4c0">Recent advances in AI — Generative AI</a> and <a href="https://medium.com/@souhailguennouni/optimizing-rag-applications-from-prototype-to-production-grade-ai-retrieval-solutions-33a6e0534089">Optimizing RAG Applications</a> LLM (Large Language Model) is a type of AI capable of primarily understanding and generating text. It is based on machine learning type of models called transformer models.</p><p>LLMs are trained on massive amounts of dataset from mainly from internet. The quality of the dataset impact the how the model will comprehend and generate.</p><p>LLM use deep learning technique to be able to understand the relationship between characters, words and sentences. It also uses probabilistic analysis of unstructured data to be able to descern differences in content without human intervention.</p><p><strong>What is LLM Fine-tuning?</strong></p><p>LLM fine-tuning is the process of customizing a general purpose pre-trained large language model into a specific domain in order to get better results in a specific task/domain. It is achieved by further training the language model on a smaller but specialized dataset in the form of “input-output” examples similar to the desired model responses.</p><p>This process allows the LLM to extend and enhance its knowledge on a specific domain thus improving its output in to meet the expected results.</p><p>The process of fine-tuning involves updating the model parameters through an extensive supervised learning method using labeled data.</p><p><strong>Dataset: it’s all about automation:</strong></p><p>To build an enterprise-scale fine-tuned LLM, we need to have a highly clean and comprehensive domain-specific dataset. In addition, there is a need to keep the dataset up to date with the freshest data collected. Building such dataset can be expensive. Therefore, there is a need to automate and streamline the process of data collection and preparation.</p><p>An efficient way to do it is to build data pipelines that includes different data prep/processing tools in addition to RAG application. Using RAG is important to comprehending and classifying, and transforming the streams of unstructured data.</p><p><strong>How to fine-tune an LLM:</strong></p><p>After preparing a high quality task-oriented dataset of labeled data, we can now proceed with the process of fine-tuning, which includes the following steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9A_ZX1xcfrqJLjoHOPVNPA.png" /><figcaption>Fine-tuning a pre-trained LLM</figcaption></figure><ul><li>The first step is to select the appropriate general-purpose LLM that best suits your need and use case. Considerations regarding the number of parameters and quality of data in the training phase are key to the performance of the LLM (I will detail this point in a future article)</li><li>Domain-specific dataset: As discussed earlier, data preparation pipeline should be well-designed to allow for the creation of high quality labeled data using an efficient and cost-effective pipeline. Depending on the domain, an alternative is to purchase a database from the internet.</li><li>Continuous training phase: The general purpose model is trained on the new labeled dataset using the supervised learning technique. During this process, the model recalibrates its parameters and weights in order to overwrite its general-purpose knowledge with the new acquired knowledge, making the model develop a deep understanding/expertise in that domain. This phase should be continuously running in order to accommodate for the new information coming from the data pipeline.</li><li>Domain-specific model: This is the result of the training phase. This model will keep it general knowledge capabilities while excelling the specific domain.</li><li>Human interaction: Using the model by the client (human or system) to implement new use cases and help solve industry-specific problems.</li></ul><p><strong>Fine-tuning challenges and solutions:</strong></p><p>While fine-tuning an LLM model offers a huge potential, it comes with its specific challenges.</p><p><em>The data dilemma:</em></p><p>One of the main challenges is the availability of data. Getting an extensive dataset of particular domain can be a tedious task. In addition, the dataset used in the fine-tuning needs to be large enough and of a high quality to be able to have satisfying outcome especially if the pre-training data did not extensively cover your specific domain (which is most likely)</p><p>Training the LLM with limited dataset would result in unsuccessful outcomes. Remember that it is only through practice that human learn, and it is applicable to LLMs.</p><p>To mitigate those challenges, there are some techniques that can boost the performance of fine-tuned LLM like:</p><ul><li><strong>Data augmentation</strong>: this method involves applying different techniques such as rotation, noise injection, translation and scaling, to data sample in order to generate additional training data.</li><li><strong>Transfer learning</strong>: is adapting the model to another related task. Instead of re-training the model from scratch to perform a new task, this technique leverages the knowledge gained to solve the new related task.</li><li><strong>Semi-supervised learning</strong>: this technique uses combination of labeled and un-labeled data to hit the right balance between supervised and unsupervised learning. By leveraging the superabundance of un-labeled data along with labeled data, this technique will improve the model’s performance and reduce the dependancy on labeled data that requires the extensive labeling effort.</li></ul><p><em>Catastrophic interference:</em></p><p>While fine-tuning an LLM, you are most likey to experience catastrophic interference cases where the model is trained on a new domain but “forgets” about tasks it was already good at.</p><p>This regression happens due to the update on the model’s parameters during the fine-tuning phase. Overcoming this hurdle is critical to ensure that the model learned a new domain(s) without compromising the prior knowledge.</p><p>To overcome this challenge, several techniques should be employed:</p><ul><li><strong>Elastic Weight Consolidation (EWC)</strong>: This technique allows to help preserve important parameters that were trained to be good at specific tasks. This is achieved by assigning importance to specific parameters based on their significance in previous tasks and penalieze their update during the training on the new tasks.</li><li><strong>Progressive Neural Networks (PNNs)</strong>: PNNs are a subset of neural networks used to enable the model’s continuous learning without catastrophic interference. In this technique, each new task is learned by adding a new neural network modules while retaining the knowledge on previously learned tasks. This is a modular approach that allows to expand the model’s progressively over time without compromising the existing knowledge.</li><li><strong>Tasks Sequencing and Knowledge distillation</strong>: Task sequencing enforces priority-based ordered learning of tasks while Knowledge distillation is a technique to transfer knowledge from a complex model “teacher” to a simpler one “student”. When combined, task sequencing can enforce in whitch the distillation is applied, ensuring that the “student” is learning from the “teacher” model in an ordered manner which improves both the efficiency and the performance of the model on multiple tasks.</li></ul><p>These methods allow to fine-tune the model while retaining previously learned knowledge.</p><p><em>Overfitting:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-kBbKGKfSr-Vc0rq.png" /><figcaption>Good-fitting vs overfitting — Source: <a href="https://shorturl.at/OUV68">https://shorturl.at/OUV68</a></figcaption></figure><p>During fine-tuning, the LLM might become overly specific to the training examples. It is the case where the model memorizes training data instead of learning real world general language patterns.</p><p>There several approaches to overcome this problem:</p><ul><li><strong>Regularization techniques</strong>: this includes dropouts and weight decay methods to prevent the model from memorizing specific examples of the learning data by introducing randomness and penalizing overly large weights.</li><li><strong>Data strategies</strong>: training data quality selection using methods like cross-validation helps maintain the balance between the model’s complexity and its ability to generalize to new situations.</li><li><strong>Training strategies</strong>: considering training strategies like early stop, ensemble learning (combining multiple models), and regularly monitor the model’s performance during the training phase will prevent overfitting.</li></ul><p><em>Hyperparameter Tuning:</em></p><p>During fine-tuning, several settings called hyperparameters are adjusted, which dramatically impacts the model’s performance. Choosing the wrong hyperparameters can lead to poor performance on unseen data, slow learning and training failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qye72VsXnSIKmFMsgcVYWw.png" /><figcaption>Hyperparameters tuning</figcaption></figure><p>There are many techniques that can help with this kind of tuning. One of which is automation, which uses techniques like grid search and Bayesian optimization to automate the process of detecting hyperparameter combinations and thus coming out with the best possible configuration. Additional techniques like adjusting the learning rate during training phase can also enhance the efficiency of hyperparameter tuning.</p><p><em>Bias amplification:</em></p><p>Fine-tuning can amplify the existing pre-trained LLM bias (from pre-training dataset) leading to prejudiced outputs. This is a crucial matter to address due to the high negative impact it can cause to the users.</p><p>To mitigate this risk, a multi-layered approach needs to be put in place. This includes the following:</p><ul><li><strong>Data techniques: </strong>handle the bias in both the pre-processing to reduce bias and post-processing training techniques to debias the outputs.</li><li><strong>Monitoring and evaluation</strong>: Regularly audit the model’s behavior to help identify and address the biased outputs.</li><li><strong>Curating data</strong>: involves selecting, pre-processing and organizing datasets in order to reduce bias in the training datasets</li><li><strong>Neural prompts:</strong> using input instructions when interacting with the model to better generate debiased outputs.</li></ul><p><strong>Conclusion</strong>:</p><p>LLMs are disrupting nowadays business in so many ways. Fine-tuning unlocks the true potential of LLMs by customizing them for specific domaines or tasks. However, it comes with many challenges like data limitations, knowledge loss, and bias. This article explores solutions for these challenges, including data augmentation and bias mitigation techniques. By addressing these concerns, you can leverage fine-tuning to create powerful domain-specific LLMs. As AI evolves, fine-tuning will play a key role in maximizing LLM potential across various industries.</p><p><strong>Next:</strong></p><p><em>In my next article, I will be evaluating and comparing both Retrieval Augmented Generation (RAG) and Fine-tuning approaches. Stay tuned.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1467d4b13fcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-native-daily/unlocking-the-potential-of-llms-fine-tuning-1467d4b13fcc">Unlocking the potential of LLMs: Fine-tuning</a> was originally published in <a href="https://medium.com/cloud-native-daily">Cloud Native Daily</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing RAG Applications: From Prototype to Production-Grade AI Retrieval Solutions]]></title>
            <link>https://medium.com/@souhailguennouni/optimizing-rag-applications-from-prototype-to-production-grade-ai-retrieval-solutions-33a6e0534089?source=rss-b8cb8c28ffa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/33a6e0534089</guid>
            <category><![CDATA[production-ready]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <category><![CDATA[retrieval-generation]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Souhail Guennouni - سهيل گنوني]]></dc:creator>
            <pubDate>Fri, 15 Dec 2023 09:20:06 GMT</pubDate>
            <atom:updated>2023-12-17T11:31:43.257Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQ5vtS7rYX6Ndi9UB9jMBw.png" /></figure><p><em>One of the most exciting applications in the rapidly evolving Artificial Intelligence (AI) field is Retrieval Augmented Generation (RAG)</em></p><p><em>RAG applications are completely transforming our approach to information retrieval. They are revolutionary on handling knowledge-intensive tasks requiring more than a general-purpose language model.</em></p><p><em>Developing a RAG prototype is relatively easy, but building a production-ready, scalable and performant RAG application able to extract and process information from multiples sources can be challenging and requires attention to key limitations.</em></p><p><em>In this article, I will be discussing the key necessary optimizations to RAG application components that allows you to meet production-grade solution requirements in terms of performance, reliability, accuracy and scalability.</em></p><p><strong>What is RAG application?</strong></p><p>Retrieval Augmented Generation (RAG) is a framework to develop language models that can access and use external information sources such as APIs, documents and knowledge bases. It distinguishes itself from traditional language models by including an information retrieval step into the text generation process.</p><p>Implementing a production -ready RAG application can be challenging due to different limitations. One of the major limitation is the context window.</p><p><strong>What is the motivation behind RAG applications usage?</strong></p><p>RAG application are becoming more and more essential in different industries and domains and offering a better alternative to traditional LLM models. Here are some key reasons why we need RAG applications:</p><ul><li><strong><em>Better accuracy than traditional LLM</em></strong>: RAG applications have access to multiples knowledge sources and able to extract up-to-date information that is fed in real time in knowledge bases</li><li><strong><em>Better domain specialization</em></strong>: one of the main issues with general purpose LLMs is that they are able to generate domain specific information because they were trained on general-purpose training data. RAG applications can be better in domain-specific tasks through including domain-specific information in the knowledge bases which allow RAG applications to general more specific and tailored output.</li><li><strong><em>Less hallucinations and bias</em></strong>: Traditional LLMs suffer from hallucination and inaccuracy syndromes, due to training data limitations. RAG applications, on the other hand, through grounding their responses on external sources, can significantly reduce the risk of hallucination and bias ensuring a more reliable and accurate responses.</li><li><strong><em>More personalized user experiences</em></strong><em>:</em> RAG applications can personalize the response based on the user preferences, interests or search history. This can enhance the user experience and satisfaction of the application.</li></ul><h3><strong>Building High Performance, Production-Ready RAG Applications</strong></h3><p>This section aims to provide a comprehensive guide on optimization parameters for RAG applications to meet requirements of high-performance in production environments.</p><p>It covers optimization aspects in two main components: <em>data ingestion pipeline,</em> and <em>augmented generation</em> . It covers techniques and configuration to build reliable, accurate, high-performing RAG applications.</p><h3><strong>Data ingestion pipeline</strong></h3><p>One of the main optimizations in RAG applications performance lies in the data collection and ingestion phase. The efficiency and effectiveness of the data ingestion phase significantly influences the overall performance of the system.</p><p>Therefore, through optimizing the data ingestion phase, we can potentially empower the RAG application to achieve higher performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r1N014OoHBMNRLRBWNu69Q.png" /><figcaption>RAG Application — Data ingestion phase</figcaption></figure><ol><li><strong><em>Collecting Data</em></strong><em>:</em></li></ol><p>Data sources can range from structured databases, trusted websites, to structured policy documents, each with its unique format and structure.</p><p>The power of RAG system is its ability to collect and process different types of data from different sources.</p><p>Each data source would use its own load mechanism. This can range from API calls to document parsing and web scraping.</p><p><strong><em>2. Data Cleaning and Metadata Enrichment</em></strong><em>:</em></p><p>After collecting a diverse set of data, and storing it in a data lake or a storage of this kind, the most important step is to process and produce a high quality data that can be used by the RAG application.This will include ensuring the data is free from inconsistencies, errors, and is encoded correctly is the first step.</p><p>Another important factor in data quality optimization is validating the integrity of data because it significantly influences the RAG pipeline’s performance and output.</p><p>Another optimization factor is metadata enrichment. It consists of adding metadata annotations that will improve the post-search results. It is key to improve the RAG system accuracy, and offering additional contextual filters.</p><p><strong><em>3. Smart Chunking and Labeling:</em></strong></p><p>This technique is crucial to RAG application retrieval performance. The idea consists of breaking up large documents into smaller coherent units of information.</p><p>The challenge with this operation is to be able to generate logically coherent paragraphs that will add value to the context it is retrieved for.</p><p>In addition to chunking, labeling data is another important optimization to RAG application the enforce reliability and trusted outcome.</p><p>This labeling might include a URL of the source document the chunk is extracted from or additional information that will give more context to the chunk allowing it to be a meaningful unit of information. An example use case could be to reliably offer reference the any piece of information the LLM model provides. This is a key differentiator from general-purpose LLMs.</p><p><strong><em>4. Embedding Models</em></strong><em>:</em></p><p>The embedding models are key to the retrieval process. The quality of embeddings directly impacts the retrieval outcomes. While many general-purpose embedding models exist, fine-tuned, use-case specific models can improve the overall performance of the retrieval.</p><p>For example using BERT model we can generate embedding as follows:</p><pre>from transformers import BertModel, BertTokenizer<br>import torch<br><br># Load pre-trained model tokenizer and model<br>tokenizer = BertTokenizer.from_pretrained(&#39;bert-base-uncased&#39;)<br>model = BertModel.from_pretrained(&#39;bert-base-uncased&#39;)<br><br>def generate_embeddings(text):<br>    # Encode text to get token ids<br>    inputs = tokenizer(text, return_tensors=&#39;pt&#39;)<br><br>    # Generate embeddings<br>    with torch.no_grad():<br>        outputs = model(**inputs)<br><br>    # Extract the embeddings <br>    embeddings = outputs.last_hidden_state[:, 0, :].numpy()<br>    return embeddings</pre><p>After generating embeddings, we proceed to query a vector database to retrieve relevant information.</p><p><strong><em>5. Vector Database</em></strong></p><p>A vector database is a type of database that indexes and stores vector embeddings for fast retrieval and similarity search, with capabilities like CRUD operations, metadata filtering, and horizontal scaling. It is heavily used in RAG application due to its adaptability with RAG performance use cases.</p><p><em>Indexing Algorithms:</em></p><p>For more granular context separation, experimenting with multiple indexes might be important. This involves different indexes for different document types and index routing during retrieval.</p><p>Furthermore, to improve the performance of similarity searches at scale, vector databases use Approximate Nearest Neighbor (ANN) search methodologies as opposed to traditional k-nearest neighbor (kNN) techniques. ANN offers an estimation of the closest neighbors, potentially sacrificing some accuracy compared to kNN.</p><p>It is also important to activate vector compression in these indexing techniques. While it shares similarities with ANN in terms of potential precision loss, the exact impact depends on the chosen vector compression method and its configuration.</p><h3>Generation Phase</h3><p>In this section, we primarily discuss state of the art techniques to improve the generation phase and overall performance of the RAG application. We will be discussing some key concepts that will improve the RAG app quality, mainly: query enhancement, re-ranking technique, and prompt engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_N4qAh0WMDCkI4n71SHEQ.png" /><figcaption>RAG Application — Generation Phase</figcaption></figure><p><strong><em>Query Enhancement:</em></strong></p><p>The search query, embedded into the vector storage, can influence the retrieval results. When unsatisfactory results are obtained, various query optimization techniques can be used:</p><ul><li><strong>Smart iteration</strong>: Leverage the LLM to provide the best prompt and give additional context.</li><li><strong>Query Partitioning</strong>: Partition long queries into multiple smaller and simpler ones.</li></ul><p><strong><em>Re-ranking technique:</em></strong></p><p>One of the main issues in retrieval use-cases is that the most similar text retrieved is not always the most relevant. Using re-Ranking models can help eliminate non-relevant context information by using a technique based on relevance score calculation. This is usually performed through configuring the model by providing the the number of search results and the number of re-ranked results.</p><p><strong><em>Prompt engineering:</em></strong></p><p>Prompt engineering is a technique that involves crafting, modifying, or optimizing the input prompts given to a LLM to elicit more accurate, relevant, or specific responses.</p><p>While it doesn’t directly fine-tune the model’s parameters, prompt engineering can significantly improve the model’s performance on specific tasks or domains.</p><ul><li><em>Clarity and direction</em>: Crafting clear and concise prompts that accurately convey the desired output helps the LLM understand the task and focus its generation accordingly. Vague or ambiguous prompts can lead to irrelevant or nonsensical outputs.</li><li><em>Specificity and control</em>: By incorporating specific details and instructions into the prompt, you can guide the LLM towards a particular style, tone, or factual accuracy. This allows you to tailor the output to your specific needs.</li><li><em>Context and knowledge injection</em>: You can provide the LLM with additional context or knowledge through the prompt, such as relevant examples, background information, or specific vocabulary. This can improve the accuracy and coherence of the generated text.</li><li><em>Creativity and exploration:</em> Prompt engineering allows you to experiment with different creative approaches and explore the full potential of the LLM. By using creative prompts or techniques like few-shot learning, you can encourage the LLM to generate more original and engaging outputs.</li></ul><h3>Conclusion</h3><p>The evolution of RAG application in the AI landscape signifies a transformative shift in information retrieval.</p><p>By leveraging external knowledge sources and advanced techniques like data cleaning, smart chunking, and effective prompt engineering, RAG applications can surpass traditional LLMs in accuracy, domain specialization, and user experience.</p><p>As discussed in this article, while the foundational principles of RAG are intriguing, the journey from prototyping to creating a robust, production-ready application presents multifaceted challenges.</p><p>From meticulous data ingestion processes to the nuanced art of prompt engineering, each step in the RAG pipeline demands fine grained knowledge of the optimization paths and great deal of innovation.</p><p>By overcoming these challenges, RAG applications can unlock a new era of information retrieval, empowering users with access to more accurate, personalized, and trustworthy information. The future of search is bright, and RAG is poised to lead the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a6e0534089" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>