<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shatesh Soni</title>
    <description>The latest articles on DEV Community by Shatesh Soni (@shateshsoni).</description>
    <link>https://dev.to/shateshsoni</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3933214%2Faaf9c204-4ebd-4354-932c-330dd60fe66a.png</url>
      <title>DEV Community: Shatesh Soni</title>
      <link>https://dev.to/shateshsoni</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shateshsoni"/>
    <language>en</language>
    <item>
      <title>“LLMs Do Not Remember Anything”: They only process the context we give them.</title>
      <dc:creator>Shatesh Soni</dc:creator>
      <pubDate>Fri, 15 May 2026 13:48:36 +0000</pubDate>
      <link>https://dev.to/shateshsoni/llms-do-not-remember-anything-they-only-process-the-context-we-give-them-26b2</link>
      <guid>https://dev.to/shateshsoni/llms-do-not-remember-anything-they-only-process-the-context-we-give-them-26b2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The hidden engineering problem of context accumulation and context window overflow — and why bigger models alone won’t solve it.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most people interact with AI systems like ChatGPT the same way they’d chat with a colleague — assuming there’s some form of ongoing awareness happening behind the screen. You mention your name early in the conversation, come back to it ten messages later, and the model responds as if it remembered all along.&lt;/p&gt;

&lt;p&gt;That assumption is architecturally wrong. And the gap between perception and reality isn’t just a philosophical curiosity — it sits at the center of one of the most important engineering challenges in modern AI infrastructure.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What appears to be memory is actually a carefully engineered illusion — rebuilt from scratch on every single API call.”_&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post breaks down exactly how LLMs handle (or fail to handle) conversational state: why context keeps growing, when it overflows, how that destroys response quality, and what the best engineering teams are doing about it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Architecture Nobody Talks About
&lt;/h2&gt;

&lt;p&gt;Let’s start with the mental model most users have when they interact with a conversational AI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// What users THINK is happening
User sends message
    → AI reads it
    → AI "remembers" internally
    → AI generates a response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now here’s what’s actually happening at the infrastructure layer:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyteq9cv7bcjx7azz5vd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyteq9cv7bcjx7azz5vd.png" alt=" " width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The model itself is completely stateless. After the API call ends, it retains absolutely nothing. The “memory” is an illusion maintained by the application layer, which dutifully resends the entire conversation history with every new request.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Illusion in Action
&lt;/h2&gt;

&lt;p&gt;Here’s a classic example that makes this click. Consider this simple exchange:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User:      My name is Alex.
Assistant: Nice to meet you, Alex!
User:      What is my name?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To the user, the model “remembered.” But the model never stored “Alex” anywhere. What actually happened on the third message is the application sent this entire block to the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`[system]    You are a helpful assistant.
[user]      My name is Alex.
[assistant] Nice to meet you, Alex!
[user]      What is my name?`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model processed the complete reconstructed context from scratch. It “knew” the name because it was right there in the prompt. Not because it remembered — because it was re-told.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Key Insight:&lt;br&gt;
AI conversations are not stored in the model. They’re stored in your application’s database, then injected back into the model on every single request. The model is not a participant with memory — it’s a very sophisticated text-completion engine that reads a full transcript each time.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Context Accumulation: The Hidden Scaling Problem&lt;br&gt;
Now here’s where it gets expensive — and dangerous in production. Every new message makes the context window grow. Not linearly. Rapidly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8futrdqxjbw899h9sjqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8futrdqxjbw899h9sjqm.png" alt=" " width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This creates a cascading set of problems that compound on each other. It’s not just one issue — it’s five problems arriving together:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpckxqh68j5bwfpd7infj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpckxqh68j5bwfpd7infj.png" alt=" " width="765" height="332"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The Context Window: A Hard Ceiling
&lt;/h2&gt;

