<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Kauntey Acharya: Notes</title>
  <link>https://kaunteyacharya.com/notes.html</link>
  <description>Notes on AI, automation, and the projects I build.</description>
  <language>en</language>
  <atom:link href="https://kaunteyacharya.com/feed.xml" rel="self" type="application/rss+xml"/>
  <lastBuildDate>Wed, 21 Oct 2026 03:30:00 GMT</lastBuildDate>
  <image><url>https://kaunteyacharya.com/assets/icons/icon-512.png</url><title>Kauntey Acharya: Notes</title><link>https://kaunteyacharya.com/notes.html</link></image>
  <item>
    <title>Building AI Stack Advisor, a build-vs-buy calculator for AI</title>
    <link>https://kaunteyacharya.com/notes/ai-stack-advisor/</link>
    <guid isPermaLink="false">kaunteyacharya-note-ai-stack-advisor</guid>
    <pubDate>Wed, 21 Oct 2026 03:30:00 GMT</pubDate>
    <description>Should a business buy a SaaS tool, build on APIs, or run its own model? A free browser tool that answers with costs, TCO, break-even, and ROI.</description>
    <category>AI</category>
    <category>projects</category>
    <content:encoded><![CDATA[<p>Almost every business that wants an AI chatbot, voice agent, or document assistant runs into the same question: should we buy it or build it? Subscribe to a SaaS tool, build on hosted LLM APIs, run an open model on our own GPUs, or mix the two? The honest answer is &quot;it depends&quot;, but it depends on things you can actually put numbers on: volume, data sensitivity, team skills, and what each conversation is worth.</p>
<p>So I built <a href="https://github.com/KaunteyAcharya/ai-stack-advisor" target="_blank" rel="noopener noreferrer">AI Stack Advisor</a>. You describe what you want AI to do, and it compares the four options on monthly cost, 36-month total cost of ownership (TCO), break-even volume, and ROI, then writes a consultant-style recommendation with every assumption listed. You can <a href="https://kaunteyacharya.com/ai-stack-advisor/" target="_blank" rel="noopener noreferrer">try it live</a>.</p>
<h2>How it works</h2>
<ol>
<li><strong>Start from goals.</strong> Pick what you want AI to do, like answering customers, processing invoices, or finding answers in company data. Each goal becomes a workload, and you can pick several.</li>
<li><strong>Volume.</strong> Users per day, requests per user, or documents and pages, growing month by month.</li>
<li><strong>Cost of each option.</strong> API cost comes from tokens times published prices, plus hosting, databases, and maintenance. Self-hosting picks a model size, the cheapest GPU with enough memory, and enough GPUs for peak traffic. SaaS uses the cheapest plan whose limits fit.</li>
<li><strong>Value.</strong> What a conversation is worth in sales, or how many staff hours an internal tool saves.</li>
<li><strong>Recommendation.</strong> A weighted score of cost and non-cost factors (privacy, time to launch, team fit, quality, lock-in, and scalability), plus a check on whether the answer is robust or a close call.</li>
</ol>
<p>Every formula is written out in the <a href="https://github.com/KaunteyAcharya/ai-stack-advisor/blob/main/docs/METHODOLOGY.md" target="_blank" rel="noopener noreferrer">methodology</a>.</p>
<h2>The parts I care most about</h2>
<p><strong>Showing the workings.</strong> A recommendation is only useful if you can see why. Click any monthly cost and it breaks down into quantity × rate. Every number has a source, a last-checked date, and a confidence level, and the high-impact guesses are flagged as &quot;check these first&quot;.</p>
<p><strong>Being honest about uncertainty.</strong> You can mark inputs you are unsure about, and the tool shows results as ranges. It also runs 300 simulations that vary prices, GPU throughput, labour costs, and model quality, then reports how often each option wins. A tornado chart shows which assumptions move the answer most. This is the same instinct as in my physics and quant work: a single number without error bars can mislead.</p>
<p><strong>Real-world details.</strong> Taxes (VAT, GST, and US sales tax, counted only when a business can&#39;t reclaim them), data-protection rules that rule out options when data must stay in-house, labour costs from official statistics, and eight currencies, including lakh and crore formatting for India.</p>
<h2>Tech stack</h2>
<ul>
<li>Plain <strong>HTML</strong>, <strong>CSS</strong>, and <strong>JavaScript</strong> modules, with no framework and no build step</li>
<li>A pure-function <strong>engine</strong> that runs the same in the browser and in Node tests</li>
<li><strong>Chart.js</strong> for the charts</li>
<li><strong>GitHub Actions</strong> that refresh exchange rates from the European Central Bank and flag prices older than 30 days</li>
</ul>
<p>Everything runs in your browser. There is no backend, no API key, no LLM call, and no tracking.</p>
<p><em>The numbers are estimates for planning, not quotes. Vendor prices change often, so test with your own data before deciding.</em></p>
]]></content:encoded>
  </item>
  <item>
    <title>Building TickerBrief, an equity research agent</title>
    <link>https://kaunteyacharya.com/notes/tickerbrief/</link>
    <guid isPermaLink="false">kaunteyacharya-note-tickerbrief</guid>
    <pubDate>Thu, 01 Oct 2026 03:30:00 GMT</pubDate>
    <description>Type a ticker, get a full equity research report with charts, filings, news sentiment, and an LLM-written narrative. All local and free.</description>
    <category>AI</category>
    <category>projects</category>
    <content:encoded><![CDATA[<p>Researching a single stock properly means opening a lot of tabs: price charts, financial statements, peer comparisons, SEC filings, and the latest news. I wanted to see how much of that I could automate, so I built <a href="https://github.com/KaunteyAcharya/tickerbrief" target="_blank" rel="noopener noreferrer">TickerBrief</a>. You type a ticker, and a few minutes later you get a full research report as an interactive web page and a PDF. There is a video demo in the <a href="https://github.com/KaunteyAcharya/tickerbrief#readme" target="_blank" rel="noopener noreferrer">README</a>.</p>
<h2>The workflow</h2>
<p><a href="https://kaunteyacharya.com/notes/images/tickerbrief-workflow.png" target="_blank" rel="noopener" title="Open full size"><img src="https://kaunteyacharya.com/notes/images/tickerbrief-workflow.png" alt="The TickerBrief workflow in n8n, in five stages: request, parallel data pulls, Python analysis, LLM drafting, and publishing" loading="lazy"></a></p>
<p>The whole pipeline is one n8n workflow, built in five stages:</p>
<ol>
<li><strong>Request.</strong> A webhook or a simple form takes the ticker (and optional peers) and checks that it is valid.</li>
<li><strong>Parallel data pulls.</strong> Prices, fundamentals, and peers come from yfinance; recent filings come from SEC EDGAR; and headlines come from Google News and Yahoo Finance RSS. Every branch keeps going if its source fails, so one broken feed never blocks the report.</li>
<li><strong>Analysis in Python.</strong> A small FastAPI service computes ratios, peer comparisons, technical indicators (RSI, MACD, moving averages, and Bollinger bands), drawdown, volatility, news sentiment, and a simple scorecard.</li>
<li><strong>LLM drafting.</strong> A local model writes the narrative in three passes: fundamentals, then technicals and news, then a lead-analyst summary. Each pass returns structured JSON.</li>
<li><strong>Publish.</strong> The report is saved as JSON and a PDF, and the report site opens it.</li>
</ol>
<h2>The design choice I care most about</h2>
<p>The LLM never calculates anything. Every number it sees has already been computed in Python, and it only writes the words around them. If the model is unavailable or returns broken JSON, that section falls back to rule-based text, and a <strong>Method</strong> tab shows exactly which parts came from the model and which came from rules. Small local models can still misread numbers, so being open about where each sentence came from felt important.</p>
<h2>Tech stack</h2>
<ul>
<li><strong>n8n</strong> (self-hosted in Docker) for orchestration</li>
<li><strong>yfinance</strong>, <strong>SEC EDGAR</strong>, and <strong>RSS</strong> feeds as key-less data sources</li>
<li><strong>Python</strong>, <strong>FastAPI</strong>, and <strong>pandas</strong> for the analytics, with <strong>VADER</strong> plus a finance vocabulary for sentiment</li>
<li><strong>Ollama</strong> (<code>qwen3:4b</code> by default) for the three LLM passes</li>
<li><strong>WeasyPrint</strong> and <strong>matplotlib</strong> for the PDF, and <strong>Apache ECharts</strong> for the interactive charts</li>
</ul>
<p>It runs entirely on my machine with free tools. It also works for Indian listings like <code>RELIANCE.NS</code>, with NIFTY 50 as the benchmark.</p>
<p><em>This is a learning project, not investment advice.</em></p>
]]></content:encoded>
  </item>
  <item>
    <title>Building a model drift alert agent</title>
    <link>https://kaunteyacharya.com/notes/ml-drift-alert-agent/</link>
    <guid isPermaLink="false">kaunteyacharya-note-ml-drift-alert-agent</guid>
    <pubDate>Tue, 29 Sep 2026 03:30:00 GMT</pubDate>
    <description>A local MLOps stack that notices when a model starts going wrong and explains why, in plain English, on Slack.</description>
    <category>AI</category>
    <category>projects</category>
    <content:encoded><![CDATA[<p>A machine learning model can look great on the day it ships and then quietly get worse. The data coming in slowly changes, and nobody notices until the predictions are already off. I wanted to see what it takes to catch that early, so I built a <a href="https://github.com/KaunteyAcharya/ML-model-drift-alert-agent" target="_blank" rel="noopener noreferrer">Model Monitoring + Drift Alert Agent</a>. There is a short video demo in the <a href="https://github.com/KaunteyAcharya/ML-model-drift-alert-agent#readme" target="_blank" rel="noopener noreferrer">README</a>.</p>
<h2>What it does</h2>
<p>Every 15 minutes, an n8n workflow scores a fresh batch of simulated &quot;production&quot; traffic and logs every prediction to Postgres. It then checks three things: has the input data drifted, have the predictions drifted, and is the model still accurate? If something crosses a threshold, a local LLM reads the numbers and writes a short explanation of the likely cause. That explanation lands in Slack, with links to the full report and a Grafana dashboard.</p>
<p>The part I enjoyed most: the LLM is never told what went wrong. It has to work it out from the metrics alone, and because the true cause is stored separately, I can score how often its explanation was right.</p>
<h2>The scenarios</h2>
<p>The model predicts breast cancer diagnoses from the UCI Wisconsin dataset, and I simulate a few realistic ways things break:</p>
<ul>
<li><strong>Calibration shift:</strong> a software update makes measurements about 25% larger, and accuracy drops from about 96% to about 80%.</li>
<li><strong>Population shift:</strong> a new clinic sends far more malignant cases. The data drifts, but the model stays accurate, which is a useful reminder that drift doesn&#39;t always mean failure.</li>
<li><strong>Data quality bug:</strong> one feature arrives in the wrong unit, and another is often missing.</li>
</ul>
<h2>Tech stack</h2>
<ul>
<li><strong>n8n</strong> for scheduling and the alert workflow</li>
<li><strong>FastAPI</strong> + <strong>Evidently AI</strong> for drift and quality metrics (K-S tests, PSI, and KL divergence per feature)</li>
<li><strong>scikit-learn</strong> (a random forest) as the model being watched</li>
<li><strong>Postgres</strong> for logging and <strong>Grafana</strong> for the dashboard</li>
<li><strong>Ollama</strong> (llama3.1, running locally) for the root-cause explanation</li>
<li><strong>Slack</strong> for alerts, and <strong>Docker Compose</strong> to run everything</li>
</ul>
<p>Everything runs on my machine, and nothing leaves it except the Slack message.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Building a fully local RAG agent</title>
    <link>https://kaunteyacharya.com/notes/local-rag-agent/</link>
    <guid isPermaLink="false">kaunteyacharya-note-local-rag-agent</guid>
    <pubDate>Tue, 22 Sep 2026 03:30:00 GMT</pubDate>
    <description>Asking questions about my own documents with n8n, Ollama, and ChromaDB, with nothing leaving my machine.</description>
    <category>AI</category>
    <category>projects</category>
    <content:encoded><![CDATA[<p>I wanted a simple way to ask questions about my own documents without sending them to a cloud API. No API keys, no usage bills, and no data leaving my machine. So I built a <a href="https://github.com/KaunteyAcharya/RAG-doc-qa-agent" target="_blank" rel="noopener noreferrer">local RAG document Q&amp;A agent</a>. There is a short video demo in the <a href="https://github.com/KaunteyAcharya/RAG-doc-qa-agent#readme" target="_blank" rel="noopener noreferrer">README</a>.</p>
<h2>How it works</h2>
<p>There are two flows, both running in n8n:</p>
<ol>
<li><strong>Ingestion.</strong> I upload a PDF, TXT, DOCX, or MD file through a form. It is split into chunks of 400 characters with 100 characters of overlap, each chunk is embedded, and the vectors are stored in ChromaDB.</li>
<li><strong>Question answering.</strong> I ask a question in a chat window. The agent retrieves the 15 most relevant chunks and passes them to a local LLM with a strict system prompt: answer only from this context, and say so plainly when the answer isn&#39;t there.</li>
</ol>
<p>That last rule mattered more than I expected. A small model will happily fill gaps with confident guesses, and forcing it to admit &quot;I can&#39;t find this in the document&quot; made the answers far more trustworthy.</p>
<h2>Tech stack</h2>
<ul>
<li><strong>n8n</strong> (self-hosted in Docker) for orchestration</li>
<li><strong>Ollama</strong> running <code>llama3.2:1b</code> for answers and <code>nomic-embed-text</code> for embeddings</li>
<li><strong>ChromaDB</strong> (also in Docker) as the vector store</li>
<li>One <code>docker compose up</code> to start everything</li>
</ul>
<h2>What I learned</h2>
<p>Retrieval quality depends heavily on chunk size and top-k, and the right values change with the kind of document. I also chose a deliberately small model for speed, and it shows its limits on multi-item reasoning, such as correctly pairing items in a list with their attributes. Swapping in a larger model like <code>llama3.2:3b</code> or <code>qwen2.5:3b</code> fixes much of that, at the cost of speed. It is a nice, hands-on way to feel the trade-offs in a RAG system rather than just read about them.</p>
]]></content:encoded>
  </item>
  <item>
    <title>What is RAG, and why does it matter so much?</title>
    <link>https://kaunteyacharya.com/notes/what-is-rag/</link>
    <guid isPermaLink="false">kaunteyacharya-note-what-is-rag</guid>
    <pubDate>Mon, 24 Aug 2026 03:30:00 GMT</pubDate>
    <description>Retrieval-augmented generation lets an AI answer from your own documents instead of its memory. Here is how it works, why it has become so important, and where it goes wrong.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>If you&#39;ve looked at AI job posts or company AI plans in the last two years, you&#39;ve seen the word <strong>RAG</strong> come up again and again. Almost every organisation wants AI that can answer from its own documents, and RAG is how most of them build it.</p>
<p>I&#39;ve been reading about and experimenting with RAG a lot lately, so I wanted to write a clear explanation of what it is, why it has become so important, and the parts that are harder than they look.</p>
<h2>The problem RAG solves</h2>
<p>A language model like GPT or Claude learns from a huge amount of text during training. But that knowledge has three big limits:</p>
<ol>
<li><strong>It&#39;s frozen in time.</strong> The model doesn&#39;t know anything that happened after its training data was collected.</li>
<li><strong>It doesn&#39;t know your private data.</strong> Your company&#39;s policies, your contracts, your internal wiki, your research notes. None of that was in its training.</li>
<li><strong>It can make things up.</strong> When a model doesn&#39;t know something, it may still produce a confident, plausible-sounding answer. This is called <strong>hallucination</strong>.</li>
</ol>
<p>You could retrain or fine-tune the model on your data, but that&#39;s expensive, slow, and has to be redone every time your documents change. And fine-tuning is better at teaching style and behaviour than at reliably storing facts.</p>
<h2>The idea: look it up first</h2>
<p><strong>RAG</strong> stands for <strong>retrieval-augmented generation</strong>. The name comes from a 2020 paper by researchers at Facebook AI (now Meta), and the idea is simple:</p>
<blockquote>
<p>Before the model answers, find the most relevant pieces of your documents and give them to the model along with the question.</p>
</blockquote>
<p>It&#39;s the difference between a closed-book exam and an open-book exam. Without RAG, the model answers from memory. With RAG, it answers with the right pages open in front of it.</p>
<h2>How it works, step by step</h2>
<p>A RAG system has two phases.</p>
<h3>Phase 1: preparing your documents (done once, updated as needed)</h3>
<ol>
<li><strong>Load</strong> your documents: PDFs, web pages, emails, notes, whatever you have.</li>
<li><strong>Chunk</strong> them: split each document into smaller pieces, often a few paragraphs each. Models can only take in so much text, and smaller pieces make retrieval more precise.</li>
<li><strong>Embed</strong> each chunk: an <strong>embedding model</strong> turns each piece of text into a vector, a long list of numbers that captures its meaning. Texts with similar meanings get vectors that point in similar directions, even if they use different words. &quot;How do I reset my password?&quot; and &quot;I forgot my login&quot; end up close together.</li>
<li><strong>Store</strong> the vectors in a <strong>vector database</strong> (like Chroma, Pinecone, or pgvector), which is built to quickly find the closest vectors to a new one.</li>
</ol>
<h3>Phase 2: answering a question (every time someone asks)</h3>
<ol>
<li><strong>Embed the question</strong> with the same embedding model.</li>
<li><strong>Retrieve</strong> the chunks whose vectors are closest to the question&#39;s vector, usually the top 3 to 10.</li>
<li><strong>Augment</strong> the prompt: put those chunks into the prompt with an instruction like &quot;Answer using only the context below. If the answer isn&#39;t there, say so.&quot;</li>
<li><strong>Generate</strong> the answer with the language model, ideally with citations pointing back to the source chunks.</li>
</ol>
<p>That&#39;s it. The model doesn&#39;t learn anything new permanently. It just gets the right information at the right moment.</p>
<h2>Why it matters so much</h2>
<p><strong>1. It works with data that changes.</strong> Update a document, re-embed it, and the system knows the new version immediately. No retraining.</p>
<p><strong>2. It&#39;s cheap.</strong> You use an existing model as is. The main costs are embedding your documents (cheap) and the model calls.</p>
<p><strong>3. It reduces hallucination.</strong> Grounding answers in real documents makes them far more reliable. Not perfect, but much better.</p>
<p><strong>4. It can cite sources.</strong> Users can click through to the exact paragraph the answer came from. For businesses, legal teams, and researchers, this trust matters more than almost anything else.</p>
<p><strong>5. It respects access control.</strong> You can filter retrieval by who&#39;s asking, so people only get answers from documents they&#39;re allowed to see.</p>
<p><strong>6. It fits almost every business.</strong> Customer support, internal knowledge bases, legal and compliance search, research assistants, onboarding guides. Any company with lots of documents has a use for it.</p>
<p>This is why RAG has become one of the most important building blocks for companies adopting AI. It&#39;s practical, relatively easy to start, and the value is easy to explain.</p>
<h2>The parts that are harder than they look</h2>
<p>The basic version takes an afternoon. Making it actually good takes much longer. What I found most interesting while experimenting with it is that the language model is rarely the problem. Retrieval is.</p>
<ul>
<li><strong>Chunking matters a lot.</strong> Chunks too small lose context; chunks too large bury the relevant sentence in noise. Splitting in the middle of a table or a list can break the meaning entirely.</li>
<li><strong>Similar isn&#39;t always relevant.</strong> Vector search finds text that <em>sounds</em> similar, but it can miss exact terms like product codes, names, or error numbers. That&#39;s why many systems use <strong>hybrid search</strong>, combining vector search with classic keyword search (like BM25).</li>
<li><strong>Reranking helps.</strong> Retrieve a broader set of chunks first, then use a second, more careful model to reorder them by true relevance before passing the best few to the language model.</li>
<li><strong>Messy documents.</strong> Scanned PDFs, tables, charts, and headers repeated on every page all need cleaning before they&#39;re useful.</li>
<li><strong>Questions that need many documents.</strong> &quot;Summarise all complaints from last quarter&quot; can&#39;t be answered from five chunks. Approaches like <strong>GraphRAG</strong> (from Microsoft) build a map of entities and relationships across documents to handle these broader questions.</li>
<li><strong>Evaluation.</strong> How do you know it&#39;s good? You need a set of test questions with known answers and to measure both parts separately: did retrieval find the right chunks, and did the model use them faithfully?</li>
</ul>
<h2>Isn&#39;t long context going to kill RAG?</h2>
<p>Models can now read hundreds of thousands, even millions of tokens in a single prompt. So why not just paste in all your documents?</p>
<p>For small collections, that can work well. But for anything large, RAG still wins on cost (you pay for every token you send), speed, and focus (models can still miss details buried in very long inputs). And most companies have far more documents than any context window can hold. In practice, the two work together: retrieve the right material, then use long context to read it properly.</p>
<h2>Where it&#39;s going: agentic RAG</h2>
<p>The newer versions are less of a fixed pipeline and more of an <strong>agent</strong>. Instead of always retrieving once and answering, the model decides for itself: should I search? What should I search for? Was that result good enough, or should I try a different query? Should I check another source?</p>
<p>That&#39;s much closer to how a person researches something, and it&#39;s where a lot of current work is heading. Tools like MCP (Model Context Protocol) make it easier to connect models to many data sources this way.</p>
<h2>Why I like it</h2>
<p>I love RAG as an idea because it makes the strengths and weaknesses of language models very visible. The model is great at reading and explaining. It&#39;s bad at remembering specific facts reliably. RAG plays to the strength and covers the weakness.</p>
<p>If you&#39;re starting with AI engineering, it&#39;s probably the single most useful thing to build first. Next, I&#39;m planning to build a fully local version that runs entirely on my own machine, and I&#39;ll write about it once it&#39;s done.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Creating FocusPulse</title>
    <link>https://kaunteyacharya.com/notes/creating-focuspulse/</link>
    <guid isPermaLink="false">kaunteyacharya-note-creating-focuspulse</guid>
    <pubDate>Mon, 17 Aug 2026 03:30:00 GMT</pubDate>
    <description>A Chrome extension where you track your own focus in four colours. Ideas to make it more addictive are welcome.</description>
    <category>projects</category>
    <content:encoded><![CDATA[<p>I have been building <a href="https://github.com/KaunteyAcharya/FocusPulse" target="_blank" rel="noopener noreferrer">FocusPulse</a>, a small Chrome extension for tracking focus.</p>
<h2>The idea</h2>
<p>Most productivity trackers watch you: they log which sites you visit and hand you a report at the end of the week. FocusPulse goes the other way. You tell it what you are doing, right now, with one click:</p>
<ul>
<li><strong>Green</strong> for deep focus</li>
<li><strong>Blue</strong> for working with music or a podcast on</li>
<li><strong>Orange</strong> for mindless tab-switching (you estimate the minutes lost, and it adds a 10-minute penalty)</li>
<li><strong>Red</strong> for a break</li>
</ul>
<p>A floating widget sits on every tab and shows today&#39;s colour ratio filling up in real time. The bet is that watching your own green bar grow is its own reward. You are not being tracked; you are tracking yourself, and I think that difference matters. It is honesty-based and non-punitive: orange and red are just time you can win back.</p>
<h2>Tech stack</h2>
<ul>
<li>Chrome extension on <strong>Manifest V3</strong>, written in plain <strong>JavaScript</strong> and <strong>CSS</strong></li>
<li>A <strong>background service worker</strong> holds the single source of truth: the active colour, time per colour, widget position, and session history</li>
<li>A <strong>content script</strong> injects the widget into every tab and keeps it in sync through runtime messages and storage-change events</li>
<li>Everything lives in <strong>chrome.storage.local</strong>: no backend, no account, and no data leaving the browser</li>
</ul>
<p>Phase 1 (the persistent widget and basic logging) works. Next up are an analytics dashboard, streaks, small nudges, end-of-day summaries, and eventually export and idle detection.</p>
<h2>Help me make it better</h2>
<p>The whole point is for FocusPulse to be a little addictive, in a good way. If you have ideas on how to make it more engaging (or you try it and something feels off), drop me an <a href="mailto:kaunteyacharya2000@gmail.com">email</a> or message me on <a href="https://www.linkedin.com/in/kauntey-acharya" target="_blank" rel="noopener noreferrer">LinkedIn</a>. I would love to hear them.</p>
]]></content:encoded>
  </item>
  <item>
    <title>How AI benchmarks are actually designed, from first principles</title>
    <link>https://kaunteyacharya.com/notes/ai-benchmarks/</link>
    <guid isPermaLink="false">kaunteyacharya-note-ai-benchmarks</guid>
    <pubDate>Sat, 25 Jul 2026 03:30:00 GMT</pubDate>
    <description>Benchmarks look like simple tables of percentages. Underneath, each one is a measuring instrument with design choices about tasks, scoring, statistics, and leakage. Here is how they work.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>Every new model launch comes with a chart: a row of benchmark names, a column of percentages, and the new model&#39;s numbers in bold. For a long time I just read the bold numbers and moved on.</p>
<p>I&#39;d had some ideas of my own around evaluation for a while, mostly from testing models on physics problems and noticing how differently they behaved from what the leaderboards suggested. But I went into this much deeper after coming across a job post from <strong>Epoch AI</strong> for an <strong>AI researcher</strong>. Epoch is one of the groups that takes measuring AI progress seriously, and reading about the role made me realise I couldn&#39;t clearly explain what makes a benchmark <em>good</em>. Not which benchmarks exist, but how you&#39;d design one from scratch.</p>
<p>So instead of another list of benchmark names, this note is about the design itself. As a physicist, I find it easiest to think of a benchmark as a <strong>measuring instrument</strong>. Every instrument has to answer the same questions: what are you measuring, how do you read the result, how precise is it, and what can fool it?</p>
<h2>1. Start with the thing you actually want to measure</h2>
<p>Physics has a clean version of this problem. You can&#39;t measure &quot;temperature&quot; directly. You measure something that tracks it, like how far mercury expands in a tube, and you trust the link between the two.</p>
<p>Benchmarks work the same way. Nobody can measure &quot;coding ability&quot; or &quot;reasoning&quot; directly. So you pick a set of tasks where success should depend on that ability, and you measure success on those tasks instead.</p>
<p>This gap between the <strong>thing you care about</strong> (the construct) and <strong>the thing you can score</strong> (the proxy) is the root of almost every benchmark problem. A multiple-choice science test measures &quot;can pick the right letter among four,&quot; which overlaps with &quot;understands science&quot; but is not the same thing. The first design question is always: if a model scores high here, what am I actually allowed to conclude?</p>
<h2>2. Choose the tasks: a sample from a much bigger world</h2>
<p>A benchmark is never the full skill. It&#39;s a <strong>sample</strong>. If you want to know how good a model is at fixing bugs in real software, you can&#39;t test it on every bug that will ever exist. You collect, say, 500 real bugs and hope they&#39;re representative.</p>
<p>That means the way you collect tasks decides what you can claim:</p>
<ul>
<li><strong>Where do tasks come from?</strong> Written fresh by experts, taken from exams, scraped from real work (like GitHub issues), or generated by a program.</li>
<li><strong>How varied are they?</strong> 500 bugs from just three projects measure something much narrower than 500 bugs from 100 projects.</li>
<li><strong>How hard should they be?</strong> This is subtle. If every task is easy, all good models score 100% and you learn nothing. If every task is impossible, they all score 0% and you also learn nothing. The useful information lives in tasks that some models solve and others don&#39;t.</li>
</ul>
<p>That third point is why good benchmarks deliberately spread difficulty from easy to very hard. Epoch&#39;s FrontierMath, for example, runs from hard undergraduate problems up to research-level ones that take expert mathematicians hours or days. A spread like that keeps the instrument useful as models improve, the same way a good ruler has both millimetre and centimetre marks.</p>
<p>There&#39;s also a trap here. Some benchmarks keep only the questions that current top models get wrong (Humanity&#39;s Last Exam was built partly this way). That makes the benchmark hard on day one, but it also means scores are artificially low at launch and then jump quickly, partly because models were selected against rather than because they suddenly got much smarter.</p>
<h2>3. Decide how to score: the &quot;ground truth&quot; problem</h2>
<p>Once a model gives an answer, how do you decide if it&#39;s right? There are only a few basic options, and each has trade-offs.</p>
<p><strong>Exact answers.</strong> The answer is a number, a letter, or an expression that can be checked automatically. Cheap, objective, and repeatable. This is why so many maths benchmarks ask for a final number. FrontierMath goes further and designs problems so the answer is hard to guess, like a large specific number rather than &quot;yes&quot; or &quot;no.&quot;</p>
<p><strong>Executable checks.</strong> For code, run it against tests. SWE-bench does this with real projects: the fix counts only if the project&#39;s own tests pass. It&#39;s objective, but only as good as the tests. Weak tests let wrong solutions slip through.</p>
<p><strong>Rubrics and judges.</strong> For open-ended work like essays, analyses, or plans, there is no single right answer. Someone has to grade it, either human experts with a rubric or another AI model acting as a judge. More realistic, but also more expensive, slower, and less consistent. An AI judge can also share the blind spots of the model being judged.</p>
<p><strong>Human preference.</strong> Show people two answers and ask which is better, like LMArena does. With enough votes, you can turn pairwise comparisons into a single rating, the same way chess ratings work. This captures what people actually like, but people also reward confidence, length, and nice formatting, which aren&#39;t the same as correctness.</p>
<p>What I found most interesting: the more realistic the task, the harder it is to score objectively. Benchmark designers are always trading <strong>realism</strong> against <strong>reliability of grading</strong>.</p>
<h2>4. Treat the score as a measurement with error bars</h2>
<p>This is the part I think most launch charts ignore, and it&#39;s pure statistics.</p>
<p>If a benchmark has $n$ questions and a model gets a fraction $p$ right, the uncertainty in that score (the standard error) is roughly</p>
<p>$$\text{SE} \approx \sqrt{\frac{p(1-p)}{n}}$$</p>
<p>Take a benchmark with about 200 questions and a model scoring 70%:</p>
<p>$$\sqrt{\frac{0.7 \times 0.3}{200}} \approx 0.032$$</p>
<p>That&#39;s about ±3 percentage points for one standard error, and closer to ±6 for a 95% confidence range. So when one model scores 71% and another 73% on a 200-question test, that difference is basically noise. Small benchmarks can only tell apart models that are far apart.</p>
<p>There&#39;s a second source of noise: the model itself. Ask the same question twice and you can get different answers. So designers also have to decide:</p>
<ul>
<li><strong>How many attempts?</strong> Score only the first try, or count it as solved if any of several attempts is right (&quot;pass@k&quot;)?</li>
<li><strong>How to combine attempts?</strong> Majority vote across several runs often scores higher than a single run.</li>
</ul>
<p>Two labs reporting the &quot;same&quot; benchmark with different choices here aren&#39;t really reporting the same number.</p>
<h2>5. Control how the test is run</h2>
<p>In physics, you&#39;d never compare two measurements taken under different conditions without saying so. In AI benchmarks, conditions vary a lot:</p>
<ul>
<li><strong>The prompt:</strong> exact wording and examples given can shift scores noticeably.</li>
<li><strong>Tools:</strong> can the model search the web, run code, use a calculator?</li>
<li><strong>Thinking budget:</strong> reasoning models score higher when allowed to think longer.</li>
<li><strong>The scaffold:</strong> for agent benchmarks, the surrounding software (how the model sees files, how many steps it gets, what happens when it errs) matters as much as the model.</li>
</ul>
<p>So a benchmark score is really a score for a <strong>model plus a setup</strong>. This is a big reason independent evaluators matter: they run every model under the same, documented conditions, using open evaluation frameworks such as Inspect, so the comparisons are actually fair. Good evaluations also report the <strong>cost</strong> of each run, because a slightly higher score at ten times the price isn&#39;t the same achievement.</p>
<h2>6. Protect the test from leaking</h2>
<p>A benchmark only works if the model hasn&#39;t seen the answers. But models are trained on huge amounts of internet text, and benchmarks tend to end up on the internet. When that happens, the score starts measuring memory instead of ability. This is called <strong>contamination</strong>.</p>
<p>The main defences, from first principles:</p>
<ul>
<li><strong>Keep tasks private.</strong> Release only a few examples and keep the real test set hidden. FrontierMath keeps most problems private for this reason.</li>
<li><strong>Use fresh tasks.</strong> Draw from problems created after a model&#39;s training data was collected, like each year&#39;s new maths competition, or continuously updated question sets.</li>
<li><strong>Mark the data.</strong> Some benchmarks embed a unique &quot;canary&quot; string so labs can filter them out of training data, and so researchers can test whether a model has seen it.</li>
<li><strong>Check for memorisation.</strong> If a model can complete a benchmark question word for word from a partial prompt, that&#39;s a warning sign.</li>
</ul>
<h2>7. Plan for the benchmark&#39;s death</h2>
<p>Every benchmark eventually <strong>saturates</strong>: the best models score close to the maximum, and it stops separating them. Often the last few percent can&#39;t even be reached, because some questions have mistakes in them. If 3% of answers in the key are wrong, 97% is effectively a perfect score.</p>
<p>There&#39;s also Goodhart&#39;s law: when a measure becomes a target, it stops being a good measure. Once a benchmark becomes famous, labs optimise for it, sometimes in ways that improve the number more than the skill.</p>
<p>Good designers expect this and build in <strong>headroom</strong>: tasks well beyond current ability, private holdout sets, and versions that can be updated.</p>
<h2>8. Connect benchmarks across time</h2>
<p>Here&#39;s a problem I hadn&#39;t thought about before. Each benchmark lives only a few years. So how do you compare a model from 2021 with one from 2026, when no single benchmark covers both?</p>
<p>The solution borrows from how standardised exams compare students across different test papers, a method called <strong>item response theory</strong>. The idea: every model has an underlying ability, every benchmark (or question) has a difficulty, and the chance of success depends on the gap between the two. If you have enough overlapping results, with some models tested on both old and new benchmarks, you can estimate abilities and difficulties together on one shared scale.</p>
<p>That&#39;s essentially what Epoch&#39;s <strong>Capabilities Index</strong> does: stitch many benchmarks together into one long ruler, so progress can be tracked across years even as individual benchmarks saturate. I loved this, because it&#39;s exactly how physicists calibrate instruments that each work only over a limited range.</p>
<h2>My own ideas, revisited</h2>
<p>Thinking about benchmarks this way made the ideas I&#39;d had before more concrete:</p>
<ul>
<li><strong>Consistency deserves its own number.</strong> Ask a model the same physics question five times and you can get different answers. A single score hides that. Reporting how often a model is reliably right across repeated runs would tell you more about whether you can trust it.</li>
<li><strong>Verifiable research problems.</strong> In my field, many derivations end in a checkable result, like the maximum efficiency of an energy extraction process for a given black hole spin. A set of these could test real derivation ability with exact, automatic grading, in the same spirit as FrontierMath.</li>
<li><strong>Cost per correct answer.</strong> For real use, accuracy per dollar often matters more than raw accuracy.</li>
</ul>
<p>Some of these already exist in some form, which was humbling and also reassuring. It meant I was thinking in the right direction.</p>
<h2>A checklist I now use</h2>
<p>When I see a new benchmark result, I ask:</p>
<ol>
<li><strong>What exactly is being measured,</strong> and what am I allowed to conclude from it?</li>
<li><strong>How many tasks?</strong> Is the difference between models bigger than the error bars?</li>
<li><strong>How is it graded?</strong> Exact answers, tests, rubric, AI judge, or human votes?</li>
<li><strong>Under what conditions?</strong> Tools, attempts, thinking time, scaffold, cost.</li>
<li><strong>Could it be contaminated?</strong> Public or private, old or fresh?</li>
<li><strong>Is it saturated?</strong> Are all top models bunched near the ceiling?</li>
<li><strong>Who ran it?</strong> The lab itself, or an independent evaluator?</li>
</ol>
<p>Benchmarks are imperfect, but they&#39;re the closest thing we have to a shared ruler for AI progress. And designing a good ruler turns out to be one of the most interesting problems in the field.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Creating EasyAutoFill</title>
    <link>https://kaunteyacharya.com/notes/creating-easyautofill/</link>
    <guid isPermaLink="false">kaunteyacharya-note-creating-easyautofill</guid>
    <pubDate>Mon, 20 Jul 2026 03:30:00 GMT</pubDate>
    <description>A local, open-source browser extension that fills any form from your own profile file.</description>
    <category>projects</category>
    <content:encoded><![CDATA[<p>My latest side project is <a href="https://github.com/KaunteyAcharya/Easy-Auto-Fill" target="_blank" rel="noopener noreferrer">EasyAutoFill</a>, a free, open-source browser extension that fills in forms from your own profile data.</p>
<h2>The idea</h2>
<p>Typing the same name, email, links, education, and work history into form after form gets old quickly. Browser autofill handles the basics, but not the longer fields like a summary or a job description. So the idea was simple: keep your details in one file you control, and let the extension map them onto whatever form is in front of you.</p>
<p>You upload a profile as Markdown, JSON, TXT, or CSV, open any form, and click <strong>Auto-Fill All Fields</strong>. Filled fields turn green and unmatched ones turn yellow, so you can see exactly what happened. You can keep several profiles (say, one for tech roles and one for academic applications) and save custom mappings for sites you use often.</p>
<h2>Tech stack</h2>
<ul>
<li>A <strong>Chrome/Edge extension</strong> with a popup UI, a content script for field detection, and a background service worker</li>
<li><strong>Multi-strategy field matching</strong>, where the highest-confidence match wins: input type first (<code>type=&quot;email&quot;</code>), then a keyword map of labels, then direct key matching, and finally fuzzy matching with <strong>Levenshtein distance</strong> for typos and variations</li>
<li><strong>Native event dispatch</strong>, so React, Angular, and Vue forms register the filled values</li>
<li><strong>IndexedDB</strong> for storage: no server, no API calls, and no analytics</li>
</ul>
<h2>What I enjoyed</h2>
<p>I had a lot of fun with this one beyond the code. Working through the product ideation, deciding what the extension should and shouldn&#39;t do, designing the popup, and thinking about how a first-time user would feel was the best part for me.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Starting a statistics series on Medium</title>
    <link>https://kaunteyacharya.com/notes/stats-with-first-principles/</link>
    <guid isPermaLink="false">kaunteyacharya-note-stats-with-first-principles</guid>
    <pubDate>Wed, 24 Jun 2026 03:30:00 GMT</pubDate>
    <description>Stats_with_FirstPrinciples: rebuilding statistical thinking from the ground up, one intuitive post at a time.</description>
    <category>maths</category>
    <content:encoded><![CDATA[<p>I am starting a statistics series on <a href="https://medium.com/@sometimes_rational" target="_blank" rel="noopener noreferrer">Medium</a> called <strong>Stats_with_FirstPrinciples</strong>.</p>
<h2>Why</h2>
<p>A lot of statistics is taught as a toolbox: memorise the test, plug in the numbers, report the p-value. I have always found it more useful (and more fun) to rebuild ideas from the ground up, the way I learned to approach physics. If you understand where a formula comes from, you know when it applies and when it quietly breaks.</p>
<h2>The plan</h2>
<p>The series starts before probability, with randomness and uncertainty themselves, and then builds step by step: events and sample spaces, how probabilities add and multiply, counting, and onwards toward inference. Each post leans on everyday examples (cards, passwords, lotteries, and locks) rather than heavy notation, so the intuition comes first and the maths follows.</p>
<p>If you have ever used a statistical test without being sure why it works, this series is for you. Follow along on <a href="https://medium.com/@sometimes_rational" target="_blank" rel="noopener noreferrer">Medium</a>.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Automating my morning arXiv routine</title>
    <link>https://kaunteyacharya.com/notes/automating-arxiv/</link>
    <guid isPermaLink="false">kaunteyacharya-note-automating-arxiv</guid>
    <pubDate>Tue, 02 Jun 2026 03:30:00 GMT</pubDate>
    <description>Checking arXiv every day and feeding papers to an LLM ate my mornings, so I built an n8n agent to do it.</description>
    <category>AI</category>
    <category>projects</category>
    <content:encoded><![CDATA[<p>Every morning I used to do the same thing: open arXiv, scroll through the new submissions in my categories, skim abstracts to guess which papers mattered, download a few PDFs, and then paste them into an LLM to walk me through the derivations. It was useful, but it quietly ate a big chunk of my morning. So I automated it.</p>
<p>The result is the <a href="https://github.com/KaunteyAcharya/n8n-arxiv-research-automation" target="_blank" rel="noopener noreferrer">ArXiv Research Analysis Agent</a>.</p>
<h2>What it does</h2>
<ol>
<li>Each morning it checks arXiv&#39;s new-submissions listing for the categories I care about (General Relativity and Quantum Cosmology, and Quantitative Finance by default).</li>
<li>It filters the new papers against my keyword list.</li>
<li>For every match, I get a Telegram message with the title, the abstract, and a yes/no prompt.</li>
<li>If I reply <code>yes &lt;arxiv_id&gt;</code>, it downloads the full PDF, extracts the text, and asks a local LLM to explain the paper&#39;s derivation and methodology from first principles. The analysis comes back to me on Telegram as a Markdown report.</li>
<li>If I reply <code>no</code>, it marks the paper as skipped and moves on.</li>
</ol>
<p>The yes/no step is the part I like most. I stay in control of what gets a deep read, without doing any of the busywork.</p>
<h2>Under the hood</h2>
<ul>
<li><strong>n8n</strong> (self-hosted) orchestrates two branches: a daily schedule that queries and filters arXiv, and a one-minute poller that reads my Telegram replies.</li>
<li><strong>Ollama</strong> runs the model locally (<code>qwen3:4b</code>), so paper content never goes to a third-party API.</li>
<li><strong>ChromaDB</strong> is used purely as a small key-value store for paper status (pending, in progress, or declined) and the Telegram polling offset, which turned out more reliable than n8n&#39;s built-in static data across separate triggers.</li>
<li>The <strong>Telegram Bot API</strong> handles both the daily briefs and my replies.</li>
<li>arXiv&#39;s public listing pages need no API key.</li>
</ul>
<p>It now runs every morning, and I spend that time actually reading the papers that matter.</p>
]]></content:encoded>
  </item>
  <item>
    <title>How machine learning and deep learning are different</title>
    <link>https://kaunteyacharya.com/notes/ml-vs-deep-learning/</link>
    <guid isPermaLink="false">kaunteyacharya-note-ml-vs-deep-learning</guid>
    <pubDate>Wed, 05 Mar 2025 03:30:00 GMT</pubDate>
    <description>Not &quot;deep learning is ML with neural networks,&quot; but why. A first-principles look at what each one is really doing, and why the difference comes down to who builds the representation.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>The usual answer to this question is a diagram of circles: deep learning sits inside machine learning, which sits inside AI. That&#39;s true, but it never helped me understand anything. It tells you <em>where</em> deep learning sits, not <em>why</em> it behaves so differently.</p>
<p>So I tried to work it out from first principles, the way I&#39;d approach a physics problem: strip it down to what learning actually is, and see where the two approaches split.</p>
<h2>What does &quot;learning&quot; mean, mathematically?</h2>
<p>Every supervised learning problem has the same shape. You have inputs $x$ (an image, a row of customer data, a sound clip) and outputs $y$ (a label, a price, a yes/no). You believe there&#39;s some function connecting them:</p>
<p>$$y \approx f(x)$$</p>
<p>You don&#39;t know $f$. You only have examples. Learning means finding a function that matches the examples and, more importantly, works on new ones.</p>
<p>To do that, every learning method makes three choices:</p>
<ol>
<li><strong>A family of possible functions</strong> to search through (straight lines, decision trees, neural networks...).</li>
<li><strong>A way to measure error</strong> (how wrong is a given function on the examples?).</li>
<li><strong>A way to search</strong> for the function with the lowest error.</li>
</ol>
<p>Machine learning and deep learning differ mostly in the first choice, and that one difference ripples through everything else.</p>
<h2>The key idea: representation</h2>
<p>Here&#39;s a small example that, for me, explains the whole topic.</p>
<p>Imagine points scattered on a flat sheet. Points inside a circle are red; points outside are blue. You want a model that separates them.</p>
<p>If you describe each point by its coordinates $(x_1, x_2)$, a simple model that draws straight lines can&#39;t do it. No straight line separates the inside of a circle from the outside.</p>
<p>But change how you describe the points. Add one new quantity:</p>
<p>$$r^2 = x_1^2 + x_2^2$$</p>
<p>Now the problem is trivial: red if $r^2$ is less than some number, blue otherwise. The model didn&#39;t get smarter. The <strong>description of the data</strong> got better.</p>
<p>Physicists do this all the time. Choose the right coordinates and a nasty problem becomes simple. Planetary orbits are a mess in Cartesian coordinates and clean in polar ones.</p>
<p>In machine learning, this description is called the <strong>representation</strong>, or the <strong>features</strong>. And this is the real dividing line:</p>
<ul>
<li><strong>In classic machine learning, a human usually designs the representation.</strong> The model learns a fairly simple function on top of it.</li>
<li><strong>In deep learning, the model learns the representation itself,</strong> along with the function on top.</li>
</ul>
<h2>Classic machine learning: you build the features</h2>
<p>Say you&#39;re predicting whether a customer will repay a loan. A data scientist would think about what actually matters and build features: debt divided by income, number of late payments in the past year, length of credit history, change in balance over six months.</p>
<p>Then a model like logistic regression, a decision tree, or gradient-boosted trees learns how to combine those features into a prediction.</p>
<p>Why this works well:</p>
<ul>
<li><strong>The search is easy.</strong> For logistic regression, the error landscape is a single smooth bowl (it&#39;s convex), so there&#39;s exactly one best answer and you&#39;re guaranteed to find it.</li>
<li><strong>It needs less data.</strong> The human has already done much of the thinking through the features, so the model has less to figure out.</li>
<li><strong>It&#39;s explainable.</strong> You can see which features mattered and by how much.</li>
</ul>
<p>The weakness: the model can only be as good as the features someone thought of. If the important pattern is something no one thought to compute, the model will never see it.</p>
<h2>Deep learning: the model builds the features</h2>
<p>A neural network is a chain of simple steps. Each layer takes numbers in, multiplies them by weights, adds them up, and passes them through a simple bend (a non-linear function). Stack many layers and the output of each becomes the input of the next:</p>
<p>$$f(x) = f_L\big(\cdots f_2(f_1(x))\big)$$</p>
<p>Each layer re-describes the data a little. Train the whole chain together, and the early layers learn to build whatever representation makes the final step easy.</p>
<p>In the circle example, a small network would essentially discover something like $r^2$ by itself. Nobody tells it to.</p>
<p>In images, this is very visible. Inspect a trained network and you find:</p>
<ul>
<li>early layers responding to edges and colour changes,</li>
<li>middle layers responding to textures and simple shapes,</li>
<li>deeper layers responding to eyes, wheels, or letters.</li>
</ul>
<p>Nobody programmed edges or eyes. They emerged because they were useful for reducing the error.</p>
<h2>Why depth, specifically?</h2>
<p>Why many layers instead of one very wide one? Two reasons.</p>
<p><strong>The world is built from parts.</strong> A face is made of eyes and a mouth, which are made of curves, which are made of edges. A sentence is made of phrases, which are made of words. Stacking layers matches this structure: each layer builds on the pieces found by the one before. A single layer would have to learn every combination directly, which needs vastly more units.</p>
<p><strong>Composition is powerful.</strong> Each layer can bend and fold the data space. Folding a sheet of paper a few times creates many creases; folding it many times creates exponentially more. In the same way, a deep network can represent very complicated functions with far fewer parameters than a shallow one.</p>
<h2>The price: data, compute, and a harder search</h2>
<p>Learning the representation yourself isn&#39;t free.</p>
<p><strong>It needs more data.</strong> A model searching through a much bigger family of functions needs more examples to pin down the right one. With little data, a flexible model memorises the examples instead of learning the pattern (overfitting).</p>
<p><strong>It needs more compute.</strong> Millions or billions of weights, adjusted again and again by gradient descent. This is why deep learning only took off once GPUs made it practical, around 2012, when the AlexNet network won the ImageNet image competition by a huge margin.</p>
<p><strong>The search is harder.</strong> The error landscape is no longer a single smooth bowl. It&#39;s full of hills and valleys, and gradient descent gives no guarantee of finding the best point. In practice it works surprisingly well, and why it works so well is still an active research question.</p>
<p><strong>It&#39;s harder to explain.</strong> The learned features are spread across thousands of numbers rather than named columns like &quot;debt-to-income.&quot;</p>
<h2>So when does each one win?</h2>
<p>Once you see the difference as &quot;who builds the representation,&quot; the practical rules follow naturally.</p>
<p><strong>Raw, high-dimensional, structured data like images, sound, and text: deep learning wins.</strong> A small photo has hundreds of thousands of pixel values, and no human can hand-design features for &quot;is there a dog in this photo&quot; that hold up across angles, lighting, and breeds. The representation is the hard part, so you want the model to learn it.</p>
<p><strong>Tables with meaningful columns: classic ML often wins.</strong> In a spreadsheet, each column already means something (age, income, balance), so much of the representation work is already done. Here, gradient-boosted trees still often match or beat neural networks. A 2022 study by Grinsztajn and colleagues looked into why, and found a few reasons: tables often contain irrelevant columns that trees simply ignore, and the patterns in tabular data are often irregular and step-like, which trees capture naturally while neural networks tend to prefer smooth functions.</p>
<p>Credit scoring, which I worked on in one of my projects, is a good example of the second case: tree-based models with sensible features are the natural starting point, and they&#39;re easier to explain to the people who have to act on the decisions.</p>
<h2>Side by side</h2>
<table>
<thead>
<tr>
<th></th>
<th>Classic machine learning</th>
<th>Deep learning</th>
</tr>
</thead>
<tbody><tr>
<td>Who builds the representation</td>
<td>Mostly the human</td>
<td>The model learns it</td>
</tr>
<tr>
<td>Function family</td>
<td>Simpler (lines, trees, ensembles)</td>
<td>Very flexible (deep layered networks)</td>
</tr>
<tr>
<td>Search</td>
<td>Often easy, sometimes guaranteed</td>
<td>Harder, no guarantees, works well in practice</td>
</tr>
<tr>
<td>Data needed</td>
<td>Can work with hundreds to thousands of rows</td>
<td>Usually much more</td>
</tr>
<tr>
<td>Compute</td>
<td>A laptop CPU is often enough</td>
<td>Often needs GPUs</td>
</tr>
<tr>
<td>Best on</td>
<td>Tables with meaningful columns</td>
<td>Images, audio, text, raw signals</td>
</tr>
<tr>
<td>Explaining decisions</td>
<td>Usually easier</td>
<td>Usually harder</td>
</tr>
</tbody></table>
<h2>The one-line version</h2>
<p>Classic machine learning is mostly about <strong>learning a decision on top of a description that humans designed</strong>. Deep learning is about <strong>learning the description too</strong>.</p>
<p>Everything else, more data, more compute, harder training, less transparency, and better results on raw signals, follows from that single difference. Once I saw it that way, choosing between the two stopped feeling like following a rule and started feeling obvious.</p>
]]></content:encoded>
  </item>
  <item>
    <title>How AI labs actually train their models</title>
    <link>https://kaunteyacharya.com/notes/how-labs-train-ai-models/</link>
    <guid isPermaLink="false">kaunteyacharya-note-how-labs-train-ai-models</guid>
    <pubDate>Sun, 26 Jan 2025 03:30:00 GMT</pubDate>
    <description>From raw web text to a helpful assistant: the stages every big lab goes through, and how OpenAI, Anthropic, Google, Meta, and DeepSeek each do it differently.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>I use these models every day, and since part of my role involves training models, I wanted to go deeper than the usual &quot;they read the internet&quot; explanation. How do the big labs actually go from a pile of text to something like ChatGPT or Claude? Where do they spend their money, and where do they differ?</p>
<p>With DeepSeek-R1 out this week and everyone talking about it, it felt like the right time to write it down. The broad recipe is shared across labs. The interesting part is where each one puts its own spin on it.</p>
<h2>The big picture</h2>
<p>Training a modern assistant happens in roughly four stages:</p>
<ol>
<li><strong>Data:</strong> collect and clean an enormous amount of text.</li>
<li><strong>Pretraining:</strong> teach a model to predict the next token on all of it.</li>
<li><strong>Post-training:</strong> turn that raw model into a helpful, safe assistant.</li>
<li><strong>Evaluation and safety testing:</strong> check what it can do and what could go wrong before release.</li>
</ol>
<p>Pretraining builds the <strong>knowledge</strong>. Post-training shapes the <strong>behaviour</strong>. Most people only see the last stage, but the first two are where most of the compute and cost go.</p>
<h2>Stage 1: data</h2>
<p>Everything starts with data, and it&#39;s less glamorous than it sounds.</p>
<ul>
<li><strong>Sources:</strong> public web pages (often from Common Crawl, a giant open archive of the web), books, Wikipedia, scientific papers, code from public repositories, and licensed datasets.</li>
<li><strong>Cleaning:</strong> removing spam, duplicate pages, broken text, and low-quality content. Labs also filter out personal information and harmful material.</li>
<li><strong>Mixing:</strong> deciding how much of each kind of data to include. More code tends to make models better at reasoning; more maths helps with maths.</li>
<li><strong>Tokenising:</strong> splitting text into tokens, small chunks of words that the model actually reads.</li>
</ul>
<p>The scale is hard to picture. Meta&#39;s Llama 3 was trained on over 15 trillion tokens. What I found most interesting is how much labs say data quality matters. Removing junk and duplicates often helps as much as making the model bigger. From my own work I can relate: a clean dataset beats a clever model on bad data almost every time.</p>
<h2>Stage 2: pretraining</h2>
<p>This is the expensive part. The model starts with random numbers as its parameters and reads through the data, predicting the next token over and over. Each wrong guess nudges billions of parameters slightly in the right direction using gradient descent.</p>
<ul>
<li><strong>Hardware:</strong> thousands to tens of thousands of GPUs (or Google&#39;s TPUs) running in parallel for weeks or months. Llama 3&#39;s largest model used up to 16,000 Nvidia H100 GPUs.</li>
<li><strong>Engineering:</strong> at this scale, hardware fails regularly, so a lot of work goes into checkpoints, recovery, and splitting the model across many chips efficiently.</li>
<li><strong>Planning:</strong> labs use <strong>scaling laws</strong> to predict how good a model will be before training it, by running smaller experiments first. Nobody wants to discover a mistake after spending tens of millions of dollars.</li>
</ul>
<p>The result is a <strong>base model</strong>. It knows an enormous amount, but it&#39;s not an assistant. Ask it a question, and it may continue with more questions, because that&#39;s what text on the internet often looks like. It&#39;s a brilliant autocomplete, not yet a helper.</p>
<h2>Stage 3: post-training</h2>
<p>This is where the model gets its personality, its helpfulness, and its safety behaviour. It&#39;s also where labs differ the most.</p>
<h3>Supervised fine-tuning (SFT)</h3>
<p>First, the model is trained on curated examples of good conversations: a prompt and an ideal response, written by people or carefully generated and filtered. This teaches the format of being an assistant, like answering the question, following instructions, and saying &quot;I don&#39;t know.&quot;</p>
<h3>Preference tuning</h3>
<p>Examples only go so far, because it&#39;s hard to write the perfect answer but much easier to say which of two answers is better. So:</p>
<ol>
<li>The model writes several answers to the same prompt.</li>
<li>People (or another model) rank them.</li>
<li>The model is trained to produce more answers like the preferred ones.</li>
</ol>
<p>The classic version is <strong>RLHF</strong> (reinforcement learning from human feedback): train a separate reward model to predict human preferences, then use reinforcement learning to push the language model towards high-reward answers. A simpler method from 2023, <strong>DPO</strong> (direct preference optimisation), skips the separate reward model and learns from the preference pairs directly. Many labs now use some mix of both.</p>
<h3>Reinforcement learning for reasoning</h3>
<p>This is the newest and most exciting piece. Instead of only learning what humans <em>prefer</em>, models are trained with reinforcement learning on problems where the answer can be <strong>checked automatically</strong>: does the maths answer match? Does the code pass the tests?</p>
<p>The model tries, gets rewarded for correct answers, and gradually learns to work through problems step by step, check itself, and backtrack when stuck. This is what&#39;s behind OpenAI&#39;s o1 and o3, and DeepSeek&#39;s R1. I go into it more below.</p>
<h2>Stage 4: evaluation and safety</h2>
<p>Before release, labs test models on benchmarks (maths, coding, knowledge, reasoning), but also on risks:</p>
<ul>
<li><strong>Red-teaming:</strong> people deliberately try to make the model misbehave or give dangerous information.</li>
<li><strong>Dangerous capability tests:</strong> for example, could it meaningfully help with cyberattacks or biological weapons?</li>
<li><strong>Model cards and system cards:</strong> documents describing what was tested and what was found.</li>
</ul>
<p>Anthropic, for example, has a Responsible Scaling Policy that ties how carefully a model must be handled to how capable it is. OpenAI publishes system cards with each major release.</p>
<h2>How the labs differ</h2>
<p><strong>OpenAI</strong> popularised RLHF with InstructGPT in 2022, which became the basis for ChatGPT. With <strong>o1</strong> (September 2024), they added large-scale reinforcement learning on reasoning. The model learns to &quot;think&quot; in a long hidden chain of thought before answering, and a key finding was that performance keeps improving the longer it&#39;s allowed to think. That&#39;s a new way of scaling: spend more compute when <em>answering</em>, not only when training.</p>
<p><strong>Anthropic</strong> developed <strong>Constitutional AI</strong>. Instead of relying only on human ratings, the model is given a written set of principles (the &quot;constitution&quot;). It critiques and revises its own answers against them, and AI feedback based on those principles is used in preference training. I loved this idea because the values are written in plain language, so you can actually read what the model is being steered towards rather than guessing from thousands of individual ratings.</p>
<p><strong>Google DeepMind</strong> trains Gemini to be <strong>natively multimodal</strong>: text, images, audio, and video are part of training from the start, rather than added later. They train on their own TPU chips, which gives them a big hardware advantage.</p>
<p><strong>Meta</strong> releases the weights of its <strong>Llama</strong> models openly. Anyone can download them, fine-tune them, and run them on their own machines. A large share of the open-source AI world is built on Llama, and their technical papers are some of the most detailed public descriptions of how a frontier model is trained.</p>
<p><strong>DeepSeek</strong> is the story of the month, and for good reason.</p>
<ul>
<li><strong>DeepSeek-V3</strong> (December 2024) uses a <strong>mixture-of-experts</strong> design: the model has 671 billion parameters in total, but only about 37 billion are active for each token. Think of a team of specialists where only the relevant few work on each question. They reported the final training run took about 2.8 million GPU hours, roughly $5.6 million in compute. That doesn&#39;t include all the research and experiments before it, but it&#39;s still remarkably cheap for a model this strong.</li>
<li><strong>DeepSeek-R1</strong> (20 January 2025) is a reasoning model like o1, and they published how they built it. Their <strong>R1-Zero</strong> model was trained with pure reinforcement learning from the base model, without any supervised examples first. It learned to reason step by step, double-check, and even reconsider its approach mid-answer, just from being rewarded for correct answers. That surprised a lot of people, me included.</li>
<li>They used an algorithm called <strong>GRPO</strong> (group relative policy optimisation). The model answers the same question several times, and each answer is scored relative to the group average. This avoids training a separate &quot;critic&quot; model, saving memory and compute.</li>
<li>R1-Zero&#39;s answers were sometimes hard to read or mixed languages, so the final R1 added a small amount of supervised data first, then more rounds of RL and fine-tuning.</li>
<li>They also <strong>distilled</strong> R1&#39;s reasoning into much smaller open models, which then reason far better than their size suggests.</li>
</ul>
<h2>Ingredients everyone uses</h2>
<ul>
<li><strong>Synthetic data:</strong> strong models generate training examples for other models, which are then filtered for quality. This is now a huge part of post-training.</li>
<li><strong>Distillation:</strong> a large &quot;teacher&quot; model trains a smaller, cheaper &quot;student&quot; model to mimic it.</li>
<li><strong>Evaluation-driven development:</strong> labs build internal tests for every capability they care about and train against them, which is probably the least visible but most important habit.</li>
</ul>
<h2>A caveat</h2>
<p>Most of the details are secret, especially at OpenAI, Anthropic, and Google. Papers and model cards describe the outline, not the full recipe. DeepSeek and Meta share much more. So treat this as the shape of the process, not a blueprint.</p>
<h2>What I took away</h2>
<p>Underneath all the different techniques is one idea in different forms: <strong>define what &quot;better&quot; means, measure it, and optimise towards it</strong>. Next-token prediction, human preferences, written principles, and verifiable rewards are all just different ways of defining &quot;better.&quot;</p>
<p>For my own work, the lesson is that the hard part is rarely the training loop itself. It&#39;s the data, the definition of success, and the evaluation. That&#39;s true whether you&#39;re training a 600 billion parameter model or a small one on a laptop.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Karpathy in 2017: “Gradient descent can write better code than you”</title>
    <link>https://kaunteyacharya.com/notes/gradient-descent-better-code/</link>
    <guid isPermaLink="false">kaunteyacharya-note-gradient-descent-better-code</guid>
    <pubDate>Wed, 08 Jan 2025 03:30:00 GMT</pubDate>
    <description>In 2017, Andrej Karpathy joked that gradient descent writes better code than us. Seven years later, it doesn't feel like much of a joke.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>In August 2017, Andrej Karpathy, then director of AI at Tesla, tweeted: <em>&quot;Gradient descent can write code better than you. I&#39;m sorry.&quot;</em></p>
<p>At the time it read like a joke from someone deep in the neural network world. Going into 2025, after watching what coding models did last year, I keep coming back to it. Here&#39;s what he meant, and how true it has turned out to be.</p>
<h2>First, what is gradient descent?</h2>
<p>Gradient descent is how neural networks learn. Picture standing somewhere on a hilly landscape in thick fog. You want to reach the lowest point, but you can only feel the slope under your feet. So you take a small step downhill, feel the slope again, take another step, and repeat thousands of times.</p>
<p>In a neural network, the &quot;landscape&quot; is how wrong the model is (its error), and your position is the setting of all its parameters, often millions or billions of numbers. Every step nudges all of them slightly in the direction that reduces the error. Nobody tells the network <em>how</em> to solve the problem. It finds its own way downhill.</p>
<h2>Software 2.0</h2>
<p>A few months after the tweet, Karpathy expanded the idea in an essay called <strong>Software 2.0</strong>. His argument went like this:</p>
<ul>
<li><strong>Software 1.0</strong> is the code we all know. A human writes explicit instructions: if this, do that; loop over these; call this function.</li>
<li><strong>Software 2.0</strong> is a neural network&#39;s weights. You don&#39;t write them. You collect a dataset, define what &quot;good&quot; looks like, and let gradient descent search for a program that does it.</li>
</ul>
<p>For many problems, Software 2.0 wins easily. Try writing rules by hand for recognising a cat in a photo: pointy ears, whiskers, fur... and then a cat sits in a strange pose, or the lighting is odd, and your rules fall apart. A trained network handles this far better than any handwritten code ever did.</p>
<p>He gave real examples: speech recognition, image recognition, and machine translation all moved from handwritten rules and features to trained networks, and got much better. Google Translate&#39;s switch to a neural system in 2016 is a famous case.</p>
<h2>What I loved about this idea</h2>
<p>It flips what programming means. Instead of writing the solution, you write down what a good solution looks like (the data, the goal, and how you&#39;ll measure success) and let the optimiser find the solution.</p>
<p>As someone who has spent years tuning parameters in physics code by hand, that framing really landed for me. The skill shifts from &quot;can you write the algorithm?&quot; to &quot;can you define the problem and evaluate the answer well?&quot;</p>
<h2>Now it writes the 1.0 code too</h2>
<p>Here is the twist: Software 2.0 now writes Software 1.0. Models trained with gradient descent generate ordinary Python, JavaScript, and SQL that humans can read and run.</p>
<p>Here&#39;s roughly how that happened:</p>
<p><strong>2021: GitHub Copilot.</strong> Built on OpenAI&#39;s Codex, a GPT model trained on public code. It sits in your editor and suggests the next line or a whole function as you type. GitHub&#39;s own experiment found developers completed a task about 55% faster with it.</p>
<p><strong>2022 to 2023: chat models.</strong> ChatGPT, then GPT-4 and Claude, could write, explain, and debug code from a plain-language description. DeepMind&#39;s AlphaCode showed models could compete in programming contests at roughly the level of an average human competitor.</p>
<p><strong>2024: whole projects.</strong> Models started editing entire codebases: reading many files, making changes across them, running tests, and fixing their own mistakes. On SWE-bench, which tests models on real GitHub issues, the best scores went from low single digits at the start of the year to solving around half the problems by the end.</p>
<p><strong>December 2024: o3.</strong> On 20 December, OpenAI announced o3, a model trained to reason step by step before answering. They reported:</p>
<ul>
<li>A <strong>Codeforces rating around 2727.</strong> Codeforces is a competitive programming site, and this rating would put it among the top couple of hundred human competitors in the world.</li>
<li><strong>71.7% on SWE-bench Verified.</strong></li>
</ul>
<p>It isn&#39;t publicly available yet, so these are OpenAI&#39;s own numbers. But even with some caution, the trend is hard to ignore.</p>
<h2>So is the tweet true?</h2>
<p>For contest problems and well-defined tasks with clear right answers: increasingly, yes.</p>
<p>For real software, it&#39;s more complicated. Most of the work in a real project isn&#39;t typing code. It&#39;s figuring out <em>what</em> to build, understanding messy and changing requirements, making trade-offs, knowing the context nobody wrote down, and being responsible when something breaks. Models are very fast and know a huge amount. People still bring judgement and ownership.</p>
<p>There are also real risks: code that looks right but has subtle bugs, security holes, or depends on libraries that don&#39;t exist. Reviewing AI code carefully is now a core skill.</p>
<h2>How I actually use it</h2>
<p>I let the model write the first draft, especially boilerplate, data cleaning scripts, and plotting code. Then I spend my time on the parts that matter: the design, the edge cases, testing, and checking whether it actually solves the problem.</p>
<p>My code has got better, not because I write more of it, but because I review more of it and think more about structure. In a way, I&#39;ve become a bit of a Software 2.0 programmer myself: my job is defining the goal clearly and judging the result.</p>
]]></content:encoded>
  </item>
  <item>
    <title>How Claude overtook GPT (where it matters)</title>
    <link>https://kaunteyacharya.com/notes/claude-overtook-gpt/</link>
    <guid isPermaLink="false">kaunteyacharya-note-claude-overtook-gpt</guid>
    <pubDate>Thu, 05 Dec 2024 03:30:00 GMT</pubDate>
    <description>ChatGPT is still the household name, but in coding and enterprise use, Anthropic's Claude has caught up and pulled ahead this year. Here is how that happened.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>If you ask most people which AI they use, the answer is still ChatGPT. It has the brand, the user numbers, and the head start. But in the places I care about most, which are coding, agents, and real work inside companies, the story of 2024 has been Claude.</p>
<p>I switched most of my own work to Claude this year, so I wanted to understand whether that was just me or a real shift. Here is the timeline, and what I think explains it.</p>
<h2>Quick background: who makes Claude?</h2>
<p>Claude is made by <strong>Anthropic</strong>, a company founded in 2021 by a group of former OpenAI researchers, including siblings Dario and Daniela Amodei. Their focus from the start was AI safety: how to build models that are helpful but also predictable and honest.</p>
<p>The first Claude came out in March 2023, a few months after ChatGPT. For most of 2023, Claude was &quot;the other one.&quot; It was good at long documents (Claude 2 could read around 100,000 tokens, roughly a full book, in one go), but GPT-4 was clearly ahead on most tasks.</p>
<h2>March 2024: the first crack</h2>
<p>In March, Anthropic released the <strong>Claude 3</strong> family in three sizes: Haiku (small and fast), Sonnet (balanced), and Opus (largest).</p>
<p>A few weeks later, Claude 3 Opus reached the top of the <strong>LMSYS Chatbot Arena</strong>. This is a public leaderboard where people type a prompt, get two answers from anonymous models, and vote for the better one. Thousands of blind votes add up to a ranking. It was the first time a GPT-4 model had lost the top spot.</p>
<p>It didn&#39;t stay there forever. OpenAI responded with updated models, and GPT-4o in May. But the point was made: GPT was beatable.</p>
<h2>June 2024: Claude 3.5 Sonnet</h2>
<p>This is when things really changed for developers. <strong>Claude 3.5 Sonnet</strong> was a mid-sized model, so faster and cheaper than Opus, but better than Opus at almost everything, especially code.</p>
<p>What people around me noticed:</p>
<ul>
<li><strong>It wrote cleaner code</strong> and changed only what you asked it to change.</li>
<li><strong>It followed instructions carefully,</strong> including long, detailed ones.</li>
<li><strong>It understood whole projects,</strong> not just one file at a time.</li>
</ul>
<p>Anthropic also launched <strong>Artifacts</strong> alongside it, where Claude shows generated code, documents, or small apps in a separate panel next to the chat. You could ask for a small web tool and actually use it right there. It sounds like a small UI change, but it made Claude feel like a workspace instead of a chatbot.</p>
<p>Around the same time, AI code editors like Cursor took off among developers, and Claude 3.5 Sonnet became the model most people picked inside them. For a lot of programmers, their main daily AI tool quietly became Claude, even if they never opened claude.ai.</p>
<h2>October 2024: agents and computer use</h2>
<p>In October, Anthropic released an <strong>upgraded Claude 3.5 Sonnet</strong>. The headline number was on <strong>SWE-bench Verified</strong>, a benchmark that gives the model real GitHub issues from real open-source projects and checks whether its fix actually passes the tests. Its score jumped from <strong>33.4% to 49.0%</strong>, the best published result at the time.</p>
<p>The same release introduced <strong>computer use</strong>: Claude can look at screenshots of a computer, move the mouse, click, and type, like a person would. It is slow and clunky, and Anthropic called it experimental. But it&#39;s the clearest sign yet of where things are heading: from AI that <em>answers</em> to AI that <em>does</em>.</p>
<p>And just last week, Anthropic released the <strong>Model Context Protocol (MCP)</strong>, an open standard for connecting AI models to tools and data sources (files, databases, apps) in a consistent way. I think this will matter a lot for agents.</p>
<p>What I found most interesting is that all of these are skills you need for <strong>agents</strong>, not just chat: working through long multi-step tasks, using tools correctly, and not breaking things along the way. Anthropic seems to be betting on that future, and so far the bet is paying off.</p>
<h2>The numbers</h2>
<p>According to Menlo Ventures&#39; report on enterprise AI, published in November 2024:</p>
<table>
<thead>
<tr>
<th></th>
<th>2023</th>
<th>2024</th>
</tr>
</thead>
<tbody><tr>
<td>OpenAI&#39;s share of enterprise LLM use</td>
<td>50%</td>
<td>34%</td>
</tr>
<tr>
<td>Anthropic&#39;s share</td>
<td>12%</td>
<td>24%</td>
</tr>
</tbody></table>
<p>OpenAI is still ahead overall, but in one year Anthropic doubled its share while OpenAI lost about a third of its own. The same report lists code generation as one of the biggest use cases in companies, which lines up with where Claude is strongest. Amazon also announced another 4 billion USD investment in Anthropic last month, bringing its total to 8 billion USD.</p>
<h2>Why I think it happened</h2>
<p><strong>1. Coding first.</strong> Developers are the earliest adopters and the most demanding users. They pick whatever saves them the most time, and they tell each other. Winning developers means winning the tools built for them.</p>
<p><strong>2. Reliability over flash.</strong> For businesses, a model that follows instructions, stays on task, and admits uncertainty is worth more than one that impresses in a demo. Claude&#39;s style tends to be careful and direct, which fits real work.</p>
<p><strong>3. Long context.</strong> Claude 3 models can read 200,000 tokens at once. Being able to load a whole codebase or a long contract in a single request matters a lot in practice.</p>
<p><strong>4. Thoughtful product choices.</strong> Artifacts, Projects (shared knowledge for a set of chats), computer use, and MCP all point the same direction: making the model useful inside real workflows.</p>
<h2>To be precise</h2>
<p>&quot;Overtook&quot; here means in <strong>coding, developer preference, and enterprise momentum</strong>. ChatGPT is still far bigger with everyday users, with hundreds of millions using it every week. And OpenAI&#39;s <strong>o1</strong> models, released in September, are very strong at maths and reasoning by &quot;thinking&quot; longer before they answer.</p>
<p>This race changes every few months, and I wouldn&#39;t bet on any lead being permanent. But it has been fun to watch the default choice stop being automatic.</p>
]]></content:encoded>
  </item>
  <item>
    <title>The maths and physics hiding inside LLMs</title>
    <link>https://kaunteyacharya.com/notes/maths-physics-inside-llms/</link>
    <guid isPermaLink="false">kaunteyacharya-note-maths-physics-inside-llms</guid>
    <pubDate>Mon, 14 Oct 2024 03:30:00 GMT</pubDate>
    <description>Like many others, I was surprised the physics Nobel went to Geoffrey Hinton. So I went looking for the physics and maths inside large language models.</description>
    <category>AI</category>
    <category>maths</category>
    <content:encoded><![CDATA[<p>On 8 October, the 2024 Nobel Prize in Physics went to John Hopfield and Geoffrey Hinton &quot;for foundational discoveries and inventions that enable machine learning with artificial neural networks.&quot;</p>
<p>Just like many others, I was surprised the Nobel for physics went to Geoffrey Hinton. My first reaction was: isn&#39;t this computer science? But then I tried to understand what physics and maths go behind LLMs, to see why the committee made this choice. This note is what I found. I&#39;ve tried to keep it readable even if you haven&#39;t touched an equation in years.</p>
<h2>Why physics, at all?</h2>
<p>The answer starts in the 1980s.</p>
<p><strong>Hopfield networks (1982).</strong> John Hopfield built a network that stores memories the way a physical system settles into a stable state. He borrowed the idea of <strong>energy</strong> from physics, specifically from models of magnets where tiny atomic spins point up or down and try to line up with their neighbours. Each stored memory is a valley in an energy landscape. Show the network a noisy or partial pattern, and it rolls downhill to the nearest valley, recovering the full memory. It&#39;s like recognising a friend&#39;s face from a blurry photo.</p>
<p><strong>Boltzmann machines (1985).</strong> Hinton and colleagues took this further using <strong>statistical mechanics</strong>, the physics of systems with huge numbers of particles where we deal in probabilities, not certainties. A Boltzmann machine learns by adjusting itself until the patterns it generates match the probabilities of patterns in the data. Its name comes from Ludwig Boltzmann, and the core formula is lifted straight from thermodynamics.</p>
<p>So neural networks didn&#39;t just borrow a few physics words. Their foundations were built with physics tools. Modern LLMs are much bigger and quite different, but a lot of that DNA is still there.</p>
<h2>Step 1: words become vectors (linear algebra)</h2>
<p>A model can&#39;t read words directly. Text is split into <strong>tokens</strong> (words or pieces of words), and each token is turned into a <strong>vector</strong>: a long list of numbers, often thousands long.</p>
<p>You can picture each vector as an arrow in a space with thousands of dimensions. Words with similar meanings end up pointing in similar directions. &quot;King&quot; and &quot;queen&quot; sit close together; &quot;king&quot; and &quot;banana&quot; do not.</p>
<p>From then on, almost everything the model does is <strong>matrix multiplication</strong>: taking those vectors and transforming them, layer after layer. A large language model is, at its heart, an enormous amount of linear algebra running on GPUs.</p>
<h2>Step 2: attention, or &quot;which words matter here?&quot;</h2>
<p>The key idea in transformers is <strong>attention</strong>. For every token, the model asks: which other tokens in this text should I pay attention to?</p>
<p>It does this by creating three versions of each token&#39;s vector, called a query ($Q$), a key ($K$), and a value ($V$). Roughly:</p>
<ul>
<li>the <strong>query</strong> is &quot;what am I looking for?&quot;</li>
<li>the <strong>key</strong> is &quot;what do I contain?&quot;</li>
<li>the <strong>value</strong> is &quot;what information do I pass on?&quot;</li>
</ul>
<p>The model compares each query with every key using a <strong>dot product</strong>, which measures how much two vectors point the same way. High overlap means &quot;pay attention.&quot; Written compactly:</p>
<p>$$\mathrm{Attention}(Q,K,V) = \mathrm{softmax}\big(QK^\top / \sqrt{d}\big)\, V$$</p>
<p>If you&#39;ve done quantum mechanics, a dot product as &quot;how much do these two states overlap&quot; will feel very familiar. The $\sqrt{d}$ just keeps numbers from growing too large when vectors are long.</p>
<h2>Step 3: softmax is the Boltzmann distribution</h2>
<p>This is the one I loved most.</p>
<p>At the end of each step, the model gives every possible next token a score $z_i$. To turn scores into probabilities, it uses <strong>softmax</strong>:</p>
<p>$$p_i = \frac{e^{z_i/T}}{\sum_j e^{z_j/T}}$$</p>
<p>Now compare that with the <strong>Boltzmann distribution</strong> from statistical mechanics, which gives the probability of a system being in a state with energy $E_i$ at temperature $T$:</p>
<p>$$p_i = \frac{e^{-E_i/k_B T}}{\sum_j e^{-E_j/k_B T}}$$</p>
<p>It&#39;s the same formula, with score playing the role of negative energy. And the &quot;temperature&quot; setting you see in AI tools behaves exactly like physical temperature:</p>
<ul>
<li><strong>Low temperature:</strong> a cold system sits in its lowest-energy state. The model almost always picks its top choice. Answers are safe and repetitive.</li>
<li><strong>High temperature:</strong> a hot system jumps between many states. The model explores less likely words. Answers become creative, and eventually nonsense.</li>
</ul>
<p>Seeing a formula from my thermodynamics classes sitting at the heart of ChatGPT made the Nobel make a lot more sense to me.</p>
<h2>Step 4: measuring mistakes (information theory)</h2>
<p>During training, the model reads real text and tries to predict each next token. To measure how wrong it is, we use <strong>cross-entropy loss</strong>, which basically measures how <em>surprised</em> the model is by the actual word:</p>
<p>$$L = -\log p_{\text{correct}}$$</p>
<p>If the model gave the right word a probability close to 1, the loss is near 0. If it gave it a tiny probability, the loss is large. This comes from Claude Shannon&#39;s information theory, and Shannon&#39;s entropy is a close cousin of entropy in thermodynamics. Training is, in a sense, making the model less and less surprised by human language.</p>
<h2>Step 5: learning by rolling downhill (calculus)</h2>
<p>So how does the model actually improve? Through <strong>gradient descent</strong>.</p>
<p>Imagine standing on a hilly landscape in thick fog, trying to reach the lowest valley. You can&#39;t see far, but you can feel the slope under your feet. So you take a small step downhill, then check again, over and over. That&#39;s gradient descent. The landscape is the loss, and your position is the setting of all the model&#39;s parameters $\theta$:</p>
<p>$$\theta_{\text{new}} = \theta_{\text{old}} - \eta \, \nabla L$$</p>
<p>Here $\nabla L$ is the slope (the gradient) and $\eta$ is the step size.</p>
<p>The hard part is computing that slope for billions of parameters at once. The method for it, <strong>backpropagation</strong>, is really just the chain rule from school calculus, applied carefully backwards through every layer. Hinton was one of the people who popularised it in a famous 1986 paper. Modern optimisers like <strong>Adam</strong> add momentum, a bit like a ball rolling downhill that remembers which way it was going and doesn&#39;t stop at every small bump.</p>
<h2>Step 6: rotations that encode word order</h2>
<p>Attention on its own doesn&#39;t know word order. &quot;Dog bites man&quot; and &quot;man bites dog&quot; would look the same. Many modern models fix this with <strong>rotary position embeddings (RoPE)</strong>: each token&#39;s vector is rotated by an angle that depends on its position in the text.</p>
<p>When two rotated vectors are compared, the result depends on the <em>difference</em> in their angles, which means relative position comes out naturally. It&#39;s the same maths as rotating an arrow in a plane, or the phase of a wave. Physicists use this trick all the time with complex numbers.</p>
<h2>Step 7: diffusion and thermodynamics</h2>
<p>Image generators like Stable Diffusion use a different kind of model called <strong>diffusion models</strong>. The idea was inspired by <strong>non-equilibrium thermodynamics</strong>: take an image, slowly add noise until it becomes pure static (like ink spreading in water), then train a network to reverse the process step by step. To generate something new, start from random noise and &quot;un-diffuse&quot; it into a picture.</p>
<p>I honestly don&#39;t understand this part in much detail. The general picture makes sense to me, but the full mathematics of how the reverse process is learned is something I still need to sit down and work through properly. It isn&#39;t central to how text LLMs work, but it&#39;s another place where physics thinking shaped modern AI.</p>
<h2>Step 8: scaling laws look like physics</h2>
<p>What I found most interesting of all: when researchers plotted how a model&#39;s loss changes as you add more parameters, data, and compute, they got smooth <strong>power laws</strong>, straight lines on a log-log plot.</p>
<p>$$L(N) \propto N^{-\alpha}$$</p>
<p>Power laws show up all over physics: in phase transitions, turbulence, and earthquake sizes. Seeing one describe how an AI model improves felt strangely familiar. It also changed how labs work. Research from DeepMind in 2022 (the &quot;Chinchilla&quot; paper) used this kind of analysis to show many models were too big for the data they were trained on, and that you should scale data and model size together.</p>
<p>To me, this is the most &quot;physics&quot; part of modern AI: treat a complex system you can&#39;t fully explain, measure it carefully, and find the simple law hiding underneath.</p>
<h2>So, was it a physics prize?</h2>
<p>After going through all this, I think yes, in spirit. The early neural networks were built from statistical physics ideas, and modern LLMs still run on Boltzmann&#39;s formula, energy landscapes, information theory, and power laws.</p>
<p>LLMs aren&#39;t &quot;just physics.&quot; But the toolbox overlaps far more than I expected, and it makes me feel a little less like I&#39;m changing fields and more like I&#39;m applying the same thinking somewhere new.</p>
]]></content:encoded>
  </item>
  <item>
    <title>My quickest paper, and an unexpected collaboration</title>
    <link>https://kaunteyacharya.com/notes/jmn-magnetic-field/</link>
    <guid isPermaLink="false">kaunteyacharya-note-jmn-magnetic-field</guid>
    <pubDate>Thu, 12 Oct 2023 03:30:00 GMT</pubDate>
    <description>How a comment in a research meeting turned into a paper with Mustapha Azreg-Aïnou in about six weeks.</description>
    <category>physics</category>
    <content:encoded><![CDATA[<p>Some projects take a year. This one took about six weeks, and it wasn&#39;t even the problem I was supposed to be working on.</p>
<h2>The object</h2>
<p>In general relativity, a very heavy star that collapses under its own gravity usually forms a black hole, with an event horizon that hides everything inside. But some theoretical models, such as the <strong>JMN-1 spacetime</strong>, end in a <strong>naked singularity</strong> instead: an extremely dense core without a horizon. Studying what happens around such objects helps us ask whether everything we call a &quot;black hole&quot; really is one.</p>
<p>Real objects in space are rarely alone; they usually sit in magnetic fields. Those fields shape how charged particles move, and they play a big role in things we can actually observe, such as jets and bright glowing matter near the centre.</p>
<h2>How it started</h2>
<p>I was working on a different topic. In one of our research meetings, someone pointed out that the way I had defined the magnetic field around JMN-1 might have a flaw. That comment stuck with me, so I started digging.</p>
<p>Searching around, I found a paper by <strong>Mustapha Azreg-Aïnou</strong> that described a cleaner way to set up magnetic fields in this kind of spacetime. I used his method and managed to solve the first part of the problem myself. Then I did something I wasn&#39;t sure I should do: I emailed him, asked him to check whether my approach was right, and asked for his insight on a part involving <strong>Legendre polynomials</strong> (a family of functions that show up whenever you describe how something varies with angle around a sphere).</p>
<p>He replied, we started talking, and together we solved the problem in about <strong>three weeks</strong>. Within <strong>six weeks</strong> we had a draft ready for arXiv. It is probably the quickest project I have worked on.</p>
<h2>What we found</h2>
<p>In simple terms: JMN-1 is built by matching a region filled with matter to the empty space outside it. We found that part of the magnetic field jumps suddenly at that boundary, which means an electric current has to flow along the surface there. Yet when we looked at charged particles colliding near the boundary, the collision energy stayed smooth across it.</p>
<p>The paper was later published as <a href="https://link.springer.com/article/10.1140/epjc/s10052-024-12905-4" target="_blank" rel="noopener noreferrer">JMN-1 singularity in weak magnetic field</a> in the European Physical Journal C. The preprint is on <a href="https://arxiv.org/abs/2310.08022" target="_blank" rel="noopener noreferrer">arXiv</a>.</p>
<p>The lesson I took from it: a critical comment is a gift, and a polite cold email to someone whose work you admire can go much further than you expect.</p>
]]></content:encoded>
  </item>
  <item>
    <title>GPT: the model that started it all</title>
    <link>https://kaunteyacharya.com/notes/gpt-origins/</link>
    <guid isPermaLink="false">kaunteyacharya-note-gpt-origins</guid>
    <pubDate>Wed, 29 Mar 2023 03:30:00 GMT</pubDate>
    <description>With GPT-4 out, I went back to where the GPT series began. The surprising part is how simple the core idea is, and how far scaling it went.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>GPT-4 came out on 14 March, and after a few weeks of using it I got curious about how we got here. ChatGPT made the world notice, but the story starts years earlier. So I went back and read through the GPT papers one by one. Here is the history as I understand it, in plain terms.</p>
<h2>First, what does &quot;GPT&quot; mean?</h2>
<p><strong>Generative Pre-trained Transformer.</strong> Each word tells you something:</p>
<ul>
<li><strong>Generative:</strong> it produces text, one piece at a time.</li>
<li><strong>Pre-trained:</strong> it first learns from a huge amount of general text before being used for anything specific.</li>
<li><strong>Transformer:</strong> the type of neural network underneath.</li>
</ul>
<p>The transformer came from a 2017 Google paper called <em>Attention Is All You Need</em>. Its key idea, <strong>attention</strong>, lets every word in a sentence look at every other word and decide which ones matter for understanding it. In &quot;The cat sat on the mat because it was tired,&quot; attention is what helps the model link &quot;it&quot; to &quot;the cat.&quot; Older models read text strictly left to right and struggled with long-range connections like this. Transformers handle them well and can be trained in parallel on GPUs, which turns out to matter a lot.</p>
<h2>GPT-1 (June 2018): pretrain, then adapt</h2>
<p>OpenAI&#39;s first GPT paper was titled <em>Improving Language Understanding by Generative Pre-Training</em>. Back then, the usual approach was to build a separate model for each task (one for sentiment, one for question answering) trained on labelled data, which is expensive to collect.</p>
<p>GPT-1 proposed a two-step recipe:</p>
<ol>
<li><strong>Pretrain</strong> a transformer on lots of unlabelled text with one job: predict the next word. They used a dataset of around 7,000 unpublished books.</li>
<li><strong>Fine-tune</strong> it on a small labelled dataset for each specific task.</li>
</ol>
<p>The model had about <strong>117 million parameters</strong> (the adjustable numbers it learns). Tiny by today&#39;s standards. But the lesson was big: a model that learns general language first needs much less task-specific data later. That &quot;pretrain first, adapt later&quot; idea became the template for almost everything that followed.</p>
<h2>GPT-2 (February 2019): &quot;too dangerous to release&quot;</h2>
<p>GPT-2 kept the same idea and scaled it up: <strong>1.5 billion parameters</strong>, trained on about 40 GB of web text (pages linked from Reddit posts with some upvotes, a clever way to filter for quality).</p>
<p>Two things stood out:</p>
<ul>
<li><strong>It wrote coherent text.</strong> Give it a fake news opening, and it would continue with paragraphs that sounded plausible.</li>
<li><strong>It could do tasks without fine-tuning.</strong> Ask it to translate or summarise with the right prompt, and it would try, even though nobody trained it for that specifically.</li>
</ul>
<p>OpenAI initially released only smaller versions, worried about misuse like spam and fake news, and released the full model in stages through the year. Some people called it hype. Looking back, it was the first time a language model became a public debate, not just a research result.</p>
<h2>GPT-3 (2020): learning from the prompt</h2>
<p>GPT-3 jumped to <strong>175 billion parameters</strong>, trained on hundreds of billions of words from the web, books, and Wikipedia. The paper&#39;s title says it all: <em>Language Models are Few-Shot Learners.</em></p>
<p>What I found most interesting here is <strong>in-context learning</strong>. You could write a few examples directly in the prompt:</p>
<pre><code>sea otter =&gt; loutre de mer
cheese =&gt; fromage
peppermint =&gt;
</code></pre>
<p>and GPT-3 would continue with &quot;menthe poivrée.&quot; No retraining, no new data. It figured out the task from the pattern in the prompt. Nobody explicitly designed this ability. It appeared as the model got bigger, and it was weak or absent in the smaller versions.</p>
<p>GPT-3 was offered through an API, and a lot of early AI startups were built on it. A version fine-tuned on code, called Codex, became the engine behind GitHub Copilot.</p>
<h2>The missing step: making it helpful (2022)</h2>
<p>Raw GPT-3 was powerful but awkward. It would continue your text rather than follow your instructions. In early 2022, OpenAI published <strong>InstructGPT</strong>, trained with human feedback to follow instructions. A striking result from that paper: people preferred answers from a 1.3 billion parameter InstructGPT model over the original 175 billion parameter GPT-3. Size isn&#39;t everything; alignment with what people actually want matters a lot.</p>
<p>That same recipe, applied to a GPT-3.5 model with a chat interface, became ChatGPT in November 2022.</p>
<h2>GPT-4 (March 2023): more reliable, and it can see</h2>
<p>GPT-4 brings two big changes:</p>
<ul>
<li><strong>Much stronger reasoning.</strong> OpenAI reports it scores around the top 10% of test takers on a simulated bar exam, where GPT-3.5 was around the bottom 10%.</li>
<li><strong>Image input.</strong> It can take a picture along with text, such as a chart, a photo, or a hand-drawn sketch, and reason about it. This isn&#39;t widely available yet, but the demos are impressive.</li>
</ul>
<p>It is also better at following instructions and less likely to make things up, though it still does. It can handle much longer inputs too, up to around 32,000 tokens in one version.</p>
<p>Something new this time: OpenAI&#39;s technical report doesn&#39;t reveal the model&#39;s size, data, or training methods, citing competition and safety. That alone tells you how much the field has changed since 2018, when the whole recipe was in the paper.</p>
<h2>The real story is scaling</h2>
<p>The training objective barely changed from GPT-1 to GPT-4: predict the next token. What changed was the amount of data, the number of parameters, and the compute behind it.</p>
<table>
<thead>
<tr>
<th>Model</th>
<th>Year</th>
<th>Parameters</th>
</tr>
</thead>
<tbody><tr>
<td>GPT-1</td>
<td>2018</td>
<td>117 million</td>
</tr>
<tr>
<td>GPT-2</td>
<td>2019</td>
<td>1.5 billion</td>
</tr>
<tr>
<td>GPT-3</td>
<td>2020</td>
<td>175 billion</td>
</tr>
<tr>
<td>GPT-4</td>
<td>2023</td>
<td>not disclosed</td>
</tr>
</tbody></table>
<p>In 2020, OpenAI researchers also published <strong>scaling laws</strong>: the model&#39;s error drops smoothly and predictably as you increase model size, data, and compute. That gave labs the confidence to spend huge amounts on training bigger models.</p>
<p>As a physicist, I find this surprising. You&#39;d expect such a simple objective to hit a wall. Instead, new abilities keep showing up as the scale grows. I loved going back through these papers because each one looks modest on its own, and only together do you see the curve.</p>
<p>It makes me want to understand <em>why</em> it works, not just that it does.</p>
]]></content:encoded>
  </item>
  <item>
    <title>ChatGPT: the interface that changed everything</title>
    <link>https://kaunteyacharya.com/notes/chatgpt-interface/</link>
    <guid isPermaLink="false">kaunteyacharya-note-chatgpt-interface</guid>
    <pubDate>Wed, 14 Dec 2022 03:30:00 GMT</pubDate>
    <description>ChatGPT is two weeks old and everyone around me is talking to it. The model behind it is not brand new. The way we get to use it is.</description>
    <category>AI</category>
    <content:encoded><![CDATA[<p>OpenAI released ChatGPT on 30 November as a free &quot;research preview.&quot; Two weeks later, it has taken over every conversation I have, in research circles and outside them. Sam Altman posted that it crossed a million users in about five days. I can&#39;t think of any piece of software that spread this fast.</p>
<p>I&#39;ve been playing with it a lot, so here is my attempt to explain what it is, why it suddenly feels so different, and where it still falls short.</p>
<h2>What is it, in plain words?</h2>
<p>At its core, ChatGPT is a <strong>language model</strong>: a program trained to predict the next word in a piece of text. Give it &quot;The capital of France is&quot; and it predicts &quot;Paris.&quot; Do this one word at a time, feeding each prediction back in, and you get whole paragraphs, essays, or code.</p>
<p>That sounds too simple to be useful, but to predict the next word <em>well</em> across millions of documents, a model has to pick up grammar, facts, styles of writing, and even some reasoning patterns. All of that gets stored in the model&#39;s parameters, which are billions of numbers adjusted during training.</p>
<p>ChatGPT is built on a model from OpenAI&#39;s <strong>GPT-3.5</strong> series. So the raw ability isn&#39;t new. GPT-3 has been around since 2020, and developers have been building on it through OpenAI&#39;s API.</p>
<h2>So what changed?</h2>
<p>Two things: how the model was <strong>tuned</strong>, and how it is <strong>presented</strong>.</p>
<h3>1. It was trained to be an assistant</h3>
<p>A raw language model is not trying to help you. It just continues text. Ask it a question, and it might answer, or it might write five more questions, because that&#39;s what often follows a question on the internet.</p>
<p>To fix this, OpenAI used a method called <strong>reinforcement learning from human feedback (RLHF)</strong>. Their blog post describes three steps:</p>
<ol>
<li><strong>Show it good examples.</strong> Human trainers wrote conversations, playing both the user and the assistant. The model was fine-tuned on these to learn the format of being helpful.</li>
<li><strong>Teach it what &quot;better&quot; means.</strong> The model wrote several answers to the same prompt, and trainers ranked them from best to worst. A separate <strong>reward model</strong> learned to predict those rankings.</li>
<li><strong>Practise against the judge.</strong> The language model was then trained with reinforcement learning to produce answers the reward model scores highly.</li>
</ol>
<p>Think of it like training a new employee: first you show them examples of good work, then you give feedback on their drafts, and they slowly learn your taste. The same team used this approach earlier this year for InstructGPT.</p>
<p>The result is a model that answers the question you asked, admits mistakes when you point them out, pushes back on false assumptions, and declines some harmful requests. None of that is perfect, but it changes the experience completely.</p>
<h3>2. It&#39;s a chat box</h3>
<p>This is the part I find most interesting. Before ChatGPT, using GPT-3 meant an API key, a &quot;playground&quot; with sliders for things like temperature, and carefully engineered prompts. Now it&#39;s a text box. You type like you&#39;d text a friend, and it remembers what you said earlier in the conversation, so you can say &quot;make it shorter&quot; or &quot;now explain it to a 10-year-old.&quot;</p>
<p>It reminds me of how the web browser didn&#39;t invent the internet but made it usable for everyone. The technology was there. The interface let normal people in.</p>
<h2>What I&#39;ve noticed so far</h2>
<p><strong>Where it shines:</strong></p>
<ul>
<li>Explaining concepts. I asked it about the Penrose process and frame dragging, and the explanations were surprisingly clear for a first pass.</li>
<li>Small coding tasks. Little Python scripts and plotting code often run on the first try.</li>
<li>Rewriting and summarising. Emails, abstracts, and making messy notes readable.</li>
</ul>
<p><strong>Where it worries me:</strong></p>
<ul>
<li><strong>It is confidently wrong.</strong> It can invent references that don&#39;t exist or get maths subtly wrong, and it sounds exactly as sure when it&#39;s wrong as when it&#39;s right. OpenAI says this openly in their own list of limitations.</li>
<li><strong>It depends on phrasing.</strong> Ask the same question two ways and you can get two different answers.</li>
<li><strong>It doesn&#39;t know recent events.</strong> Its training data stops in 2021.</li>
<li><strong>It&#39;s already causing problems.</strong> Stack Overflow temporarily banned answers generated by ChatGPT a few days ago, because so many plausible but wrong answers were being posted.</li>
</ul>
<p>My rule for now: treat it like a very well-read friend who sometimes bluffs. Useful for a first draft or explanation, never the final word.</p>
<h2>Why I think this matters</h2>
<p>For the first time, talking to a computer in plain language feels normal. My guess is that every big tech company will want its own version within months, and new kinds of work will appear around checking, evaluating, and building on top of these models.</p>
<p>I don&#39;t think we go back from here.</p>
]]></content:encoded>
  </item>
  <item>
    <title>Where machine learning meets black hole energy extraction</title>
    <link>https://kaunteyacharya.com/notes/ml-black-hole-energy-extraction/</link>
    <guid isPermaLink="false">kaunteyacharya-note-ml-black-hole-energy-extraction</guid>
    <pubDate>Wed, 19 Oct 2022 03:30:00 GMT</pubDate>
    <description>Machine learning doesn't calculate the Penrose process for us, but it is quietly becoming essential to everything around it.</description>
    <category>physics</category>
    <category>AI</category>
    <content:encoded><![CDATA[<p>Most of my research time goes into one question: how much energy can you pull out of a spinning black hole (or something that only looks like one)? That is pen-and-paper work plus a lot of numerical code. Lately I keep wondering where machine learning fits into this, so here are my notes on it.</p>
<h2>First, an honest answer</h2>
<p>Machine learning is not calculating energy extraction for anyone. The Penrose process, the magnetic Penrose process, and the efficiency numbers we publish all still come from solving equations in a known spacetime. What ML is doing is helping with the hard parts <em>around</em> that calculation, and that turns out to matter a lot.</p>
<h2>1. Measuring spin, the energy source</h2>
<p>Every energy extraction mechanism feeds on the black hole&#39;s spin. No spin, no ergoregion, no Penrose process. So the most important number is also one of the hardest to measure.</p>
<p>What I found most interesting is a 2020 paper called <strong>Deep Horizon</strong>. The authors trained neural networks on around 100,000 simulated images of black holes surrounded by glowing plasma. The networks then learned to read off the mass, the accretion rate, the viewing angle, and even classify the spin from a single image, with uncertainty estimates attached.</p>
<p>With the Event Horizon Telescope images of M87* (2019) and now Sgr A* (May 2022), this suddenly feels very real. A network that can look at a shadow and say &quot;this one is spinning fast&quot; is directly useful for asking how much energy could be extracted from it.</p>
<h2>2. Making simulations cheaper</h2>
<p>The realistic version of energy extraction involves magnetised plasma swirling around the black hole, which needs huge general relativistic magnetohydrodynamics (GRMHD) simulations. A single run can take enormous amounts of computing time.</p>
<p>Here ML can act as an <strong>emulator</strong>: train a network on a set of expensive simulations, and it learns to predict the outcome for new parameters almost instantly. That means you can explore far more combinations of spin, magnetic field, and accretion than brute force would ever allow.</p>
<h2>3. Solving the equations themselves</h2>
<p><strong>Physics-informed neural networks</strong> (PINNs) take a different route. Instead of learning only from data, the network is trained so that its output satisfies the governing equations directly. People have started using this idea for problems in general relativity, including solving for spacetime geometries. It is still early, but I love the idea of the physics living inside the loss function.</p>
<h2>Where I see it helping my own work</h2>
<p>In my papers, a big chunk of the effort is scanning parameter space: how does the efficiency change as spin, charge, magnetic field, or a deformation parameter changes? Right now that is careful grids and a lot of plots. A model that learns the efficiency surface, or flags the interesting regions to look at more closely, could save weeks.</p>
<p>My feeling is that the physics will stay the core, and machine learning will become the tool that helps us measure, simulate, and search faster. I want to learn it properly.</p>
]]></content:encoded>
  </item>
  <item>
    <title>My first paper: stealing energy from spinning black holes</title>
    <link>https://kaunteyacharya.com/notes/first-paper-penrose/</link>
    <guid isPermaLink="false">kaunteyacharya-note-first-paper-penrose</guid>
    <pubDate>Thu, 02 Jun 2022 03:30:00 GMT</pubDate>
    <description>The Penrose process in plain words, and what my first paper asked about black hole look-alikes.</description>
    <category>physics</category>
    <content:encoded><![CDATA[<p>This was my first paper, and I still remember how exciting it was to see it go up on <a href="https://arxiv.org/abs/2206.00428" target="_blank" rel="noopener noreferrer">arXiv</a>. It was later published in <a href="https://doi.org/10.3390/universe8110571" target="_blank" rel="noopener noreferrer">Universe</a>, with Vishva Patel, Parth Bambhaniya, and Prof. Pankaj S. Joshi.</p>
<h2>The Penrose process, simply</h2>
<p>A spinning black hole drags space around with it. Just outside the horizon there is a region, called the <strong>ergoregion</strong>, where this dragging is so strong that nothing can stay still; everything is forced to rotate with the black hole.</p>
<p>In 1969, Roger Penrose noticed something surprising. Imagine throwing a rock into the ergoregion, and the rock splits in two. One piece falls into the black hole in a special way that effectively carries <em>negative</em> energy. The other piece flies back out carrying <em>more</em> energy than the original rock had. The extra energy comes from the black hole&#39;s spin, which slows down a tiny bit. You have taken energy out of a black hole.</p>
<h2>Why it still matters</h2>
<p>The original idea is not very efficient, but its descendants are central to black hole astrophysics:</p>
<ul>
<li>The <strong>magnetic Penrose process</strong> adds magnetic fields and can be far more efficient. It is one way to explain how black holes power extremely energetic particles.</li>
<li>The <strong>Blandford-Znajek mechanism</strong>, an electromagnetic cousin of the same idea, is a leading explanation for the huge jets we see shooting out of galaxies with spinning black holes at their centres.</li>
<li>The <strong>collisional Penrose process</strong> looks at particles smashing together near a black hole, which can reach very high energies.</li>
</ul>
<h2>What we asked</h2>
<p>Some theorists have proposed objects that look almost exactly like spinning (Kerr) black holes from the outside, but avoid the infinitely dense point at the centre. We call them <strong>black hole mimickers</strong>. We asked: if you run the Penrose process around them, does anything change?</p>
<p>For one family (Simpson-Visser spacetimes), the answer was no: the efficiency matched a normal Kerr black hole. For another family (conformally transformed spacetimes), the efficiency was clearly higher. That difference could, in principle, help tell a mimicker apart from a real black hole.</p>
<p>Looking back, this paper taught me how research actually works: a lot of patient calculation, a lot of plots that don&#39;t work the first time, and the quiet joy when they finally do.</p>
]]></content:encoded>
  </item>
  <item>
    <title>My MSc thesis: following light and matter around black holes</title>
    <link>https://kaunteyacharya.com/notes/msc-thesis/</link>
    <guid isPermaLink="false">kaunteyacharya-note-msc-thesis</guid>
    <pubDate>Thu, 21 Apr 2022 03:30:00 GMT</pubDate>
    <description>Five months of learning how light and particles move around black holes, naked singularities, and wormholes.</description>
    <category>physics</category>
    <content:encoded><![CDATA[<p>I have just wrapped up my MSc thesis, <a href="https://github.com/KaunteyAcharya/MSc-Thesis-Behavior-of-Null-and-Timelike-Geodesics-around-Black-Holes" target="_blank" rel="noopener noreferrer">Behavior of Null and Timelike Geodesics around Black Holes</a>. I had been working on it since December, and the whole idea for the thesis came from my MSc thesis supervisor. I am grateful for that, because it pulled me into the field I ended up doing research in.</p>
<h2>What the title means</h2>
<p>In general relativity, gravity isn&#39;t a force pulling on things; it is the shape of spacetime itself. Objects simply follow the straightest possible paths through that curved spacetime. Those paths are called <strong>geodesics</strong>.</p>
<ul>
<li><strong>Null geodesics</strong> are the paths of light.</li>
<li><strong>Timelike geodesics</strong> are the paths of anything with mass: particles, planets, or a spaceship.</li>
</ul>
<p>So the thesis was really about one question: how do light and matter move around very dense objects?</p>
<h2>What I learned about</h2>
<ul>
<li><strong>Black holes</strong>, both non-rotating (Schwarzschild) and spinning (Kerr), where I wrote Python notebooks to trace particle paths.</li>
<li><strong>Naked singularities</strong>, extremely dense objects without a horizon to hide them.</li>
<li><strong>Wormholes</strong>, including a metric proposed by Juan Maldacena and Alexey Milekhin in their paper on <a href="https://arxiv.org/abs/2008.06618" target="_blank" rel="noopener noreferrer">humanly traversable wormholes</a>. It was a thrill to work with a spacetime from a paper by one of the biggest names in theoretical physics.</li>
</ul>
<h2>Shadows and precession</h2>
<p>Two ideas from the thesis have stayed with me because they connect theory to things we can actually observe.</p>
<p><strong>Shadows.</strong> Light that passes close to a black hole can be bent, trapped, or swallowed. The result is a dark patch surrounded by a bright ring, which is exactly what the Event Horizon Telescope photographed. The size and shape of that shadow depend on what the central object really is, so a naked singularity or a wormhole could leave a different shadow from a black hole.</p>
<p><strong>Orbital precession.</strong> An orbit around a massive object doesn&#39;t close perfectly; the whole ellipse slowly rotates. Mercury does this around the Sun, and it was one of the first tests of Einstein&#39;s theory. Stars orbiting the centre of our galaxy do it too, and the amount of rotation depends on the geometry close to the central object.</p>
<p>Put together, shadows and precession give us a way to ask a deep question with real data: is the thing at the centre of our galaxy really a black hole, or something that only looks like one?</p>
<p>This thesis is where my research journey really started, and it led directly to my first paper a few weeks later.</p>
]]></content:encoded>
  </item>
</channel>
</rss>
