<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rithvik K on Medium]]></title>
        <description><![CDATA[Stories by Rithvik K on Medium]]></description>
        <link>https://medium.com/@rithvikbng?source=rss-a437e55472b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ksjQ6nKCHVr7VPx22VTesw.png</url>
            <title>Stories by Rithvik K on Medium</title>
            <link>https://medium.com/@rithvikbng?source=rss-a437e55472b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 21:59:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rithvikbng/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Giving AI Agents a Memory That Lives on the Device: Qdrant Edge]]></title>
            <link>https://medium.com/@rithvikbng/giving-ai-agents-a-memory-that-lives-on-the-device-qdrant-edge-b3f9b4a1eebc?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3f9b4a1eebc</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 13:49:15 GMT</pubDate>
            <atom:updated>2026-10-04T13:49:15.269Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ty4rbJ11OAQtAR5Vk8hdZQ.png" /></figure><p><em>How I built a hybrid-search, self-cleaning long-term memory for an AI agent that runs entirely inside the app process: no server, no network, about 150 lines of Python.</em></p><p>Every AI agent has the same embarrassing flaw: it forgets you the moment the session ends. You tell it you prefer concise answers, that your service is called ledgerly, that deploys go through staging first. Tomorrow it greets you like a stranger.</p><p>The usual fix is to bolt a vector database onto the agent. That works, but it drags in a server, a network hop on every turn, and a privacy question: your user’s memories now live on someone else’s machine.</p><p>In this post we build a different kind of agent memory, one that lives <strong>inside the agent process</strong> using <a href="https://qdrant.tech/documentation/edge/">Qdrant Edge</a>. By the end you will have:</p><ul><li>A memory store with episodic, semantic and procedural memories</li><li>Hybrid recall (dense embeddings + BM25) fused with Reciprocal Rank Fusion</li><li>Recency and importance weighting, so fresh and important memories win ties</li><li>Consolidation, where old conversations get compressed into durable facts</li><li>Forgetting, so the store does not grow forever</li><li>A drop-in agent loop that reads and writes memory every turn</li></ul><p>Every snippet below was run against qdrant-edge-py 0.8.0.</p><h3>What “memory” means for an agent</h3><p>An LLM’s context window is working memory: fast, small, and wiped at the end of each call. Long-term memory has to live outside the model, and cognitive science gives us a useful way to split it into three kinds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ST5ddBBCiA1tKpBPWnvBA.png" /></figure><p>The trick is that all three can live in <strong>one</strong> vector collection. A kind field in the payload tells them apart, and payload filters let us ask for one kind, two kinds, or everything. That design keeps the code small and lets a single hybrid query rank across all of them.</p><h3>Why Qdrant Edge instead of a vector server</h3><p>Qdrant Edge is the in-process flavour of Qdrant. There is no client and no server: you open a shard on local disk and call it like a library, the same way you would use SQLite. The Python package is qdrant-edge-py, and it imports as qdrant_edge.</p><p>For agent memory that brings four concrete wins:</p><ul><li><strong>Zero network latency.</strong> Recall runs on every single agent turn, so shaving a round trip off each one adds up fast.</li><li><strong>Offline by default.</strong> A coding agent on a laptop, a field-service app, or a desktop assistant keeps its memory on a plane.</li><li><strong>Privacy.</strong> A user’s memories never leave their device unless you choose to sync them.</li><li><strong>Real Qdrant features.</strong> You still get HNSW indexing, payload indexes, named dense and sparse vectors, prefetch plus fusion, and even a built-in BM25 encoder. Nothing here is a toy.</li></ul><pre>pip install qdrant-edge-py sentence-transformers</pre><p>When should you <em>not</em> use Edge? If many users or many agent instances must share one memory in real time, a Qdrant server or Qdrant Cloud is the better home. We will see later how the two can work together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJToyhw_yH28HNZ9VEV3-A.png" /></figure><h3>The architecture</h3><p>The whole system is one Python class, AgentMemory, wrapping one Edge shard on local disk. The agent loop calls it twice per turn: recall() before the LLM answers, and remember() after.</p><p>Each memory is stored as a single point with two named vectors and a payload:</p><ul><li>dense: a 384-dimension sentence embedding (all-MiniLM-L6-v2) that captures meaning</li><li>bm25: a sparse vector from Qdrant Edge&#39;s built-in BM25 encoder that captures exact words, such as project names, error codes and commands</li><li>payload: text, kind, user_id, importance, created_at and access_count</li></ul><p>Two background jobs keep the store healthy. <strong>Consolidation</strong> turns piles of old episodic memories into a few semantic facts. <strong>Forgetting</strong> deletes old, low-importance memories nobody needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBVlMbezqfIuIV-RoFGRA.png" /></figure><h3>Building it, step by step</h3><h3>Step 1: Create (or reopen) the shard</h3><p>The shard is a folder on disk. On first run we create it with a dense vector, a sparse BM25 vector with IDF weighting, and payload indexes on the fields we filter by. On later runs we simply load it.</p><pre>import time, uuid<br>from pathlib import Path<br>from sentence_transformers import SentenceTransformer<br>from qdrant_edge import (<br>    EdgeShard, EdgeConfig, EdgeVectorParams, EdgeSparseVectorParams, Distance, Modifier,<br>    Point, UpdateOperation, PayloadSchemaType, QueryRequest, Prefetch, Query, Fusion,<br>    Filter, FieldCondition, MatchValue, RangeFloat, ScrollRequest, CountRequest, Bm25,<br>)<br>DIM = 384<br>class AgentMemory:<br>    def __init__(self, path=&quot;./agent_memory&quot;):<br>        self.embedder = SentenceTransformer(&quot;all-MiniLM-L6-v2&quot;)<br>        self.bm25 = Bm25()  # built-in sparse encoder, no extra model<br>        config = EdgeConfig(<br>            vectors={&quot;dense&quot;: EdgeVectorParams(size=DIM, distance=Distance.Cosine)},<br>            sparse_vectors={&quot;bm25&quot;: EdgeSparseVectorParams(modifier=Modifier.Idf)},<br>        )<br>        if Path(path).exists():<br>            self.shard = EdgeShard.load(path)<br>        else:<br>            Path(path).mkdir(parents=True)  # create() needs the folder to exist<br>            self.shard = EdgeShard.create(path, config)<br>            for field, schema in [(&quot;kind&quot;, PayloadSchemaType.Keyword),<br>                                  (&quot;user_id&quot;, PayloadSchemaType.Keyword),<br>                                  (&quot;created_at&quot;, PayloadSchemaType.Float),<br>                                  (&quot;importance&quot;, PayloadSchemaType.Float)]:<br>                self.shard.update(UpdateOperation.create_field_index(field, schema))</pre><p>Two gotchas I hit: EdgeShard.create() fails if the folder does not exist yet, and Modifier.Idf matters, because without it BM25 scores ignore how rare a word is across your memories.</p><h3>Step 2: Write a memory</h3><p>Every memory gets both vectors at write time, plus a timestamp and an importance score between 0 and 1.</p><pre>def remember(self, text, kind=&quot;episodic&quot;, user_id=&quot;default&quot;, importance=0.5, **extra):<br>        point_id = str(uuid.uuid4())<br>        self.shard.update(UpdateOperation.upsert_points([<br>            Point(<br>                id=point_id,<br>                vector={<br>                    &quot;dense&quot;: self.embedder.encode(text, normalize_embeddings=True).tolist(),<br>                    &quot;bm25&quot;: self.bm25.embed_document(text),<br>                },<br>                payload={&quot;text&quot;: text, &quot;kind&quot;: kind, &quot;user_id&quot;: user_id,<br>                         &quot;importance&quot;: importance, &quot;created_at&quot;: time.time(),<br>                         &quot;access_count&quot;: 0, **extra},<br>            )<br>        ]))<br>        return point_id</pre><h3>Step 3: Hybrid recall with RRF</h3><p>This is the heart of the system. Dense search finds memories that <em>mean</em> the same thing (“ship the app” finds “deploy ledgerly”). BM25 finds memories with the <em>same words</em> (“ledgerly”, “ECONNREFUSED”). We run both as prefetches inside one query and let Reciprocal Rank Fusion merge the two ranked lists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCT8ay6baCuuCDWe0y6Oog.png" /></figure><pre>def _filter(self, user_id, kinds=None, since=None):<br>        must = [FieldCondition(key=&quot;user_id&quot;, match=MatchValue(value=user_id))]<br>        if since is not None:<br>            must.append(FieldCondition(key=&quot;created_at&quot;, range=RangeFloat(gte=since)))<br>        if kinds:<br>            return Filter(must=must, should=[<br>                FieldCondition(key=&quot;kind&quot;, match=MatchValue(value=k)) for k in kinds])<br>        return Filter(must=must)<br>def recall(self, query, user_id=&quot;default&quot;, k=5, kinds=None, since=None,<br>               half_life_days=14.0):<br>        flt = self._filter(user_id, kinds, since)<br>        dense_q = self.embedder.encode(query, normalize_embeddings=True).tolist()<br>        hits = self.shard.query(QueryRequest(<br>            prefetches=[<br>                Prefetch(query=Query.Nearest(dense_q, using=&quot;dense&quot;),<br>                         limit=k * 4, filter=flt),<br>                Prefetch(query=Query.Nearest(self.bm25.embed_query(query), using=&quot;bm25&quot;),<br>                         limit=k * 4, filter=flt),<br>            ],<br>            query=Fusion.Rrf(k=60),<br>            limit=k * 4,<br>            with_payload=True,<br>        ))</pre><p>Note that Fusion.Rrf must be instantiated with k; passing the bare class raises a type error. The filter is applied inside each prefetch, so one user&#39;s memories never leak into another user&#39;s results.</p><h3>Step 4: Re-rank by recency and importance</h3><p>RRF tells us what is relevant. Humans also weigh what is recent and what mattered. We multiply the fused score by a blend of an exponential recency decay (half-life of 14 days) and the stored importance, then reinforce whatever we return.</p><pre>now = time.time()<br>        def final(h):<br>            age_days = (now - h.payload[&quot;created_at&quot;]) / 86400<br>            recency = 0.5 ** (age_days / half_life_days)<br>            return h.score * (0.6 + 0.25 * recency + 0.15 * h.payload[&quot;importance&quot;])<br>ranked = sorted(hits, key=final, reverse=True)[:k]<br>        for h in ranked:  # memories that get used become easier to keep<br>            self.shard.update(UpdateOperation.set_payload(<br>                [h.id], {&quot;access_count&quot;: h.payload[&quot;access_count&quot;] + 1}))<br>        return ranked</pre><p>The 0.6 floor means relevance always dominates. Recency and importance only break ties and nudge close calls, which is exactly what you want from memory.</p><h3>Step 5: Consolidation, from episodes to facts</h3><p>Left alone, episodic memory becomes a pile of chat logs. Consolidation scrolls through old episodes, asks a summarizer (usually your LLM) for durable facts, stores those as semantic memories, and deletes the originals in one filter-based call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gFGq4xxKjlZ8SgT_9-aGsw.png" /></figure><pre>def consolidate(self, user_id, summarize, older_than_days=1.0, min_items=3):<br>        cutoff = time.time() - older_than_days * 86400<br>        old = Filter(must=[<br>            FieldCondition(key=&quot;user_id&quot;, match=MatchValue(value=user_id)),<br>            FieldCondition(key=&quot;kind&quot;, match=MatchValue(value=&quot;episodic&quot;)),<br>            FieldCondition(key=&quot;created_at&quot;, range=RangeFloat(lt=cutoff)),<br>        ])<br>        records, _ = self.shard.scroll(ScrollRequest(filter=old, limit=100, with_payload=True))<br>        if len(records) &lt; min_items:<br>            return None<br>        facts = summarize([r.payload[&quot;text&quot;] for r in records])<br>        for fact in facts:<br>            self.remember(fact, kind=&quot;semantic&quot;, user_id=user_id, importance=0.8)<br>        self.shard.update(UpdateOperation.delete_points_by_filter(old))<br>        return facts</pre><h3>Step 6: Forgetting on purpose</h3><p>Forgetting is a feature. Old, unimportant memories add noise to recall and cost disk. One filtered delete handles it.</p><pre>def forget(self, user_id, max_age_days=90, below_importance=0.3):<br>        cutoff = time.time() - max_age_days * 86400<br>        self.shard.update(UpdateOperation.delete_points_by_filter(Filter(must=[<br>            FieldCondition(key=&quot;user_id&quot;, match=MatchValue(value=user_id)),<br>            FieldCondition(key=&quot;created_at&quot;, range=RangeFloat(lt=cutoff)),<br>            FieldCondition(key=&quot;importance&quot;, range=RangeFloat(lt=below_importance)),<br>        ])))<br>def count(self, user_id):<br>        return self.shard.count(CountRequest(filter=self._filter(user_id)))</pre><h3>Does it work?</h3><p>Here is a quick test with five memories for one user and one for a different user:</p><pre>m = AgentMemory(&quot;./mem_test&quot;)<br>u = &quot;asha&quot;<br>m.remember(&quot;User prefers concise answers with code examples&quot;, kind=&quot;semantic&quot;, user_id=u, importance=0.9)<br>m.remember(&quot;User is building a FastAPI service called ledgerly&quot;, kind=&quot;semantic&quot;, user_id=u, importance=0.8)<br>m.remember(&quot;Debugged a Postgres connection timeout in ledgerly on Tuesday&quot;, user_id=u)<br>m.remember(&quot;User asked about pytest fixtures for async code&quot;, user_id=u, importance=0.4)<br>m.remember(&quot;To deploy ledgerly: run make build then make deploy-staging&quot;, kind=&quot;procedural&quot;, user_id=u, importance=0.9)<br>m.remember(&quot;Other user likes Rust&quot;, kind=&quot;semantic&quot;, user_id=&quot;bob&quot;)<br>for h in m.recall(&quot;how do I deploy ledgerly?&quot;, user_id=u, k=3):<br>    print(h.payload[&quot;kind&quot;], &quot;|&quot;, h.payload[&quot;text&quot;])</pre><pre>procedural | To deploy ledgerly: run make build then make deploy-staging<br>semantic   | User is building a FastAPI service called ledgerly<br>episodic   | Debugged a Postgres connection timeout in ledgerly on Tuesday</pre><p>The deploy recipe comes first, Bob’s memory never appears, and after closing and reloading the shard from disk the count is unchanged. The memory survives restarts.</p><h3>Plugging memory into an agent loop</h3><p>Memory only matters if the agent uses it. The loop below does three things per turn: recall relevant memories and inject them into the system prompt, answer, then ask the LLM to extract anything worth remembering from the exchange.</p><pre>import json<br>SYSTEM = &quot;&quot;&quot;You are a helpful coding assistant.<br>Relevant long-term memories about this user (may be outdated):<br>{memories}&quot;&quot;&quot;<br>EXTRACT = &quot;&quot;&quot;From this exchange, list durable facts worth remembering about the user,<br>as JSON: [{{&quot;text&quot;: str, &quot;kind&quot;: &quot;semantic&quot;|&quot;procedural&quot;|&quot;episodic&quot;, &quot;importance&quot;: 0-1}}].<br>Return [] if nothing is worth keeping.<br>User: {user}<br>Assistant: {reply}&quot;&quot;&quot;<br>class MemoryAgent:<br>    def __init__(self, llm, memory, user_id):<br>        self.llm, self.memory, self.user_id = llm, memory, user_id<br>    def chat(self, user_msg):<br>        # 1. Recall before answering<br>        hits = self.memory.recall(user_msg, user_id=self.user_id, k=5)<br>        memories = &quot;\n&quot;.join(<br>            f&quot;- [{h.payload[&#39;kind&#39;]}] {h.payload[&#39;text&#39;]}&quot; for h in hits) or &quot;- none yet&quot;<br>        # 2. Answer with memories in context<br>        reply = self.llm(system=SYSTEM.format(memories=memories), prompt=user_msg)<br>        # 3. Extract and store new memories<br>        try:<br>            items = json.loads(self.llm(system=&quot;Reply with JSON only.&quot;,<br>                                        prompt=EXTRACT.format(user=user_msg, reply=reply)))<br>        except json.JSONDecodeError:<br>            items = []<br>        for it in items:<br>            self.memory.remember(it[&quot;text&quot;], kind=it.get(&quot;kind&quot;, &quot;episodic&quot;),<br>                                 user_id=self.user_id,<br>                                 importance=float(it.get(&quot;importance&quot;, 0.5)))<br>        return reply</pre><p>The llm argument is any function that takes a system prompt and a user prompt and returns text, so you can plug in any provider. Here is a version using the Anthropic SDK:</p><pre>import anthropic<br>client = anthropic.Anthropic()<br>def llm(system, prompt):<br>    msg = client.messages.create(<br>        model=&quot;claude-sonnet-4-6&quot;,  # use whichever model you prefer<br>        max_tokens=1024,<br>        system=system,<br>        messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}],<br>    )<br>    return msg.content[0].text<br>agent = MemoryAgent(llm, AgentMemory(&quot;./agent_memory&quot;), user_id=&quot;asha&quot;)<br>agent.chat(&quot;I always ship ledgerly to staging first&quot;)<br># ...next day, new process...<br>agent.chat(&quot;How should I release ledgerly today?&quot;)</pre><p>On the second call, the system prompt the model sees already contains:</p><pre>- [procedural] User deploys ledgerly to staging before prod</pre><p>That is the whole point: the agent “remembers” across processes because the memory lives on disk, right next to the app.</p><p>To keep the store tidy, schedule the maintenance jobs, for example once a day or on app start:</p><pre>def summarize(texts):<br>    out = llm(system=&quot;Reply with a JSON list of short strings only.&quot;,<br>              prompt=&quot;Merge these notes into a few durable facts:\n&quot; + &quot;\n&quot;.join(texts))<br>    return json.loads(out)<br>memory.consolidate(&quot;asha&quot;, summarize, older_than_days=1)<br>memory.forget(&quot;asha&quot;, max_age_days=90, below_importance=0.3)</pre><h3>Syncing with a Qdrant server (optional)</h3><p>Local-first does not have to mean local-only. A common pattern is to treat the Edge shard as the agent’s fast, private cache and a Qdrant server or Qdrant Cloud collection as the durable backup that follows the user across devices.</p><p>The two directions work differently:</p><ul><li><strong>Edge to server (push).</strong> Durable memories, usually only semantic and procedural ones, are upserted to a server collection with the regular qdrant-client. Raw episodic chatter can stay on the device.</li><li><strong>Server to Edge (pull).</strong> A new device bootstraps from a snapshot of the server data. The Edge API exposes EdgeShard.unpack_snapshot(), update_from_snapshot() and snapshot_manifest() for this; check the <a href="https://qdrant.tech/documentation/edge/">Qdrant Edge docs</a> for the current snapshot workflow, since this part of the API is new and evolving.</li></ul><p>A minimal push of durable memories looks like this:</p><pre>from qdrant_client import QdrantClient, models<br>server = QdrantClient(url=&quot;https://YOUR-CLUSTER.cloud.qdrant.io&quot;, api_key=&quot;...&quot;)<br>def push_durable(memory, user_id):<br>    durable = Filter(<br>        must=[FieldCondition(key=&quot;user_id&quot;, match=MatchValue(value=user_id))],<br>        should=[FieldCondition(key=&quot;kind&quot;, match=MatchValue(value=&quot;semantic&quot;)),<br>                FieldCondition(key=&quot;kind&quot;, match=MatchValue(value=&quot;procedural&quot;))],<br>    )<br>    records, _ = memory.shard.scroll(ScrollRequest(<br>        filter=durable, limit=500, with_payload=True, with_vector=True))<br>    server.upsert(&quot;agent_memory&quot;, points=[<br>        models.PointStruct(id=r.id, vector={&quot;dense&quot;: r.vector[&quot;dense&quot;]}, payload=r.payload)<br>        for r in records<br>    ])</pre><p>The server collection needs a matching dense vector config, and you can add the bm25 sparse vector there too if you want hybrid search server-side. Pushing only durable memory keeps bandwidth low and keeps the noisiest, most personal data on the device.</p><h3>Limitations</h3><ul><li><strong>Hybrid beats dense alone for agents.</strong> Agent memories are full of identifiers: project names, file paths, error codes, CLI commands. Dense embeddings blur those; BM25 nails them. RRF gives you both without tuning score scales.</li><li><strong>Filter inside the prefetch.</strong> Putting the user_id filter in each prefetch, not after fusion, guarantees isolation and keeps the candidate pools full of useful hits.</li><li><strong>Forgetting improves recall.</strong> Once the store held a few thousand stale episodes, relevant facts started losing to noisy near-matches. Consolidation plus forgetting fixed that.</li><li><strong>Let the LLM decide what is memorable, but cap it.</strong> Extraction prompts can over-remember. Keep importance scores honest and skip storing small talk.</li></ul><p>There are honest limits too. The read-modify-write on access_count is not atomic, which is fine for a single agent process but not for many writers. Embedding on every write costs CPU on small devices, so batch writes when you can. And Qdrant Edge is young, so pin your package version.</p><h3>Where to take it next</h3><ul><li>Use Qdrant’s server-side formula queries with a decay function to move recency scoring into the engine</li><li>Add MMR (Mmr is in the Edge API) to diversify recalled memories</li><li>Add a multimodal vector so the agent remembers screenshots and diagrams</li><li>Expose AgentMemory as an MCP server so any agent framework can use it</li></ul><p><strong>Resources:</strong> <a href="https://qdrant.tech/documentation/edge/">Qdrant Edge documentation</a> · <a href="https://github.com/qdrant/qdrant">Qdrant on GitHub</a> · <a href="https://qdrant.tech/documentation/concepts/hybrid-queries/">Hybrid queries in Qdrant</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3f9b4a1eebc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If Neural Networks Came in Parts?]]></title>
            <link>https://tutorialsavvy.com/what-if-neural-networks-came-in-parts-574b20ccc490?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/574b20ccc490</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 13:44:29 GMT</pubDate>
            <atom:updated>2026-10-03T13:44:29.607Z</atom:updated>
            <content:encoded><![CDATA[<p>You can build a website out of parts. I’ve shipped code that leaned on a dozen libraries written by people I’ll never meet, and it mostly just worked. My laptop takes a USB stick made years before the laptop existed. None of that works because anyone coordinated. It works because somebody agreed on an interface early, and then everyone stopped touching it.</p><p>Models don’t have that. If you want one that’s better at chemistry, you fine-tune the whole thing or train a new one. Two labs can’t each build a piece and snap them together, because every layer inside a trained model speaks a private dialect. It only makes sense next to the exact weights it grew up with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxQ_vMZznqKqa3BhCDMoBQ.png" /></figure><h3>The one test that matters</h3><blockquote><em>Two people train two modules separately. They never see each other’s code or data. Then we plug both modules into the same model, and it does nearly as well as a model where everything was trained together.</em></blockquote><p>That’s it. If that works on a toy problem, I’ll believe there’s something here. If it doesn’t, at least it fails fast and cheap.</p><p>I like this test because of what it leaves out. The modules don’t need to be small or efficient. There’s no new training algorithm involved. It’s just asking whether two strangers can build parts that understand each other, because if they can’t, nothing else I’d want to build on top of this matters.</p><h3>A whiteboard everyone shares</h3><p>The first piece is a shared workspace: a fixed set of slots, say 64 vectors, that every module reads from and writes to.</p><p>The picture in my head is a whiteboard in a meeting room. Nobody whispers to anyone else. If you have something to say, you write it on the board, and if you want to know what’s going on, you read the board. Modules work the same way. They never call each other directly.</p><p>The board is the socket. Its shape doesn’t change: same number of slots, same width, same spot in the forward pass. As long as a module fits that shape, it can plug in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuAcf8AuC5zQzSws-cHumg.png" /></figure><h3>What a module promises</h3><p>The second piece is a contract every module signs. It reads the workspace through attention, does some work, and writes results back.</p><p>The middle part is nobody’s business. A module could be a transformer, a CNN, a lookup table, or a hand-written symbolic solver. I only care about the read and the write. If you’ve written a function against someone else’s API, it’s the same deal: agree on what goes in and what comes out, and do whatever you want in between.</p><p>The whiteboard and the contract are the easy bits. This next one is where I think the whole idea lives or dies.</p><p>Agreeing on the shape of the board doesn’t mean agreeing on what’s written on it. Say two modules were trained apart, and both learned to use slot 12. One uses it to mean “the subject of the sentence.” The other uses it to mean “something red.” Plug them in together and they’ll happily read each other’s notes and get everything wrong. Same alphabet, different language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDv8bn18kPLsEIesyXyP2w.png" /></figure><p>So something has to pin down what each slot means. The simplest version I can think of is a frozen reference model, an anchor. Every module trains against it: it learns from workspace states the anchor produced, and whatever it writes has to stay readable by the anchor. Since the anchor never changes, a module built this week and one built next year should still share a dictionary.</p><p>What I genuinely don’t know is whether that’s enough. A frozen anchor might also be a ceiling. If the anchor has no way to represent some concept, can a new module still get that idea across? Or does every module end up limited to the vocabulary of whatever we froze on day one? If I had to pick one question to spend a year on, it’d be this one.</p><h3>Who gets called</h3><p>The last piece is a router that decides which modules run for a given input. Routers aren’t new. The awkward requirement here is that this one has to accept modules that didn’t exist when it was trained. If you need to retrain the router every time someone ships a module, you’ve lost most of the point.</p><p>One way I can imagine it working: each module publishes a small key, a vector living in the same space as the workspace. The router compares the current state of the board against those keys and picks the closest matches. Joining means registering a key. Nobody retrains anything.</p><h3>How I’d test it</h3><p>Putting it together, the first experiment looks something like this:</p><p>Two teams, separate data, separate code. The only thing they share is the frozen anchor. Plug both modules in, then compare against a baseline with the same parts trained together. A small gap means the idea works. A big gap tells us where it breaks, which is useful too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAoNv_NGB4nFjkIxFsgxQw.png" /></figure><h3>Hasn’t someone done this?</h3><p>Sort of, and I’d be surprised if nobody had come close. The nearest work I know of:</p><ul><li><strong>“Coordination Among Neural Modules Through a Shared Global Workspace”</strong> (Goyal et al., 2021). This is almost exactly the whiteboard idea. But the modules are trained together.</li><li><strong>Recurrent Independent Mechanisms</strong> (Goyal et al., 2019). Separate modules that compete to update a shared state. Also trained jointly.</li><li><strong>Perceiver</strong> (Jaegle et al., 2021). Reads and writes through a fixed latent array, which is very close to how I picture the workspace.</li></ul><p>There’s also a nearby line of work on model stitching and on aligning representations between separately trained networks, plus methods that train expert models in parallel and merge them afterward. Those feel relevant to the anchor question in particular.</p><p>As far as I can tell, none of them tests the specific thing I care about: modules trained independently, by people who never coordinated, plugged in after the fact. That looks like the gap. I’m going from memory on these citations, though, so if you know of work that already does this, please tell me. I’d honestly rather find out now.</p><h3>The stuff I’m deliberately ignoring</h3><p>There are two bigger ideas sitting behind this one, and I’m parking both on purpose.</p><p>The first is training without backpropagation. Backprop needs the whole network held in memory while gradients flow backward, which makes training expensive and pretty much rules out a device learning on the fly. The dream is a network where each layer learns from local signals only, so layers can train in parallel and out of sync, a bit like the brain seems to. Hinton’s Forward-Forward algorithm and predictive coding networks are early steps, but as far as I know nothing matches backprop at scale yet. Whoever cracks that changes what hardware we build.</p><p>The second is an asynchronous framework where modules update on their own schedules</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=574b20ccc490" width="1" height="1" alt=""><hr><p><a href="https://tutorialsavvy.com/what-if-neural-networks-came-in-parts-574b20ccc490">What If Neural Networks Came in Parts?</a> was originally published in <a href="https://tutorialsavvy.com">Tutorial Savvy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Large World Models(LWM): Teaching AI to Imagine the World]]></title>
            <link>https://tutorialsavvy.com/large-world-models-lwm-teaching-ai-to-imagine-the-world-1f1e6a73091a?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f1e6a73091a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[lwm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 17:20:32 GMT</pubDate>
            <atom:updated>2026-09-30T01:11:11.855Z</atom:updated>
            <content:encoded><![CDATA[<h3>What LWMs are, how they work under the hood, who’s building them in 2026, and why your production stack still runs on LLMs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7O4EmtOarZo1TyVx3Tc-A.png" /></figure><p>Ask a good LLM what happens if you nudge a glass off the edge of a table and you’ll get a flawless answer: it falls, it probably shatters, there’s water on the floor. Now ask it to <em>show</em> you the next three seconds, from the other side of the room, after you’ve nudged the glass two centimetres to the left instead. It can’t. It knows the sentence. It doesn’t have the scene.</p><p>That gap is what large world models are trying to close.</p><p>In the last 18 months, world models have gone from a research curiosity to one of the most heavily funded ideas in AI. Google DeepMind’s Genie 3 generates explorable worlds in real time. Fei-Fei Li’s World Labs raised $1 billion in February 2026 and, on September 28, agreed to join AMD. Yann LeCun left Meta to found AMI Labs, which raised $1.03 billion to build world models. NVIDIA’s Cosmos models, trained on 20 million hours of video, are being used to train robots and self-driving cars. Gartner put “physical AI” on its list of top strategic technology trends for 2026.</p><p>This post is a practical guide. We’ll cover:</p><ul><li>what a world model is, and what makes one “large”</li><li>how LWMs work under the hood, with block diagrams</li><li>the four families of world models and the flagship systems in each</li><li>where they’re used today, and what’s still hard</li><li>how LWMs differ from LLMs, and why nearly every AI product you use still runs on an LLM</li></ul><blockquote><strong><em>TL;DR:</em></strong><em> An LLM predicts the next token of text. An LWM predicts the next state of a world (video frames, a 3D scene or an abstract latent state) given an action. That makes LWMs the right tool for robotics, driving, games and simulation, and the wrong (and far more expensive) tool for most knowledge work. The future isn’t one replacing the other. It’s a stack where each does what it’s best at.</em></blockquote><h3>1. What is a world model?</h3><p>A world model is a learned simulator. Give it the current state of an environment and an action, and it predicts what happens next:</p><pre>next_state = f(current_state, action)</pre><p>The idea is older than deep learning. In 1943 the psychologist Kenneth Craik suggested that the mind carries a “small-scale model” of external reality, which lets us try out alternatives before committing to one. You use yours constantly. To catch a ball, you predict where it <em>will</em> be, not where it is. To cross a dark room, you remember where the coffee table was.</p><p>A machine world model has three jobs:</p><ol><li><strong>Represent.</strong> Compress raw observations (pixels, depth, lidar, joint angles) into a compact state.</li><li><strong>Predict.</strong> Roll that state forward in time, conditioned on actions.</li><li><strong>Stay consistent.</strong> Remember what it has seen, so the wall you walked past is still there when you turn around.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0WPFMukniRRDQVUm4RodQ.png" /></figure><p><em>The core loop. The agent imagines many futures cheaply, then acts on the best one in the real world.</em></p><p>The payoff is imagination. An agent with a good world model can try a thousand candidate actions “in its head” and execute only the one that looks best. In 2018, David Ha and Jürgen Schmidhuber showed that an agent could learn to play a video game entirely inside “its own hallucinated dream,” then carry that skill back to the real game. They split the system into Vision (V), Memory (M) and Controller ©. That three-part shape still describes most world models today.</p><h3>2. So what makes it “large”?</h3><p>Classic world models were small and narrow: one model per game or robot, trained on that environment’s data. Large world models apply the recipe that made LLMs work:</p><ul><li><strong>Internet-scale data:</strong> millions of hours of video instead of one game’s replays.</li><li><strong>Big transformer backbones:</strong> billions of parameters.</li><li><strong>Pretrain, then adapt:</strong> one general model, then fine-tune or prompt it for driving, robotics or games.</li><li><strong>Prompting:</strong> describe a world in text, or hand it a photo, and it generates one.</li></ul><p>A note on naming, because it’s messy. World Labs describes its work as building “large world models.” NVIDIA calls Cosmos “world foundation models.” DeepMind called Genie 2 a “foundation world model.” And a 2024 Berkeley paper literally named “Large World Model” (LWM) was a long-context model that reads video and text across a million-token window, which is closer to a multimodal LLM than to a simulator. In this post, <strong>LWM</strong> means the broad category: large, general-purpose models that learn how worlds look and behave.</p><h3>3. A short history</h3><p><em>World models have deep roots in cognitive science and reinforcement learning, but most of the progress has happened since 2024.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tpTVv7PBpA6LnUQwWJYC9Q.png" /></figure><p>Three threads came together.</p><p><strong>Model-based reinforcement learning gave us the loop.</strong> Richard Sutton’s Dyna (1990) learned a model of the environment and planned inside it. Ha and Schmidhuber (2018) trained agents in their dreams. DeepMind’s MuZero mastered Go, chess and Atari by planning with a learned model it was never told the rules of. DreamerV3 used one configuration across more than 150 tasks and became the first algorithm to collect diamonds in Minecraft from scratch, with no human data. It was published in <em>Nature</em> in 2025.</p><p><strong>Video generation gave us scale.</strong> OpenAI’s February 2024 Sora report argued that scaling video models is “a promising path towards building general purpose simulators of the physical world.”</p><p><strong>Interactivity tied them together.</strong> DeepMind’s Genie (February 2024, 11 billion parameters) learned playable 2D worlds from unlabeled internet video, without any action labels. Genie 2 (December 2024) made playable 3D worlds from a single image, consistent for up to a minute. Genie 3 (August 2025) made them real-time.</p><h3>4. Inside a large world model</h3><p>There’s no single LWM architecture, but most systems fill the same four slots: inputs, tokenizers, a prediction backbone and outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFpx09bKvqSJlGjf5acQxg.png" /><figcaption><em>A generic blueprint. Different labs make different choices in each column.</em></figcaption></figure><h3>Step 1: Tokenize the world</h3><p>Raw video is enormous. One minute of 720p video at 24 frames per second is 1,440 frames and more than 1.3 billion pixels. So the first job is compression. A video tokenizer (usually a VAE or a vector-quantized encoder) chops a clip into small space-time patches and maps each one to a compact latent token. The rest of the model never sees raw pixels; it works in this compressed space.</p><p>Other inputs get their own encoders: depth and camera pose, text prompts (often via a pretrained language model), and, most importantly, actions.</p><h3>Step 2: Condition on actions</h3><p>This is what separates a world model from a video generator. A video model answers “what might happen next?” A world model answers “what happens next <em>if I do this</em>?”</p><p>Actions can be explicit: key presses, steering angles, robot joint commands. But most internet video has no action labels. Nobody logged which buttons the player pressed. Genie’s clever trick was a <strong>latent action model</strong> that watches consecutive frames and infers a small set of discrete actions that explain the change. Train it on enough gameplay footage and those latent actions end up meaning things like “jump” or “move left,” without anyone labeling them.</p><h3>Step 3: Predict the next state</h3><p>The backbone is usually a large spatiotemporal transformer. It attends within each frame (space), across frames (time, usually causally so the future can’t leak into the past), and to the actions and text it’s conditioned on. Three training objectives dominate:</p><ul><li><strong>Autoregressive prediction:</strong> predict the next video tokens one step at a time, the way an LLM predicts the next word. Genie’s dynamics model works this way.</li><li><strong>Diffusion or flow matching:</strong> start from noise and iteratively denoise the next frames, conditioned on history and actions. Most photoreal video world models work this way. NVIDIA released Cosmos in both diffusion and autoregressive versions.</li><li><strong>Embedding prediction (JEPA):</strong> don’t predict pixels at all. Predict the <em>representation</em> of the future.</li></ul><p>That last choice is one of the biggest philosophical splits in the field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0oZHMz6ZwAVBFTBOikFWBg.png" /></figure><p>Yann LeCun’s case for JEPA (Joint-Embedding Predictive Architecture) is that the world is full of details nobody can predict, like the exact pattern of leaves in the wind or ripples on a pond, and forcing a model to generate them wastes capacity. Predict an abstract summary instead, and the model can focus on what matters: the glass is falling, the car is braking. The trade-off is that you can’t watch a JEPA model’s imagination. There’s no video to inspect.</p><h3>Step 4: Remember</h3><p>Memory is the hardest part. Generate a world frame by frame and small errors compound: a door drifts, a sign changes, a building disappears when you look away. There are three main approaches:</p><ul><li><strong>Frame cache:</strong> attend to recent frames. Genie 3’s visual memory reaches back about a minute.</li><li><strong>Pose-indexed spatial memory:</strong> store frames along with the camera position they were taken from, and retrieve the nearby ones when you come back. World Labs’ RTFM model does this and runs at interactive frame rates on a single H100 GPU.</li><li><strong>Explicit 3D:</strong> build a persistent 3D scene (Gaussian splats or meshes) so the world can’t forget. World Labs’ Marble takes this route.</li></ul><h3>The imagination loop, in code</h3><p>Once you have a world model, planning is surprisingly simple. Here’s the core idea in pseudocode. It’s roughly how Meta’s V-JEPA 2-AC plans robot arm movements toward a goal image:</p><pre># Planning with a world model (simplified pseudocode)<br>z    = encoder(camera_frame)       # 1. compress what you see<br>goal = encoder(goal_image)         #    ...and what you want to see</pre><pre>best_plan, best_score = None, float(&quot;-inf&quot;)<br>for plan in sample_action_sequences(n=256, horizon=10):<br>    z_sim = z<br>    for action in plan:            # 2. imagine; don&#39;t act yet<br>        z_sim = dynamics(z_sim, action)<br>    score = -distance(z_sim, goal) # 3. how close did we get?<br>    if score &gt; best_score:<br>        best_plan, best_score = plan, score</pre><pre>robot.execute(best_plan[0])        # 4. take one step, observe, repeat</pre><p>No hand-written reward function and no real-world trial and error. The robot rehearses in latent space, takes one step, looks again, and replans.</p><h3>5. The four families of world models</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPxi_oxevspbeWssOW4DBw.png" /></figure><p><em>What a model predicts determines what it’s good at.</em></p><p><strong>Interactive video world models</strong> (Genie 3, Runway GWM, Odyssey, Decart, Cosmos Predict, Waymo’s world model, Wayve GAIA) generate pixels in response to actions. They’re the most visually impressive and the most general. They’re also the most expensive to run, and they drift over time.</p><p><strong>Spatial or 3D world models</strong> (World Labs Marble, Tencent HunyuanWorld) produce an explicit 3D scene you can walk through, edit and export to other tools. Persistence comes for free. Rich dynamics don’t.</p><p><strong>Latent predictive models</strong> (Meta’s V-JEPA 2, AMI Labs) predict in embedding space. They’re efficient and good for planning, but hard to show off, since there’s nothing to watch.</p><p><strong>Agent-centric RL world models</strong> (DreamerV3, MuZero) learn compact dynamics for one environment. They’re narrow but proven, and they’re the source of most of the field’s core ideas.</p><p>Real systems increasingly mix families. Cosmos pairs video models with a reasoning vision-language model, and World Labs’ RTFM renders frames in real time on top of a spatial memory.</p><h3>6. The flagship systems, as of September 2026</h3><h3>Google DeepMind: Genie 3 and Project Genie</h3><p>Genie 3, announced in August 2025, generates worlds from a text prompt in real time at 720p and 24 fps, and keeps them consistent for a few minutes. It introduced “promptable world events”: type a text command to change the weather or add a new object or character, and the world changes mid-session. DeepMind also uses Genie 3 worlds as a training ground. Its SIMA 2 agent plays and improves itself inside them.</p><p>In January 2026, Google opened <strong>Project Genie</strong>, a prototype for US Google AI Ultra subscribers with a 60-second limit per world. In May it added Street View, so you can generate worlds from real streets. DeepMind’s Jack Parker-Holder was candid about where it stands, calling it “maybe six to 12 months behind video” in quality. And in February, Waymo unveiled the <strong>Waymo World Model</strong>, built on Genie 3. It generates both camera and lidar data and can simulate rare events like a tornado or an elephant on the road.</p><h3>World Labs: Marble, RTFM and the AMD deal</h3><p>Fei-Fei Li’s World Labs came out of stealth in September 2024 with $230 million to build “large world models” with spatial intelligence. Its product <strong>Marble</strong> (generally available since November 2025) turns text, images, video or rough 3D layouts into persistent 3D worlds, and exports them as Gaussian splats, meshes or video. <strong>RTFM</strong>, its real-time frame model, renders explorable worlds on a single H100.</p><p>In 2026 World Labs launched a World API, raised $1 billion from backers including AMD, Autodesk and NVIDIA, and released <strong>Atlas</strong>, which generates up to a minute of 1440p video. On September 28, 2026, it announced an agreement to join AMD, with Fei-Fei Li set to become AMD’s Chief Scientist. The deal is expected to close by the end of 2026. TechCrunch reports its value at $8.2 billion.</p><h3>NVIDIA: Cosmos</h3><p>NVIDIA launched <strong>Cosmos</strong> at CES in January 2025 as a platform of open world foundation models for “physical AI,” trained on 9,000 trillion tokens drawn from 20 million hours of real-world data. The family grew into three lines: <strong>Predict</strong> (generate future video), <strong>Transfer</strong> (turn structured inputs like depth maps, segmentation or simulator output into photoreal video) and <strong>Reason</strong> (a vision-language model that reasons about physical scenes). <strong>Cosmos 3</strong>, released in May 2026, merges text, image, video, sound and action into one “omnimodel” in 4B, 16B and 64B sizes.</p><p>Cosmos’s pitch is less “play a world” and more “make training data for robots and cars.”</p><h3>Meta and AMI Labs: the JEPA bet</h3><p>Meta’s <strong>V-JEPA 2</strong> (June 2025) is a 1.2-billion-parameter model trained on more than a million hours of video. Its action-conditioned version, V-JEPA 2-AC, was trained on just 62 hours of robot data and then planned pick-and-place tasks zero-shot in new labs, with 65–80% success. <strong>V-JEPA 2.1</strong> (March 2026) improved real-robot grasping by about 20 points.</p><p>Yann LeCun, who championed JEPA at Meta, left to found <strong>AMI Labs</strong> in Paris. In March 2026 it raised $1.03 billion at a $3.5 billion pre-money valuation to build JEPA-style world models. As of September 2026, it hasn’t released a product and describes itself as still in a research and building phase.</p><h3>Driving: Waymo, Wayve and Tesla</h3><p>Self-driving is the most mature commercial use of world models. Besides Waymo’s Genie-based model, Wayve’s <strong>GAIA-3</strong> (15 billion parameters, December 2025) and <strong>GAIA-4</strong> (August 2026, closed-loop simulation) generate driving scenarios for training and testing, and Tesla has described a “neural world simulator” for evaluating its driving software. The value is obvious: you can’t wait for a real child to run into a real road to test your car, but you can simulate it a million times.</p><h3>Also worth knowing</h3><p>Runway’s GWM-1 (December 2025) and GWM Worlds 2 (September 2026) target media and robotics. Microsoft’s Muse, published in <em>Nature</em>, generates gameplay from a real game’s data. Odyssey-3 (September 2026) aims to cover robots, cars and games in one model. Tencent’s HunyuanWorld line offers open-source 3D world generation. And OpenAI, whose Sora report helped popularize the “world simulator” framing, discontinued the Sora app in April 2026.</p><h3>7. Where world models are used today</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXPinNdtSy4WUH_3Xvq0fw.png" /></figure><p>The common thread is that reality is a slow and expensive teacher. With a world model, robots can rehearse before they move, cars can crash safely, agents can train on endless worlds, and game studios and VFX teams can prototype in minutes instead of weeks.</p><h3>8. What’s still hard</h3><ul><li><strong>Long-horizon consistency.</strong> DeepMind describes Genie 3 as supporting “a few minutes of continuous interaction, rather than extended hours.” Small errors compound.</li><li><strong>Physics that looks right but isn’t.</strong> Visual plausibility is not physical accuracy. TechCrunch described Project Genie as “not yet physics-aware.” A robot trained on subtly wrong physics learns subtly wrong skills.</li><li><strong>Limited actions and multiple agents.</strong> DeepMind lists a limited action space and interactions between multiple agents as Genie 3 limitations, along with text legibility and geographic accuracy.</li><li><strong>Data.</strong> There’s plenty of video, but very little <em>action-labeled</em> video that records what caused each change.</li><li><strong>Evaluation.</strong> There’s no MMLU for worlds. Meta released three new benchmarks (IntPhys 2, MVPBench and CausalVQA) alongside V-JEPA 2 because existing ones didn’t measure physical understanding well.</li><li><strong>Compute.</strong> This is the biggest reason LWMs aren’t everywhere yet. More on it below.</li><li><strong>Trust and safety.</strong> Photoreal, controllable video of real places raises obvious questions about deepfakes and misuse.</li></ul><h3>9. LLMs vs LWMs: what’s actually different?</h3><p>At a high level they share a recipe: big transformers, scaling laws, and pretraining on huge datasets followed by post-training. The difference is <em>what they predict</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uok5KO-LuKiWR_2G2ytTgQ.png" /></figure><p>An LLM lives in a one-dimensional world of text. Its state is the text so far, its unit of prediction is a sub-word token, and a hundred tokens a second feels instant. An LWM lives in space and time. Its state is a whole scene, including whatever is currently off-screen. Its unit is a space-time patch, and it has to produce 24 to 60 frames every second to feel real.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbThAY2lnPcBERbveGfT0g.png" /></figure><p>The most important differences, in words:</p><ul><li><strong>The core question.</strong> An LLM asks “what word comes next?” An LWM asks “what happens next if I do this?”</li><li><strong>Training data.</strong> Recent open LLMs train on roughly 15 to 36 trillion tokens of text and code (Llama 3 used 15T+, Qwen3 about 36T). Cosmos trained on about 9,000 trillion tokens from 20 million hours of video. Each video token carries far less meaning than a text token, so the numbers aren’t directly comparable.</li><li><strong>The scarce ingredient.</strong> For LLMs, it’s fresh, high-quality human text. For LWMs, it’s action-labeled data.</li><li><strong>What they understand.</strong> LLMs: language, facts, code and symbolic reasoning. LWMs: geometry, intuitive physics, cause and effect, object permanence.</li><li><strong>Time.</strong> LLMs are turn-based, and a second of latency is fine. LWMs are continuous and real-time.</li><li><strong>How they fail.</strong> LLMs hallucinate facts. LWMs hallucinate physics: drift, melting objects, things that vanish.</li><li><strong>Maturity.</strong> LLMs are everywhere, with mature APIs and tooling. LWMs are mostly research previews and early APIs.</li></ul><p><strong>Don’t LLMs already have a world model?</strong> Partly. Trained on enough text, LLMs absorb a lot about how the world works, which is why they can explain why a glass breaks. But that knowledge comes from <em>descriptions</em> of the world, not from observing it, and it isn’t spatial, continuous or tied to actions. An LLM knows the glass falls. An LWM can show you where the shards land.</p><h3>10. So why do we still use LLMs, not LWMs?</h3><p>If world models are closer to how intelligence works in the physical world, why does nearly every AI product (chat assistants, coding tools, support bots, search) still run on LLMs? There are seven reasons.</p><h3>1. Most valuable digital work is language-shaped</h3><p>Code, contracts, emails, tickets, spreadsheets, reports: most knowledge work is text in, text out. A world model can simulate a kitchen, but it can’t write your SQL query, summarize a contract or fix a failing test. The problem picks the model, and most software problems are language problems.</p><h3>2. Text is pre-compressed meaning</h3><p>“The glass fell and shattered” is five words. Rendering it as video takes hundreds of thousands of tokens. When people write, they’ve already done the hard work of abstraction: deciding what matters and naming it. That’s why an LLM learns so much per token, and why a world model has to wade through huge volumes of redundant pixels to learn the same concept. Worse, most video lacks the thing a world model needs most: a record of the action that caused each change.</p><h3>3. Serving a world costs orders of magnitude more</h3><p><em>World-model figures from World Labs’ RTFM post (October 2025). LLM figures are typical 2026 values.</em></p><p>A chatbot streams about a hundred tokens a second and can pause to think. A world model has to generate frames continuously, for every user, against hard real-time deadlines. World Labs has written that world models “will be very computationally demanding, much more so than LLMs today.” By its estimate, 4K video at 60 fps needs more than 100,000 tokens per second, and keeping a world consistent for an hour would take more than 100 million tokens of context, which it calls “neither feasible nor economically viable” today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0KDnPU91qLU7wjZPiLMZw.png" /></figure><p>You can see the economics in how these systems are offered. Genie 3 launched as a limited research preview, and Project Genie caps each world at 60 seconds for top-tier subscribers.</p><h3>4. You can check an LLM’s work</h3><p>When an LLM writes code, you run the tests. When it states a fact, you can look it up. Checking whether a simulated world obeys physics is much harder, and the benchmarks to do it are still being invented. For a business, being able to verify output is what turns a demo into a product.</p><h3>5. The ecosystem is years ahead</h3><p>LLMs come with everything a team needs to ship: stable APIs, fine-tuning, retrieval, function calling, agent frameworks, evaluation harnesses, guardrails, and lots of engineers who know how to use them. LWMs mostly offer research previews, waitlists and first-generation APIs. AMI Labs, with more than a billion dollars raised, hasn’t released a product yet.</p><h3>6. Language is still the interface</h3><p>People specify goals in words. Even world models are prompted in text (“a rainy street in Tokyo”), and many use a pretrained language model as their text encoder. NVIDIA built Cosmos Reason, a vision-language model, because a physical-AI system still needs something that can follow instructions and explain its reasoning. Here LLMs aren’t competing with world models; they’re a component inside them.</p><h3>7. They aren’t substitutes</h3><p>“Why LLMs and not LWMs?” assumes one should replace the other. They do different jobs. Asking an LWM to draft a strategy memo is like asking a flight simulator to write the pilot’s manual. The useful question is where each one fits.</p><h3>11. Which one should you reach for?</h3><p>A practical rule of thumb:</p><ul><li><strong>Use an LLM</strong> when the input and output are language, code or structured data, and the job is reasoning, retrieval, writing or tool use.</li><li><strong>Use a vision-language model</strong> when you need to <em>understand</em> images or video but can answer in text: inspection, captioning, visual Q&amp;A.</li><li><strong>Use a world model</strong> when you need to <em>predict what physically happens next</em> under different actions: generating training data, testing robot or driving policies, rehearsing plans, or building explorable 3D and interactive media.</li><li><strong>Use both</strong> when an agent has to act in the physical world. That’s where the field is heading.</li></ul><h3>12. The future is a stack, not a winner</h3><p><em>Each layer does the job it’s best at. The loop between imagination and action is the key idea.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtZ-4jN1ggGKgtFvHnIYEQ.png" /></figure><p>The emerging architecture for physical AI looks less like one giant model and more like a team. A language model understands the request and plans the steps. A world model imagines what each candidate step would do. An action model, often a vision-language-action (VLA) model like Physical Intelligence’s π series, turns the chosen plan into motor commands. Sensors stream back, and the loop repeats.</p><p>You can already see the pieces converging. Cosmos 3 folds text, video, sound and action into one model. DeepMind trains SIMA 2 agents inside Genie 3 worlds. Waymo tests its cars against Genie-based simulations of events it may never record in reality. The lines between “language model,” “video model” and “world model” get blurrier every quarter.</p><h3>References</h3><ol><li>Google DeepMind, “Genie 3: A new frontier for world models” (Aug 2025): <a href="https://deepmind.google/discover/blog/genie-3-a-new-frontier-for-world-models/">https://deepmind.google/discover/blog/genie-3-a-new-frontier-for-world-models/</a></li><li>Google DeepMind, “Genie 2: A large-scale foundation world model” (Dec 2024): <a href="https://deepmind.google/discover/blog/genie-2-a-large-scale-foundation-world-model/">https://deepmind.google/discover/blog/genie-2-a-large-scale-foundation-world-model/</a></li><li>Bruce et al., “Genie: Generative Interactive Environments” (Feb 2024): <a href="https://arxiv.org/abs/2402.15391">https://arxiv.org/abs/2402.15391</a></li><li>Google, “Project Genie” (Jan 2026): <a href="https://blog.google/innovation-and-ai/models-and-research/google-deepmind/project-genie/">https://blog.google/innovation-and-ai/models-and-research/google-deepmind/project-genie/</a></li><li>TechCrunch, “Google’s Genie world model can now simulate real streets with Street View” (May 2026): <a href="https://techcrunch.com/2026/05/19/googles-genie-world-model-can-now-simulate-real-streets-with-street-view/">https://techcrunch.com/2026/05/19/googles-genie-world-model-can-now-simulate-real-streets-with-street-view/</a></li><li>Google DeepMind, “SIMA 2” (Nov 2025): <a href="https://deepmind.google/blog/sima-2-an-agent-that-plays-reasons-and-learns-with-you-in-virtual-3d-worlds/">https://deepmind.google/blog/sima-2-an-agent-that-plays-reasons-and-learns-with-you-in-virtual-3d-worlds/</a></li><li>Waymo, “The Waymo World Model” (Feb 2026): <a href="https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simulation">https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simulation</a></li><li>World Labs, “Marble” (Nov 2025): <a href="https://www.worldlabs.ai/blog/marble-world-model">https://www.worldlabs.ai/blog/marble-world-model</a></li><li>World Labs, “RTFM: A Real-Time Frame Model” (Oct 2025): <a href="https://www.worldlabs.ai/blog/rtfm">https://www.worldlabs.ai/blog/rtfm</a></li><li>World Labs, 2026 funding announcement: <a href="https://www.worldlabs.ai/blog/funding-2026">https://www.worldlabs.ai/blog/funding-2026</a></li><li>World Labs, AMD announcement (Sep 2026): <a href="https://www.worldlabs.ai/blog/amd-announcement">https://www.worldlabs.ai/blog/amd-announcement</a></li><li>TechCrunch, “AMD will acquire Fei-Fei Li’s World Labs for $8.2 billion” (Sep 2026): <a href="https://techcrunch.com/2026/09/28/amd-will-acquire-fei-fei-lis-world-labs-for-8-2-billion/">https://techcrunch.com/2026/09/28/amd-will-acquire-fei-fei-lis-world-labs-for-8-2-billion/</a></li><li>TechCrunch, World Labs comes out of stealth (Sep 2024): <a href="https://techcrunch.com/2024/09/13/fei-fei-lis-world-labs-comes-out-of-stealth-with-230m-in-funding/">https://techcrunch.com/2024/09/13/fei-fei-lis-world-labs-comes-out-of-stealth-with-230m-in-funding/</a></li><li>NVIDIA, Cosmos launch (Jan 2025): <a href="https://nvidianews.nvidia.com/news/nvidia-launches-cosmos-world-foundation-model-platform-to-accelerate-physical-ai-development">https://nvidianews.nvidia.com/news/nvidia-launches-cosmos-world-foundation-model-platform-to-accelerate-physical-ai-development</a></li><li>NVIDIA, “What are world foundation models?”: <a href="https://blogs.nvidia.com/blog/cosmos-world-foundation-models/">https://blogs.nvidia.com/blog/cosmos-world-foundation-models/</a></li><li>NVIDIA, Cosmos 3 launch (May 2026): <a href="https://nvidianews.nvidia.com/news/nvidia-launches-cosmos-3-the-open-frontier-foundation-model-for-physical-ai">https://nvidianews.nvidia.com/news/nvidia-launches-cosmos-3-the-open-frontier-foundation-model-for-physical-ai</a></li><li>Meta AI, “V-JEPA 2” (Jun 2025): <a href="https://ai.meta.com/blog/v-jepa-2-world-model-benchmarks/">https://ai.meta.com/blog/v-jepa-2-world-model-benchmarks/</a></li><li>V-JEPA 2.1 (Mar 2026): <a href="https://arxiv.org/abs/2603.14482">https://arxiv.org/abs/2603.14482</a></li><li>TechCrunch, “Yann LeCun’s AMI Labs raises $1.03 billion to build world models” (Mar 2026): <a href="https://techcrunch.com/2026/03/09/yann-lecuns-ami-labs-raises-1-03-billion-to-build-world-models/">https://techcrunch.com/2026/03/09/yann-lecuns-ami-labs-raises-1-03-billion-to-build-world-models/</a></li><li>TechCrunch, “World model companies are keeping a lot of secrets” (Sep 2026): <a href="https://techcrunch.com/2026/09/20/world-model-companies-are-keeping-a-lot-of-secrets/">https://techcrunch.com/2026/09/20/world-model-companies-are-keeping-a-lot-of-secrets/</a></li><li>OpenAI, “Video generation models as world simulators” (Feb 2024): <a href="https://openai.com/index/video-generation-models-as-world-simulators/">https://openai.com/index/video-generation-models-as-world-simulators/</a></li><li>OpenAI, “Sora 2 is here” (Sep 2025; product discontinued Apr 2026): <a href="https://openai.com/index/sora-2/">https://openai.com/index/sora-2/</a></li><li>Wayve, GAIA-3 (Dec 2025): <a href="https://wayve.ai/thinking/gaia-3/">https://wayve.ai/thinking/gaia-3/</a> and GAIA-4 (Aug 2026): <a href="https://wayve.ai/thinking/gaia-4/">https://wayve.ai/thinking/gaia-4/</a></li><li>Runway, “Introducing GWM-1” (Dec 2025): <a href="https://runwayml.com/research/introducing-runway-gwm-1">https://runwayml.com/research/introducing-runway-gwm-1</a></li><li>Microsoft Research, “Introducing Muse” (Feb 2025): <a href="https://www.microsoft.com/en-us/research/blog/introducing-muse-our-first-generative-ai-model-designed-for-gameplay-ideation/">https://www.microsoft.com/en-us/research/blog/introducing-muse-our-first-generative-ai-model-designed-for-gameplay-ideation/</a></li><li>Odyssey, “Introducing Odyssey-3” (Sep 2026): <a href="https://odyssey.systems/introducing-odyssey-3">https://odyssey.systems/introducing-odyssey-3</a></li><li>Liu et al., “World Model on Million-Length Video and Language with Blockwise RingAttention” (Feb 2024): <a href="https://arxiv.org/abs/2402.08268">https://arxiv.org/abs/2402.08268</a></li><li>Ha &amp; Schmidhuber, “World Models” (2018): <a href="https://arxiv.org/abs/1803.10122">https://arxiv.org/abs/1803.10122</a></li><li>Hafner et al., “Mastering diverse control tasks through world models,” <em>Nature</em> (2025): <a href="https://www.nature.com/articles/s41586-025-08744-2">https://www.nature.com/articles/s41586-025-08744-2</a></li><li>Schrittwieser et al., “Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model” (MuZero): <a href="https://arxiv.org/abs/1911.08265">https://arxiv.org/abs/1911.08265</a></li><li>Meta, “Introducing Meta Llama 3”: <a href="https://ai.meta.com/blog/meta-llama-3/">https://ai.meta.com/blog/meta-llama-3/</a> · Qwen, “Qwen3”: <a href="https://qwenlm.github.io/blog/qwen3/">https://qwenlm.github.io/blog/qwen3/</a></li><li>Gartner, “Top Strategic Technology Trends for 2026” (Oct 2025): <a href="https://www.gartner.com/en/newsroom/press-releases/2025-10-20-gartner-identifies-the-top-strategic-technology-trends-for-2026">https://www.gartner.com/en/newsroom/press-releases/2025-10-20-gartner-identifies-the-top-strategic-technology-trends-for-2026</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f1e6a73091a" width="1" height="1" alt=""><hr><p><a href="https://tutorialsavvy.com/large-world-models-lwm-teaching-ai-to-imagine-the-world-1f1e6a73091a">Large World Models(LWM): Teaching AI to Imagine the World</a> was originally published in <a href="https://tutorialsavvy.com">Tutorial Savvy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why LLMs Hallucinate (and What Actually Helps)]]></title>
            <link>https://tutorialsavvy.com/why-llms-hallucinate-and-what-actually-helps-01f5267375ac?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/01f5267375ac</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 02:21:51 GMT</pubDate>
            <atom:updated>2026-09-29T02:21:51.942Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Why a model makes things up, what’s going on inside it, and which fixes are worth your engineering time.</em></blockquote><p>Anyone who has shipped something built on an LLM has had this happen. You ask a simple question, like which API version added a certain endpoint, and you get a clean, confident, nicely formatted answer.</p><p>It’s wrong. The version number doesn’t exist, and the function it cites was never in the SDK. What bothered me most the first time was the tone: the model sounded exactly as sure as it does when it’s right.</p><p>For a while I treated hallucination as a bug that the next model release would fix. It hasn’t gone away, and I now think that’s expected. Hallucination is a side effect of how these models are trained and evaluated. Once you see where it comes from, it’s much easier to tell which mitigations actually work and which ones just make you feel better.</p><p>This post covers both. First the <em>why</em>, then the fixes that have held up for me and in the research, and a few that are overrated.</p><h3>First, what are we actually talking about?</h3><p>“Hallucination” has turned into a catch-all for “the AI said something wrong,” and that’s too broad to be useful. OpenAI’s definition is the one I like best: <em>plausible but false statements generated by language models.</em> The key word is plausible. A typo is a mistake. A made-up but perfectly formatted citation is a hallucination.</p><p><strong>So why do models make things up?</strong></p><p>Short version: next-word prediction produces hallucinations naturally, and the way we grade models keeps them around. There’s no single cause. Each stage of a model’s life adds a bit of pressure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yFkqrX4kJ5SXfXHD6FkdTA.png" /></figure><h3>1. Next-word prediction has no concept of “false”</h3><p>During pretraining the model learns one thing: given this text, what comes next? Nobody labels any sentence as true or false. All it ever sees are examples of fluent language.</p><p>The <a href="https://arxiv.org/abs/2509.04664">OpenAI paper by Kalai et al.</a> uses an analogy that made this click for me. Train an image model to label photos as “cat” or “dog” and it gets very good. Train it to label each pet photo with <em>the pet’s birthday</em> and it will always make mistakes, because nothing in the photo predicts the birthday.</p><p>Lots of facts work like birthdays. Spelling and bracket-matching follow consistent patterns, so those errors go away with scale. A specific person’s birth date, a niche API parameter, or the exact title of a paper doesn’t follow a pattern. Either the model saw it enough times to memorise it or it didn’t.</p><p>The paper makes this concrete. If 20% of birthday facts appear exactly once in the training data, you should expect a base model to hallucinate on at least 20% of birthday questions. So hallucination isn’t a mysterious glitch. It’s a predictable statistical error rate.</p><h3>2. The scoreboards reward bluffing</h3><p>This is the part people usually miss. Think back to multiple-choice exams with no negative marking. If you don’t know the answer, you guess, because a blank is guaranteed zero and a guess sometimes pays off.</p><p>Models get graded the same way. Most benchmarks score plain accuracy, so a model that says “I don’t know” scores the same as one that’s wrong. Over thousands of questions, the model that always guesses climbs the leaderboard. Train against that leaderboard and you’re effectively teaching the model to bluff.</p><p>OpenAI’s own numbers show this clearly. On the SimpleQA benchmark, the older o4-mini edges out the newer model on accuracy, 24% vs 22%. But it answers almost everything, so it’s wrong 75% of the time. The newer model says “I don’t know” on about half the questions and cuts its error rate to 26%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0_s8mGcWWYC4sOKJJRhgA.png" /></figure><p>An accuracy-only leaderboard would rank o4-mini higher. As a user, I’d much rather have the other one.</p><p>The math behind this is simple. Suppose a correct answer scores 1, an abstention scores 0, and a wrong answer costs λ points. If the model’s confidence is p, answering is worth taking only when:</p><pre>p \cdot 1 - (1 - p) \cdot \lambda &gt; 0 \quad \Longleftrightarrow \quad p &gt; \frac{\lambda}{1 + \lambda}</pre><p>With plain accuracy scoring, λ = 0 and the threshold is zero, so guessing always pays. Set λ = 1 and the model should answer only when it’s more than 50% sure. Set λ = 3 and the bar is 75%. That’s the fix Kalai et al. argue for: change how the <em>main</em> benchmarks are scored, rather than adding yet another hallucination benchmark that nobody optimises for.</p><h3>3. Fine-tuning on facts the model doesn’t know</h3><p><a href="https://arxiv.org/abs/2405.05904">Gekhman et al. (EMNLP 2024)</a> ran a controlled experiment and found that fine-tuning examples with <em>new</em> facts are learned much more slowly than examples the model already agrees with. Once those new facts are learned, the model’s tendency to hallucinate goes up roughly linearly.</p><p>Their explanation is that models get most of their factual knowledge in pretraining. Fine-tuning mostly teaches them how to use what they already know. If you push brand-new facts in through SFT, what the model really learns is “answer confidently even when you don’t actually know.”</p><h3>4. Decoding and context</h3><p>The last push comes at inference time. Sampling with temperature above zero will sometimes pick a lower-probability token, and every token after that is conditioned on it. <a href="https://arxiv.org/abs/2305.13534">Zhang et al.</a> call this <em>hallucination snowballing</em>. They found GPT-4 could recognise 87% of its own mistakes when asked separately, yet it still defended them once they were in the answer.</p><p>Context causes problems too. If the retrieved documents are missing the answer, or the answer sits in the middle of a long prompt, the model falls back on memory. <a href="https://arxiv.org/abs/2307.03172">Liu et al.</a> showed that accuracy drops noticeably when the relevant passage is in the middle of a long context rather than at the start or end.</p><h3>Mitigations that actually help</h3><p>Nothing gets you to zero. What works in practice is layering: give the model the facts, make abstaining a legitimate option, then check the output before a user sees it. Here’s the pipeline I’d build today:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvCmgSzraJe2M5G0nqb_ug.png" /></figure><p>Each step deals with one of the causes above. Here they are in order of how much they bought me for the effort.</p><h3>1. Ground the model in real sources (RAG, done properly)</h3><p>If pretraining can’t reliably store rare facts, don’t ask the model to recall them. Retrieve them. The original <a href="https://arxiv.org/abs/2005.11401">RAG paper by Lewis et al.</a> showed that pairing a generator with a retrieval index gives “more specific, diverse and factual language” than a model working from memory alone.</p><p>What the diagrams on vendor slides leave out is that <strong>retrieval quality is the ceiling.</strong> If the right chunk isn’t retrieved, the model will still produce an answer, just a made-up one. The details that made the biggest difference for me:</p><ul><li><strong>Measure retrieval separately.</strong> Track recall@k on a labelled set before you look at a single generated answer.</li><li><strong>Put the best evidence at the start or end of the context,</strong> not buried in the middle.</li><li><strong>Say it explicitly:</strong> “Answer only using the sources below. If they don’t contain the answer, say so.”</li><li><strong>Require citations per claim,</strong> so every sentence points back to a chunk you can check.</li></ul><h3>2. Make “I don’t know” a first-class answer</h3><p>This follows straight from the scoring argument. If your prompt, your eval, and your product all treat abstaining as failure, you’ll get bluffing. So:</p><ul><li>Tell the model in the system prompt that abstaining is acceptable, and show an example of it doing so.</li><li>Score your internal evals with a penalty for wrong answers (the λ from earlier), not plain accuracy.</li><li>Design the UI so “I couldn’t find this in our docs, here’s who to ask” is a normal outcome, not an error screen.</li></ul><h3>3. Detect uncertainty by sampling</h3><p>This is my favourite technique because it’s so simple. Ask the same question several times at a non-zero temperature. If the model knows the answer, the samples agree. If it’s guessing, they scatter.</p><p><a href="https://www.nature.com/articles/s41586-024-07421-0">Farquhar et al. (Nature, 2024)</a> formalised this as <strong>semantic entropy.</strong> You sample several answers, cluster them by <em>meaning</em> rather than exact wording (“Paris” and “It’s Paris, France” count as the same answer), and compute entropy over the clusters. High entropy flags a likely confabulation. It costs N times the inference, so I only run it on high-stakes questions.</p><h3>4. Verify after generating, independently</h3><p><a href="https://arxiv.org/abs/2309.11495">Chain-of-Verification (CoVe)</a> from Meta works in four steps: draft an answer, plan verification questions, answer those questions <em>independently</em>, then write a revised final answer.</p><p>The word “independently” is doing the heavy lifting. Remember the snowballing result: once a model has committed to a claim, it tends to defend it. Answering the checks in a fresh context, without the draft visible, breaks that loop. In RAG systems I do a lighter version: a second, cheaper call checks each cited claim against its source chunk and drops the claims that aren’t supported.</p><h3>5. Hand deterministic work to tools</h3><p>Dates, arithmetic, ID lookups, current prices, and user permissions shouldn’t be generated from memory. Give the model a tool and have it call the tool. A function call either returns the right value or fails with an error. It never invents a plausible number.</p><h3>6. Fine-tune for behaviour, not facts</h3><p>Given the Gekhman result, I’ve stopped trying to put knowledge into weights through SFT. Fine-tuning is great for format, tone, and teaching the model <em>when</em> to abstain. Facts belong in retrieval, where you can update them, cite them, and audit them.</p><h3>Mitigations that are overrated</h3><p>Some fixes get recommended a lot and don’t do much.</p><p><strong>“Do not hallucinate” in the system prompt.</strong> The model has no switch to turn off. Explicit <em>permission</em> to abstain helps, as covered above. A bare instruction not to make things up does almost nothing.</p><p><strong>Temperature 0 as a fix.</strong> Greedy decoding makes the output <em>repeatable</em>, not <em>correct</em>. A model that’s confidently wrong at temperature 0.7 is usually confidently wrong at 0 too, just the same way every time. You also lose the variation between samples</p><p><strong>“Just wait for a bigger model.”</strong> Bigger models know more, so they hallucinate less on common facts. But OpenAI’s paper makes a point that stuck with me: some questions can’t be answered, so accuracy will never reach 100%. And knowing your own limits can actually be <em>easier</em> for a small model. Calibration comes from training incentives, not parameter count.</p><p><strong>Asking “Are you sure?” in the same chat.</strong> Because of snowballing, the model tends to double down, or swing the other way and apologise for a correct answer. Verification works when it runs in a fresh context, not as a follow-up turn.</p><p><strong>Treating RAG as done.</strong> Retrieval addresses factuality. It does nothing for faithfulness, where the model has the right document and still paraphrases it wrongly. You need the verification step for that.</p><h3>Checklist</h3><p>If you’re putting an LLM feature in front of users, run through this list. It’s short on purpose.</p><ul><li>Build an eval set of 100 to 200 real questions, including ones your sources <strong>can’t</strong> answer</li><li>Score it three ways (correct, wrong, abstained), with a penalty for wrong answers</li><li>Measure retrieval recall on its own, before measuring generation</li><li>Tell the model it’s allowed to abstain, and give it an example</li><li>Require a citation for every factual claim, and check the citations automatically</li><li>Route dates, math, lookups, and permissions through tools, not generation</li><li>Add a verification pass (CoVe-style or a claim-vs-source check) for high-stakes answers</li><li>Use sampling consistency or semantic entropy where the extra cost is worth it</li><li>Log every abstention and flagged answer, since they show you where your knowledge base has gaps</li><li>Design the “I don’t know” state in the UI as carefully as the answer state</li></ul><h3>References</h3><ol><li>Kalai, Nachum, Vempala &amp; Zhang, <a href="https://arxiv.org/abs/2509.04664">Why Language Models Hallucinate</a> (OpenAI, 2025). Also see OpenAI’s <a href="https://openai.com/index/why-language-models-hallucinate/">summary post</a>, which has the SimpleQA numbers.</li><li>Huang et al., <a href="https://arxiv.org/abs/2311.05232">A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions</a> (ACM TOIS, 2024)</li><li>Lewis et al., <a href="https://arxiv.org/abs/2005.11401">Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks</a> (NeurIPS 2020)</li><li>Farquhar, Kossen, Kuhn &amp; Gal, <a href="https://www.nature.com/articles/s41586-024-07421-0">Detecting hallucinations in large language models using semantic entropy</a> (Nature, 2024)</li><li>Dhuliawala et al., <a href="https://arxiv.org/abs/2309.11495">Chain-of-Verification Reduces Hallucination in Large Language Models</a> (Meta AI, 2023)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01f5267375ac" width="1" height="1" alt=""><hr><p><a href="https://tutorialsavvy.com/why-llms-hallucinate-and-what-actually-helps-01f5267375ac">Why LLMs Hallucinate (and What Actually Helps)</a> was originally published in <a href="https://tutorialsavvy.com">Tutorial Savvy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cacheup: A Multi-Tiered Cache in Front of Claude, So You Stop Paying for Work You’ve Already Done]]></title>
            <link>https://tutorialsavvy.com/cacheup-a-multi-tiered-cache-in-front-of-claude-so-you-stop-paying-for-work-youve-already-done-b27b109a5bab?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b27b109a5bab</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 15:17:02 GMT</pubDate>
            <atom:updated>2026-09-23T15:17:02.060Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Try it here : <a href="http://github.com/Rithvik1709/Cacheup">github.com/Rithvik1709/Cacheup</a></blockquote><p>You would have noticed this in claude the same questions get asked twice, the same system prompt gets sent on every single call, and the same large files get read into context over and over just so the model can tell you “yes, this function calls the database.”</p><p><strong>Cacheup</strong> is a small, dependency-free proxy that sits in front of api.anthropic.com and fixes all three problems at once without touching your prompts by hand or standing up Redis. Point your SDK at http://127.0.0.1:8787 instead of the real endpoint, and it starts saving you tokens immediately.</p><h3>The core idea: three tiers, each solving a different kind of waste</h3><p>Cacheup doesn’t try to be one clever cache. It’s three layered defenses, each targeting a different flavor of redundant work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryrf3zRCAuOjd3yfC3Ns3Q.png" /></figure><p><strong>Tier 1 — Semantic response cache.</strong> Before anything hits the network, Cacheup embeds your latest message with a dependency-free hashed n-gram embedding (no model download, no GPU) and compares it against prior requests that shared the <em>exact same</em> model, system prompt, and tools. If cosine similarity clears 0.96, you get the old answer back a near-instant X-Cacheup: hit; layer=semantic. match to identical context is deliberate it stops the cache from confidently returning a stale answer to a differently-configured session.</p><p><strong>The exact cache.</strong> If there’s no semantic near-match, Cacheup hashes the fully normalized request (whitespace collapsed, keys sorted) into a cache key and checks a layered backend in-memory LRU first, then SQLite. A hit here is a byte-for-byte repeat of a prior call, and it’s promoted back up into memory so the next repeat is even faster.</p><p><strong>Tier 2 — Reusable fragments.</strong> Register a big, stable block of context once a DB schema, a style guide, a tool definition — and reference it by ID ({&quot;cacheup&quot;: {&quot;fragments&quot;: [&quot;schema:v3.2&quot;]}}) instead of pasting it into every request. Cacheup splices it into the system prompt server-side and strips the fragment metadata before the request ever reaches Anthropic.</p><p><strong>Tier 3 — Native prompt caching.</strong> On a real miss, prepare_anthropic_request() marks up to four deterministic cache_control: {&quot;type&quot;: &quot;ephemeral&quot;} breakpoints: the first and last system blocks, the last tool definition, and the final content block of the latest message. That&#39;s Anthropic&#39;s own prompt caching, applied automatically so you don&#39;t have to hand-place breakpoints on every call.</p><p>The three tiers compose cleanly: a semantic hit skips the network entirely; an exact-cache hit skips it too; a genuine miss still gets to keep its expensive prefix cached upstream. Every response header tells you exactly which layer answered — hit; layer=semantic, hit; layer=memory, hit; layer=sqlite, or miss; source=anthropic — plus an estimated X-Cacheup-Tokens-Saved.</p><h3>The second half: don’t even let Claude read the haystack</h3><p>Caching repeated <em>requests</em> is only half the problem. The other half is requests that didn’t need to spend frontier-model context in the first placereading ten files to answer one question, or generating boilerplate test code from a pattern that’s already sitting in the repo. For that, Cacheup ships a local implementation of Spotify’s <strong>Portal/Shunt</strong> pattern a conservative router that decides, per task, whether the work should stay on Claude or get delegated to a cheaper worker mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ELO1bFAyQoqsMg7JBde73A.png" /></figure><p>The policy is deliberately narrow and ordered so the safe default wins ties:</p><ol><li><strong>Is this an edit?</strong> Editing, debugging, architecture, and safety-critical reasoning <em>always</em> stay on Claude no exceptions, checked first.</li><li><strong>Is the output predictable and reference-driven?</strong> Given a spec and a reference file (e.g. “write tests for UserService, modeled on OrderTest.java&quot;), code-writer generates the file — and if you pass a target path, the generated code is written straight to disk and never even enters Claude&#39;s context.</li><li><strong>Is this bulk, low-reasoning I/O?</strong> More than one path, or any single file over the configurable SHUNT_MIN_LINES (default 350), routes to bulk-reader, which ingests the files and answers a focused question instead of dumping raw file contents into the model&#39;s context window.</li><li><strong>Otherwise:</strong> it stays on Claude. Small or reasoning-heavy work is exactly what the primary model is for.</li></ol><p>You can inspect this decision before committing to it via POST /v1/route, which returns the route, the mode, and the plain-English reason — useful for debugging why something got delegated (or didn&#39;t). And delegated results are cached too, through the same LayeredCache machinery, so a repeated bulk-read of the same files doesn&#39;t re-invoke the Portal CLI.</p><p>The rules aren’t hidden in Python eithershunt.yaml declares them as hookable policy (on: Read, on: Bash, on: Edit, etc.), so the same &quot;big reads get delegated, edits stay on Claude&quot; contract can be enforced at the tool-call layer, not just the HTTP layer.</p><h3>Why the architecture stays boring on purpose</h3><p>Nothing here requires a vector database or a model download. The semantic tier uses a hashed embedding over SQLite or process memory specifically so the project runs cold, with zero setup.</p><h3>Try it</h3><pre>python3 -m unittest discover -v<br>python3 server.py</pre><pre>export ANTHROPIC_API_KEY=sk-ant-...<br>curl http://127.0.0.1:8787/v1/messages \<br>  -H &#39;content-type: application/json&#39; \<br>  -H &#39;anthropic-version: 2023-06-01&#39; \<br>  -d &#39;{&quot;model&quot;:&quot;claude-sonnet-4-5&quot;,&quot;max_tokens&quot;:128,&quot;system&quot;:&quot;You are a concise coding assistant.&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;What is dependency injection?&quot;}]}&#39;</pre><p>Run it twice. The first response comes back X-Cacheup: miss; source=anthropic. The second assuming it&#39;s a normalized repeat comes back hit, with a token-savings estimate attached</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b27b109a5bab" width="1" height="1" alt=""><hr><p><a href="https://tutorialsavvy.com/cacheup-a-multi-tiered-cache-in-front-of-claude-so-you-stop-paying-for-work-youve-already-done-b27b109a5bab">Cacheup: A Multi-Tiered Cache in Front of Claude, So You Stop Paying for Work You’ve Already Done</a> was originally published in <a href="https://tutorialsavvy.com">Tutorial Savvy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jev: Teaching Software to Make Small Decisions Without Calling in a Language Model]]></title>
            <link>https://medium.com/data-science-collective/jev-teaching-software-to-make-small-decisions-without-calling-in-a-language-model-bbfc25bad214?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbfc25bad214</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[jevs]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sat, 19 Sep 2026 16:16:29 GMT</pubDate>
            <atom:updated>2026-09-19T16:16:29.357Z</atom:updated>
            <content:encoded><![CDATA[<h4>Stop Sending Every Tiny Decision to an LLM</h4><h4><strong>A new model called Jev bets that most of your “AI decisions” were never language problems in the first place.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gktR3r8UyKN6ptOacpb_yQ.png" /></figure><p>Here’s an uncomfortable truth about most “AI-powered” systems: they don’t need an AI that can write. They need one that can <strong>judge</strong>.</p><p>Is this order fraudulent? Which warehouse should fulfill it? Is this API key request risky? Does this search result actually match the query?</p><p>None of these need a paragraph. They need a label, fast.</p><p>That’s the bet behind <strong>Jev</strong>, a model TypeSafe AI shipped on September 15, 2026. It can’t hold a conversation. It can’t write code. It won’t generate so much as a sentence. And that’s not a limitation it’s the entire pitch.</p><blockquote>The model isn’t broken. It’s just refusing to do a job it was never good at.</blockquote><h4>The tax we’ve been paying without noticing</h4><p>Tool calling and structured outputs made LLMs much easier to bolt onto software. But under the hood, nothing changed the model is still generative. Even a one-word answer gets produced token by token, with input cost, generation latency, and output cost stacked on top.</p><p>Now picture that inside a loop that calls a model over and over just to pick a next step:</p><pre>def run_agent(task):<br> memory = [task]<br> while not finished(memory):<br> step = brain.decide(memory) # generation call #1<br> outcome = perform(step)<br> memory.append(outcome)<br> status = brain.decide(memory) # generation call #2, just to check progress<br>return memory</pre><p>Two of those calls never needed a written answer just a label. That’s the tax.</p><p><strong>So what does it actually do?</strong></p><p>Strip away the branding and Jev is a <strong>semantic decision engine</strong>. You feed it two things:</p><p>- <strong>State</strong> plain text or JSON describing what’s happening right now<br>- <strong>Questions</strong> decisions you want made about that state, each with a predefined answer shape</p><p>Three answer types, no freeform text allowed:</p><ul><li><strong>Choice</strong> (pick one option, probability per option),</li><li><strong>Score</strong> (place the input on a scale you define), and</li><li><strong>Noul</strong>(a yes/no question that returns a probability instead of a flat boolean).</li></ul><p>Here’s a differently-shaped example than a support ticket an incoming order review:</p><pre>{<br> &quot;model&quot;: &quot;jev-latest&quot;,<br> &quot;state&quot;: &quot;Order #48213: $2,400 electronics, shipping to a new address, paid with a card added 10 minutes ago.&quot;,<br> &quot;questions&quot;: {<br> &quot;likely_fraud&quot;: {<br> &quot;type&quot;: &quot;noul&quot;,<br> &quot;instructions&quot;: &quot;Does this order show signs of card fraud?&quot;<br> },<br> &quot;fulfillment_center&quot;: {<br> &quot;type&quot;: &quot;choice&quot;,<br> &quot;instructions&quot;: &quot;Which warehouse should ship this order?&quot;,<br> &quot;criteria&quot;: {<br> &quot;east&quot;: &quot;Closest to East Coast addresses, electronics in stock&quot;,<br> &quot;west&quot;: &quot;Closest to West Coast addresses, limited electronics stock&quot;,<br> &quot;hold&quot;: &quot;Do not ship until reviewed&quot;<br> }<br> }<br> }<br>}</pre><p>And the response your code actually acts on:</p><pre>result = jev.ask(order_payload)<br>if result[&quot;likely_fraud&quot;] &gt; 0.85:<br> hold_for_manual_review(order_id)<br>elif result[&quot;fulfillment_center&quot;][&quot;confidence&quot;] &lt; 0.5:<br> hold_for_manual_review(order_id)<br>else:<br> ship_from(result[&quot;fulfillment_center&quot;][&quot;choice&quot;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jao8uNe7vzynN9zk.jpg" /></figure><p>People keep calling this “a smart switch statement.” That’s meant as an insult, but it’s the whole point ordinary code owns the branching. The model just supplies the fuzzy judgment code can’t calculate on its own.</p><h4>LLM vs. Jev: not a rivalry, a division of labor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q9srFydCcBVDoqzR.jpg" /></figure><p>TypeSafe says Jev evaluates every declared question about a state<strong> in parallel</strong>, in one request. The company’s numbers: 70–500ms latency, roughly $0.042 per million input tokens, free output, with headline claims up to 200x faster and 400x cheaper than comparable LLM workflows.</p><blockquote>Worth noting: those multiples come from TypeSafe’s own benchmarks. Treat them as a ceiling, not a promise.</blockquote><h4>The number matters more than the label</h4><p>This unlocks a simple pattern, shown here with the fraud-check example instead of a ticket:</p><pre>verdict = jev.ask(order_payload)<br>  if verdict[&quot;likely_fraud&quot;] &gt; 0.9:<br>   block_order(order_id)<br>  elif verdict[&quot;likely_fraud&quot;] &gt; 0.5:<br>   flag_for_analyst(order_id)<br>  else:<br>   approve_order(order_id)</pre><p>Thresholds live in your code, not the modelreviewable, testable, adjustable per use case.</p><h4>“It can’t hallucinate”</h4><p>Jev genuinely can’t return an answer outside the schema you gave it. But it can absolutely, confidently, land on the <strong>wrong valid option</strong>.</p><blockquote><strong>Type safety guarantees the shape of the answer. It says nothing about whether the answer is right.</strong></blockquote><h4>Where it actually belongs: next to an LLM, not instead of one</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BRxKyXFtzvglOfWpU9wjFA.png" /></figure><p>A model-routing example, using a different pair of tiers than the original “fast/powerful” split:</p><pre>tier = jev.choice(<br> state=incoming_request,<br> options={<br> &quot;light&quot;: &quot;Simple lookups, formatting, short factual answers&quot;,<br> &quot;heavy&quot;: &quot;Multi-step reasoning, novel code, ambiguous requests&quot;,<br> },<br>)<br>handler = light_weight_model if tier == &quot;light&quot; else frontier_model<br>response = handler.run(incoming_request)</pre><p>And a tool-gating example for an agent about to touch a file system:</p><pre>risk = jev.score(<br> state=f&quot;About to run: {proposed_command}&quot;,<br> scale=[&quot;safe&quot;, &quot;reversible&quot;, &quot;destructive&quot;],)<br>if risk[&quot;label&quot;] == &quot;destructive&quot; or risk[&quot;confidence&quot;] &lt; 0.7:<br> request_human_approval(proposed_command)<br>else:<br> execute(proposed_command)</pre><h4>Where it earns its keep today</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qo8QEIG0Hh9c3hW4.jpg" /></figure><p>That maps cleanly onto support/ops triage, search reranking and citation checks, safety screening, bulk classification, and with a caveat real-time interfaces, since Jev only reads text/JSON, never pixels.</p><h4>Where it’s clearly the wrong tool</h4><p>No writing, no summarizing, no code generation, no explaining itself. Weak at arithmetic, exact string matching, date math. Struggles with decisions needing several hidden reasoning steps. Can’t pull an unknown value out of nowhere.</p><p>And the boring-but-true rule: <strong>if an if-statement already solves it, keep the if-statement</strong>.</p><h4>How to roll it out without shooting yourself in the foot</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Stni7Iufdr47j3b7.jpg" /></figure><pre># Shadow mode: log Jev&#39;s answer, but let the old system decide<br>old_result = legacy_router(request)<br>shadow_result = jev.ask(request)<br>log_comparison(old_result, shadow_result)<br>return old_result</pre><p>Pick one bounded, low-risk decision. Write the rubric first. Collect messy, adversarial examples. Run it quietly in shadow mode. Set thresholds from what you observe. Automate the safest slice first. Version everything like code.</p><h4>The real takeaway</h4><blockquote>Jev isn’t interesting because it beats an LLM at writing. It’s interesting because it refuses to try.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbfc25bad214" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/jev-teaching-software-to-make-small-decisions-without-calling-in-a-language-model-bbfc25bad214">Jev: Teaching Software to Make Small Decisions Without Calling in a Language Model</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Launching Vaani v1.0.0: An Open-Source Real-Time Voice AI Stack]]></title>
            <link>https://medium.com/@rithvikbng/launching-vaani-v1-0-0-an-open-source-real-time-voice-ai-stack-28ed637e6fa2?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/28ed637e6fa2</guid>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 15:53:46 GMT</pubDate>
            <atom:updated>2026-08-16T16:03:06.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKb-PzYHrx3-tCBu5aAlhA.jpeg" /></figure><p><em>A low-latency voice pipeline for local inference, streaming speech recognition, LLM reasoning, and text-to-speech synthesis.</em></p><p>Voice interfaces are becoming one of the most important interaction layers for AI products.</p><p>Whether it’s assistants, copilots, smart devices, or customer support tools, real-time voice interaction is moving from novelty to necessity.</p><p>But building a fast, reliable, production-quality voice AI system remains difficult. Developers often have to stitch together multiple components across ASR, LLMs, and TTS systems, while depending on vendor-specific ecosystems or closed APIs.</p><p><strong>We built Vaani to solve that problem.</strong></p><p>Today, we’re releasing <strong>Vaani v1.0.0</strong> — the first stable open-source release of our real-time voice AI stack.</p><h3>Why We Built Vaani</h3><p>The core challenge in voice AI is <strong>latency</strong>.</p><p>A user expects an assistant to respond quickly, naturally, and continuously. However, many systems are optimized primarily for model quality, rather than the end-to-end responsiveness required for real-time conversations.</p><p>We wanted to build a system that:</p><ul><li>Works locally</li><li>Supports real-time streaming</li><li>Is transparent and inspectable</li><li>Keeps the stack open and extensible</li><li>Allows developers to benchmark and tune latency</li><li>Supports both local and remote inference</li></ul><p><strong>Vaani is built around that idea.</strong></p><h3>What Is Vaani?</h3><p>Vaani is an open-source, real-time voice AI stack designed for end-to-end conversational interaction.</p><p>It combines streaming speech recognition, language-model generation, and text-to-speech synthesis into a single streaming pipeline.</p><p>At its core:</p><p><strong>Microphone → ASR → LLM → TTS → Speaker</strong></p><p>The architecture is designed around streaming data rather than traditional batch processing, allowing different stages of the pipeline to work concurrently.</p><p>This makes Vaani suitable for:</p><ul><li>Conversational AI assistants</li><li>Voice copilots</li><li>Smart devices</li><li>Local AI applications</li><li>Voice-driven software</li><li>Research and experimentation</li></ul><h3>What Vaani Includes</h3><p>Vaani brings together several components required for a complete voice AI system:</p><ul><li><strong>Streaming ASR</strong> with VAD-based speech detection</li><li><strong>Partial and final transcript handling</strong></li><li><strong>LLM token streaming</strong> with TTFT instrumentation</li><li><strong>Sentence-level TTS chunking</strong></li><li><strong>Low-latency audio playback</strong></li><li><strong>Barge-in and interrupt handling</strong></li><li><strong>gRPC deployment</strong> for remote inference</li><li><strong>Benchmarking utilities</strong> for latency and throughput analysis</li></ul><p>The goal is to make these components work together as a coherent system rather than forcing developers to build the entire orchestration layer themselves.</p><h3>System Architecture</h3><p>The architecture is intentionally modular.</p><p>Speech input is processed in small audio chunks. A lightweight VAD layer detects speech activity and identifies speech boundaries.</p><p>The resulting audio stream is passed to the ASR layer, which produces partial and final transcripts.</p><p>These transcripts are then converted into prompts for the LLM. Instead of waiting for the complete response, Vaani streams generated tokens as soon as they become available.</p><p>The generated response is then passed to the TTS layer, which converts the text into smaller audio chunks that can be played back progressively.</p><p>This creates a continuous pipeline:</p><p><strong>Audio Input → VAD → ASR → LLM → TTS → Audio Output</strong></p><p>The streaming architecture is what makes the system suitable for real-time interaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0J_ooEAKX6q4hruHD5W5ug.png" /></figure><h3>Performance Goals</h3><p>Vaani was designed around a simple principle:</p><blockquote><strong><em>The most important metric isn’t just what the model says — it’s how quickly the user hears it.</em></strong></blockquote><p>Our target latency profile is:</p><p>ComponentTargetVAD + ASR boundary~20–80 msLLM TTFT~60–180 msTTS first chunk~40–120 msPlayback output~6–20 ms</p><p><strong>Overall local first response&lt;500 ms</strong></p><p>These targets are intended as an optimization baseline for conversational systems where responsiveness matters as much as correctness.</p><h3>Benchmark Snapshot</h3><p>We benchmarked Vaani with <strong>10 concurrent clients</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OHUQvFRHOOlSh5VW9EFo0Q.png" /><figcaption>Benchmarks</figcaption></figure><h3>First Audio Latency — P50</h3><p>ModelLatency<strong>Vaani1008.65 ms</strong>ElevenLabs Conversational*680 msOpenAI Realtime1089 ms</p><h3>First Audio Latency — P95</h3><p>ModelLatency<strong>Vaani1009.66 ms</strong>ElevenLabs Conversational*1560 msOpenAI Realtime1630 ms</p><h3>Throughput</h3><p>ModelResponses/secVaani <strong>1.97 </strong>ElevenLabs Conversational*2.40 OpenAI Realtime1.70</p><p>The benchmark demonstrates that Vaani can operate competitively within the conversational voice AI space while remaining open, inspectable, and developer-controlled.</p><p>More importantly, the benchmark gives us a measurable baseline for future optimization.</p><p>These results should not be interpreted as a claim that Vaani is universally better than commercial voice platforms. Different systems can use different hardware, regions, models, network conditions, audio configurations, and measurement methodologies.</p><p>Our goal is to establish a transparent baseline and continuously improve it.</p><h3>Why This Release Matters</h3><p>Vaani v1.0.0 is more than an experiment.</p><p>It provides a foundation for developers and researchers who want to:</p><ul><li>Run a voice AI stack locally</li><li>Benchmark latency and throughput</li><li>Experiment with different models</li><li>Build custom voice agents</li><li>Deploy remote inference through gRPC</li><li>Modify and extend the entire pipeline</li></ul><p>The release includes:</p><ul><li>Local deployment mode</li><li>gRPC server/client mode</li><li>Build validation</li><li>Test coverage</li><li>Benchmarking utilities</li><li>Package metadata</li><li>Modular inference components</li></ul><h3>What’s Next?</h3><p>Vaani v1.0.0 is only the beginning.</p><p>Our upcoming focus areas include:</p><ul><li>Further latency optimization</li><li>Better deployment ergonomics</li><li>Greater model flexibility</li><li>Improved multi-turn memory</li><li>More advanced profiling and benchmarking</li><li>Broader hardware compatibility</li><li>Improved streaming performance</li></ul><p>The long-term goal is to make Vaani a flexible building block for the next generation of <strong>voice-native AI applications</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28ed637e6fa2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harness Layer: Building the Intelligence Infrastructure Behind Modern AI Systems]]></title>
            <link>https://medium.com/@rithvikbng/harness-layer-building-the-intelligence-infrastructure-behind-modern-ai-systems-ef60e5d4c3ad?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef60e5d4c3ad</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 15:13:43 GMT</pubDate>
            <atom:updated>2026-06-21T15:13:43.101Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LgGbHLKf8BgZPKECcwmTyQ.png" /></figure><h3>Introduction</h3><p>The AI industry is obsessed with models.Every week a new model is released. Bigger context windows. Better reasoning. Faster inference. Lower costs.</p><p>Yet most AI systems fail for a surprisingly simple reason:</p><p><strong>The model doesn’t know enough about your business.</strong></p><p>An LLM can explain quantum mechanics, write production-grade code, and solve complex reasoning problems, but ask it:</p><ul><li>What was the latest update to our internal policy?</li><li>Which API endpoint was deprecated last week?</li><li>What customer issues were reported this month?</li><li>What does our private documentation say about deployment?</li></ul><p>And suddenly the model becomes almost useless.</p><p>The problem isn’t intelligence. The problem is knowledge.</p><p>Modern organizations generate enormous amounts of information:</p><ul><li>Documentation</li><li>Wikis</li><li>Source code</li><li>Databases</li><li>Customer conversations</li><li>PDFs</li><li>Slack messages</li><li>Meeting notes</li><li>APIs</li><li>Analytics</li><li>Product specifications</li></ul><p>Unfortunately, this information is fragmented across dozens of systems.</p><p>This fragmentation creates a massive gap between organizational knowledge and AI capabilities.</p><p>The solution is a Harness Layer.</p><p>A Harness Layer acts as the intelligence infrastructure that continuously gathers, transforms, validates, enriches, stores, and serves knowledge to AI applications.</p><p>Instead of asking:</p><blockquote><em>“How do we make the model smarter?”</em></blockquote><p>A Harness Layer asks:</p><blockquote><em>“How do we make knowledge accessible, trustworthy, and continuously updated?</em></blockquote><h3>Understanding the Core Problem</h3><p>An organization with:</p><ul><li>500,000 documents</li><li>40 Git repositories</li><li>15 databases</li><li>20 SaaS platforms</li><li>10 years of historical data</li></ul><p>An AI assistant connected directly to these systems faces several challenges.</p><h3>Challenge 1: Format Diversity</h3><p>Knowledge exists in many formats:</p><pre>PDF<br>DOCX<br>TXT<br>Markdown<br>JSON<br>XML<br>CSV<br>SQL Tables<br>REST APIs<br>Source Code<br>Images<br>Videos</pre><p>Every format requires different processing logic.</p><h3>Challenge 2: Knowledge Fragmentation</h3><p>The same information may exist in multiple locations.</p><p>Example:</p><p>Feature Documentation → Notion</p><p>API Documentation → GitHub</p><p>Release Notes → Confluence</p><p>Customer Issues → Zendesk</p><p>Product Specs → Google Drive</p><p>Without consolidation, AI receives incomplete context.</p><h3>Challenge 3: Constant Change</h3><p>Knowledge never remains static. Every day, documents change, APIs evolve, new code is pushed, policies are updated, and teams create new content. As a result, a static knowledge base becomes obsolete quickly.</p><h3>Challenge 4: Information Quality</h3><p>Not all knowledge is reliable. Some content can be outdated, duplicated, incorrect, incomplete, or contradictory. Without proper validation, AI systems amplify these problems rather than resolving them.</p><h3>What Exactly Is a Harness Layer?</h3><p>A Harness Layer is a centralized intelligence system responsible for converting raw organizational data into AI-ready knowledge.</p><p>Think of it as:</p><pre>Raw Data<br>     ↓<br>Harness Layer<br>     ↓<br>Trusted Knowledge<br>     ↓<br>AI Applications</pre><p>The Harness Layer does not replace databases.It does not replace vector stores.It does not replace AI models.Instead, it coordinates all of them.</p><p>Its job is to ensure that AI always receives the best possible information.</p><h3>The Anatomy of a Harness Layer</h3><p>A production-grade Harness Layer typically consists of eight major subsystems.</p><h3>1. Connector Framework</h3><p>The Connector Framework is responsible for collecting data.</p><p>It acts as the entry point into the knowledge ecosystem.</p><p>Examples:</p><pre>GitHub<br>GitLab<br>Bitbucket<br>Notion<br>Confluence<br>Google Drive<br>Dropbox<br>MongoDB<br>PostgreSQL<br>MySQL<br>Snowflake<br>REST APIs<br>GraphQL APIs<br>Local Files<br>S3 Buckets</pre><p>A connector abstracts away platform-specific complexities.</p><p>Instead of writing separate logic for every source, the Harness Layer standardizes ingestion.</p><p>Example Interface:</p><pre>class Connector:<br>    def connect()<br>    def fetch()<br>    def sync()<br>    def validate()</pre><p>Every connector follows the same contract.</p><h3>2. Parsing Layer</h3><p>Raw data is rarely usable because a PDF, JSON file, or Git repository is not knowledge in itself. Knowledge emerges only after parsing, where the parsing layer extracts meaningful content from these raw formats.</p><p>Examples:</p><h3>PDF Parser</h3><p>Extracts:</p><ul><li>Headings</li><li>Sections</li><li>Tables</li><li>Metadata</li></ul><h3>Markdown Parser</h3><p>Extracts:</p><ul><li>Titles</li><li>Hierarchies</li><li>Code blocks</li><li>Links</li></ul><h3>Source Code Parser</h3><p>Extracts:</p><ul><li>Classes</li><li>Functions</li><li>Comments</li><li>Dependencies</li></ul><h3>Database Parser</h3><p>Extracts:</p><ul><li>Records</li><li>Relationships</li><li>Schemas</li></ul><p>The goal is to transform every source into a unified representation.</p><h3>3. Normalization Layer</h3><p>Different systems describe identical concepts differently.</p><p>Example:</p><pre>Customer<br>Client<br>Consumer<br>Account Holder</pre><p>All may represent the same entity.</p><p>Normalization creates consistency.</p><p>Tasks include:</p><ul><li>Deduplication</li><li>Standard naming</li><li>Metadata mapping</li><li>Relationship mapping</li></ul><p>Without normalization, retrieval quality collapses.</p><h3>4. Knowledge Enrichment Layer</h3><p>This is where intelligence begins. The enrichment layer enhances raw content.</p><p>Techniques include:</p><h3>Summarization</h3><p>Converts long documents into concise descriptions.</p><h3>Classification</h3><p>Assigns categories.</p><p>Example:</p><pre>Engineering<br>Finance<br>Legal<br>HR<br>Marketing</pre><h3>Entity Extraction</h3><p>Identifies:</p><ul><li>Companies</li><li>People</li><li>Technologies</li><li>Products</li></ul><h3>5. Validation Layer</h3><p>A critical but often ignored component.</p><p>Validation ensures knowledge quality.</p><p>Checks include:</p><h4>Freshness Validation</h4><p>Is content outdated?</p><h4>Integrity Validation</h4><p>Is content corrupted?</p><h4>Duplicate Detection</h4><p>Has this already been indexed?</p><h4>Reference Validation</h4><p>Do linked resources still exist?</p><h4>Trust Scoring</h4><p>Assign confidence levels.</p><p>Example:</p><pre>Official Documentation = 100<br>Internal Wiki = 80<br>Community Notes = 60<br>Archived Content = 20</pre><p>Retrieval can prioritize high-trust content.</p><h3>6. Scheduling &amp; Orchestration Layer</h3><p>Knowledge pipelines must run continuously.</p><p>Common schedules:</p><pre>Every Minute<br>Every 5 Minutes<br>Hourly<br>Daily<br>Weekly<br>Monthly</pre><p>Advanced systems support:</p><ul><li>Event-based triggers</li><li>Webhooks</li><li>Real-time streaming</li></ul><p>Popular orchestration tools:</p><ul><li>Airflow</li><li>Temporal</li><li>Dagster</li><li>Prefect</li></ul><h3>7. Knowledge Storage Layer</h3><p>After processing, knowledge is stored.</p><p>Most Harness Layers use multiple storage systems.</p><h3>Object Storage</h3><p>Stores raw files.</p><p>Example:</p><pre>S3<br>MinIO<br>GCS</pre><h3>Relational Storage</h3><p>Stores metadata.</p><p>Example:</p><pre>PostgreSQL<br>MySQL</pre><h3>Vector Storage</h3><p>Stores embeddings.</p><p>Example:</p><pre>Pinecone<br>Qdrant<br>Weaviate<br>Milvus<br>pgvector</pre><h3>Graph Storage</h3><p>Stores relationships.</p><p>Example:</p><pre>Neo4j<br>TigerGraph<br>ArangoDB</pre><h3>8. Retrieval Layer</h3><p>The retrieval layer is the heart of AI interaction.</p><p>It determines:</p><blockquote><em>What knowledge should be sent to the model?</em></blockquote><p>Techniques include:</p><h4>Keyword Search</h4><p>Traditional text matching.</p><h4>Semantic Search</h4><p>Vector similarity.</p><h4>Hybrid Search</h4><p>Keyword + Semantic.</p><h4>Metadata Filtering</h4><p>Example:</p><pre>Department = Engineering<br>Created After = Jan 2026<br>Author = Platform Team</pre><h4>Reranking</h4><p>Uses a smaller model to improve relevance.</p><p>This dramatically improves answer quality.</p><h3>How Knowledge Bases Fit Into a Harness Layer</h3><p>Many people think:</p><pre>Knowledge Base = Harness Layer</pre><p>This is incorrect.</p><p>A Knowledge Base is only one component.</p><p>Relationship:</p><pre>Sources<br>   ↓<br>Harness Layer<br>   ↓<br>Knowledge Base<br>   ↓<br>Retrieval<br>   ↓<br>LLM</pre><p>The Harness Layer builds and maintains the Knowledge Base.</p><p>The Knowledge Base stores the processed knowledge.</p><h3>Building a Strong Knowledge Layer</h3><p>The strongest Harness Layers share six characteristics.</p><h4>Characteristic 1: Source Agnostic</h4><p>Adding a new connector should take hours, not weeks.</p><h4>Characteristic 2: Self-Healing</h4><p>Failures automatically recover.</p><h4>Characteristic 3: Incremental Updates</h4><p>Only changed data gets reprocessed.</p><h4>Characteristic 4: Versioned Knowledge</h4><p>Historical snapshots remain available.</p><h4>Characteristic 5: Trust Scoring</h4><p>Every piece of knowledge has confidence levels.</p><h4>Characteristic 6: Observability</h4><p>Everything is measurable.</p><p>Metrics:</p><ul><li>Sync Success Rate</li><li>Retrieval Accuracy</li><li>Knowledge Freshness</li><li>Query Latency</li><li>Coverage Percentage</li></ul><h3>Reference Open-Source Architecture</h3><pre>harness-layer/<br>│<br>├── connectors/<br>│   ├── github/<br>│   ├── notion/<br>│   ├── postgres/<br>│   └── drive/<br>│<br>├── parsers/<br>│   ├── pdf/<br>│   ├── markdown/<br>│   ├── code/<br>│   └── json/<br>│<br>├── enrichers/<br>│   ├── embeddings/<br>│   ├── summaries/<br>│   ├── classifiers/<br>│   └── entities/<br>│<br>├── validators/<br>│   ├── freshness/<br>│   ├── trust/<br>│   └── duplicate/<br>│<br>├── schedulers/<br>│<br>├── retrieval/<br>│<br>├── vectorstore/<br>│<br>├── api/<br>│<br>└── dashboard/</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef60e5d4c3ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Representation Learning: The Hidden Language of Modern AI]]></title>
            <link>https://medium.com/@rithvikbng/representation-learning-the-hidden-language-of-modern-ai-c8daa1ee0308?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8daa1ee0308</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Sun, 31 May 2026 05:14:40 GMT</pubDate>
            <atom:updated>2026-05-31T05:14:40.860Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How ChatGPT understands language, how Netflix recommends movies, how search engines find the right results, and how modern AI learns without explicit instructions.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ozbui14obCndZVfC.png" /></figure><h3>Introduction</h3><p>Imagine you are shown thousands of images of cats and dogs.</p><p>A traditional computer program would require manually defining rules:</p><ul><li>Cats have pointy ears.</li><li>Dogs have longer snouts.</li><li>Cats usually have vertical pupils.</li></ul><p>The problem is obvious: reality is messy. Some dogs have pointy ears. Some cats have round faces. Lighting, angles, and backgrounds constantly change.</p><p>Modern AI solves this differently. Instead of programming rules, we allow models to <strong>learn representations</strong> of the world.</p><p>Representation Learning is arguably the most important idea in modern machine learning. It is the reason deep learning surpassed traditional machine learning and enabled systems like ChatGPT, image generators, recommendation engines, autonomous vehicles, and scientific discovery models.</p><p>At its core, representation learning answers a simple question:</p><blockquote><em>How can a machine automatically discover useful features from raw data?</em></blockquote><p>The answer transformed artificial intelligence.</p><h3>What Is Representation Learning?</h3><p>A representation is simply a way of describing information.</p><p>For example, consider the word:</p><pre>Apple</pre><p>Humans immediately understand multiple meanings:</p><ul><li>Fruit</li><li>Technology company</li><li>Brand</li><li>Food item</li></ul><p>Computers see:</p><pre>A p p l e</pre><p>just characters.</p><p>Representation learning converts raw data into mathematical forms that capture meaning.</p><p>Instead of storing:</p><pre>Apple</pre><p>the model may represent it as:</p><pre>[0.82, -0.14, 1.23, 0.56, ...]</pre><p>This vector contains learned information about the concept.</p><p>The model learns:</p><ul><li>Apple is related to fruit</li><li>Apple is related to technology</li><li>Apple is similar to Microsoft</li><li>Apple is different from Banana in some contexts</li></ul><p>These learned vectors are called embeddings.</p><h3>The Evolution of Feature Engineering</h3><p>Before deep learning, machine learning depended heavily on handcrafted features.</p><h3>Traditional Approach</h3><p>Suppose we want to classify emails as spam.</p><p>Engineers manually create features:</p><pre>contains_discount<br>contains_offer<br>contains_money<br>number_of_links<br>email_length</pre><p>The model learns from these predefined features.</p><p>Pipeline:</p><pre>Raw Email<br>    ↓<br>Manual Feature Engineering<br>    ↓<br>Machine Learning Model<br>    ↓<br>Prediction</pre><p>Performance is limited by human creativity.</p><h3>Deep Learning Approach</h3><p>Modern systems learn features automatically.</p><p>Pipeline:</p><pre>Raw Email<br>    ↓<br>Neural Network<br>    ↓<br>Learned Representation<br>    ↓<br>Prediction</pre><p>The model discovers patterns humans might never think of.</p><p>This shift from manual feature engineering to automatic representation learning fueled the AI revolution.</p><h3>The Geometry of Intelligence</h3><p>A surprising fact about modern AI:</p><blockquote><em>Intelligence often emerges from geometry.</em></blockquote><p>Models transform information into points inside high-dimensional spaces.</p><p>Consider three words:</p><pre>King<br>Queen<br>Prince</pre><p>After training:</p><pre>King   → (2.1, 1.3, ...)<br>Queen  → (2.0, 2.4, ...)<br>Prince → (1.7, 1.0, ...)</pre><p>Distances now encode meaning.</p><p>Words with similar meanings appear close together.</p><p>Visualization:</p><pre>King -------- Queen<br>  |<br>  |<br>Prince</pre><p>while unrelated concepts remain far away.</p><pre>King -------------------- Refrigerator</pre><p>The model has learned a semantic space.</p><p>This space becomes the foundation of reasoning.</p><h3>Embeddings: The DNA of Modern AI</h3><p>Embeddings are dense numerical representations learned from data.</p><p>Think of them as compressed knowledge.</p><h3>Word Embeddings</h3><p>One of the first breakthroughs was:</p><ul><li>Word2Vec</li><li>GloVe</li><li>FastText</li></ul><p>Example:</p><pre>King - Man + Woman ≈ Queen</pre><p>The model learned gender relationships purely from text.</p><p>Mathematically:<br>v(King)-v(Man)+v(Woman) ~=v(Queen)</p><p>This was one of the first demonstrations that neural networks could capture abstract concepts.</p><h3>Sentence Embeddings</h3><p>Instead of individual words:</p><pre>I love machine learning</pre><p>becomes:</p><pre>[0.21, -0.87, 0.55, ...]</pre><p>Now entire meanings can be compared.</p><p>Examples:</p><pre>&quot;I like AI&quot;</pre><pre>&quot;I enjoy artificial intelligence&quot;</pre><p>produce vectors that are extremely close.</p><p>Applications:</p><ul><li>Semantic search</li><li>Document retrieval</li><li>Chatbots</li><li>RAG systems</li></ul><h3>Image Embeddings</h3><p>Images can also become vectors.</p><pre>Cat Image</pre><p>To</p><pre>[0.67, -0.42, 1.54, ...]</pre><p>Images of cats cluster together.</p><p>Visualization:</p><pre>Cats<br> ● ● ● ●</pre><pre>Dogs<br>         ● ● ● ●</pre><pre>Cars<br>                 ● ● ●</pre><p>The model learns visual concepts automatically.</p><h3>Latent Spaces: Where Meaning Lives</h3><p>One of the most fascinating ideas in AI is the latent space.</p><p>A latent space is a compressed hidden representation learned by a model.</p><p>Imagine a face generator.</p><p>Every face:</p><ul><li>Age</li><li>Gender</li><li>Hair style</li><li>Expression</li><li>Lighting</li></ul><p>can be encoded into a vector.</p><pre>Face<br> ↓<br>Encoder<br> ↓<br>Latent Vector<br> ↓<br>Decoder<br> ↓<br>Reconstructed Face</pre><p>The latent vector captures essential information.</p><h3>Autoencoders</h3><p>Autoencoders are designed specifically for learning latent spaces.</p><p>Architecture:</p><pre>Input<br>  ↓<br>Encoder<br>  ↓<br>Latent Space<br>  ↓<br>Decoder<br>  ↓<br>Output</pre><p>Goal:<br>Input ~= Output</p><p>The bottleneck forces compression.</p><p>The network learns the most important features.</p><h3>Variational Autoencoders (VAEs)</h3><p>VAEs make latent spaces smooth and continuous.</p><p>Instead of encoding:</p><pre>Face A → Point A<br>Face B → Point B</pre><p>the model learns distributions.</p><p>This enables generation.</p><p>Move smoothly between points:</p><pre>Young Face<br>      ↓<br>Middle Age Face<br>      ↓<br>Old Face</pre><p>AI-generated images emerged from this idea.</p><h3>Contrastive Learning: Learning Through Comparison</h3><p>Humans learn by comparing.</p><p>A child learns dogs because they are:</p><ul><li>Similar to other dogs</li><li>Different from cats</li></ul><p>Contrastive learning follows the same principle.</p><h3>Core Idea</h3><p>Bring similar examples together.</p><p>Push different examples apart.</p><p>Mathematically:<br>d(z_i,z_j) -&gt; 0</p><p>for positive pairs.<br>d(z_i,z_k) -&gt; Infinity</p><h3>Example</h3><p>Take an image:</p><pre>Dog</pre><p>Create two augmented versions:</p><ul><li>Rotated</li><li>Cropped</li></ul><p>The model sees both.</p><p>Since they originate from the same image:</p><pre>Positive Pair</pre><p>Representations become closer.</p><p>Different images:</p><pre>Dog<br>Car</pre><p>become farther apart.</p><h3>SimCLR</h3><p>One landmark method was:</p><p><strong>SimCLR</strong></p><p>Pipeline:</p><pre>Image<br> ↓<br>Augmentation<br> ↓<br>Encoder<br> ↓<br>Projection Head<br> ↓<br>Contrastive Loss</pre><p>No labels required.</p><p>The model learns useful features automatically.</p><p>This dramatically reduced dependence on labeled datasets.</p><h3>Self-Supervised Learning</h3><p>Representation learning evolved into self-supervised learning.</p><p>The idea:</p><blockquote><em>Create labels automatically from data itself.</em></blockquote><p>Examples:</p><h3>BERT</h3><p>Mask words:</p><pre>The cat sat on the [MASK]</pre><p>Predict:</p><pre>mat</pre><h3>GPT</h3><p>Predict next token:</p><pre>Artificial Intelligence is &quot;transforming&quot;</pre><h3>CLIP</h3><p>Train on image-text pairs.</p><pre>Image ↔ Caption</pre><p>The model learns a shared representation space.</p><p>Images and text become directly comparable.</p><p>This powers modern multimodal systems.</p><h3>Representation Learning Inside ChatGPT</h3><p>Large Language Models are massive representation learners.</p><p>When ChatGPT processes:</p><pre>Explain quantum mechanics</pre><p>it converts text into embeddings.</p><p>Pipeline:</p><pre>Text<br> ↓<br>Tokenization<br> ↓<br>Embeddings<br> ↓<br>Transformer Layers<br> ↓<br>Higher-Level Representations<br> ↓<br>Prediction</pre><p>Each transformer layer learns increasingly abstract concepts.</p><p>Early layers:</p><pre>Grammar</pre><p>Middle layers:</p><pre>Syntax</pre><p>Higher layers:</p><pre>Reasoning<br>Knowledge<br>Concept Relationships</pre><p>The model continuously refines representations before generating output.</p><h3>Representation Learning in Search Engines</h3><p>Modern search engines no longer rely purely on keywords.</p><p>Query:</p><pre>best laptop for machine learning</pre><p>Traditional search:</p><pre>Keyword Matching</pre><p>Modern search:</p><pre>Query Embedding<br> ↓<br>Vector Search<br> ↓<br>Semantic Matching</pre><p>Now the engine understands intent.</p><p>This is why searching:</p><pre>car insurance</pre><p>can return pages discussing:</p><pre>vehicle coverage</pre><p>even without exact keyword overlap.</p><h3>Representation Learning in Recommendation Systems</h3><p>Recommendation systems are giant embedding machines.</p><p>User:</p><pre>Watched:<br>Interstellar<br>Inception<br>The Matrix</pre><p>Model learns:</p><pre>User Vector</pre><p>Movies become vectors too.</p><p>Recommendations emerge from vector similarity.</p><blockquote>Similarity(User,Movie)</blockquote><p>Higher similarity:</p><pre>Recommend</pre><p>Lower similarity:</p><pre>Ignore</pre><p>This drives:</p><ul><li>Netflix</li><li>YouTube</li><li>Spotify</li><li>Amazon</li></ul><p>recommendations.</p><h3>Representation Learning in Healthcare</h3><p>Healthcare AI increasingly relies on learned representations.</p><p>Examples:</p><h3>Medical Imaging</h3><p>MRI scans:</p><pre>Raw Pixels<br> ↓<br>CNN<br> ↓<br>Latent Representation<br> ↓<br>Disease Detection</pre><h3>Drug Discovery</h3><p>Protein structures become embeddings.</p><p>Researchers compare:</p><pre>Protein A<br>Protein B</pre><p>inside learned biological spaces.</p><p>This dramatically accelerates drug development.</p><p>Companies such as <a href="https://deepmind.google/?utm_source=chatgpt.com">DeepMind</a> leveraged representation learning in systems like AlphaFold to predict protein structures with unprecedented accuracy.</p><h3>The Future: Foundation Models Learn Universal Representations</h3><p>The trend is clear.</p><p>AI is moving toward universal representations.</p><p>Modern foundation models learn:</p><ul><li>Language representations</li><li>Image representations</li><li>Audio representations</li><li>Video representations</li><li>Scientific representations</li></ul><p>inside a shared latent space.</p><p>Future systems may learn representations for:</p><ul><li>Biology</li><li>Physics</li><li>Robotics</li><li>Human behavior</li></ul><p>allowing transfer of knowledge across domains.</p><h3>Key Takeaways</h3><p>Representation Learning is the process of automatically discovering useful features from raw data.</p><p>It powers:</p><ul><li>Large Language Models</li><li>Recommendation Systems</li><li>Search Engines</li><li>Computer Vision</li><li>Medical AI</li><li>Autonomous Systems</li></ul><p>The fundamental building blocks are:</p><ol><li><strong>Embeddings</strong> — numerical representations of meaning.</li><li><strong>Latent Spaces</strong> — compressed worlds where concepts live.</li><li><strong>Contrastive Learning</strong> — learning through similarity and difference.</li><li><strong>Self-Supervised Learning</strong> — creating supervision from unlabeled data.</li><li><strong>Feature Extraction</strong> — discovering useful patterns automatically.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8daa1ee0308" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Mental Health Emotion Memory System using Qdrant + ML]]></title>
            <link>https://medium.com/@rithvikbng/building-a-mental-health-emotion-memory-system-using-qdrant-ml-859bd1d6cacc?source=rss-a437e55472b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/859bd1d6cacc</guid>
            <category><![CDATA[qdrant]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[memories]]></category>
            <dc:creator><![CDATA[Rithvik K]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 05:52:07 GMT</pubDate>
            <atom:updated>2026-02-19T17:01:44.061Z</atom:updated>
            <content:encoded><![CDATA[<p>As AI systems become more personalized, one major gap still exists: <strong>emotional memory</strong>. Most chatbots forget user emotions after a session. But what if an AI could remember emotional patterns over time and respond more empathetically?</p><p>In this blog, we’ll build a <strong>Behavioral Health Emotion Memory System</strong> using:</p><ul><li>Machine Learning (emotion embeddings)</li><li>Qdrant (vector memory database)</li><li>NLP models (emotion detection)</li><li>RAG-style retrieval (context-aware responses)</li></ul><p>This architecture is highly relevant for:</p><ul><li>Mental health bots</li><li>Therapy assistants</li><li>Behavioral AI systems</li><li>Reflective journaling apps</li></ul><h3>The Core Problem: Emotional Context Loss in AI Systems</h3><p>Traditional AI chat systems store chat logs as plain text. But emotional signals like:</p><ul><li>“I feel anxious about exams”</li><li>“I’m stressed and overwhelmed”</li><li>“I can’t sleep lately”</li></ul><p>are treated as just text — not psychological context.</p><p>This leads to:</p><ul><li>Generic responses</li><li>No emotional continuity</li><li>Poor personalization</li></ul><p>We solve this using <strong>ML-based emotion embeddings + Qdrant semantic memory</strong>.</p><h3>System Architecture (Behavioral AI + Vector Memory)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_a_-79kr811t41fa4rheA.png" /><figcaption>Architecture diagram</figcaption></figure><h3>Implementation</h3><h4>Step 1: Using ML for Emotion Classification</h4><p>We first integrate a fine-tuned emotion detection model (NLP-based).</p><pre>from transformers import pipeline<br><br>emotion_model = pipeline(<br>    &quot;text-classification&quot;,<br>    model=&quot;j-hartmann/emotion-english-distilroberta-base&quot;,<br>    return_all_scores=True<br>)<br><br>text = &quot;I feel extremely anxious about my future&quot;<br>emotion_scores = emotion_model(text)<br>print(emotion_scores)</pre><p>This ML model detects nuanced emotional states like:</p><ul><li>Anxiety</li><li>Sadness</li><li>Joy</li><li>Fear</li><li>Anger</li></ul><p>Now we convert this emotional text into embeddings for vector storage.</p><h4>Step 2: Generating Emotion-Aware Embeddings</h4><p>Instead of generic embeddings, we use sentence transformers to capture psychological semantics.</p><pre>from sentence_transformers import SentenceTransformer<br><br>embedder = SentenceTransformer(&quot;all-MiniLM-L6-v2&quot;)<br><br>entry = &quot;Feeling overwhelmed with workload and deadlines&quot;<br>vector = embedder.encode(entry)<br>print(len(vector))  # 384-dimensional vector</pre><p>These vectors represent <strong>emotional meaning</strong>, not just keywords.</p><h4>Step 3: Setting Up Qdrant as an Emotional Memory Database</h4><p>Now we integrate Qdrant as a long-term behavioral memory layer.</p><pre>from qdrant_client import QdrantClient<br>from qdrant_client.http.models import VectorParams, Distance<br><br>client = QdrantClient(&quot;:memory:&quot;)<br><br>client.create_collection(<br>    collection_name=&quot;emotion_memory&quot;,<br>    vectors_config=VectorParams(size=384, distance=Distance.COSINE),<br>)</pre><p>Why Qdrant?</p><ul><li>Fast similarity search</li><li>Payload filtering (emotion tags)</li><li>Scalable for long-term user memory</li><li>Perfect for RAG-based therapy agents</li></ul><h4>Step 4: Storing Emotional Events with ML Metadata</h4><p>We now store emotional entries along with detected emotions.</p><pre>from uuid import uuid4<br><br>journal_entry = &quot;I feel lonely and mentally drained today&quot;<br>vector = embedder.encode(journal_entry)<br>emotion = emotion_model(journal_entry)[0][0][&quot;label&quot;]<br><br>client.upsert(<br>    collection_name=&quot;emotion_memory&quot;,<br>    points=[<br>        {<br>            &quot;id&quot;: str(uuid4()),<br>            &quot;vector&quot;: vector,<br>            &quot;payload&quot;: {<br>                &quot;text&quot;: journal_entry,<br>                &quot;emotion&quot;: emotion<br>            }<br>        }<br>    ]<br>)</pre><p>This creates a <strong>personalized emotional knowledge base</strong>.</p><h4>Step 5: ML-Powered Emotional Retrieval (Context-Aware Search)</h4><p>Now when a user writes a new entry, the system retrieves similar emotional history.</p><pre>query = &quot;I feel stressed and exhausted&quot;<br>query_vector = embedder.encode(query)<br><br>results = client.search(<br>    collection_name=&quot;emotion_memory&quot;,<br>    query_vector=query_vector,<br>    limit=3<br>)<br><br>for r in results:<br>    print(r.payload)</pre><p>Even if the wording changes, Qdrant retrieves emotionally similar past states using ML embeddings.</p><p>This is extremely powerful for mental health AI.</p><h3>Step 6: Blending with RAG for Therapeutic AI Responses</h3><p>Now we combine retrieval + LLM:</p><p>Workflow:</p><ol><li>User expresses emotion</li><li>ML detects emotional state</li><li>Qdrant retrieves similar emotional memories</li><li>LLM generates empathetic, context-aware response</li></ol><p><strong>Example prompt injection to LLM:</strong></p><pre>User Current Emotion: Anxiety<br>Past Emotional Patterns: [Stress during exams, sleep issues]<br>Generate a supportive response.</pre><p>This creates a <strong>psychologically aware AI agent</strong> instead of a generic chatbot.</p><p>You can reach out to me if you have any queries</p><p>LinkedIn: <a href="https://www.linkedin.com/in/rithvik1709/">https://www.linkedin.com/in/rithvik1709/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=859bd1d6cacc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>