<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ankit Rathi on Medium]]></title>
        <description><![CDATA[Stories by Ankit Rathi on Medium]]></description>
        <link>https://medium.com/@rathi-ankit?source=rss-5c26b6edc826------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p7xT0nuZ_0KFnPHb2he7Zg.jpeg</url>
            <title>Stories by Ankit Rathi on Medium</title>
            <link>https://medium.com/@rathi-ankit?source=rss-5c26b6edc826------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:07:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rathi-ankit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Trade-offs in Data System Architecture]]></title>
            <link>https://rathi-ankit.medium.com/trade-offs-in-data-system-architecture-33212a882d68?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/33212a882d68</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[trade-off]]></category>
            <category><![CDATA[data-system]]></category>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 15:05:01 GMT</pubDate>
            <atom:updated>2026-06-01T15:05:01.521Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>There are no perfect solutions, only trade-offs</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vYQI-H7PDxLJnC86" /></figure><p>At the heart of every data system is a simple organizational problem: businesses need to make decisions under constraints of time, cost, uncertainty, and scale. But the moment organizations begin operating digitally, they generate massive amounts of activity continuously. Customers place orders, payments move, sensors emit signals, employees update records, applications communicate, and systems react to events in real time. The challenge is not merely storing this activity. The challenge is deciding how to structure systems so that this activity can be processed, understood, trusted, and acted upon efficiently. That is where data systems architecture emerges.</p><p>The first major architectural tension appears between operational execution and analytical understanding. Operational systems exist to run the business in real time. They must respond quickly to individual user actions such as placing an order, updating a profile, or processing a payment. These systems prioritize low latency, concurrency, and transactional consistency because the business cannot function if core operations become slow or unreliable. But operational systems are not optimized for deep organizational analysis. Analysts and decision-makers do not merely want the latest transaction. They want patterns across millions of transactions over time. They want trends, forecasts, anomalies, and business insights. That creates a fundamentally different workload.</p><p>This is why analytical systems evolved separately from operational systems. Instead of focusing on fast updates to individual records, analytical systems focus on scanning massive datasets to answer aggregate questions. Organizations therefore began moving data from operational systems into warehouses, lakes, and analytical platforms through ETL pipelines. The architecture separated execution from understanding. Operational systems optimized for running the business, while analytical systems optimized for understanding the business.</p><p>But once data started moving across systems, another challenge emerged. Different teams needed the same data in different forms. Search systems required indexed structures for fast retrieval. Dashboards required aggregated metrics. Machine learning systems required transformed training datasets. Caches required precomputed outputs. This created the concept of derived data systems. Instead of relying only on the original source of truth, organizations began creating secondary representations of data optimized for specific use cases. Technically this introduced redundancy, but economically it improved usability and performance dramatically.</p><p>As systems grew larger, organizations faced another architectural decision: whether to operate infrastructure themselves or rely on cloud providers. Traditionally, companies managed physical servers, databases, storage systems, and networking infrastructure directly. This gave them maximum control but also introduced enormous operational complexity. Cloud computing emerged because organizations increasingly valued speed, elasticity, and scalability over low-level infrastructure ownership. Instead of provisioning hardware manually, teams could now scale storage and compute dynamically through managed services.</p><p>This shift fundamentally changed architecture design itself. In traditional systems, storage and compute were tightly coupled because they lived on the same machines. In cloud-native systems, they became separable layers. Storage could scale independently through distributed object stores, while compute resources could scale elastically based on workload demand. This improved flexibility, utilization efficiency, and scalability, but also introduced dependency on distributed infrastructure managed across networks rather than within single machines.</p><p>That transition exposed another fundamental trade-off in architecture: simplicity versus distribution. A single-machine system is often easier to understand, cheaper to operate, and simpler to debug because everything happens within one environment. There are fewer failure modes, lower coordination overhead, and more predictable behavior. But single machines eventually hit physical limits in storage, compute, throughput, or geographic reach. Distributed systems emerged because organizations needed higher scalability, fault tolerance, and global availability.</p><p>However, distributing systems introduces problems that do not exist on a single machine. Networks fail. Messages arrive late. Systems lose synchronization. Partial failures occur where one component fails while others continue running. Consistency becomes harder because multiple nodes must coordinate shared state across unreliable communication channels. In distributed systems, architecture becomes less about pure computation and more about managing uncertainty itself. Scalability is gained by accepting coordination complexity.</p><p>As organizations collected even more data, another assumption initially dominated system design: store everything because future analysis may become valuable. But over time, legal, ethical, and societal pressures exposed the dangers of unrestricted data accumulation. Regulations like GDPR and CCPA emerged because data systems increasingly affected privacy, identity, autonomy, and human rights. Organizations realized that storing data indefinitely created not only storage costs but also legal exposure, security risks, and ethical consequences.</p><p>This introduced the principle of data minimization. Instead of treating data accumulation as inherently beneficial, organizations began recognizing that every piece of retained data carries operational and societal responsibility. Engineers could no longer optimize systems only for scale and performance. They also had to optimize for privacy, explainability, governance, and regulatory compliance. Architecture therefore evolved from being purely a technical discipline into a socio-technical discipline where legal and ethical constraints directly shape system design.</p><p>What makes modern data architecture difficult is that none of these trade-offs have universally correct answers. Faster systems may become more expensive. More scalable systems may become more complex. Stronger consistency may reduce availability. More flexibility may reduce governance. Greater control may reduce development speed. Simpler architectures may limit future growth. Every architectural decision optimizes for one dimension by sacrificing another.</p><p>That is why data systems architecture is ultimately the discipline of navigating constrained optimization under uncertainty. Organizations are continuously balancing execution efficiency, analytical capability, scalability, reliability, governance, cost, flexibility, and human usability simultaneously. The architecture itself becomes an expression of organizational priorities.</p><p>As intelligent systems continue evolving, these trade-offs become even more important because modern enterprises are no longer merely processing transactions. They are building continuously learning systems powered by real-time analytics, machine learning, automation, and AI-driven decision-making. In that environment, architecture is no longer simply about storing and moving data. It becomes the foundation that determines whether organizational intelligence itself can scale reliably, safely, and economically.</p><blockquote>Checkout my new book here: <a href="https://ankit-rathi.github.io/store/">https://ankit-rathi.github.io/store/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33212a882d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Data To Decisions]]></title>
            <link>https://rathi-ankit.medium.com/from-data-to-decisions-7268dd52a985?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/7268dd52a985</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[decisions]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[decision-making]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 12:11:23 GMT</pubDate>
            <atom:updated>2026-02-21T12:11:23.180Z</atom:updated>
            <content:encoded><![CDATA[<h4>Designing Decision Systems Under Real-World Constraints</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35gXQhPs0o2x219etW8osA.png" /></figure><p>Every organization claims to be data-driven.</p><p>Few can explain what that actually means.</p><p>If we strip away dashboards, pipelines, models, and AI systems, what remains is something much simpler:</p><p>Organizations exist to make decisions under uncertainty.</p><p>Every investment approved, loan sanctioned, fraud flagged, product launched, or risk mitigated is ultimately a choice made without full information. The quality of those choices determines outcomes. Data and AI are not ends in themselves — they are mechanisms intended to improve decision quality.</p><p>This article begins from that first principle: the unit of value is not data. It is not models. It is not dashboards. It is decision quality under uncertainty.</p><h3>Decisions as the Foundation</h3><p>A decision is a choice among alternatives, made under uncertainty, with consequences. That definition forces clarity.</p><p>Uncertainty implies probability. Probability implies expected value. Expected value implies tradeoffs.</p><p>The moment we acknowledge uncertainty, we must distinguish signal from noise. Organizations often confuse activity with insight and metrics with meaning. KPIs become proxies for reality, and teams optimize those proxies without examining whether they causally influence outcomes.</p><p>This is why the distinction between correlation and causation matters. Predictive accuracy can create confidence without control. Explanation builds understanding; prediction optimizes performance. Each serves different decision contexts.</p><p>From here emerges a critical separation: decision quality versus outcome quality. A good decision can lead to a bad outcome because uncertainty exists. Without this separation, organizations learn the wrong lessons.</p><p>To improve over time, decisions must sit inside feedback loops. Learning systems require measurement, iteration, and the ability to update beliefs.</p><p>Once we understand that decisions are central, a natural question arises:</p><p>Where does the information informing those decisions come from?</p><h3>From Reality to Data</h3><p>Reality is continuous, messy, and dynamic. Data is discrete, structured, and stored.</p><p>The moment we record an event, we compress reality into representation. We choose what counts as an entity, what qualifies as an attribute, and how relationships are encoded. Time itself must be modeled — are we capturing events, states, or transitions?</p><p>These choices are not neutral. They are abstractions.</p><p>Structured versus unstructured data reflects our attempt to impose order on complexity. Identifiers give continuity to entities across time. Schemas encode assumptions. Constraints embed business rules directly into data structures.</p><p>Data quality issues are not technical annoyances — they are distortions in the lens through which decisions are made. Missingness, bias, and measurement error shape downstream models long before algorithms are applied.</p><p>We must also distinguish systems of record from systems of insight. Operational systems optimize transactional correctness. Analytical systems reconstruct reality for interpretation. The two are not the same.</p><p>At the sharpest edge lies a difficult truth: sometimes data does not represent reality well enough to support reliable decisions. Model risk often begins at the abstraction layer, not the algorithm layer.</p><p>Once reality is represented as data, it must be stored, queried, and made available reliably.</p><p>This leads us to infrastructure.</p><h3>Storage as Encoded Tradeoffs</h3><p>Databases exist to persist state and ensure consistency over time. But no storage system optimizes for everything.</p><p>OLTP systems prioritize transactional integrity. OLAP systems prioritize analytical efficiency. Data warehouses impose structure for performance; data lakes trade structure for flexibility.</p><p>SQL versus NoSQL is not about syntax — it is about consistency models, scalability assumptions, and flexibility tradeoffs.</p><p>Indexing improves query speed but increases storage and maintenance complexity. Transactions create trust but reduce distributed flexibility.</p><p>The CAP theorem formalizes a hard truth: in distributed systems, consistency, availability, and partition tolerance cannot be maximized simultaneously. Every architecture allocates risk somewhere.</p><p>Storage is not neutral infrastructure. It is risk allocation in technical form.</p><p>Once stored, data must move, transform, and integrate across systems.</p><p>That movement introduces complexity.</p><h3>Architecture in the Real World</h3><p>Data pipelines are the circulatory system of organizations. They move information from operational systems to analytical environments. Along the way, transformation occurs.</p><p>Batch systems trade latency for stability. Streaming systems trade simplicity for immediacy. ETL and ELT represent philosophical differences about where logic should reside — upstream control versus downstream flexibility.</p><p>As integrations multiply, complexity grows nonlinearly. Distributed systems introduce failure patterns: partial failures, retries, cascading breakdowns. Observability becomes essential because silent failure is often more dangerous than visible failure.</p><p>Yet many platforms fail not because of technical flaws, but because of organizational misalignment. Ownership is unclear. Incentives conflict. Adoption lags.</p><p>Architecture without adoption produces no value. A perfectly engineered system unused by decision-makers is inert.</p><p>At this stage, infrastructure exists. But decisions still require abstraction.</p><p>We now move to modeling.</p><h3>Modeling and Measurement</h3><p>Analytical modeling aggregates, transforms, and reshapes data into decision-support structures. Dimensional modeling separates facts from dimensions to provide analytical clarity. Feature engineering encodes aspects of reality into machine-readable signals.</p><p>But what are we optimizing?</p><p>Evaluation metrics shape behavior. When models improve metrics but do not improve decisions, organizations optimize the wrong objective function.</p><p>Real-time versus offline tradeoffs resurface here. Speed may degrade stability. Complexity may degrade interpretability.</p><p>At this point, the groundwork is laid for machine learning.</p><h3>Machine Learning as Optimization Under Uncertainty</h3><p>Machine learning is not magic. It is function approximation under uncertainty. Supervised learning minimizes error against labeled outcomes. Unsupervised learning discovers structure.</p><p>Training and inference are separate phases with different constraints. Overfitting illustrates the danger of mistaking memorization for generalization. Validation techniques estimate out-of-sample performance.</p><p>Drift reminds us that reality changes. Models decay. Monitoring becomes necessary.</p><p>Neural networks and embeddings extend representation power. Large language models predict tokens, not truth. Retrieval-augmented generation combines stored knowledge with probabilistic generation.</p><p>Yet not every problem requires machine learning. Sometimes rules are sufficient. Sometimes simpler systems are more robust.</p><p>Restraint is strategic maturity.</p><p>But models alone do not create value.</p><p>They must operate inside production systems.</p><h3>Operationalizing AI</h3><p>Moving from model to production introduces reliability concerns. Automation must be balanced with human oversight. Cost-performance tradeoffs become real when inference runs at scale.</p><p>Governance and lineage ensure traceability. Privacy and bias mitigation address ethical and regulatory risk. Security protects against misuse.</p><p>In regulated environments, constraints tighten further. Auditability, explainability, and compliance become design requirements, not afterthoughts.</p><p>Operationalization is where many AI initiatives stall. Building intelligence is easier than embedding it safely into decision workflows.</p><p>Finally, even operational AI does not guarantee value.</p><p>Value is an economic outcome.</p><h3>Strategy, ROI, and Decision Systems</h3><p>Measuring ROI forces discipline. Value must exceed cost — including infrastructure, talent, and governance overhead.</p><p>Build versus buy decisions reflect strategic positioning and capability maturity. Incentive alignment determines whether systems are used responsibly.</p><p>Decision velocity and decision quality must be balanced. Faster decisions are not better if they degrade expected value.</p><p>Scaling data products requires modularity and evolution. Systems must be designed for change because environments shift.</p><p>At the highest level, the organization must see the end-to-end map: from decision to data, from data to model, from model to production, from production to outcome, and back through feedback loops.</p><p>The ultimate aim is not intelligence.</p><p>It is inevitability.</p><p>Systems so well designed that better decisions become the default behavior of the organization — not dependent on heroics, intuition, or isolated brilliance.</p><h3>The Coherent Arc</h3><p>The article moves from first principles to execution:</p><ul><li>Decisions define value.</li><li>Data abstracts reality.</li><li>Storage encodes tradeoffs.</li><li>Architecture orchestrates flow.</li><li>Modeling shapes signals.</li><li>Machine learning optimizes under uncertainty.</li><li>Operationalization embeds intelligence into workflow.</li><li>Strategy ensures economic alignment.</li></ul><p>Each layer builds on the previous. Each layer introduces constraints. Each layer redistributes risk.</p><p>Together, they form what this article calls decision systems.</p><p>Data does not create value.</p><p>AI does not create value.</p><p>Better decisions — made consistently under constraint — create value.</p><p>Everything in this syllabus serves that single idea.</p><p>Have a good day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7268dd52a985" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is a Decision?]]></title>
            <link>https://rathi-ankit.medium.com/what-is-a-decision-9d07af3d9019?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d07af3d9019</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[decisions]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[process]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 06:33:12 GMT</pubDate>
            <atom:updated>2026-02-08T06:33:12.494Z</atom:updated>
            <content:encoded><![CDATA[<h4>Process vs Outcome</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*GVohPQEY1J-7UxW7" /></figure><p>What is a decision?</p><p>A decision only exists because the future is uncertain. If you already knew what would happen, you wouldn’t be deciding — you’d just be executing.</p><p>Every decision has three parts. There are choices you can make, outcomes that might follow, and uncertainty connecting the two.</p><p>Where people often go wrong is judging decisions by outcomes. But outcomes include luck. A good decision can still lead to a bad result, and a bad decision can sometimes work out.</p><p>So a good decision isn’t about being right in hindsight. It’s about being reasonable with the information you had at the time.</p><p>Data helps here, but it doesn’t remove uncertainty. It reduces surprise and sharpens judgment, but the future always remains open.</p><p>A decision is a moment of responsibility. You look at what you know, what you don’t know, and you choose anyway.</p><p>And to understand why outcomes surprise us so often, the next thing we need to talk about is uncertainty and outcomes.</p><p>Have a good day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d07af3d9019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stream Processing]]></title>
            <link>https://rathi-ankit.medium.com/stream-processing-e4f995e8ad64?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4f995e8ad64</guid>
            <category><![CDATA[batch-processing]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-system]]></category>
            <category><![CDATA[stream-processing]]></category>
            <category><![CDATA[modern-data-architecture]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Tue, 23 Sep 2025 07:10:31 GMT</pubDate>
            <atom:updated>2025-09-23T07:10:31.134Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Beating Heart of Modern Data Systems</h4><p>When we think about data, the first picture that comes to mind is usually a database table or a file — something fixed, something finite. But real-world data rarely behaves this way.</p><p>User clicks on a website, payments on UPI, temperature from a factory sensor — none of these come in neat, finite bundles. They keep coming, all the time. This is what we call <strong>unbounded data</strong>.</p><p>Now the question is: <em>How do we process something that never stops?</em></p><p>That’s where <strong>Stream Processing</strong> comes in. Think of it as the unbounded cousin of batch processing.</p><h3>1. Why Stream Processing Matters</h3><p>Traditional <strong>batch processing</strong> works on fixed chunks of data — say, “all the orders from yesterday.” This works fine when delays are acceptable.</p><p>But if your users expect real-time updates — like tracking their Ola cab live — a daily or hourly batch process is far too slow.</p><p><strong>Stream processing flips the game</strong>: instead of waiting, it processes events <em>continuously as they happen</em>. This reduces delays and unlocks applications like fraud detection, personalization, and live monitoring.</p><p>It reminds me of John Gall’s line: <em>“A complex system that works is invariably found to have evolved from a simple system that works.”</em> Stream processing is that simple system — process each event as it comes, no waiting.</p><h3>2. Events: The Building Blocks of Streams</h3><p>In streaming, each data point is called an <strong>event</strong>.</p><ul><li>An event = something that happened, at a specific time, with details.</li><li>Example: <em>User X clicked “Buy” on Product Y at 3:47 PM.</em></li></ul><p>Events are produced once (by a publisher) and can be consumed many times (by different subscribers).</p><p>To organize events, we group related ones into <strong>topics</strong> or <strong>streams</strong>.</p><h3>3. How Do We Transmit Streams?</h3><p>Polling a database every few seconds (“any new data yet?”) is costly and inefficient. That’s why <strong>messaging systems</strong> were built — to notify consumers whenever new events arrive.</p><p>There are two main styles here:</p><h3>a) Traditional Message Brokers (JMS/AMQP Style)</h3><ul><li>Optimized for short-lived, transient messages.</li><li>Support <strong>load balancing</strong>: distribute messages across consumers.</li><li>Messages are deleted once delivered.</li><li>Problems: messages can be reordered or lost on failures.</li></ul><h3>b) Log-Based Brokers (Kafka, Kinesis)</h3><ul><li>Built on a durable, append-only log.</li><li>Messages are <strong>never deleted</strong> — consumers track their own progress (called an <em>offset</em>).</li><li>Easy fan-out: multiple consumers can read the same stream independently.</li><li>Can <strong>replay old messages</strong> by resetting offsets — great for debugging or experimenting.</li><li>Support <strong>log compaction</strong>, which means only the latest value for each key is kept. This allows rebuilding a full dataset without taking fresh snapshots.</li></ul><h3>4. Databases and Change Data Capture (CDC)</h3><p>Here’s a simple truth: <strong>every database write is an event.</strong></p><p>But in practice, many applications write to multiple systems (say, database + cache + search index). If you do this directly in your code (<strong>dual writes</strong>), you risk permanent inconsistencies. One write might succeed while another fails.</p><p>The solution: <strong>Change Data Capture (CDC).</strong></p><p>CDC taps into the database’s own log (the single source of truth) and streams every change to other systems. This way, the database acts as the “leader” and other systems just follow.</p><h3>5. Immutability and State Evolution</h3><p>A key principle in stream processing is <strong>immutability</strong>: don’t overwrite old data, just append new events.</p><ul><li><strong>Mutable State</strong> = current snapshot (like your bank account balance today).</li><li><strong>Immutable Events</strong> = every transaction that ever happened.</li></ul><p>One is the <em>result</em>; the other is the <em>history</em>. Together, they form two sides of the same coin.</p><p>This leads to two models:</p><ul><li><strong>CDC</strong>: Application writes mutably to DB, and changes are captured after-the-fact.</li><li><strong>Event Sourcing</strong>: Application itself writes all user actions as events, and state is rebuilt from the log.</li></ul><h3>6. Processing Streams: Time and Joins</h3><p>Here’s where it gets tricky. Since streams are infinite, operations like aggregation or joins need careful handling.</p><h3>Event Time vs Processing Time</h3><ul><li><strong>Event Time</strong> = when it actually happened (timestamp in the event).</li><li><strong>Processing Time</strong> = when your system processed it.<br> Confusing the two leads to errors, especially if data is delayed.</li></ul><h3>Windows</h3><p>To aggregate (say, number of clicks per minute), you use <strong>windows</strong>. But what if an event arrives late? Systems either:</p><ul><li>Drop it, or</li><li>Correct previous results by updating the window.</li></ul><h3>Types of Joins</h3><ol><li><strong>Stream–Stream Join</strong>: Two streams matched by key + time window (e.g., search → click).</li><li><strong>Stream–Table Join</strong>: Enrich a stream with reference data (e.g., user profile).</li><li><strong>Table–Table Join</strong>: Keep derived views updated (e.g., social media home feed).</li></ol><h3>7. Fault Tolerance and Exactly-Once Semantics</h3><p>Unlike batch jobs, streams don’t end. You can’t just restart from the beginning every time something breaks.</p><p>The holy grail is <strong>exactly-once semantics</strong> — every event processed once, no duplicates, no misses.</p><p>Common strategies:</p><ul><li><strong>Checkpointing / Micro-batching</strong>: Save progress periodically so you don’t restart from scratch.</li><li><strong>Atomic Commits</strong>: Write outputs + state together, or not at all.</li><li><strong>Idempotence</strong>: Design operations so re-running doesn’t mess things up (e.g., using offsets).</li></ul><h3>Final Thoughts</h3><p>Stream processing is not just a technology trend; it’s how the world <em>really</em> works. Data doesn’t wait. It flows.</p><p>Batch processing will always have its place for finite tasks, but when it comes to building responsive, real-time systems, streams are the foundation.</p><p>If we embrace the principles — immutability, event-driven thinking, fault tolerance — we can design systems that aren’t just fast, but also resilient and evolvable.</p><p>After all, the world itself is a stream, not a batch.</p><p>Have a good day.</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4f995e8ad64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Quantvesting Secrets]]></title>
            <link>https://rathi-ankit.medium.com/5-quantvesting-secrets-155d801e640c?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/155d801e640c</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[compounding]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[wealth]]></category>
            <category><![CDATA[investing]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Mon, 22 Sep 2025 13:23:53 GMT</pubDate>
            <atom:updated>2025-09-22T13:23:53.887Z</atom:updated>
            <content:encoded><![CDATA[<h4>That Separate Winners from Losers</h4><p>Today I am going to discuss with you the five key traits of successful traders were discussed.<br>These are not the usual “get rich quick” hacks, but timeless principles that help in surviving and thriving in the markets over the long term.</p><p>Here are my notes and reflections based on what I have learnt and experienced in the market:</p><h3>1. Quantvestors Who Succeed Don’t Watch TV</h3><p>Noise doesn’t make you money, analysis does.</p><ul><li>Successful traders don’t waste their time glued to business channels.</li><li>Instead, they focus on studying businesses — financial ratios, balance sheets, quarterly results.</li><li>They don’t stop at “profit down” or “profit up” — they dig deeper: Is it due to one-off tax expense? Or a temporary income spike?</li><li>Charts are another tool they rely on heavily. Reviewing 100–150 charts gives them more clarity than hours of news.</li><li>Charts may wobble in the short term, but in the long run, they rarely lie.</li></ul><h3>2. Stock Market ≠ Fixed Deposit</h3><p>This is where most beginners go wrong.</p><ul><li>The market is a <strong>business</strong>, not a fixed deposit where you’re guaranteed daily returns.</li><li>The dream of making ₹1000–2000 every single day leads only to stress and bad decisions.</li><li>Even legends like Jim Simons didn’t make money every day, every month, or even every quarter.</li><li>There will be dry months, sometimes even a couple in a row. And then one big month can make up for all of it.</li><li>Accepting this uneven rhythm is key to survival.</li></ul><h3>3. Market Crashes Come with Bad News</h3><p>Bad news is the headline, but opportunity is the hidden story.</p><ul><li>Markets never fall on good news. Every 5%, 10%, 20% drop is tied to some scary headline.</li><li>But if the business fundamentals and charts are screaming “buy,” the news should be ignored.</li><li>By the time the market recovers and the news cycle turns positive, you’ve already missed the best entry point.</li><li>And remember, nobody buys at the lowest or sells at the highest. Success is in catching the middle.</li></ul><h3>4. Never Trade with Borrowed Money</h3><p>This one is non-negotiable.</p><ul><li>Borrowed money = pressure. EMIs, interest, timelines… all force you into desperate moves.</li><li>What if the market gives you no return for six months? That’s very much possible.</li><li>Only trade with money you don’t need for at least three years.</li><li>And Futures &amp; Options? That’s not for beginners. Equity trading is like playing in the street; FnO is the Olympics. Don’t jump the queue.</li></ul><h3>5. Discipline = Trading Plan + Execution</h3><p>Random trading is gambling. Successful traders run on a plan.</p><p>The plan answers in advance:</p><ul><li><strong>Which companies?</strong> Large cap, mid cap, small cap?</li><li><strong>Which sectors?</strong> Cyclical or conventional?</li><li><strong>How much risk?</strong> Max 2%, 5%, or 10% per stock?</li><li><strong>How to enter?</strong> All at once, or in parts as the price falls?</li><li><strong>Which analysis tools?</strong> Indicators or patterns?</li><li><strong>Exit rules?</strong> Do we stick till the target, or exit only if the business is fundamentally broken (not just due to one bad quarter)?</li></ul><p>And the hardest part — sticking to the plan for years, not days.</p><h3>The Payoff</h3><p>If you follow these five secrets with discipline, even a three-year cycle can double your capital. That’s roughly 24% annually, or ~2% monthly on average.</p><p>Not exciting? Think again. Compounded over 10–20 years, this is how traders move from surviving to truly wealthy.</p><p>The essence: Success in quantvesting is boringly consistent, not excitingly random.</p><p>Have a good day.</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155d801e640c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thriving in Sideways Markets]]></title>
            <link>https://rathi-ankit.medium.com/thriving-in-sideways-markets-43c33fca0e2c?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c33fca0e2c</guid>
            <category><![CDATA[bears]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[wealth]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[bulls]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 18:22:41 GMT</pubDate>
            <atom:updated>2025-09-18T18:22:41.383Z</atom:updated>
            <content:encoded><![CDATA[<h4>Key Learnings from a SOIC Podcast</h4><p>I recently tuned into a podcast featuring <strong>Mr. Prabhakar Kodwa of Samvidhi Capital</strong>, where he spoke about a topic that doesn’t get enough attention — <strong>sideways markets</strong>.</p><p>We all love bull markets. Even bear markets get their fair share of analysis because of the drama and sharp falls. But sideways markets? Those long, frustrating periods where nothing seems to move? That’s where most investors lose patience, make avoidable mistakes, and end up missing the next real rally.</p><p>This podcast helped me think about these phases in a new light. Let me share some of the insights that stood out.</p><h3>What are Sideways and Corrective Markets?</h3><p>A sideways market is basically a <strong>choppy, directionless phase</strong>. Unlike the thrill of a bull market or the fear of a bear market, here you mostly get… boredom. Your portfolio just doesn’t move much.</p><p>India has seen plenty of these phases:</p><ul><li>2010–2014, 2015–2017, 2018–2020 (pre-COVID), 2021–2023, and the current period since late 2024.</li><li>Earlier, before 2007, we had <strong>deep corrections</strong> like the dot-com bust (2000–2003) and the subprime crisis (2007–2009). Markets fell 60%+ and took years to recover.</li><li>Post-2007, thanks to the Fed’s money printing, such crashes are rare. Instead, we get these <strong>long sideways consolidations</strong>.</li></ul><h3>The Rhythm of Markets</h3><ul><li><strong>Corrections follow bull markets.</strong> Markets reward, then punish. Yin and yang.</li><li><strong>Corrections set the stage for the next bull run.</strong> The deeper or longer the correction, the stronger the next rally.</li><li><strong>Every cycle has its own flavor.</strong> You can’t predict them with precision — only prepare mentally.</li></ul><h3>How Markets Behave in Sideways Phases</h3><p>This was the most relatable part for me:</p><ul><li><strong>Good news ignored, bad news exaggerated.</strong></li><li><strong>Small and micro-caps hated.</strong> No volumes, no love.</li><li><strong>Breakouts and momentum trades stop working.</strong> Strategies that shined in the bull market now bleed.</li><li><strong>Rotations dominate.</strong> Money keeps moving from one sector to another, but the index itself doesn’t go anywhere.</li></ul><p>Knowing this helps you <strong>not overreact</strong>. Recognizing the market’s mood is half the battle.</p><h3>Common Mistakes Investors Make</h3><ul><li><strong>Selling at the bottom.</strong> Going to cash when fear peaks is a cardinal sin.</li><li><strong>Over-analysis and hyperactivity.</strong> Getting chopped by price action.</li><li><strong>Strategy hopping.</strong> Chasing whatever worked yesterday leads to losses.</li><li><strong>Measuring performance too quickly.</strong> Returns are lumpy; they make sense only over full cycles, not quarters.</li></ul><h3>How to Actually Benefit</h3><ul><li><strong>Keep investing.</strong> SIPs shine here because they force you to buy in bad times.</li><li><strong>Switch smartly.</strong> Use corrections to move into better businesses at fair prices.</li><li><strong>Plant seeds, don’t harvest.</strong> This is the time to prepare for the next cycle.</li><li><strong>Favor small and mid-caps for new money.</strong> They’re punished harder, but bounce back stronger.</li></ul><h3>The Mindset Shift</h3><p>What I really liked was the focus on <strong>mindset</strong>. Sideways markets test patience more than anything else. The right approach is:</p><ul><li>Accept lull phases as normal.</li><li>Focus on business fundamentals, not market noise.</li><li>Diversify enough so that something in your portfolio always moves, keeping you sane.</li><li>Stay open-minded, let the data and results reveal the next theme instead of forcing your own narrative.</li></ul><h3>My Reflection</h3><p>Personally, this conversation reminded me why it’s so important to think in <strong>cycles, not quarters</strong>.</p><ul><li>Bull runs and corrections are two sides of the same coin.</li><li>Sideways phases, boring as they feel, are where the seeds of the next rally are sown.</li><li>Patience, discipline, and consistency matter more here than prediction skills.</li></ul><p>The next time the market feels like “nothing is working,” I’ll remind myself — <strong>this is just the prep phase for the next big move</strong>.</p><p>Have a nice day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c33fca0e2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Fine Art of Investing Wisely]]></title>
            <link>https://rathi-ankit.medium.com/the-fine-art-of-investing-wisely-5491d9e4d43b?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/5491d9e4d43b</guid>
            <category><![CDATA[wealth]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[value-investing]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[stock-market]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 03:39:16 GMT</pubDate>
            <atom:updated>2025-09-17T07:59:27.677Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lessons from ‘<em>The Book of Value’ by </em>Anurag Sharma</h4><p>Most of us are taught that investing is a numbers game. Ratios, formulas, equations, risk metrics. But Anurag Sharma’s <em>The Book of Value — The Fine Art of Investing Wisely</em> flips this on its head.</p><p>The book argues: investing is not a gamble of probabilities. It’s a <strong>human problem of choice.</strong></p><p>Let me unpack the key takeaways in plain language.</p><h3>1. Investing is About Choices, Not Gambles</h3><p>Modern finance often treats investing like rolling dice. Risk is measured by how much a stock’s price moves up and down (that’s called “standard deviation”). The advice then is: diversify into dozens of stocks so that this volatility looks smaller on paper.</p><p>But successful investors like Warren Buffett never followed this playbook. They looked at businesses, not equations. Their question was simple: <em>Is this a good business run by good people at a fair price?</em></p><p>That’s the real choice an investor makes.</p><h3>2. The Power of Saying No</h3><p>We humans are wired with biases. We seek information that proves us right (confirmation bias). We stick to beliefs even when the facts change. We get overconfident, greedy, fearful.</p><p>Sharma suggests flipping this tendency. Instead of trying to prove your idea correct, try to <strong>disprove it.</strong></p><p>This is what Karl Popper called “falsification.” In investing terms:</p><ul><li>Form a clear thesis (e.g., “This company will grow profits by 20% annually for 5 years”).</li><li>Then actively look for evidence that challenges it. Debt problems, poor governance, slowing demand.</li><li>If, after all that, you can’t disprove your thesis — your conviction grows stronger.</li></ul><p>Investing becomes a <em>negative art</em> — the art of rejecting weak ideas until only strong ones remain.</p><h3>3. Risk vs. Uncertainty</h3><p>Finance textbooks blur the difference between <strong>risk</strong> (something you can measure, like the odds of rolling a 6) and <strong>uncertainty</strong> (unknowns you simply cannot quantify, like whether a new technology will disrupt your business).</p><p>Investors must live in the world of uncertainty. The only way to handle it? Judgment, humility, and preparation.</p><p>And remember: <strong>price is not value.</strong><br> Price is what the market says today. Value is the business’s true earning power over time. Opportunities exist when the gap between the two is wide.</p><h3>4. Doing the Homework</h3><p>The book outlines a disciplined due diligence process:</p><ul><li><strong>Yield tests</strong>: Does the company generate enough earnings or cash flow compared to a safe bond?</li><li><strong>Stability tests</strong>: Has it delivered steady performance over years?</li><li><strong>Strength tests</strong>: Is the balance sheet strong enough to survive shocks?</li><li><strong>Qualitative checks</strong>: Dig into the details — off-balance-sheet debts, hidden risks, the actual business model, and most importantly, the character of management.</li></ul><p>Numbers matter, but they don’t tell the whole story. Footnotes and management behavior often reveal more than glossy annual reports.</p><h3>5. Building the Portfolio</h3><p>You don’t need 50 stocks. In fact, over-diversification spreads you too thin.<br> A concentrated portfolio of 5–10 carefully chosen businesses, each vetted through the “disconfirmation” lens, can reduce company-specific risk while keeping your circle of competence intact.</p><p>The goal is <strong>asymmetric payoff</strong> — limit your downside while leaving room for big upside.</p><h3>6. The Temperament Game</h3><p>Finally, investing is less about IQ and more about EQ.<br> Can you stay calm when others panic? Can you avoid greed when everyone around you is euphoric?</p><p>The wise investor is independent, patient, cautious, and emotionally stable. They slow down, reflect, and avoid knee-jerk reactions.</p><p>Frameworks help — but they’re only tools. The real edge lies in self-awareness and temperament.</p><h3>Final Thought</h3><p><em>The Book of Value</em> is a reminder that wise investing is not about chasing hot stocks or mastering complex equations.</p><p>It’s about:</p><ul><li>Studying businesses with care</li><li>Actively questioning your own assumptions</li><li>Being patient and disciplined</li><li>Keeping emotions in check</li></ul><p>In other words: <strong>investing is about making better choices, not bigger gambles.</strong></p><p>Have a good day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5491d9e4d43b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Markets, Money, and Mindset]]></title>
            <link>https://rathi-ankit.medium.com/markets-money-and-mindset-a9750357a671?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9750357a671</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[wealth]]></category>
            <category><![CDATA[investment]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 08:36:28 GMT</pubDate>
            <atom:updated>2025-09-15T08:37:49.338Z</atom:updated>
            <content:encoded><![CDATA[<h4>Key Lessons for Investors from Manish Dangi</h4><p>The stock market attracts millions of Indians, but very few manage to succeed consistently. Why is that? And what separates those who make money from those who build wealth?</p><p>Drawing from the insights of <strong>Manish Dangi, CEO and Founder of Mosaic Asset Management</strong>, here are some practical lessons on markets, investing, and the role of mindset.</p><h3>Why Most People Don’t Succeed in Markets</h3><p>Despite India’s huge population, only a handful — maybe 50 investors — can truly be called successful.</p><p><strong>Markets are not gambling machines.</strong> They are designed for people who are sincere, disciplined, highly intelligent, and humble enough to learn from history.</p><p><strong>Pareto’s Law applies.</strong> Just like in other areas of life, 20% of investors (or fewer) make 80% of the wealth.</p><p><strong>The odds are skewed.</strong> Out of 6,000 listed companies:</p><ul><li>2,500 will likely trade below today’s price in 20 years.</li><li>80% will deliver worse returns than a simple bank deposit.</li><li>Only 50–75 will generate most of the wealth.</li></ul><p>This means picking random stocks based on tips is almost always a losing game.</p><h3>Money vs. Wealth: Know the Difference</h3><ul><li><strong>Making Money (Index Funds):</strong> For the average investor, index funds are the best way to build steady returns of 12–14%. Over decades, this compounds into serious wealth compared to fixed deposits.</li><li><strong>Creating Wealth (Direct Stocks):</strong> To achieve outsized returns like Rakesh Jhunjhunwala, one must:</li><li>Aim to beat deposits by at least 5–7% consistently.</li><li>Or ride a “1000x” stock (like Titan) that changes your life.</li><li>Accept that there will be many failures along the way.</li></ul><h3>The Philosophy for Outsized Returns</h3><p>If you want to play the direct stock game, you need a clear philosophy.</p><p><strong>1. Position Sizing is Critical</strong></p><ul><li><strong>Scale in during panics.</strong> Buy heavily during big market crashes (like COVID-19).</li><li><strong>Scale out during euphoria.</strong> Sell gradually when the market is overheated and everyone is bullish.</li></ul><p><strong>2. Contra Mindset</strong></p><ul><li>Go against the crowd. When others are greedy, be cautious. When others are fearful, be bold.</li></ul><p><strong>3. Ride Your Winners</strong></p><ul><li>Don’t sell good companies too early. If you’ve identified a winner, stay invested for the full journey.</li></ul><p><strong>4. Slow Buy, Fast Sell (at Stock Level)</strong></p><ul><li>Start small (2–5% of your planned amount) and build conviction slowly.</li><li>If things turn sour, sell quickly.</li><li>For the <strong>overall market</strong>, the rule flips: buy fast during crashes, sell slow during booms.</li></ul><h3>How to Spot 10x Stocks</h3><p>A top-down approach works best.</p><ol><li><strong>Industry Growth (TAM — Total Addressable Market):</strong> Focus on industries with massive potential in India.</li><li><strong>Sunrise Sectors:</strong> Look at wealth management, luxury, fintech, and Indian tech built for Indian consumers.</li><li><strong>Demographics:</strong> Be wary of businesses tied to declining segments (like school uniforms in a shrinking child population).</li><li><strong>Management Quality:</strong> Back only companies with honest, capable leaders.</li><li><strong>Avoid Regulatory Traps:</strong> Stay away from sectors with cut-throat competition or heavy regulation (e.g., telecom).</li><li><strong>Exit When Thesis Breaks:</strong> Don’t cling to a stock if the business model, management, or fundamentals deteriorate.</li></ol><h3>When to Exit</h3><p>Selling is harder than buying, but a few rules help:</p><ul><li>Don’t sell just because a stock price falls 20% due to macro events.</li><li>Exit when the <strong>business itself weakens</strong> — poor governance, mounting debt, or shrinking profits.</li><li>Always buy at a <strong>reasonable valuation</strong> — even the best company is a bad buy if the price is absurd.</li><li>For new-age tech companies like Zomato or Paytm, look ahead 5–10 years instead of focusing on today’s losses. These businesses often follow a “winner-takes-all” model.</li></ul><h3>AI and the Future of IT</h3><p>AI will reshape the IT world:</p><ul><li><strong>Positive for Indian IT Services:</strong> Productivity will rise, and demand for software will grow globally.</li><li><strong>Job Displacement:</strong> Routine jobs (like junior analysts) may vanish, just like ATMs replaced tellers.</li><li><strong>High Salaries for Specialists:</strong> Skilled “10x engineers” will be in huge demand.</li><li><strong>India’s Role:</strong> Unlike the US or China, India will not lead in AI product R&amp;D due to lack of infrastructure. But Indian IT firms will thrive as service providers.</li></ul><h3>Current Market Outlook</h3><ul><li><strong>“Tired” Market:</strong> Valuations are stretched, and the market looks fatigued. A long period of sideways movement (time correction) could be coming, just like after the 1992 boom.</li><li><strong>No Big Crash Yet:</strong> Global optimism (China, US, Europe) is preventing a collapse.</li><li><strong>Bond Opportunity:</strong> Over the next 1–1.5 years, bonds might offer better returns than equities. Corporate bonds, if diversified, could give 0.5–4% higher than government bonds.</li></ul><h3>Behavioral Side of Investing</h3><p>Markets are less about numbers and more about human behavior.</p><ul><li><strong>Self-awareness (Swadhyay):</strong> Understand how you react under greed and fear. Many panic at the bottom and sell everything.</li><li><strong>Discipline or a Master:</strong> You need either discipline or a mentor (like Buffett, Soros, or even a spiritual guide) to keep emotions in check.</li><li><strong>Invest Only Surplus:</strong> If you’re struggling with rent or EMIs, focus on earning more. Investing is for surplus capital, not survival money.</li><li><strong>Constant Alertness:</strong> Active investing isn’t a hobby; it’s a serious business. If you can’t commit, index funds are the smarter option.</li></ul><h3>Beyond Money: The Bigger Picture</h3><p>Once basic needs are met, money becomes an <strong>enabler of creation</strong>.<br> It’s no longer about accumulating but about building something that lasts beyond you — a legacy, an impact.</p><h3>Final Thoughts</h3><p>The journey of investing isn’t just about chasing returns. It’s about:</p><ul><li>Staying humble.</li><li>Being disciplined.</li><li>Playing cycles smartly.</li><li>Knowing yourself.</li></ul><p>And most importantly — remembering that money is a tool, not the goal.</p><p>Have a good day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9750357a671" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Design Choices Behind AI Models]]></title>
            <link>https://rathi-ankit.medium.com/the-hidden-design-choices-behind-ai-models-760526ef33d1?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/760526ef33d1</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[foundation-models]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 07:18:28 GMT</pubDate>
            <atom:updated>2025-09-14T07:18:28.735Z</atom:updated>
            <content:encoded><![CDATA[<h4>The unseen decisions that make AI useful or flawed</h4><p>When people hear about powerful AI systems like ChatGPT or GPT-4, the first thought is often: <em>“How do you build something like that?”</em><br> The reality is: training such a model from scratch is incredibly expensive and complex — costing millions of dollars and requiring enormous compute power.</p><p>But here’s the important bit, the magic doesn’t just lie in the size of the model.<br> It lies in the design decisions made along the way — what data to use, how big to make the model, how to align it with human preferences, and even how it chooses words while generating a response.</p><p>Let’s break this down.</p><h3>1. Training Data: What You Feed Is What You Get</h3><p>Think of AI models as sponges. They soak up patterns from the data they are trained on.</p><ul><li>If the data doesn’t include Vietnamese text, the model simply <em>cannot</em> translate Vietnamese.</li><li>If the data is messy or full of misinformation, the model will reflect that.</li></ul><p>This creates a few key challenges:</p><ul><li><strong>Quality vs Quantity:</strong> More data often helps, but <em>better</em> data matters more. A small, clean dataset of coding examples can sometimes beat a massive messy dataset.</li><li><strong>English Bias:</strong> Since nearly half of internet data is in English, models tend to be much better at English tasks than at other languages. Using translation as a workaround adds cost, delay, and sometimes errors.</li><li><strong>Domain-Specific Gaps:</strong> General-purpose models (like ChatGPT) can struggle in specialized fields such as medicine or drug discovery. That’s why companies build domain-specific models like AlphaFold (proteins) or Med-PaLM2 (medical questions).</li></ul><p>So, data is both the engine and the Achilles’ heel of AI.</p><h3>2. Model Architecture and Size: The Brains of the System</h3><p>The second design choice is about how the model is built.</p><p>Most modern AI uses something called a Transformer architecture. Without going too deep, here’s what matters:</p><ul><li>Transformers pay “attention” to different parts of input text, deciding which words matter more for generating the next word.</li><li>They can process input in parallel, making them efficient, though generating responses still happens one word at a time.</li></ul><p>But there are limits:</p><ul><li>Extending context (remembering longer conversations) is hard and expensive.</li><li>Researchers are exploring alternatives like RWKV (a modernized RNN) or State Space Models like Mamba, which promise more efficiency.</li></ul><p>Size matters too:</p><ul><li>Bigger models with more parameters generally perform better.</li><li>But they are also insanely expensive to train. GPT-3 cost over $4 million just in compute!</li><li>Clever tricks like sparse models (only using parts of the network for each input) help balance cost and performance.</li><li>There’s also the Chinchilla Law: the best performance comes when training data is ~20x the model size, not just by making the model bigger.</li></ul><p>But scaling faces bottlenecks: running out of clean internet data, risk of AI training on AI-generated junk, and the sheer electricity demands of giant data centers.</p><h3>3. Post-Training: Making Models More Human</h3><p>When a model is first trained, it’s basically a text-completion machine. Give it a prompt, it’ll predict the most likely next words.<br> That’s powerful, but also dangerous: the raw model might output biased, offensive, or nonsensical text.</p><p>So, developers add post-training steps to align models with humans:</p><ol><li><strong>Supervised Fine-Tuning (SFT):</strong> Feeding the model carefully curated examples of prompts and good answers.</li><li><strong>Preference Fine-Tuning:</strong> Teaching the model to prefer responses humans like, often using Reinforcement Learning with Human Feedback (RLHF).</li></ol><p>In RLHF:</p><ul><li>Humans compare two responses and pick the better one.</li><li>A “reward model” is trained on these preferences.</li><li>The AI is then optimized to maximize these scores.</li></ul><p>This step doesn’t take as much compute as initial training, but it’s critical. Without it, ChatGPT wouldn’t feel conversational or safe.</p><h3>4. Sampling: Why AI Answers Differ Each Time</h3><p>Here’s something unusual about AI:<br> Ask the same question twice, and you might get different answers. Why? Because models are probabilistic — they don’t give fixed outputs, they sample from possible next words.</p><p>The process:</p><ul><li>The model calculates probabilities for all possible next words.</li><li>How it chooses depends on the sampling strategy:</li><li>Greedy sampling: always picks the top choice (boring, repetitive).</li><li>Temperature: higher = more creative, lower = more predictable.</li><li>Top-k / Top-p (nucleus sampling): limit the options to the most likely or to a probability threshold, balancing coherence and creativity.</li></ul><p>But this randomness also causes hallucinations — outputs that sound confident but are factually wrong.</p><p>Ways to reduce this include:</p><ul><li>Constraining outputs (e.g., must be valid JSON).</li><li>Post-processing with scripts.</li><li>Fine-tuning on structured examples.</li><li>Or generating multiple answers and picking the best (though this is expensive).</li></ul><h3>5. Why This Matters</h3><p>Every interaction you have with an AI model is shaped by these invisible decisions:</p><ul><li>The data it learned from.</li><li>The architecture and size of its brain.</li><li>The alignment work to make it usable.</li><li>The sampling rules that balance creativity and accuracy.</li></ul><p>These factors explain why ChatGPT feels different from Google Bard, or why a medical AI can do things a general chatbot cannot.</p><p>The takeaway?<br> Building AI isn’t just about raw compute or model size. It’s about thoughtful design choices — trade-offs between cost, performance, reliability, and alignment with human values.</p><p>And as AI continues to scale, the hardest challenges won’t just be technical. They’ll be about data quality, ethical alignment, and energy consumption.</p><p>Have a nice day</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=760526ef33d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding Nutrition: The Real Basics You Need for Life]]></title>
            <link>https://rathi-ankit.medium.com/decoding-nutrition-the-real-basics-you-need-for-life-1cfed367dd2f?source=rss-5c26b6edc826------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cfed367dd2f</guid>
            <category><![CDATA[health]]></category>
            <category><![CDATA[nutrition]]></category>
            <category><![CDATA[metabolism]]></category>
            <category><![CDATA[energy]]></category>
            <dc:creator><![CDATA[Ankit Rathi]]></dc:creator>
            <pubDate>Thu, 14 Aug 2025 07:25:18 GMT</pubDate>
            <atom:updated>2025-08-14T07:30:13.175Z</atom:updated>
            <content:encoded><![CDATA[<h3>Decoding Nutrition</h3><h4>The Real Basics You Need for Life</h4><p>I recently tuned into the podcast <em>“Decoding Nutrition: A Guide to Energy Balance”</em> — and honestly, it felt like the missing user manual for my body.<br> If you’ve ever felt lost in the jungle of diet trends, macros, and “eat-this-not-that” advice, this is going to make things crystal clear.</p><h3>1. What “Nutrition” Really Means</h3><p>Forget fancy definitions — at its core, nutrition is simply how your body takes food, breaks it down, and turns it into energy so you can stay alive and functional.</p><p>We’re not just talking about energy for workouts. Your brain thinking right now? Your heart beating? Your lungs breathing? All of that runs on fuel from food.</p><h3>2. It All Starts with the Cell</h3><p>Your body is built from <strong>cells</strong>.<br> Cells form tissues → tissues form organs → organs keep you alive.<br> Inside each cell, there’s a little power plant called the <strong>mitochondria</strong> — that’s where food becomes energy.</p><h3>3. Digestion Is Slow and Steady</h3><p>The process starts the second you take a bite. Chewing → stomach → small intestine → large intestine.<br> It takes <strong>48–72 hours</strong> for food to fully move through you. Along the way, <strong>enzymes</strong> break it down into smaller, usable parts.</p><h3>4. The Two Types of Nutrients</h3><p><strong>Macronutrients</strong> — the “big ticket” nutrients you need in large amounts:</p><ul><li><strong>Carbs</strong>: 4 calories per gram. Stored in small amounts in your blood (4–6g), more in your liver (60–100g), and most in your muscles (up to ~600g if you’ve got decent muscle mass). That’s roughly 2400 calories max storage.</li><li><strong>Fats</strong>: 9 calories per gram. Your body can store a lot — think under the skin, around organs, even inside muscles.</li><li><strong>Protein</strong>: 4 calories per gram. Not really for energy — it’s your <strong>building block</strong>. Stored as muscle tissue and amino acids.</li></ul><p><strong>Micronutrients</strong> — the “small but mighty” vitamins and minerals like A, B, C, magnesium, potassium, sodium. You don’t need a lot, but you really need them.</p><h3>5. The Law You Can’t Ignore: Energy Balance</h3><p>Calories in vs. calories out decides whether you gain, lose, or maintain weight.</p><ul><li>Eat more than you burn → gain weight.</li><li>Eat less than you burn → lose weight.</li></ul><p>It’s that simple. Your body is always burning energy — even if you’re lying down binge-watching a series.</p><h3>6. Know Your Numbers</h3><ul><li><strong>BMR</strong>: Calories your body burns at rest to keep you alive.<br> For most men: 1500–3000/day. Use an online calculator (age, weight, height, body fat %, gender).</li><li><strong>TDEE</strong>: Your BMR + whatever you burn moving around, walking, talking, exercising. More activity = higher TDEE.</li></ul><h3>7. How to Plan Your Diet (Without Losing Your Mind)</h3><ol><li>Calculate your TDEE.</li><li>Adjust:</li></ol><ul><li>TDEE — 300 = fat loss</li><li>TDEE + 300 = muscle gain</li></ul><ol><li>Track what you eat. Weigh ingredients <em>before</em> cooking for accuracy.</li><li>Protein is king: aim for at least 1g per kg of body weight daily.</li><li>Eat 200–300g of vegetables every single day. They’re your micronutrient insurance policy.</li></ol><h3>8. The Real Secret? Keep It Simple</h3><p>Nutrition doesn’t have to be complicated.<br> You don’t need a PhD in biochemistry — just a basic understanding of how food fuels you and a plan you can stick to for decades.</p><p>If you master this, you’ll stop hopping from one fad diet to another and start eating with purpose.<br> Because when you understand the basics, you have the freedom to choose what works for <em>you</em>.</p><p>Have a good day,</p><p>— AR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cfed367dd2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>