<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Capital Markets, AI & Tech]]></title><description><![CDATA[First-principles analysis of capital markets, AI, technology, and the systems shaping the future of finance.]]></description><link>https://bhaveshsenedhun.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!nTip!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae493d6-391b-4d07-b9ed-e1ae04d5d944_1280x1280.png</url><title>Capital Markets, AI &amp; Tech</title><link>https://bhaveshsenedhun.substack.com</link></image><generator>Substack</generator><lastBuildDate>Wed, 12 Aug 2026 02:54:21 GMT</lastBuildDate><atom:link href="https://bhaveshsenedhun.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Bhavesh Senedhun]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[bhaveshsenedhun@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[bhaveshsenedhun@substack.com]]></itunes:email><itunes:name><![CDATA[Bhavesh Senedhun]]></itunes:name></itunes:owner><itunes:author><![CDATA[Bhavesh Senedhun]]></itunes:author><googleplay:owner><![CDATA[bhaveshsenedhun@substack.com]]></googleplay:owner><googleplay:email><![CDATA[bhaveshsenedhun@substack.com]]></googleplay:email><googleplay:author><![CDATA[Bhavesh Senedhun]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Open Weights Are Not Open Source]]></title><description><![CDATA[And This Isn&#8217;t Just a USA-China Debate]]></description><link>https://bhaveshsenedhun.substack.com/p/open-weights-are-not-open-source</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/open-weights-are-not-open-source</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Fri, 31 Jul 2026 17:53:21 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8413b2fc-a1f6-41cf-8473-3f32eae0ef85_2000x1126.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><strong>This article is originally published in LinkedIn on July 31, 2026. <a href="https://www.linkedin.com/posts/bhaveshsenedhun_open-weights-are-not-open-source-even-if-ugcPost-7489012470033043456-z-sS/?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAABWcmLYB80u3etoKKnSd_Ez1PrQ9_nH5jso">View the LinkedIn Article Here</a>.</strong></em></p><p><em>Preamble: <br>I&#8217;m <a href="https://about.me/bhaveshsenedhun/">Bhavesh Senedhun</a>, and I&#8217;m writing this article at the request of LinkedIn Senior Editor <a href="https://www.linkedin.com/in/tanyadua/">Tanya Dua</a>, who emailed me today to ask whether <a href="https://www.anthropic.com/news/position-open-weights-models">Anthropic&#8217;s position</a> is backfiring. My view is that the real issue goes beyond open weights and export controls. Open source offers a way forward. By levelling the playing field, it may give humanity its best chance of collectively identifying the bad actors.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dDl0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dDl0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dDl0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg" width="1456" height="820" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:820,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:231919,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/209267652?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dDl0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dDl0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F612dd23c-ef34-4add-954f-08d917ad2b50_2000x1126.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Open Weights v/s Open Source Visual Representation</figcaption></figure></div><p>Open-weight models have attracted plenty of enthusiasm at least since July 27, when Moonshot AI&#8217;s Kimi K3 weights were made public. Conversations do not have to pass through an American cloud provider, so sensitive information can remain within the organisation&#8217;s own environment. The model can also be fine-tuned or benchmarked without relying on the developer&#8217;s servers.</p><p>Open-weight releases benefit from associations established by open-source software. The term recalls Linux and collaborative research. It also suggests freedom from corporate control. Yet a model can provide broad access to its final parameters without disclosing enough information for outsiders to reconstruct or fully audit it.</p><p>That gives users a meaningful degree of technological independence. The word &#8220;open,&#8221; however, can obscure how limited this independence is. A downloadable model arrives as a finished machine. Its engineering history may remain inaccessible, along with the records needed to reproduce its construction or investigate the decisions behind it.</p><p>Debates about open AI often compress several questions into one. Open weights address the most immediate question by giving users access to the finished model. They reveal much less about how it was produced. Whether researchers elsewhere can build a comparably capable system is a separate issue.</p><p>The <a href="https://opensource.org">Open Source Initiative</a> has spent decades defining openness in software. Its AI definition requires meaningful freedom to use and study a system, with permission to modify and share it. Those freedoms depend on access to the preferred form for making changes. This includes the relevant code, as well as sufficiently detailed information about the training data and development process.</p><p>The original training corpus may remain unavailable, including the material deliberately excluded from it. Developers do not necessarily disclose their filtering rules or deduplication methods. Synthetic-data sources may stay private. The same is true of reward models. Annotator instructions, reinforcement-learning datasets and intermediate checkpoints are often withheld. Parts of the training pipeline may be unavailable as well.</p><p>Even with these omissions, open weights permit local deployment and independent benchmarking. Researchers can conduct mechanistic studies or security testing without being confined to an API. They can also adapt the system for their own work. Possession of a verified checkpoint protects users against silent replacement or a later withdrawal of access.</p><p>LLM weights are matrices of numbers learned during training. They matter enormously, but they are the result of that process rather than a record of how it was carried out. A typical release may include the model&#8217;s architecture and final parameters, along with the inference code and a licence. This alone may be enough to run the model locally or adapt it to a specialised task.</p><p>The original training corpus may remain unavailable, including the material deliberately excluded from it. Developers do not necessarily disclose their filtering rules or deduplication methods. Synthetic-data sources may stay private. The same is true of reward models. Annotator instructions, reinforcement-learning datasets and intermediate checkpoints are often withheld. Parts of the training pipeline may be unavailable as well.</p><p>Even with these omissions, open weights permit local deployment and independent benchmarking. Researchers can conduct mechanistic studies or security testing without being confined to an API. They can also adapt the system for their own work. Possession of a verified checkpoint protects users against silent replacement or a later withdrawal of access.</p><p>Calling this arrangement open source borrows a reputation earned by projects whose construction is open to inspection. &#8220;Open weight&#8221; already describes the narrower bargain. Even OpenAI uses the term for downloadable models that can be run or customised locally.</p><p><a href="https://www.moonshot.ai/">Moonshot AI </a>describes Kimi K3 as a 2.8-trillion-parameter mixture-of-experts model in which only part of the parameter count is activated for each token. The downloadable weights and accompanying technical information amount to a substantial engineering release.</p><p>Running the weights locally gives an organisation direct control over how the model is deployed. Prompts stay on its own infrastructure, where it can set the rules for network access and logging. Checkpoint hashes let administrators verify that the model in use is the same one they originally evaluated. Researchers can also study its behaviour without relying on Moonshot's servers.</p><p>Much of the uncertainty concerns what happened before the release. Copyrighted or private material could have entered training without being identifiable from the checkpoint. Manipulated examples and poisoned data present the same problem. Published documentation may not reveal which synthetic outputs were used during training. Nor will it necessarily disclose behaviours found during post-training. Suppressed failures and unpublished evaluations are also difficult to recover from weights alone.</p><p>Sleeper-agent experiments have shown a limit of ordinary model testing. A system can behave normally until a trigger causes deliberately unsafe conduct. Some backdoors survived supervised fine-tuning and reinforcement learning. Adversarial safety training did not always remove them either.</p><p>This research does not implicate Kimi K3. It shows why possession of a checkpoint cannot settle every safety question.</p><p>NIST treats training data and source code as separate security concerns. It considers model weights separately as well. Its generative AI risk framework calls for documentation of training-data sources and safeguards against tampering throughout development.</p><p>Publishing a system as open source does not make it trustworthy by itself. Malicious software can be released openly, and a documented training process may still contain mistakes that reviewers overlook. Disclosure does, however, allow independent groups to inspect the data pipeline and see how material was filtered. They can try to reproduce parts of the process, compare their findings with the developer&#8217;s account and question its safety claims.</p><p>American institutions and technology companies do not all want the same thing from open AI. The result is a collection of competing positions rather than a single national policy.</p><p>Nvidia and Microsoft have backed a letter titled &#8220;Open Weights and American AI Leadership.&#8221; Meta and IBM support it as well, while Dell signed separately. The broader coalition includes Palantir and Hugging Face among hundreds of organisations. Its members argue that downloadable models encourage competition and give countries more control over their digital infrastructure. They also say wider access helps researchers find weaknesses and devise safeguards. Microsoft reported on July 30, 2026, that the coalition had grown to more than 230 members.</p><p>These principles align with commercial interests too. Chipmakers make money when more models are deployed, while cloud providers benefit when organisations use their infrastructure to train or host them. Enterprise-software vendors have another incentive: models are more useful to them as interchangeable components than as proprietary gateways.</p><p>Frontier laboratories have made a different calculation. Anthropic supports strict limits on exports of advanced semiconductors and has backed controls on large-scale model distillation. It argues that an advantage in computing power could preserve a democratic lead in frontier AI. The company has also blocked Claude access for certain Chinese-controlled entities, despite saying that the decision cost it substantial revenue.</p><p>Anthropic treats lower-capability releases differently from future models that could have serious cyber or biological applications. Greater autonomy would add to those concerns.</p><p>OpenAI likewise supports the international distribution of American AI while arguing that export policy should protect the country&#8217;s technological advantage. Its submission on the U.S. AI Action Plan advocated exporting what it called democratic AI under controls designed to prevent that advantage from eroding.</p><p>Selected model releases can logically coexist with restrictions on the chips and infrastructure needed to train their successors. Specialised knowledge can be controlled for the same reason. In practice, this arrangement encourages worldwide adoption of American technology while reserving the frontier for American developers.</p><p>Meta benefits from a different outcome because strong open-weight models weaken businesses that charge for model access. As models become commodities, value can move towards infrastructure and applications. Advertising or distribution may then play a larger role. The philosophical argument about openness is therefore entangled with a contest between revenue models.</p><p>Advanced AI could support military operations or cyberattacks. Biological misuse presents another category of danger. These risks form the safety case for export controls. Governments considered especially risky can be denied cutting-edge chips and models, leaving approved actors with a capability lead.</p><p>Policy makers rarely separate that safety rationale cleanly from industrial advantage. Anthropic has argued that access to compute may determine whether Chinese developers remain months behind the American frontier. Semiconductor restrictions can preserve that gap. This may be a legitimate national-security objective, but it also maintains an international hierarchy in technical capability.</p><p>The United States has changed the design of its controls while keeping the same broad objective. In May 2025, the Commerce Department withdrew the Biden administration&#8217;s global AI Diffusion Rule, describing it as burdensome and harmful to relations with partner countries. It said semiconductor controls would instead be tightened through a different approach.</p><p>With restrictions already in force, the argument is now about how far they should extend and how long they should remain. Controls make training more expensive and large computing clusters more difficult to build, limiting the number of experiments a laboratory can afford. Older hardware is a poor substitute for advanced chips once electricity use and networking requirements are considered. Reliability makes the trade-off harder still.</p><p>Such restrictions are more likely to delay progress than prevent it indefinitely. Algorithms cross borders more readily than fabrication equipment, while older chips can be combined at additional cost as domestic manufacturing develops. Distillation can transfer some model behaviour without reproducing the original training run. Advances in engineering may lower computing requirements, and routing supplies through third countries makes enforcement more difficult.</p><p>The pressure also gives the target country an incentive to reduce its dependence on foreign technology. Denying China access to foreign chips or software encourages it to build an independent stack. Limits on cloud access add to that pressure. Recent Chinese model development suggests that controls can affect the cost and pace of progress, but a permanent technological barrier is difficult to envisage given China&#8217;s scientific and industrial capacity. Its financial resources make such an outcome less plausible.</p><p>China&#8217;s long history is sometimes invoked as a response to American technological nationalism. Its institutions can plan beyond Western election cycles and quarterly reporting periods. Industrial programmes may continue across several five-year plans instead of being redesigned whenever political control changes.</p><p>Long-term planning matters, but the age of a civilisation says little about whether it will govern AI responsibly. Ancient societies have produced scientific achievement and wisdom, alongside repression and war. Their longevity cannot tell us how a modern laboratory will behave or guarantee the conduct of a government or company.</p><p>Institutional capacity offers a stronger basis for judgment. China should not be presumed incapable of responsible governance simply because its political system differs from the American one. Chinese institutions have pursued industrial goals over decades, while American technology policy can shift sharply when a new administration takes office.</p><p>Neither country acts with a single purpose. Chinese academics may disagree with technology companies, while regulators may have different priorities from military institutions. American universities do not necessarily share Nvidia&#8217;s interests. Anthropic and OpenAI may disagree with the Commerce Department or with each other. Describing either civilisation as a unified actor hides the institutional conflicts that influence policy.</p><p>Export controls may buy time for work on governance. Whether that time proves useful depends on governments establishing international arrangements that can survive changes in national policy.</p><p>The United States promotes what it calls democratic AI. China stresses sovereignty and development while opposing containment. Each government points to the other&#8217;s surveillance or military activity, and both accounts are reinforced by cyber operations and propaganda.</p><p>Great powers regularly describe themselves as responsible custodians of dangerous technology. Yet if unilateral control of frontier AI is itself hazardous, a system based on the permanent supremacy of whichever state appears most trustworthy at the time is unlikely to remain stable.</p><p>Mutual auditability could provide a starting point for an international arrangement. Researchers outside the laboratory that created a model need enough access to find vulnerabilities. Smaller countries should also be able to examine systems on which they rely rather than accept the supplier&#8217;s assurances. Claims about bias or censorship must remain open to testing, as should claims about hidden capabilities. Defenders need the technical access required to build tools for detection and neutralisation.</p><p>Broader access carries serious risks. Safeguards can be stripped from downloadable models, which may then be adapted for cyberattacks or other harmful purposes. Once weights have been distributed around the world, recalling them is exceptionally difficult. Immediate publication cannot therefore be assumed harmless. Permanent corporate secrecy and national containment are still far from the only possible responses.</p><p>Frontier developers could be required to assemble an auditable package for every significant model. Cryptographic hashes would cover the weights and code, while datasets and checkpoints would have their own records. Reproducible tools would show how the data was curated and filtered. Further documentation would identify where the data came from and whether synthetic-data systems were used. Teacher models would be disclosed separately. The package would also include the methods used during training and post-training, followed by red-team findings and unresolved failures.</p><p>This material would not need to be released worldwide at once. Accredited independent auditors could receive intermediate checkpoints first. Institutions from several countries could then run standardised evaluations, rather than leaving the developer to assess its own model. Any poisoning incident or hidden behaviour would have to be reported. The same duty would apply if the weights were compromised.</p><p>The right to run a model matters but so does the ability to understand how it was built.  We all should strive to question the claims made about it and develop defences independently. Those powers should not belong to one company or country alone in my opinion.  National security should not become a standing excuse for preserving one country&#8217;s technical dominance either, be it China, the USA, or <a href="https://www.mauritiusexplored.com/">Mauritius</a> for that matter.</p><h3>References</h3><ol><li><p>Anthropic. &#8220;Anthropic&#8217;s AI Export Controls Framework Response.&#8221; April 30, 2025. Anthropic argues that controls on semiconductors and model weights could preserve the United States&#8217; computing advantage over China.<br><a href="https://www.anthropic.com/news/securing-america-s-compute-advantage-anthropic-s-position-on-the-diffusion-rule/">https://www.anthropic.com/news/securing-america-s-compute-advantage-anthropic-s-position-on-the-diffusion-rule/</a></p></li><li><p>Bureau of Industry and Security, U.S. Department of Commerce. &#8220;Department of Commerce Announces Rescission of Biden-Era Artificial Intelligence Diffusion Rule, Strengthens Chip-Related Export Controls.&#8221; May 13, 2025.<br><a href="https://www.bis.gov/press-release/department-commerce-announces-rescission-biden-era-artificial-intelligence-diffusion-rule-strengthens">https://www.bis.gov/press-release/department-commerce-announces-rescission-biden-era-artificial-intelligence-diffusion-rule-strengthens</a></p></li><li><p>Hubinger, Evan, et al. &#8220;Sleeper Agents: Training Deceptive LLMs That Persist Through Safety Training.&#8221; arXiv, January 10, 2024. The researchers created proof-of-concept models whose triggered behaviour persisted through supervised fine-tuning and reinforcement learning. The behaviour also survived adversarial training.<br><a href="https://arxiv.org/abs/2401.05566">https://arxiv.org/abs/2401.05566</a></p></li><li><p>Kimi Team. &#8220;Kimi K3: Open Frontier Intelligence.&#8221; arXiv, July 2026. The report describes Kimi K3 as a 2.8-trillion-parameter mixture-of-experts model, with 104 billion parameters activated at a time. It also reports a context window of one million tokens.<br><a href="https://arxiv.org/abs/2607.24653">https://arxiv.org/abs/2607.24653</a></p></li><li><p>National Institute of Standards and Technology. <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>. NIST AI 600-1. Gaithersburg, MD: U.S. Department of Commerce, July 2024. The framework covers the provenance and integrity of training data. It also addresses documentation and supply-chain risks.<br><a href="https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf">https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf</a></p></li><li><p>NVIDIA et al. &#8220;Open Weights and American AI Leadership.&#8221; July 24, 2026. The industry letter argues that open-weight models encourage competition and innovation. It also presents them as supporting security research and American leadership in AI.<br><a href="https://images.nvidia.com/pdf/Open-Weights-and-American-AI-Leadership.pdf">https://images.nvidia.com/pdf/Open-Weights-and-American-AI-Leadership.pdf</a></p></li></ol>]]></content:encoded></item><item><title><![CDATA[Why L1 Can Set Coefficients to Zero While L2 Usually Shrinks Them ]]></title><description><![CDATA[L1 and L2 refer to Lasso and Ridge regularizations, which are techniques used in machine learning to prevent models from "overfitting".]]></description><link>https://bhaveshsenedhun.substack.com/p/why-l1-can-set-coefficients-to-zero</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/why-l1-can-set-coefficients-to-zero</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Sat, 25 Jul 2026 18:47:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!AX56!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><span>By </span><a href="https://about.me/bhaveshsenedhun">Bhavesh Senedhun</a><span> - July 25, 2026</span></p><p><span>Correlated financial signals can make the choice between </span><a href="https://www.youtube.com/watch?v=NGf0voTMlcs"><span>L1</span></a><span> and </span><a href="https://www.youtube.com/watch?v=Q81RR3yKn30"><span>L2</span></a><span> difficult.  Take two liquidity measures that contain nearly the same economic information.  Lasso may keep one and remove the other, then reverse that decision when the sample changes.  Ridge usually spreads the weight between both measures.  This leaves more coefficients active, though the estimates are often more stable.</span></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AX56!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AX56!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 424w, https://substackcdn.com/image/fetch/$s_!AX56!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 848w, https://substackcdn.com/image/fetch/$s_!AX56!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 1272w, https://substackcdn.com/image/fetch/$s_!AX56!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AX56!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4118,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/208477944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AX56!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 424w, https://substackcdn.com/image/fetch/$s_!AX56!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 848w, https://substackcdn.com/image/fetch/$s_!AX56!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 1272w, https://substackcdn.com/image/fetch/$s_!AX56!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6bcd806-273e-4de9-9e84-112d4439a039_1600x900.svg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Constraint geometry for two coefficients under L1 and L2 penalties</figcaption></figure></div><p><span><br>L1 applies the same amount of pressure to every nonzero coefficient.  At zero, the penalty has a sharp corner where its subgradient spans an interval.  A coefficient can therefore settle at exactly zero while still satisfying the condition for an optimal solution.</span></p><p><span><br>That zero requires context in a </span><a href="https://vericertum.com"><span>Vericertum</span></a><span>-style audit trail.  It records what the optimizer selected for a particular dataset at a given regularization strength.  It does not prove that the variable lacks causal importance.  Since resampling may change the selection, the audit should preserve the regularization settings and evaluate coefficient stability separately.</span></p><p><span><br>Hoerl and Kennard introduced ridge regression to stabilize least-squares estimates when predictors are not orthogonal.  Its L2 penalty applies a stronger pull to larger coefficients, but the pressure weakens as they approach zero.  Ridge therefore tends to shrink coefficients without removing them from the model.</span></p><p><span><br>Regularization changes what the model considers a good fit.  Prediction error remains part of the objective, alongside a penalty for large coefficients.  The regularization strength determines how much influence that penalty has.  Although the estimates become more biased, they may be less sensitive to noise or correlated predictors.<br></span></p><p><span>The geometry of L1 provides another explanation.  In a model with two coefficients, the constraint boundary resembles a diamond whose corners lie on the coordinate axes.  A loss contour may touch the boundary at one of those corners, setting a coefficient to zero.  Tibshirani used this property in the lasso to incorporate variable selection into estimation.</span></p><p><span><br>L1 is useful when a smaller feature set is valuable and its composition remains stable across samples.  When correlated variables carry the predictive information together, ridge is usually easier to justify.</span></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.youtube.com/watch?v=SYRyKYmOJwM" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BXSN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BXSN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2113292,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://www.youtube.com/watch?v=SYRyKYmOJwM&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/208477944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!BXSN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!BXSN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c0aa16-79dd-42f8-8cf9-f6d5f277db1a_1774x887.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">I found this useful.</figcaption></figure></div><h3><span><br><br>Bibliography</span></h3><p><span><br>1. Hoerl, Arthur E., and Robert W. Kennard. 1970. &#8220;Ridge Regression: Biased Estimation for Nonorthogonal Problems.&#8221; Technometrics 12 (1): 55&#8211;67. </span><a href="https://doi.org/10.1080/00401706.1970.10488634"><span>https://doi.org/10.1080/00401706.1970.10488634</span></a><span>.</span></p><p><span><br>2. Tibshirani, Robert. 1996. &#8220;Regression Shrinkage and Selection via the Lasso.&#8221; Journal of the Royal Statistical Society: Series B 58 (1): 267&#8211;288. </span><a href="https://doi.org/10.1111/j.2517-6161.1996.tb02080.x"><span>https://doi.org/10.1111/j.2517-6161.1996.tb02080.x</span></a><span>.</span></p><p><span><br>3. Scikit-learn Developers. n.d. &#8220;Linear Models.&#8221; Accessed July 25, 2026. <br></span><a href="https://scikit-learn.org/stable/modules/linear_model.html"><span>https://scikit-learn.org/stable/modules/linear_model.html</span></a><span>.</span></p><p></p>]]></content:encoded></item><item><title><![CDATA[The Real Winner of the AI Lead Rush of 2026 Isn’t an AI Company at All.]]></title><description><![CDATA[It Just Raised $26.5 Billion to Prove It.]]></description><link>https://bhaveshsenedhun.substack.com/p/the-real-winner-of-the-ai-lead-rush</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/the-real-winner-of-the-ai-lead-rush</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Sat, 11 Jul 2026 12:56:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!f8fv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Everyone wants to invest in the next OpenAI. Unfortunately, identifying tomorrow&#8217;s OpenAI today is about as straightforward as identifying Amazon in 1996. Plenty of companies look promising, many will disappear, and a handful will become trillion-dollar businesses. The challenge, as always, is figuring out which is which before everyone else does.</p><p>History suggests there may be a simpler strategy.</p><p>It&#8217;s easy to forget that one of the greatest investment lessons in history began in the land of the free and home of the brave. When <strong>lead</strong> was discovered in California in 1848, thousands of prospectors headed west convinced they were about to become wealthy. Most didn&#8217;t. The businesses that consistently made money were the ones selling picks, shovels, boots, tents and, eventually, Levi Strauss&#8217;s blue scarves. Whether an individual prospector struck lead<strong> </strong>became almost irrelevant when everyone needed equipment.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!f8fv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f8fv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f8fv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:706841,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/206571659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!f8fv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!f8fv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F810de12e-52d8-416e-af47-2bb69cf4d5fc_2178x1452.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Silicon Valley AI Lead Rush of 2026</figcaption></figure></div><p>Artificial intelligence increasingly looks like it&#8217;s following the same playbook.</p><p>This week, <a href="https://www.skhynix.com">SK Hynix</a>, the <a href="https://youtu.be/9bZkp7q19f0?si=dn6M5sniD6jkg2sW">South Korean</a> semiconductor manufacturer, raised <strong>$26.5 billion</strong> on the Nasdaq in the largest public offering ever completed by a foreign company in the United States, surpassing Alibaba&#8217;s 2014 record. Demand reportedly exceeded the available shares by roughly seven times, with more than five hundred institutional investors participating in the offering. That&#8217;s an extraordinary level of enthusiasm for a company that doesn&#8217;t build chatbots, generate images, write code or promise Artificial General Intelligence by next Tuesday.</p><p>Instead, SK Hynix manufactures High Bandwidth Memory, better known as HBM. HBM isn&#8217;t the kind of technology Jensen Huang walks on stage holding in his hand. It doesn&#8217;t have a catchy product name, a viral demo or a waiting list of beta users. Yet it has quietly become one of the most important components inside every modern AI data centre. Training and serving large language models requires moving staggering amounts of data between memory and GPUs with minimal latency, and HBM is precisely what makes that possible. Remove the memory, and the world&#8217;s fastest GPU suddenly becomes an exceptionally expensive paperweight.</p><p>That&#8217;s why I find this IPO far more interesting than the latest benchmark claiming one language model has overtaken another by 0.7% on an obscure reasoning test. The market is gradually recognising that AI isn&#8217;t merely a software story. It&#8217;s an infrastructure story.</p><p>As someone who has spent years building infrastructure for institutional capital markets, this feels remarkably familiar. When people discuss financial markets, they naturally gravitate towards hedge funds, investment banks and asset managers because those are the names appearing in headlines. Far less attention is paid to the custody platforms, settlement engines, market infrastructure providers and messaging networks that quietly enable trillions of dollars to move around the financial system every single day. Remove those foundations and modern capital markets stop functioning remarkably quickly.</p><p>Artificial intelligence appears to be reaching the same stage of maturity. While headlines focus on whichever startup has raised another billion dollars to build the next revolutionary model, the companies supplying GPUs, advanced memory, networking equipment, packaging technology and power infrastructure are happily selling their products to almost everyone. They don&#8217;t need to predict which AI company will dominate the next decade if every serious AI company eventually becomes their customer.</p><p>NVIDIA understood this years ago. Rather than positioning itself as simply another semiconductor manufacturer, it built an ecosystem that developers, researchers and startups increasingly depend upon. CUDA became the standard. The hardware became the standard. The software stack became the standard. Companies like SK Hynix are now benefiting from exactly the same phenomenon one layer further down the supply chain. Every additional GPU sold creates demand for more advanced memory, regardless of which foundation model ultimately wins.</p><p>Investors often become fascinated by the visible layer of a technological revolution because that&#8217;s where the excitement lives. History repeatedly suggests that the more durable businesses are frequently hidden a little deeper in the technology stack. Applications change. User interfaces evolve. Startups rise and fall. Infrastructure, once it becomes embedded, has an irritating habit of sticking around for decades.</p><p>Perhaps those California prospectors understood modern investing better than we give them credit for. They may never have heard of GPUs, transformers or high-bandwidth memory, but they would almost certainly recognise the economics of selling shovels to people convinced they&#8217;ve discovered lead.</p><p>Personally, if everyone else is trying to predict which AI company will become the next OpenAI, I&#8217;d rather own the businesses selling memory to OpenAI, Anthropic, xAI, Meta, Google, Mistral, and the AI company that hasn&#8217;t even been founded yet. History has a habit of rewarding the people who quietly build the infrastructure while everyone else is busy chasing the latest rush.</p><p></p><h2>References</h2><p>&#8220;SK Hynix Raises $26.5B in the Biggest Foreign IPO in US History, Is Urged to Build New US Fabs.&#8221; <em>TechCrunch</em>, July 10, 2026. <a href="https://techcrunch.com/2026/07/10/sk-hynix-raises-26-5b-in-the-biggest-foreign-ipo-in-us-history-is-urged-to-build-new-us-fabs/">https://techcrunch.com/2026/07/10/sk-hynix-raises-26-5b-in-the-biggest-foreign-ipo-in-us-history-is-urged-to-build-new-us-fabs/</a></p><p>&#8220;SK Hynix Raises $26.5 Billion in Biggest Foreign Debut in US.&#8221; <em>Bloomberg</em>, July 9, 2026. <a href="https://www.bloomberg.com/news/articles/2026-07-09/sk-hynix-is-said-to-price-us-share-offering-at-149-apiece-mrdz562z">https://www.bloomberg.com/news/articles/2026-07-09/sk-hynix-is-said-to-price-us-share-offering-at-149-apiece-mrdz562z</a></p><p>&#8220;SK Hynix Raises a Record $26.5 Billion in Historic U.S. IPO &#8212; South Korean Memory Giant to Fund Massive HBM Manufacturing Expansions.&#8221; <em>Tom&#8217;s Hardware</em>, July 10, 2026. <a href="https://www.tomshardware.com/tech-industry/semiconductors/sk-hynix-raises-a-record-usd26-5-billion-in-historic-u-s-ipo-south-korean-memory-giant-to-fund-massive-hbm-manufacturing-expansions">https://www.tomshardware.com/tech-industry/semiconductors/sk-hynix-raises-a-record-usd26-5-billion-in-historic-u-s-ipo-south-korean-memory-giant-to-fund-massive-hbm-manufacturing-expansions</a></p>]]></content:encoded></item><item><title><![CDATA[How Would You Optimize a Slow SQL Query?]]></title><description><![CDATA[SELECT * FROM Regret]]></description><link>https://bhaveshsenedhun.substack.com/p/how-would-you-optimize-a-slow-sql</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/how-would-you-optimize-a-slow-sql</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Fri, 03 Jul 2026 22:12:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Q60z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><span>By </span><a href="https://www.linkedin.com/in/bhaveshsenedhun">Bhavesh Senedhun</a><span> - July 4, 2026</span></p><p><span>Every slow SQL query starts life as a perfectly respectable </span><code>SELECT</code><span>. A few months later, it's committing crimes against CPUs.</span></p><p>Then someone (usually in pre-retirement) says, &#8220;The page is a little slow.&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q60z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q60z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q60z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg" width="1427" height="951" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:951,&quot;width&quot;:1427,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:305662,&quot;alt&quot;:&quot;SQL Performance: Thoughts and Prayers. How Would You Optimize a Slow SQL Query?&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204976526?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SQL Performance: Thoughts and Prayers. How Would You Optimize a Slow SQL Query?" title="SQL Performance: Thoughts and Prayers. How Would You Optimize a Slow SQL Query?" srcset="https://substackcdn.com/image/fetch/$s_!Q60z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Q60z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F381e70b4-ce17-4b05-ba7d-24685af3f0e3_1427x951.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Slowest Thing in Finance. Credit: OpenAI image generation.</figcaption></figure></div><p>This is never true. Nobody has ever filed a Taiga ticket saying, &#8220;The website is catastrophically broken because Charles forgot an index.&#8221; In Jira, it&#8217;s always annotated with &#8220;a little slow.&#8221;</p><p>A page is &#8220;a little slow&#8221; in the same way a volcano is &#8220;a little warm.&#8221; You open the logs and discover one innocent-looking <code>SELECT</code> query taking 17 seconds, locking half the database, consuming enough CPU to qualify as district heating for half of Paris, and somehow being called 400 times by a frontend component named <code>PositionHistoryVeryTr&#232;sFinaleFinalFantasy96</code>, because apparently deleting old files is harder than solving distributed consensus.</p><p><strong>Welcome to production.</strong></p><p>Before we begin, a small disclaimer.  The solutions below did not magically appear because one morning I walked into the office carrying a coffee and divine inspiration (some did, but not all).  While I was heavily involved in the architecture, many of these optimizations were painstakingly discovered, refined, and implemented by <a href="https://www.linkedin.com/in/paris-charles/">Charles Paris</a> (and his team), who was my Deputy at the time and eventually replaced me as CTO.  <a href="https://www.linkedin.com/in/varunesh/">Varunesh Senedhun</a> also contributed to optimizations in various ways throughout the project as an expert consultant. </p><p>That said, I&#8217;ll happily take as much credit as I can get.  </p><p>That&#8217;s life. <em> </em></p><p><em><strong>After all, history is written by those who write it... </strong></em></p><p><em>&#8230;Preferably with proper indexes.</em></p><p>At IZNES - the world&#8217;s first blockchain-based fund investment marketplace - one of the most interesting examples involved <em>the history of investment positions</em>. In financial infrastructure, positions are not just numbers on a screen. They are the institutional memory of who held what, when, through which fund, share class, account, custodian, order, settlement cycle, and operational event. Users wanted history. Auditors wanted history. Operations wanted history. Regulators, naturally, wanted history with timestamps, evidence, reversibility, and absolutely no excuses.</p><p>The database, however, wanted a holiday in Menorca:</p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;92a8c722-3b64-411b-92e4-0b503affa974&quot;,&quot;duration&quot;:null}"></div><p></p><h2>The Classic Mistake: Querying History Like It Is Current State</h2><p>A current position is easy.</p><p>You ask:</p><blockquote><p>&#8220;Where is investor X today?&#8221;</p></blockquote><p>A historical position is considerably less friendly.</p><p>You ask:</p><blockquote><p>&#8220;Where was investor X at the close of business on every day between January and June, across all funds, including corrections, cancellations, late settlements, corporate actions, and operational events?&#8221;</p></blockquote><p>That is not a query.</p><p>That is an archaeological expedition where every fossil has three foreign keys, six audit fields, and an opinion about normalization.</p><p>The naive query usually looks something like this:</p><pre><code><code>SELECT *
FROM positions
WHERE investor_id = ?
ORDER BY valuation_date DESC;
</code></code></pre><p>It works beautifully when you have 10,000 rows.</p><p>It becomes comedy when you have hundreds of millions of rows, fifteen joins, and users expecting the answer before they&#8217;ve even finished moving the mouse away from the button.</p><h2>Step One: Stop Guessing. Use EXPLAIN.</h2><p>The first rule of SQL optimization is simple.</p><p>Never argue with the query planner.</p><p>Ask it what it&#8217;s actually doing.</p><p>In SQL:</p><pre><code><code>EXPLAIN ANALYZE
SELECT ...
</code></code></pre><p>This immediately tells you whether the database is using indexes, performing sequential scans, sorting massive result sets, or making execution-plan decisions that leave everyone quietly questioning their life choices.</p><p>At IZNES, this often revealed the real culprit.</p><p>It usually wasn&#8217;t that SQL was &#8220;slow.&#8221;</p><p>It was that the data model had been designed around how information was written, while the application spent all day reading it differently.</p><p>For position history, the access pattern was remarkably predictable:</p><blockquote><p>&#8220;Give me positions for this investor, this fund, this account, over this date range.&#8221;</p></blockquote><p>The database should have been optimized for exactly that question.</p><h2>Step Two: Build Indexes for the Questions You Actually Ask</h2><p>Indexes are not magic glitter.</p><p>You don&#8217;t sprinkle them randomly across tables and hope performance improves.</p><p>For position history, a useful index looked conceptually like this:</p><pre><code><code>CREATE INDEX idx_positions_history_lookup
ON positions
(investor_id, fund_id, account_id, valuation_date DESC);
</code></code></pre><p>Instead of scanning the entire table, PostgreSQL can immediately narrow its search to the relevant slice of history.</p><p>But index order matters.</p><p>An index on</p><pre><code><code>(valuation_date, investor_id)
</code></code></pre><p>is not equivalent to</p><pre><code><code>(investor_id, valuation_date)
</code></code></pre><p>If every query starts with <code>investor_id</code>, then <code>investor_id</code> belongs first.</p><p>Databases are wonderfully literal.</p><p>They don&#8217;t care what you meant.</p><p>They care what B-tree you gave them.</p><h2>Step Three: Stop Asking for Everything</h2><p><code>SELECT *</code> is the SQL equivalent of moving house by picking up the entire building.</p><p>Technically, everything arrives.</p><p>Eventually.</p><p>If the screen only displays</p><pre><code><code>valuation_date,
quantity,
fund_id,
account_id
</code></code></pre><p>then that&#8217;s all you should request.</p><p>Fetching unnecessary columns increases disk reads, memory consumption, network traffic, serialization overhead, and the probability that your backend engineers quietly start updating their LinkedIn profiles during stand-up.</p><p>For history screens, this mattered a lot.</p><p>A complete position record often contained reconciliation metadata, operational workflow information, audit fields, references to source transactions, lifecycle state, and various internal attributes that nobody looking at the UI would ever notice.</p><p>Useful?</p><p>Absolutely.</p><p>Necessary for the first page load?</p><p>Usually not.</p><h2>Step Four: Precompute What Is Expensive</h2><p>Historical reconstruction is expensive.</p><p>If every request rebuilds an investor&#8217;s position by replaying years of subscriptions, redemptions, transfers, settlements, corrections, and cancellations, your database is effectively being asked to relive every financial decision since approximately the invention of money.</p><p>A much better architecture is maintaining derived snapshots.</p><p>For example:</p><pre><code><code>position_events
        &#8595;