&lt;p&gt;Every LLM has a maximum number of tokens it can process in a single call. This is called the context window. It’s not a soft guideline — it’s a hard architectural limit. The full window includes everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Everything competing for the same finite space
context_window = (
    system_prompt
  + conversation_history      // grows every turn
  + retrieved_documents       // from RAG pipelines
  + tool_outputs              // function call results
  + current_user_message
  + generated_response
) // must fit within N tokens — 32k, 128k, 1M, etc.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the total exceeds that limit, the system faces a terrible choice: what to throw away?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6c99jo0opyzh8lho743.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6c99jo0opyzh8lho743.png" alt=" " width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;To users, it feels like the AI ‘became confused.’ But the model didn’t get confused. The system lost context fidelity.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Attention Dilution: The Silent Quality Killer
&lt;/h2&gt;

&lt;p&gt;Here's a failure mode almost nobody talks about, and it's arguably more insidious than outright overflow. Even before you hit the context window ceiling, performance starts degrading — quietly, gradually, and in ways that are hard to debug.&lt;/p&gt;

&lt;p&gt;Transformer-based models distribute attention across all tokens in context. As your conversation history grows, attention becomes increasingly fragmented. Imagine you're at a party and someone asks you a question — but there are 200 people talking around you simultaneously. Even if you can technically hear everyone, your ability to focus on what matters degrades.&lt;/p&gt;

&lt;p&gt;This is attention dilution. The signal-to-noise ratio in your context tanks, and the model starts giving weaker, less precise answers — not because the information is gone, but because it's buried under conversational noise from twenty messages ago.&lt;/p&gt;

&lt;p&gt;Here's the unintuitive part: bigger context windows don't automatically fix this. A model with a 1M-token context window can still deliver degraded results when 800k of those tokens are irrelevant history. More space isn't the same as smarter attention.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Cost Explosion Problem
&lt;/h2&gt;

&lt;p&gt;Production AI teams discover this problem painfully. LLM APIs charge per token — both input and output. Because the application resends the entire conversation on every turn, costs compound quickly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Cost model for a 10-turn conversation (simplified)
Turn  1:  ~500 input tokens   → baseline cost
Turn  5:  ~2,500 input tokens  → 5× more expensive per call
Turn  10: ~6,000 input tokens  → 12× more expensive per call

// At scale: 10,000 users × 15-turn sessions = catastrophic bill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why smart context management isn't just an engineering nicety. For companies running AI at scale, it's the difference between a sustainable product and a runaway infrastructure cost.&lt;/p&gt;




&lt;p&gt;The Engineering Solutions&lt;br&gt;
The good news is that the field has developed a solid toolkit for managing this. Modern AI systems don't just throw more tokens at the problem — they manage context intelligently with layered memory architectures.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss5inu6jx3dschoo0wud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss5inu6jx3dschoo0wud.png" alt=" " width="652" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qcvxacwmjg0ij7bzqpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qcvxacwmjg0ij7bzqpj.png" alt=" " width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The Bigger Picture: LLMs Are Not Memory Systems&lt;br&gt;
This reframing changes how you think about building AI applications. LLMs are probabilistic text-completion engines that operate over provided context. Full stop. Everything users experience as memory, continuity, and personality is constructed by the application layer — not the model.&lt;/p&gt;

&lt;p&gt;This means serious AI applications are not just "prompting systems." They're:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory orchestration systems&lt;/li&gt;
&lt;li&gt;Context management systems&lt;/li&gt;
&lt;li&gt;Retrieval and relevance pipelines&lt;/li&gt;
&lt;li&gt;Token budget optimization layers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The teams winning in the long agentic AI era aren't the ones with the biggest models — they're the ones who've built the most intelligent context pipelines around those models.&lt;/p&gt;

&lt;p&gt;The future of AI engineering is less about training bigger models and more about building smarter context systems around those models. As applications become more agentic, long-running, and multimodal, intelligent memory architecture becomes the true moat — not model size.&lt;/p&gt;




&lt;h2&gt;
  
  
  Connect With Me
&lt;/h2&gt;

&lt;p&gt;I’d love to connect with developers, researchers, and engineers working in the AI space to learn, share insights, and grow together.&lt;/p&gt;

&lt;p&gt;🔗 LinkedIn: &lt;a href="https://www.linkedin.com/in/shatesh-soni-15976519b/" rel="noopener noreferrer"&gt;Shatesh Soni&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gpt3</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