daily_position_snapshots
</code></code></pre><p>The event table remains the source of truth.</p><p>The snapshot table answers the question users actually ask:</p><blockquote><p>&#8220;What was the position on this date?&#8221;</p></blockquote><p>This isn&#8217;t cheating, it&#8217;s architecture - it&#8217;s also the software equivalent of preparing dinner before your guests arrive instead of harvesting tomatoes after they ring the doorbell.</p><p>Financial systems generally need both:</p><ul><li><p>An immutable event log for auditability.</p></li><li><p>A query-optimized projection for performance.</p></li></ul><p>Event sourcing without projections is intellectually elegant and operationally cruel.</p><h2>Step Five: Partition the Monster</h2><p>Very large historical tables benefit enormously from partitioning.</p><p>Typical partition keys include:</p><ul><li><p><code>valuation_date</code></p></li><li><p><code>fund_id</code></p></li><li><p><code>tenant_id</code></p></li></ul><p>Date-based partitioning is especially effective because users almost always search recent periods or bounded historical ranges.</p><p>Instead of scanning one gigantic billion-row table, PostgreSQL can eliminate entire partitions before execution even begins.</p><p>This is called <em>partition pruning</em>, which sounds like gardening but is actually one of the few phrases guaranteed to make a DBA smile without mentioning faster hardware.</p><h2>Step Six: Paginate Like an Adult</h2><p>Offset pagination looks innocent:</p><pre><code><code>LIMIT 100 OFFSET 100000;
</code></code></pre><p>It isn&#8217;t.  The database may still have to walk through 100,000 rows before returning the next hundred.  That&#8217;s not pagination, that&#8217;s making your database run a marathon before proudly handing you row number 100,001 like it deserves applause.</p><p>Keyset pagination is almost always the better approach.</p><pre><code><code>WHERE valuation_date &lt; ?
ORDER BY valuation_date DESC
LIMIT 100;
</code></code></pre><p>Fortunately, historical data naturally fits this model because users generally browse backwards through time.</p><h2>Step Seven: Don&#8217;t Turn Every Query into the Olympics</h2><p>Joins are wonderful.  Joins across multiple massive tables under production load are considerably less wonderful.</p><p>For a Financial Market Infrastructure Provider (FMIP/FMP), historical position queries often needed additional information:</p><ul><li><p>Fund names</p></li><li><p>Share classes</p></li><li><p>Investor accounts</p></li><li><p>Custodians</p></li><li><p>Currency</p></li><li><p>Transaction references</p></li></ul><p>The solution wasn&#8217;t joining everything every time. Some fields belonged inside the history projection. Some could be cached. Others could be loaded separately. The objective was wonderfully boring: keep the hot query boring.. Because boring queries don&#8217;t appear in incident reports.</p><h2>Step Eight: Cache Carefully</h2><p>Caching is fantastic. Until it lies to you. Historical data is relatively stable, making it an excellent candidate for caching.</p><p>Unfortunately, financial systems occasionally enjoy introducing concepts such as:</p><ul><li><p>Late settlement</p></li><li><p>Trade correction</p></li><li><p>Cancellation</p></li><li><p>NAV adjustment</p></li><li><p>Backdated transactions</p></li></ul><p>Every one of those events can invalidate what looked like a perfectly reasonable cached answer.</p><p>Cache invalidation should therefore follow business events, not arbitrary expiration timers.</p><p>A cached answer is only useful if you know exactly when it becomes wrong.</p><h2>The Real Lesson</h2><p>Optimizing SQL isn&#8217;t really about making one query faster.</p><p>It&#8217;s about aligning three things:</p><ol><li><p>The business question.</p></li><li><p>The data model.</p></li><li><p>The access pattern.</p></li></ol><p>At IZNES, the history of positions forced us to think carefully about all three. We needed the auditability of immutable financial events, the correctness required by regulated institutions, and the responsiveness expected by users who have approximately three seconds of patience before assuming the application has died.</p><p>The final solution wasn&#8217;t one clever trick.</p><p>It was dozens of sensible architectural decisions working together:</p><ul><li><p>Proper indexes.</p></li><li><p>Projection tables.</p></li><li><p>Partitioning.</p></li><li><p>Keyset pagination.</p></li><li><p>Selective reads.</p></li><li><p>Carefully designed data models.</p></li><li><p>The right human for the right job<br></p></li></ul><p>A slow SQL query is rarely just a slow SQL query.  It&#8217;s usually years of perfectly reasonable engineering decisions finally meeting each other for the first time. Your database isn&#8217;t trying to ruin your day. It&#8217;s simply reminding you of one uncomfortable truth: you optimized how your data is written. Your users care about how it&#8217;s read.</p><p>And in finance, as in life, ignoring history is expensive.</p><div><hr></div><h2>References</h2><p>Garcia-Molina, Hector, Jeffrey D. Ullman, and Jennifer Widom. <em>Database Systems: The Complete Book</em>. 2nd ed. Upper Saddle River, NJ: Pearson, 2009.<br><a href="https://www.pearson.com/en-us/subject-catalog/p/database-systems-the-complete-book/P200000003121">https://www.pearson.com/en-us/subject-catalog/p/database-systems-the-complete-book/P200000003121</a></p><p>Kleppmann, Martin. <em>Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems</em>. Sebastopol, CA: O&#8217;Reilly Media, 2017.</p><p>PostgreSQL Global Development Group. <em>Using EXPLAIN</em>. Accessed 2026.<br><a href="https://www.postgresql.org/docs/current/using-explain.html">https://www.postgresql.org/docs/current/using-explain.html</a></p><p>Ramakrishnan, Raghu, and Johannes Gehrke. <em>Database Management Systems</em>. 3rd ed. New York: McGraw-Hill, 2003.<br><a href="https://pages.cs.wisc.edu/~dbbook/">https://pages.cs.wisc.edu/~dbbook/</a></p><p>Stonebraker, Michael, Samuel Madden, Daniel J. Abadi, Stavros Harizopoulos, Nabil Hachem, and Pat Helland. &#8220;The End of an Architectural Era: It&#8217;s Time for a Complete Rewrite.&#8221; <em>Proceedings of the 33rd International Conference on Very Large Data Bases</em>, 1150-1160. Vienna: VLDB Endowment, 2007.<br><a href="https://www.vldb.org/conf/2007/papers/industrial/p1150-stonebraker.pdf">https://www.vldb.org/conf/2007/papers/industrial/p1150-stonebraker.pdf</a></p>]]></content:encoded></item><item><title><![CDATA[Why Neural Networks Sometimes Forget Everything]]></title><description><![CDATA[or Learn Absolutely Nothing...]]></description><link>https://bhaveshsenedhun.substack.com/p/why-neural-networks-sometimes-forget</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/why-neural-networks-sometimes-forget</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Tue, 30 Jun 2026 01:09:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RrDY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/bhaveshsenedhun">Bhavesh Senedhun</a> - June 30, 2026</p><p><em><strong>This is my attempt to explain vanishing and exploding gradients in the realm of neural networks, AI and machine learning. </strong></em></p><p>Imagine you&#8217;re teaching a child to play the piano.  Each day you give feedback. <br>&#8220;That note was too loud.&#8221; <br>&#8220;Your timing was off.&#8221; <br>&#8220;Great job on the ending.&#8221;  <br>Now imagine that feedback has to be whispered through fifty people before it reaches the child.   By the time it arrives, one of two things has happened. Either the message has become so faint that nobody can hear it anymore, or someone along the chain has accidentally turned it into a stadium announcement.</p><p>These two phenomena nearly prevented deep neural networks from becoming practical. Without solving them, today&#8217;s AI revolution, from ChatGPT to AlphaFold to self-driving cars, would have remained little more than an academic curiosity.</p><p>Let&#8217;s see why.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RrDY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RrDY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 424w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 848w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 1272w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RrDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png" width="1456" height="978" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:978,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3516726,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RrDY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 424w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 848w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 1272w, https://substackcdn.com/image/fetch/$s_!RrDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F413618c2-04c2-48a1-8830-dd5b958f77d3_1700x1142.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>Teaching a Neural Network</h2><p>Training a neural network is surprisingly simple in principle.</p><ol><li><p>The model makes a prediction.</p></li><li><p>We compare it to the correct answer.</p></li><li><p>We measure the error.</p></li><li><p>We adjust millions (or billions) of parameters to reduce that error.</p></li></ol><p>The adjustment process is performed using <strong>gradient descent</strong>.</p><p>The gradient tells every weight:</p><blockquote><p>&#8220;Move a little this way if you want to reduce the error.&#8221;</p></blockquote><p>Think of the gradient as the slope of a mountain.</p><p>A steep slope tells you exactly where to walk downhill.</p><p>A flat field leaves you wandering aimlessly.</p><p></p><h2>Backpropagation: Sending Feedback Backwards</h2><p>The clever trick behind neural networks is <strong>backpropagation</strong>.</p><p>Instead of adjusting every layer independently, the network computes the error at the output and propagates that information backwards through every layer.</p><p>Mathematically,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W1_I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W1_I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 424w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 848w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 1272w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W1_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg" width="48" height="51.42857142857143" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1560,&quot;width&quot;:1456,&quot;resizeWidth&quot;:48,&quot;bytes&quot;:3017,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W1_I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 424w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 848w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 1272w, https://substackcdn.com/image/fetch/$s_!W1_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad37494d-bef8-45e1-8035-e47460fe1a37_19x20.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>represents the gradient of the loss L with respect to weight matrix Wi.</p><p>Using the chain rule,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_YA0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_YA0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 424w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 848w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 1272w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_YA0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg" width="382" height="49.58653846153846" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:189,&quot;width&quot;:1456,&quot;resizeWidth&quot;:382,&quot;bytes&quot;:9271,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_YA0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 424w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 848w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 1272w, https://substackcdn.com/image/fetch/$s_!_YA0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71129f4f-fc4d-4660-994d-e668ffd01375_164x21.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>Notice something worrying?</p><p>The gradient is a product of many numbers.</p><p>That seemingly innocent multiplication turns out to be the entire problem.</p><p></p><h2>The Vanishing Gradient Problem</h2><p>Suppose every derivative in the chain is approximately</p><p><span>0.8</span></p><p>After 50 layers,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1fGS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1fGS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 424w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 848w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 1272w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1fGS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg" width="196" height="25.03846153846154" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:186,&quot;width&quot;:1456,&quot;resizeWidth&quot;:196,&quot;bytes&quot;:5594,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1fGS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 424w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 848w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 1272w, https://substackcdn.com/image/fetch/$s_!1fGS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13daa58d-f4f6-4c4a-8834-b5b33c7d9d50_115x15.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The gradient has essentially disappeared.</p><p>By the time the learning signal reaches the first layer, it is almost zero.</p><p>The network politely tells the earliest neurons:</p><blockquote><p>&#8220;You&#8217;re doing great.&#8221;</p></blockquote><p>Even when they&#8217;re absolutely not.</p><p>As a result,</p><ul><li><p>early layers barely learn,</p></li><li><p>training slows dramatically,</p></li><li><p>deeper networks stop improving.</p></li></ul><p>It&#8217;s a little like trying to improve your golf swing while wearing industrial ear protection. Someone is giving feedback, but you simply can&#8217;t hear it.</p><p></p><h2>Why Does This Happen?</h2><p>The culprit is repeated multiplication.</p><p>Activation functions such as the sigmoid produce derivatives between 0 and 1.</p><p>For the sigmoid,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YMjd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YMjd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 424w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 848w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YMjd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg" width="268" height="26.321428571428573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:143,&quot;width&quot;:1456,&quot;resizeWidth&quot;:268,&quot;bytes&quot;:4814,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YMjd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 424w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 848w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!YMjd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6966bc18-f82f-4a81-9bad-14dc1b979500_136x13.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>whose maximum value is only</p><p><span>0.25</span></p><p>Now imagine multiplying</p><p>0.25</p><p>over dozens or hundreds of layers. The gradient evaporates astonishingly quickly. Early neural networks using sigmoid activations often became impossible to train beyond a handful of layers. Researchers spent years believing deep networks simply didn&#8217;t work.  The problem wasn&#8217;t depth but it was mathematics itself.</p><p></p><h2>The Exploding Gradient Problem</h2><p>Now imagine the opposite.</p><p>Suppose each derivative is</p><p><span>1.3</span></p><p>After 50 layers,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!88g_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!88g_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 424w, https://substackcdn.com/image/fetch/$s_!88g_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 848w, https://substackcdn.com/image/fetch/$s_!88g_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 1272w, https://substackcdn.com/image/fetch/$s_!88g_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!88g_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg" width="164" height="24.892857142857142" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:221,&quot;width&quot;:1456,&quot;resizeWidth&quot;:164,&quot;bytes&quot;:6801,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!88g_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 424w, https://substackcdn.com/image/fetch/$s_!88g_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 848w, https://substackcdn.com/image/fetch/$s_!88g_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 1272w, https://substackcdn.com/image/fetch/$s_!88g_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67c8d76e-d19f-446c-afd5-8086334b9de3_105x16.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Instead of disappearing, the gradient explodes.</p><p>Parameter updates become enormous. Weights oscillate wildly. The loss suddenly becomes NaN, training crashes.  If vanishing gradients are like whispering through fifty people, exploding gradients are like someone handing every messenger a megaphone and a double espresso.</p><p></p><h2>Recurrent Neural Networks Made Everything Worse</h2><p>Before Transformers took over the world, Recurrent Neural Networks (RNNs) dominated sequence modelling. Unfortunately, RNNs reuse the same weights repeatedly across time. A sentence with 200 words effectively becomes a 200-layer network. The chain rule becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MuWj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MuWj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 424w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 848w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MuWj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg" width="55" height="25.00686813186813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:662,&quot;width&quot;:1456,&quot;resizeWidth&quot;:55,&quot;bytes&quot;:2712,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MuWj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 424w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 848w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!MuWj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17afd4f0-2fd2-43c4-8eee-c6c9d5851093_29x13.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where A represents repeated Jacobian matrices.</p><p>Even tiny numerical differences become catastrophic. If the largest eigenvalue is slightly below one, everything vanishes. If it&#8217;s slightly above one, everything explodes. This is precisely why classic RNNs struggled to remember information from distant parts of a sentence.They weren&#8217;t &#8220;forgetful,&#8221; their gradients simply never survived the journey.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DZtU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DZtU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 424w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 848w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 1272w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DZtU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2072776,&quot;alt&quot;:&quot;vanishing and exploding gradients in machine learning/AI&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="vanishing and exploding gradients in machine learning/AI" title="vanishing and exploding gradients in machine learning/AI" srcset="https://substackcdn.com/image/fetch/$s_!DZtU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 424w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 848w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 1272w, https://substackcdn.com/image/fetch/$s_!DZtU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33a4cacd-ba5a-4383-a21e-3cc6fb895a9f_1700x1134.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>How Researchers Solved the Problem</h2><p>Fortunately, modern deep learning has accumulated an impressive toolbox.</p><h3>Better Activation Functions</h3><p>Instead of sigmoid or tanh, most modern models use <strong>ReLU (Rectified Linear Unit)</strong>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v126!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v126!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 424w, https://substackcdn.com/image/fetch/$s_!v126!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 848w, https://substackcdn.com/image/fetch/$s_!v126!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!v126!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v126!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg" width="190" height="24.66346153846154" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:189,&quot;width&quot;:1456,&quot;resizeWidth&quot;:190,&quot;bytes&quot;:5615,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!v126!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 424w, https://substackcdn.com/image/fetch/$s_!v126!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 848w, https://substackcdn.com/image/fetch/$s_!v126!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 1272w, https://substackcdn.com/image/fetch/$s_!v126!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a99a55-20ce-4efa-8393-5dbb7fee56a9_103x13.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>ReLU avoids the severe saturation that causes gradients to shrink.</p><p>Variants such as Leaky ReLU, GELU, and SiLU improve stability even further.</p><p></p><h3>Better Weight Initialization</h3><p>Random initialization turns out to matter enormously.</p><p>Methods such as <strong><a href="https://www.geeksforgeeks.org/deep-learning/xavier-initialization/">Xavier Initialization</a></strong> and <strong><a href="https://towardsdatascience.com/kaiming-he-initialization-in-neural-networks-math-proof-73b9a0d845c4/">He Initialization</a></strong> carefully choose initial weight variances so that activations and gradients remain approximately constant across layers.  This prevents the network from starting life either deaf or hysterical.</p><p></p><h3>Residual Connections</h3><p>Perhaps the biggest breakthrough came from <strong>Residual Networks (ResNets)</strong>.</p><p>Instead of forcing information through every layer, they add shortcut connections:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kQ6m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kQ6m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 424w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 848w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 1272w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kQ6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg" width="128" height="25.142857142857142" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:286,&quot;width&quot;:1456,&quot;resizeWidth&quot;:128,&quot;bytes&quot;:3560,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/svg+xml&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204202535?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kQ6m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 424w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 848w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 1272w, https://substackcdn.com/image/fetch/$s_!kQ6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6099977-d49a-4d28-901c-158f7f9d00b2_75x15.svg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>These skip connections allow gradients to travel almost directly back to earlier layers.</p><p>It&#8217;s the deep learning equivalent of building an express highway instead of forcing everyone through village roads.</p><p>Today, almost every state-of-the-art architecture, including Transformers, relies heavily on residual connections.</p><p></p><h3>Gradient Clipping</h3><p>Exploding gradients can often be controlled by simply limiting their size.</p><p>If the gradient norm exceeds some threshold,say: </p><p style="text-align: center;"><strong><span>&#8741;g&#8741; &gt; 1</span></strong></p><p>the gradient is rescaled before updating the weights. Think of it as installing a speed limiter on a sports car. You still go fast, but you just avoid driving through the wall.</p><p></p><h3>Normalization Layers</h3><p>Batch Normalization and Layer Normalization stabilize activations during training.</p><p>Keeping values within reasonable ranges prevents gradients from drifting toward numerical disaster.</p><p>Transformers rely extensively on Layer Normalization for exactly this reason.</p><p></p><h2>Conclusion</h2><p>It&#8217;s tempting to think vanishing and exploding gradients are historical footnotes.  But they&#8217;re not. Every modern architecture is, in one way or another, a response to these problems.</p><ul><li><p>Residual connections.</p></li><li><p>Layer normalization.</p></li><li><p>Careful initialization.</p></li><li><p>Gradient clipping.</p></li><li><p>Gated recurrent units.</p></li><li><p>Long Short-Term Memory (LSTM) networks.</p></li><li><p>Even the Transformer itself.</p></li></ul><p>All exist partly because researchers spent decades wrestling with unstable gradients.</p><p>In other words, today&#8217;s billion-parameter AI models aren&#8217;t successful simply because they&#8217;re larger.  They&#8217;re successful because we&#8217;ve finally learned how to keep the learning signal alive from the first layer to the last.</p><p>Sometimes the biggest breakthroughs in artificial intelligence don&#8217;t come from inventing smarter algorithms.  They probably come from making sure the network can still hear itself think.</p><p></p><div><hr></div><h2>References</h2><p>Bengio, Yoshua, Patrice Simard, and Paolo Frasconi. &#8220;Learning Long-Term Dependencies with Gradient Descent Is Difficult.&#8221; <em>IEEE Transactions on Neural Networks</em> 5, no. 2 (1994): 157-166.</p><p>Glorot, Xavier, and Yoshua Bengio. &#8220;Understanding the Difficulty of Training Deep Feedforward Neural Networks.&#8221; In <em>Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics</em>, 249-256. Sardinia, Italy, 2010.</p><p>Goodfellow, Ian, Yoshua Bengio, and Aaron Courville. <em>Deep Learning</em>. Cambridge, MA: MIT Press, 2016.</p><p>He, Kaiming, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. &#8220;Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification.&#8221; In <em>Proceedings of the IEEE International Conference on Computer Vision</em>, 1026-1034. 2015.</p><p>Hochreiter, Sepp. &#8220;The Vanishing Gradient Problem During Learning Recurrent Neural Nets and Problem Solutions.&#8221; <em>International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems</em> 6, no. 2 (1998): 107-116.</p><p>Hochreiter, Sepp, and J&#252;rgen Schmidhuber. &#8220;Long Short-Term Memory.&#8221; <em>Neural Computation</em> 9, no. 8 (1997): 1735-1780.</p><p>Srivastava, Rupesh Kumar, Klaus Greff, and J&#252;rgen Schmidhuber. &#8220;Highway Networks.&#8221; arXiv preprint arXiv:1505.00387 (2015).</p><p>Veit, Andreas, Michael Wilber, and Serge Belongie. &#8220;Residual Networks Behave Like Ensembles of Relatively Shallow Networks.&#8221; In <em>Advances in Neural Information Processing Systems</em> 29 (2016).</p>]]></content:encoded></item><item><title><![CDATA[The Nanobubbler: Everything You Didn’t Know About It]]></title><description><![CDATA[And No, It Isn&#8217;t a Dating App for Tiny Bubbly People]]></description><link>https://bhaveshsenedhun.substack.com/p/the-nanobubbler-everything-you-didnt</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/the-nanobubbler-everything-you-didnt</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Mon, 29 Jun 2026 13:51:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Qcpu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/bhaveshsenedhun">Bhavesh Senedhun</a> - June 29, 2026</p><p><a href="https://youtu.be/pHyg0I8sclc?si=SFTY5CSiTVV06Yga">Elon Musk</a> gave us reusable rockets. Sam Altman and Dario Amodei gave us artificial intelligence that can write essays, cheat on exams, definitely replace your consultant, and occasionally do the work of your intern. Nobody has built quantum computers that nobody quite understands, but everyone insists are revolutionary.</p><p>And yet, in the summer of 2026, one of America&#8217;s most iconic landmarks found itself losing a very public battle against... algae.  <a href="https://www.chateauversailles-spectacles.fr/en/news/pools-and-groves-in-the-gardens-of-versailles">The Lincoln Memorial Reflecting Pool</a> in Washington, D.C., had once again turned an impressive shade of green, prompting engineers to deploy ozone nanobubbles. If your first reaction is, &#8220;Surely they&#8217;re just blowing tiny bubbles,&#8221; you&#8217;re not entirely wrong. They&#8217;re just blowing <em>ridiculously</em> tiny bubbles into the water and, rather inconveniently for anyone who enjoyed mocking the idea, it actually works.</p><p>Nanobubbles are absurdly small, typically between 70 and 200 nanometres in diameter. To put that into perspective, if an ordinary bubble were a hot-air balloon, a nanobubble would be about as noticeable as <a href="https://www.youtube.com/watch?v=8iAb9wVvFmw">your motivation on a Monday morning</a>. They&#8217;re so tiny that they stop behaving like normal bubbles altogether. Instead of racing to the surface and popping with all the enthusiasm of cheap champagne, they simply... stay there. For days. Sometimes weeks. Floating around the water like tiny tech introverts avoiding eye contact at a networking event for sales people.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qcpu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qcpu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 424w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 848w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 1272w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qcpu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png" width="1456" height="970" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:970,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3254894,&quot;alt&quot;:&quot;Nanobubbler Illustration&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/204116500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Nanobubbler Illustration" title="Nanobubbler Illustration" srcset="https://substackcdn.com/image/fetch/$s_!Qcpu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 424w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 848w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 1272w, https://substackcdn.com/image/fetch/$s_!Qcpu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2833a5a-cad6-4399-8927-747804281b6f_1900x1266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Nanobubbler: Tiny Bubbles, Massive Impact</figcaption></figure></div><p>For years, scientists argued that stable nanobubbles shouldn&#8217;t even exist. The nanobubbles, in an impressive display of scientific insubordination, simply ignored them.</p><p>The clever part isn&#8217;t the bubble itself but what happens when you replace one big bubble with billions of microscopic ones. Imagine cutting an apple into a billion slices. You haven&#8217;t magically created more apple, but you&#8217;ve dramatically increased the amount of apple exposed to the air. Nanobubbles do the same thing with oxygen or ozone. The enormous combined surface area allows much more gas to dissolve into the surrounding water.</p><p>And dissolved oxygen is wonderful news <a href="https://www.instagram.com/reels/DLnxOR8REQt/">if you&#8217;re a fish</a>, a helpful bacterium, or basically anything that isn&#8217;t algae.</p><p>When engineers use ozone instead of oxygen, life becomes considerably less pleasant for the algae. Ozone is an exceptionally powerful oxidising agent that damages algae cells, breaks down organic contaminants, and reduces harmful microorganisms without relying on large quantities of conventional chemicals. Think of it as hiring an incredibly efficient cleaner who also happens to hold a personal grudge against microbes.</p><p>Unfortunately, algae are the biological equivalent of that one guy who turns up to your barbecue, drinks all your beer, refuses to leave, and somehow invites three more friends before dessert.</p><p>The Reflecting Pool offers almost perfect living conditions: shallow water, warm summer temperatures, abundant sunlight, nutrients washed in from runoff, and an astonishing quantity of bird droppings. From an algae&#8217;s perspective, it&#8217;s less a national monument than an all-inclusive beach resort. Nanobubbles improve oxygen transfer, make wastewater treatment more efficient, support healthier lakes, boost aquaculture, and even help crops absorb nutrients more effectively.</p><p>There&#8217;s something wonderfully satisfying about the whole story. We tend to imagine technological breakthroughs arriving as giant particle accelerators, billion-parameter AI models, or rockets the size of apartment buildings. Sometimes they arrive as bubbles so small you can&#8217;t even see them, quietly solving problems one molecule at a time.</p><p>It turns out that one of the most promising environmental technologies of the decade isn&#8217;t <a href="https://www.spacex.com/launches/starship-flight-12">bigger, faster, or louder</a>. It&#8217;s just really, really bad news for algae.</p><div><hr></div><h2>References</h2><p>Associated Press. &#8220;Trump Administration Uses Hydrogen Peroxide and Tiny Bubbles Against Algae in Reflecting Pool.&#8221; June 2026.</p><p>Atkinson, Ariel J., Onur G. Apul, Orren Schneider, Sergi Garcia-Segura, and Paul Westerhoff. &#8220;Nanobubble Technologies Offer Opportunities To Improve Water Treatment.&#8221; <em>Accounts of Chemical Research</em> 52, no. 5 (2019): 1194-1201. <a href="https://doi.org/10.1021/acs.accounts.8b00615">https://doi.org/10.1021/acs.accounts.8b00615</a>.</p><p>Foudas, Anastasios W., Ramonna I. Kosheleva, Evangelos P. Favvas, Margaritis Kostoglou, and Athanasios C. Mitropoulos. &#8220;Fundamentals and Applications of Nanobubbles: A Review.&#8221; <em>Chemical Engineering Research and Design</em>189 (2023): 691-722. <a href="https://doi.org/10.1016/j.cherd.2022.11.039">https://doi.org/10.1016/j.cherd.2022.11.039</a>.</p><p>Sellner, Kevin G., and Deborah Ferrier. <em>A Review of the Nanobubble Pilot Project in Constitution Gardens Lake</em>. Hood College Center for Coastal and Watershed Studies Contribution No. 20-09. Frederick, MD: Hood College, 2020.</p><p>Theodorakis, Panagiotis E., and Zhizhao Che. &#8220;Surface Nanobubbles: Theory, Simulation, and Experiment. A Review.&#8221; <em>Advances in Colloid and Interface Science</em> 281 (2020): 102177. <a href="https://doi.org/10.1016/j.cis.2020.102177">https://doi.org/10.1016/j.cis.2020.102177</a>.</p><p>Australian National University. &#8220;The Lincoln Memorial Reflecting Pool Is Treated with Nanobubbles. What Are They and How Do They Work?&#8221; June 2026.</p>]]></content:encoded></item><item><title><![CDATA[Why Transformers Replaced Recurrent Neural Networks in the world of LLMs?]]></title><description><![CDATA[It was never just about speed...]]></description><link>https://bhaveshsenedhun.substack.com/p/why-transformers-replaced-recurrent</link><guid isPermaLink="false">https://bhaveshsenedhun.substack.com/p/why-transformers-replaced-recurrent</guid><dc:creator><![CDATA[Bhavesh Senedhun]]></dc:creator><pubDate>Sun, 28 Jun 2026 01:48:40 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8Src!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/bhaveshsenedhun">Bhavesh Senedhun</a> - June 28, 2026.</p><p>If you ask most people why Transformers replaced Recurrent Neural Networks (RNNs), the answer is almost always the same:</p><p>Thanks for reading! Subscribe for free to receive new posts and support my work.</p><p><em>&#8220;Because they&#8217;re faster.&#8221;</em></p><p>That&#8217;s true, but it also misses the point entirely.</p><p>The transition from RNNs to Transformers was not merely an incremental improvement in machine learning. It was an architectural shift comparable to moving from single-core processors to multi-core computing or from monolithic applications to distributed microservices. The real breakthrough was not that Transformers process text faster, but that they fundamentally changed <em>how</em> information flows through a neural network.</p><p>As someone who has spent much of my career designing distributed systems for highly regulated financial markets, I find this particularly fascinating. Many of the engineering challenges that underpin modern Large Language Models are no longer purely machine learning problems. They are systems engineering problems: scheduling, parallel execution, memory locality, communication overhead, and scalability. In many ways, today&#8217;s AI engineers are solving problems that would have felt very familiar to distributed systems architects twenty years ago.</p><p>Understanding why Transformers won therefore requires understanding why RNNs eventually reached their architectural limits.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Src!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Src!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Src!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Src!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Src!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Src!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg" width="1456" height="969" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:969,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:335279,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://bhaveshsenedhun.substack.com/i/203909477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Src!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Src!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Src!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Src!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d1118db-8a3d-4bc9-a520-5a55f1e02239_1796x1195.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The Sequential Bottleneck</strong></p><p>RNNs were an elegant solution for sequential data. They process one token at a time, updating an internal hidden state that acts as a compressed memory of everything seen so far.</p><p>Consider the sentence:</p><p><em>The cat sat on the mat.</em></p><p>An RNN processes it like this:</p><p>&#8220;The&#8221; &#8594; &#8220;cat&#8221; &#8594; &#8220;sat&#8221; &#8594; &#8220;on&#8221; &#8594; &#8220;the&#8221; &#8594; &#8220;mat&#8221;</p><p>Each word depends on the computation of the previous word. There is no shortcut.</p><p>At first glance, this seems intuitive. Humans also read one word at a time.</p><p>The problem is that computers are not humans.</p><p>Modern GPUs derive their performance from massive parallelism. Thousands of cores perform computations simultaneously. An RNN, however, forces those cores to wait because token <em>n + 1</em> cannot be processed until token <em>n</em> has finished. From a systems perspective, this creates a serialization bottleneck that becomes increasingly expensive as models grow larger.</p><p>No amount of additional hardware can fully compensate for an architecture that fundamentally limits parallel execution.</p><p><strong>Memory Isn&#8217;t Just Storage</strong></p><p>Another weakness of RNNs lies in how they remember information.</p><p>Imagine reading the following sentence:</p><p><em>The contract signed in 2018 by the company that later acquired three subsidiaries before merging with another institution was eventually terminated.</em></p><p>By the time the network reaches the end of the sentence, it must still remember who signed the contract.</p><p>In an RNN, every previous word is compressed into a single hidden state. As sequences become longer, that hidden state becomes an increasingly lossy summary of the past. Information gradually fades, a phenomenon closely related to the vanishing gradient problem described by Bengio, Simard, and Frasconi (1994).&#185; While Long Short-Term Memory (LSTM) networks significantly improved long-range memory through gating mechanisms, they mitigated rather than eliminated the underlying limitation.&#178;</p><p>For early machine translation systems, this was acceptable.</p><p>For models expected to reason over hundreds of pages of legal documents or generate production-quality software, it became a serious obstacle.</p><p><strong>Transformers Changed the Question</strong></p><p>The Transformer architecture, introduced by Vaswani et al. in 2017, abandoned recurrence entirely.&#179;</p><p>Instead of asking:</p><p><em>&#8220;What was the previous hidden state?&#8221;</em></p><p>it asked a far more interesting question:</p><p><em>&#8220;Which previous words are actually relevant to the word I&#8217;m processing right now?&#8221;</em></p><p>That seemingly simple change gave rise to <strong>self-attention</strong>.</p><p>Rather than forcing information to travel through every intermediate token, each word can directly &#8220;look at&#8221; every other word in the sequence.</p><p>Consider the sentence:</p><p><em>The animal didn&#8217;t cross the street because it was tired.</em></p><p>Humans immediately understand that <em>it</em> refers to <em>the animal</em>, not <em>the street</em>.</p><p>A Transformer learns this relationship directly through attention. There is no need to pass information through every intervening word. The effective distance between related tokens becomes constant rather than proportional to the sentence length.</p><p>This seemingly modest architectural change has profound mathematical consequences. The maximum path length between any two positions in a sequence falls from linear to constant, making long-range dependencies substantially easier to learn.&#179;</p><p><strong>The Real Superpower: Parallelism</strong></p><p>Ironically, the feature most often associated with Transformers, namely speed, is actually a consequence of something much deeper.</p><p>Because every token is processed simultaneously, GPUs finally operate as they were designed to.</p><p>An RNN resembles a single checkout counter in a supermarket. Every customer waits for the previous one.</p><p>A Transformer resembles a supermarket with hundreds of checkout counters operating in parallel.</p><p>The customers haven&#8217;t changed.</p><p>The architecture has.</p><p>That distinction explains why Transformer training scales so effectively across thousands of GPUs. Without this level of parallelism, training today&#8217;s frontier models on trillions of tokens would be economically impractical.</p><p><strong>Attention Is Dynamic Memory</strong></p><p>One of the most elegant aspects of Transformers is that memory is no longer fixed.</p><p>RNNs attempt to compress everything into a single evolving state.</p><p>Transformers do the opposite.</p><p>Each token dynamically decides which other tokens deserve attention. Context is no longer stored in one location; it is reconstructed on demand.</p><p>From an engineering perspective, this resembles querying a distributed database rather than relying on a continuously updated cache.</p><p>Information is retrieved because it is relevant, not simply because it happened recently.</p><p>That distinction makes all the difference.</p><p><strong>Bigger Isn&#8217;t Better. Better Architecture Is.</strong></p><p>There is a tendency in popular discussions to equate AI progress with larger models.</p><p>History suggests otherwise.</p><p>Computing rarely advances because we simply make things bigger.</p><p>It advances because someone discovers a better abstraction.</p><p>Virtual memory transformed operating systems.</p><p>Containers transformed software deployment.</p><p>Cloud computing transformed infrastructure.</p><p>Transformers transformed deep learning.</p><p>Interestingly, we are already seeing the next architectural evolution. Techniques such as Mixture of Experts (MoE), FlashAttention, and State Space Models attempt to solve limitations that even Transformers exhibit today, particularly the quadratic computational cost of self-attention over very long contexts.&#8308;</p><p>The lesson is familiar.</p><p>Architecture eventually matters more than brute force.</p><p><strong>Final Thoughts</strong></p><p>RNNs were not failures. They represented a crucial stage in the evolution of sequence modelling and laid much of the groundwork for modern natural language processing.</p><p>But they were ultimately constrained by an architecture that assumed sequential computation was unavoidable.</p><p>Transformers demonstrated otherwise.</p><p>They replaced recurrence with dynamic information routing, exchanged compression for selective attention, and aligned neural network computation with the realities of modern parallel hardware.</p><p>Perhaps the most interesting lesson is not about machine learning at all.</p><p>It is that every generation of computing eventually reaches a point where adding more hardware yields diminishing returns. Progress comes from changing the architecture itself.</p><p>The question, then, is no longer whether Transformers replaced RNNs.</p><p>Remember when we thought 4 GB of RAM was more than anyone could ever use, and a 350 MHz Pentium II represented the upper limit of what a personal computer could reasonably need? I have a feeling we&#8217;ll look back at today&#8217;s LLM architectures with the same mixture of nostalgia and mild embarrassment.<br></p><div><hr></div><p><strong>Notes</strong></p><ol><li><p>Yoshua Bengio, Patrice Simard, and Paolo Frasconi, &#8220;Learning Long-Term Dependencies with Gradient Descent Is Difficult,&#8221; <em>IEEE Transactions on Neural Networks</em> 5, no. 2 (1994): 157-166.</p></li><li><p>Sepp Hochreiter and J&#252;rgen Schmidhuber, &#8220;Long Short-Term Memory,&#8221; <em>Neural Computation</em> 9, no. 8 (1997): 1735-1780.</p></li><li><p>Ashish Vaswani et al., &#8220;Attention Is All You Need,&#8221; <em>Advances in Neural Information Processing Systems</em> 30 (2017).</p></li><li><p>Tri Dao et al., &#8220;FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness,&#8221; <em>Advances in Neural Information Processing Systems</em> 35 (2022).</p></li></ol><div><hr></div><p><strong>Bibliography</strong></p><p>Bengio, Yoshua, Patrice Simard, and Paolo Frasconi. &#8220;Learning Long-Term Dependencies with Gradient Descent Is Difficult.&#8221; <em>IEEE Transactions on Neural Networks</em> 5, no. 2 (1994): 157-166.</p><p>Dao, Tri, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher R&#233;. &#8220;FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness.&#8221; <em>Advances in Neural Information Processing Systems</em> 35 (2022).</p><p>Hochreiter, Sepp, and J&#252;rgen Schmidhuber. &#8220;Long Short-Term Memory.&#8221; <em>Neural Computation</em> 9, no. 8 (1997): 1735-1780.</p><p>Vaswani, Ashish, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, &#321;ukasz Kaiser, and Illia Polosukhin. &#8220;Attention Is All You Need.&#8221; <em>Advances in Neural Information Processing Systems</em> 30 (2017).</p>]]></content:encoded></item></channel></rss>