<?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>Forem: Gaurav Vij</title>
    <description>The latest articles on Forem by Gaurav Vij (@gaurav_vij137).</description>
    <link>https://forem.com/gaurav_vij137</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%2F390876%2F1001f18f-15c5-4cb3-b792-3c4e81a1cc61.jpg</url>
      <title>Forem: Gaurav Vij</title>
      <link>https://forem.com/gaurav_vij137</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gaurav_vij137"/>
    <language>en</language>
    <item>
      <title>Stop Paying for the Same Answer Twice: A Deep Dive into llm-cache</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Fri, 17 Apr 2026 12:33:34 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/stop-paying-for-the-same-answer-twice-a-deep-dive-into-llm-cache-1llp</link>
      <guid>https://forem.com/gaurav_vij137/stop-paying-for-the-same-answer-twice-a-deep-dive-into-llm-cache-1llp</guid>
      <description>&lt;p&gt;Every AI engineer has been there. You open the billing dashboard, squint at the number, and do a quiet double-take. You know the product is working, traffic is healthy, users are happy. But somewhere in that invoice is a dirty secret: you are paying for the same computation over and over again.&lt;/p&gt;

&lt;p&gt;Someone asks your support bot "How do I reset my password?" Fifty other users ask "What are the steps to reset my password?" Twenty more ask "Can you help me change my password?" The LLM doesn't know it has answered this question a hundred times today. It just runs the full forward pass every single time, burns your tokens, and charges you accordingly.&lt;/p&gt;

&lt;p&gt;This is not a fringe problem. It is the default state of almost every production LLM deployment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;llm-cache&lt;/code&gt; is a Python middleware library that fixes this. It caches LLM responses not by exact string match, but by semantic similarity. The project was built fully autonomously by NEO, an AI coding agent, and the code is clean, thoughtful, and surprisingly production-ready for a library with just two commits. Let's get into how it works, what it costs you, and what you can do with it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Insight: Meaning, Not Characters
&lt;/h2&gt;

&lt;p&gt;Most developers' first instinct when building a cache is a hash map. Take the prompt string, hash it, store the result. This works if your users send byte-for-byte identical queries. They never do.&lt;/p&gt;

&lt;p&gt;Users paraphrase. They make typos. They use formal phrasing in one context and casual phrasing in another. A naive cache misses all of these. &lt;code&gt;llm-cache&lt;/code&gt; approaches the problem differently: instead of comparing strings, it compares meaning.&lt;/p&gt;

&lt;p&gt;The pipeline is elegant:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incoming prompt is converted into a 384-dimensional embedding vector using &lt;code&gt;all-MiniLM-L6-v2&lt;/code&gt;, a sentence-transformers model that runs entirely locally.&lt;/li&gt;
&lt;li&gt;The vector is L2-normalized so that inner product becomes equivalent to cosine similarity.&lt;/li&gt;
&lt;li&gt;A FAISS &lt;code&gt;IndexFlatIP&lt;/code&gt; index does exact nearest-neighbor search over all previously cached vectors.&lt;/li&gt;
&lt;li&gt;If the closest match clears a configurable similarity threshold (default 0.95), the cached response is returned immediately, no API call made.&lt;/li&gt;
&lt;li&gt;On a miss, the real LLM API is called, the response is stored, and future similar queries will hit the cache.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is that "What is the capital of France?" and "Tell me the capital city of France" return the same cached response. One API call served two users.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Architecture Under the Hood
&lt;/h2&gt;

&lt;p&gt;The project is organized into four tight modules plus two SDK wrappers.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;embedder.py&lt;/code&gt; wraps sentence-transformers with an LRU cache so repeated embeddings of the same text do not trigger redundant model inference. It normalizes vectors before returning them so the FAISS layer can do cosine comparisons via inner product without any extra math.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;store.py&lt;/code&gt; is where the actual cache lives. It holds a FAISS index and a parallel Python dict of metadata keyed by integer IDs. Thread safety is handled with a &lt;code&gt;threading.RLock&lt;/code&gt;, which means you can use this in multi-threaded FastAPI or Django setups without adding your own locking. Persistence is handled by periodically flushing both the FAISS index (via &lt;code&gt;faiss.write_index&lt;/code&gt;) and the metadata dict (via pickle) to &lt;code&gt;~/.llm_cache/&lt;/code&gt;. Every 10 writes by default, configurable if you want more frequent or less frequent saves.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cache.py&lt;/code&gt; is the high-level interface that ties embedder and store together. It exposes &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;set&lt;/code&gt;, &lt;code&gt;lookup_or_call&lt;/code&gt;, &lt;code&gt;get_similar&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;clear&lt;/code&gt;, &lt;code&gt;save&lt;/code&gt;, and &lt;code&gt;stats&lt;/code&gt;. The &lt;code&gt;lookup_or_call&lt;/code&gt; method is particularly useful: it takes a prompt and a callable, checks the cache first, and only invokes the callable on a miss.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wrappers/openai_wrapper.py&lt;/code&gt; and &lt;code&gt;wrappers/anthropic_wrapper.py&lt;/code&gt; are where the ergonomic magic happens. &lt;code&gt;CachedOpenAI&lt;/code&gt; and &lt;code&gt;CachedAnthropic&lt;/code&gt; subclass the official SDKs and intercept the &lt;code&gt;chat.completions.create&lt;/code&gt; and &lt;code&gt;messages.create&lt;/code&gt; methods respectively. From the outside, they are drop-in replacements. You change one import line and one constructor call. Everything else in your codebase stays identical.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Before
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# After
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;llm_cache&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CachedOpenAI&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CachedOpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the entire migration. Your existing call sites do not change.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Much Money Does This Actually Save?
&lt;/h2&gt;

&lt;p&gt;Let's put concrete numbers on this. The library's own README claims 40 to 60 percent cost reduction on repetitive workloads. That tracks with how LLM usage actually distributes in production.&lt;/p&gt;

&lt;p&gt;Consider a customer support application running on GPT-4o. GPT-4o is priced at $2.50 per million input tokens and $10.00 per million output tokens at the time of writing. A typical support query might be 150 input tokens and 300 output tokens: that is $0.000375 on input plus $0.003000 on output, coming to roughly $0.003375 per call. If you handle 100,000 queries a day, that is $337.50 a day, around $10,125 a month, and over $123,000 a year.&lt;/p&gt;

&lt;p&gt;Now think about the actual query distribution. Support traffic is highly repetitive. Password resets, billing questions, shipping status, cancellation flows. If even 40 percent of queries are semantically similar to something already cached, you are looking at potential savings in the range of $4,000 a month from API costs alone. On Claude Sonnet or GPT-4 Turbo, where token prices differ, the math shifts accordingly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disclaimer
&lt;/h3&gt;

&lt;p&gt;That said, these are illustrative numbers based on a simplified model. Real production costs vary considerably depending on prompt length distribution, how diverse your user base actually is, which threshold you settle on, and how much of your traffic is genuinely repetitive versus novel. The 40 to 60 percent savings figure from the library's README is a reasonable ballpark for repetitive workloads, but your actual hit rate depends entirely on your specific use case. Treat these numbers as a directional estimate, not a guarantee.&lt;/p&gt;

&lt;p&gt;For batch processing workloads the economics can be even more compelling. If you are enriching a product catalog, generating descriptions for SKUs, or running the same analysis prompts across thousands of documents with overlapping content, cache hit rates can push above 70 percent. On a $10,000 monthly LLM bill, that kind of hit rate could represent thousands of dollars in avoided API calls, though again the actual figure depends on how much genuine repetition exists in your data.&lt;/p&gt;

&lt;p&gt;There is also a latency dimension that is easy to overlook. A cache hit returns in milliseconds. A real API call takes 500ms to 3 seconds depending on model and load. In user-facing applications, this latency improvement translates directly to perceived product quality, which is harder to put a dollar figure on but is real.&lt;/p&gt;

&lt;p&gt;The configurable threshold gives you a dial between savings and correctness. At 0.95 you are catching clear paraphrases while being conservative about false positives. At 0.88 to 0.91 you are being more aggressive, which works well for batch workloads where the cost of an occasional semantically-mismatched cache hit is low. At 0.85 and below you risk serving stale or wrong responses for queries that are topically related but not actually equivalent.&lt;/p&gt;




&lt;h2&gt;
  
  
  What to Watch Out For
&lt;/h2&gt;

&lt;p&gt;The library is honest about its limitations, which is a good sign.&lt;/p&gt;

&lt;p&gt;Streaming responses are not cached. If you use &lt;code&gt;stream=True&lt;/code&gt;, the call passes through unchanged. This is a real gap for chat applications where streaming UX is expected. The architecture would need changes to buffer the streamed response and store it post-completion, which is doable but adds complexity.&lt;/p&gt;

&lt;p&gt;Tool and function calls are not cached either. If your agents use tool use, those responses pass through. This matters less than it sounds for cost savings because tool call responses are usually dynamic by nature, but it is worth knowing.&lt;/p&gt;

&lt;p&gt;The cache is model-agnostic. The key is the semantic content of the prompt, not the model name. If you ask the same question to GPT-4o and Claude Sonnet, they will share a cache entry by default. This is fine if you want that behavior, but if you need model-specific caches, use different &lt;code&gt;cache_name&lt;/code&gt; values per model.&lt;/p&gt;

&lt;p&gt;The cache is also not context-aware. If the same question means different things depending on prior conversation turns, the cache will incorrectly serve a response from a different context. This matters for multi-turn chat where the embedding of the final user message does not capture the full conversational state.&lt;/p&gt;




&lt;h2&gt;
  
  
  Built Fully by NEO: Your AI Engineering Agent
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;llm-cache&lt;/code&gt; repository was built autonomously by &lt;a href="https://heyneo.com" rel="noopener noreferrer"&gt;NEO - A fully autonomous AI Engineering Agent&lt;/a&gt; capable of finetuning, evaluating, experimenting with AI models and building/deploying AI pipelines such as RAG, classical ML experimentation and much more.&lt;/p&gt;

&lt;p&gt;This project is definitely not a toy. The codebase has a proper package structure with separated concerns across embedder, store, cache, and wrappers. It has a test suite covering the cache, the OpenAI wrapper, and the Anthropic wrapper. It has working examples that run without API keys using mock responses. It has configuration documentation, a thresholds reference table, and SVG architecture diagrams. It has async support with &lt;code&gt;AsyncCachedOpenAI&lt;/code&gt; and &lt;code&gt;AsyncCachedAnthropic&lt;/code&gt;. The FAISS persistence strategy, the RLock threading model, the LRU cache on the embedder, the L2 normalization before FAISS inner product: these are not random choices. They are informed engineering decisions.&lt;/p&gt;

&lt;p&gt;NEO can be used in your VS Code IDE via &lt;a href="https://marketplace.visualstudio.com/items?itemName=NeoResearchInc.heyneo" rel="noopener noreferrer"&gt;VS Code extension&lt;/a&gt; or Cursor  and works as an autonomous AI engineering agent that can take a high-level goal, plan the implementation, write the code, run tests, and iterate until the project is complete. This library was produced from a single prompt.&lt;/p&gt;

&lt;p&gt;What that unlocks is interesting. The tool itself is useful. But the meta-point is that an engineer with a clear idea and access to NEO can build a production-ready Python library in the time it used to take to write a design doc. The feedback loop between idea and artifact has collapsed.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Build on This with NEO
&lt;/h2&gt;

&lt;p&gt;The library works well as-is, but there are several directions where it could go further. If you want to extend it, NEO is the fastest way to do that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-turn context caching&lt;/strong&gt; is the most valuable near-term addition. Right now the cache key is the embedding of a single message. A more robust implementation would embed the last N turns of conversation concatenated together, so that "what about France?" in the context of a geography discussion hashes differently from the same phrase in a cooking discussion. You could prompt NEO like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Clone the llm-cache repo: https://github.com/dakshjain-1616/llm-cache and extend llm-cache to support multi-turn context-aware caching by embedding the last 3 messages as a single context string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and it would handle the implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Redis-backed store&lt;/strong&gt; would make the cache shareable across multiple instances of your application. Right now each process has its own FAISS index on disk. A distributed cache requires a shared vector store. Qdrant, Pinecone, or Redis with the RedisSearch module are all viable backends. NEO could scaffold the new &lt;code&gt;store.py&lt;/code&gt; backend and the adapter pattern to keep the existing API unchanged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cache warming&lt;/strong&gt; is another high-value addition for predictable workloads. If you know your users will ask about a known set of topics, you can pre-populate the cache before the first real user query arrives, guaranteeing zero-latency responses for those cases. A simple CLI command, &lt;code&gt;llm-cache warm --questions questions.txt&lt;/code&gt;, would do this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analytics and observability&lt;/strong&gt; around the cache would help you tune the threshold intelligently. Right now &lt;code&gt;get_stats()&lt;/code&gt; returns hits, misses, and hit rate. A richer implementation would log the similarity score of every hit, let you visualize the distribution, and suggest threshold adjustments. Integrating with OpenTelemetry or Datadog would make this production-observable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming support&lt;/strong&gt; is the most technically involved gap. You would need to buffer streamed response chunks, detect completion, reconstruct the full response, serialize it, and store it. The tricky part is that Python generators are not directly picklable. A design that stores the reconstructed text and then re-streams it from the cache on subsequent hits would give users the same UX without paying the API cost.&lt;/p&gt;

&lt;p&gt;To build any of these with NEO, install the VS Code extension, clone the llm-cache repo and open the directory, and describe what you want in NEO's new chat prompt. NEO reads the existing codebase, understands the architecture, and writes code that fits the existing patterns rather than starting from scratch.&lt;/p&gt;




&lt;h2&gt;
  
  
  Getting Started with llm-cache
&lt;/h2&gt;

&lt;p&gt;Install the dependencies and run a demo that shows the cache working without any API key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;faiss-cpu sentence-transformers openai anthropic
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
python examples/openai_example.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see &lt;code&gt;[CACHE HIT]&lt;/code&gt; and &lt;code&gt;[CACHE MISS]&lt;/code&gt; labels with a final stats block showing the hit rate. The sentence-transformers model downloads automatically on first run and is about 90 MB.&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%2Fjchs25tzrv7le8mwaek1.jpg" 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%2Fjchs25tzrv7le8mwaek1.jpg" alt="llm-cache management system example view for post fleet deployment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a real application, the migration is two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;llm_cache&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CachedOpenAI&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CachedOpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start with &lt;code&gt;threshold=0.90&lt;/code&gt;. Watch &lt;code&gt;client.get_stats()&lt;/code&gt; for a few days in staging. If you are seeing false positives, move to 0.93 or 0.95. If your hit rate is low and your workload is genuinely repetitive, try 0.88. The right number is workload-specific.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;The unsexy reality of running LLMs in production is that most of the cost is not in the interesting, novel queries. It is in the mundane, repeated ones that look slightly different on the surface but mean exactly the same thing. &lt;code&gt;llm-cache&lt;/code&gt; is a focused solution to that specific problem, and it is well-engineered enough to drop into a production system with confidence.&lt;/p&gt;

&lt;p&gt;The fact that it was built autonomously by NEO in a single session is, honestly, the most interesting detail in the whole story. Not because it diminishes the quality of the code, but because it demonstrates what becomes possible when the cost of building a tool drops to nearly zero. You stop asking "is this worth building?" and start asking "why haven't I built this yet?"&lt;/p&gt;

&lt;p&gt;The code is at &lt;a href="https://github.com/dakshjain-1616/llm-cache" rel="noopener noreferrer"&gt;github.com/dakshjain-1616/llm-cache&lt;/a&gt;. Go look at it. Your API bill will thank you.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>llm</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>We Gave an AI Agent a Long Context Caching Idea. Here's what happened next!</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Wed, 15 Apr 2026 18:10:04 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/we-gave-an-ai-agent-a-long-context-caching-idea-heres-what-happened-next-4c40</link>
      <guid>https://forem.com/gaurav_vij137/we-gave-an-ai-agent-a-long-context-caching-idea-heres-what-happened-next-4c40</guid>
      <description>&lt;p&gt;A few days ago, Han Xiao (VP AI @ Elastic) shared an &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:7448363489133273088/" rel="noopener noreferrer"&gt;experiment on Linkedin&lt;/a&gt; that asked a provocative question: what happens if you stop treating retrieval as a separate system and instead use the model’s own KV cache as the document store? &lt;/p&gt;

&lt;p&gt;The setup was ambitious: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Qwen3.5-35B-A3B LLM,&lt;/li&gt;
&lt;li&gt;1M token context,&lt;/li&gt;
&lt;li&gt;A single 24 GB L4 GPU, and &lt;/li&gt;
&lt;li&gt;A pipeline that avoids embeddings, vector databases, and chunking entirely. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core idea was simple. Prefill the document once, save the KV cache to disk, restore it on demand, and answer queries with the full document already resident in context.&lt;/p&gt;

&lt;p&gt;We wanted to see whether &lt;a href="https://heyneo.com" rel="noopener noreferrer"&gt;NEO&lt;/a&gt; - Fully autonomous AI Engineering Agent, could take that idea and turn it into a working implementation on its own.&lt;/p&gt;

&lt;p&gt;So we gave NEO the research direction and let it run.&lt;/p&gt;

&lt;p&gt;In about 30 minutes, it autonomously produced a working Cache-Augmented Generation system that implements the same core pattern: ingest a document once, prefill the entire document into the model’s KV cache, persist the cache as a &lt;code&gt;.bin&lt;/code&gt; file, restore it before each query, and answer against full-document context without re-embedding or re-chunking anything. &lt;/p&gt;

&lt;p&gt;The resulting &lt;a href="https://github.com/dakshjain-1616/Cache-Augmented-Generation-CAG-System" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt; also documents that the full implementation, debugging, GPU validation, and documentation were done autonomously by NEO, including fixing 9 bugs across CUDA, Python, and shell, and running 11 GPU validation tests end to end.&lt;/p&gt;

&lt;h2&gt;
  
  
  The original idea
&lt;/h2&gt;

&lt;p&gt;Traditional RAG pipelines split documents into chunks, embed them, store those embeddings in a vector index, and retrieve a subset of chunks at query time. That architecture is practical and scalable, but it comes with tradeoffs. The model only sees selected fragments, retrieval quality becomes a separate engineering problem, and there is always some risk that the right information was chunked poorly or never retrieved at all. The repo’s own README summarizes that contrast directly: RAG gives the model chunked fragments, while CAG aims to keep the full document active for every query.&lt;/p&gt;

&lt;p&gt;Han’s experiment pushed that idea hard. His post describes loading a 1.2 million word novel into KV cache, pre-filling 905K tokens on a single L4 24 GB GPU, and relying on several optimizations to make that feasible, including YaRN scaling, Q3_K_M quantization, compressed KV cache, slot save and restore, and custom patches to support the model architecture. He also reported a key caveat that matters a lot: the system worked mechanically, but retrieval quality degraded badly in the middle of the context window, which is the classic lost-in-the-middle problem.&lt;/p&gt;

&lt;p&gt;That was the interesting part for us.&lt;/p&gt;

&lt;p&gt;Not because “RAG is dead” is the right conclusion. It probably is not. But because the experiment is a good stress test for whether an AI agent can reproduce a non-trivial systems idea from a public technical post and turn it into runnable software.&lt;/p&gt;

&lt;h2&gt;
  
  
  What NEO built
&lt;/h2&gt;

&lt;p&gt;We used &lt;a href="https://marketplace.visualstudio.com/items?itemName=NeoResearchInc.heyneo" rel="noopener noreferrer"&gt;Neo's Extension&lt;/a&gt; in our VS Code IDE and prompted it to build a cache augmented generated system which is a full document QA stack built around &lt;code&gt;llama-server&lt;/code&gt; and a persistent KV slot workflow.&lt;/p&gt;

&lt;p&gt;The flow is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A document is wrapped into a structured prompt and sent to the model for a one-time prefill.&lt;/li&gt;
&lt;li&gt;The resulting KV cache is saved to disk as a slot file.&lt;/li&gt;
&lt;li&gt;For every future query, that slot file is restored into &lt;code&gt;llama-server&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The user’s question is appended to the restored state.&lt;/li&gt;
&lt;li&gt;The model answers with the entire document already present in active context.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That sounds small in one paragraph, but there is a lot packed into it.&lt;/p&gt;

&lt;p&gt;The repo includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a setup script that builds the required inference stack and downloads the model&lt;/li&gt;
&lt;li&gt;a server launch script&lt;/li&gt;
&lt;li&gt;a FastAPI application for ingestion, querying, corpus management, and health checks&lt;/li&gt;
&lt;li&gt;CLI scripts for document ingest and querying&lt;/li&gt;
&lt;li&gt;a demo path&lt;/li&gt;
&lt;li&gt;Docker artifacts&lt;/li&gt;
&lt;li&gt;validation docs and a GPU testing checklist &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Access &lt;a href="https://github.com/dakshjain-1616/Cache-Augmented-Generation-CAG-System" rel="noopener noreferrer"&gt;Cache Augmented Generation GitHub Repo&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%2F14qqzsnw7s0om2iw0zsw.jpg" 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%2F14qqzsnw7s0om2iw0zsw.jpg" alt=" " width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The API surface is also clean enough to use like a real system, not just a one-off experiment. &lt;/p&gt;

&lt;p&gt;There are endpoints for &lt;code&gt;/ingest&lt;/code&gt;, &lt;code&gt;/status/{job_id}&lt;/code&gt;, &lt;code&gt;/query&lt;/code&gt;, &lt;code&gt;/corpora&lt;/code&gt;, &lt;code&gt;/corpora/{id}&lt;/code&gt;, and &lt;code&gt;/health&lt;/code&gt;, with ingestion running asynchronously and status polled through a job state transition. &lt;/p&gt;

&lt;p&gt;That matters because replication is not just “it ran once on my machine.” A credible reproduction needs to be shaped into something other people can actually use, inspect, and test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the implementation is technically interesting
&lt;/h2&gt;

&lt;p&gt;The most important architectural shift here is that retrieval moves from an external index into the model runtime itself.&lt;/p&gt;

&lt;p&gt;In standard RAG:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;storage is in a vector database&lt;/li&gt;
&lt;li&gt;retrieval happens before generation&lt;/li&gt;
&lt;li&gt;the model sees only the retrieved subset&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this CAG-style system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;storage is effectively the saved KV state&lt;/li&gt;
&lt;li&gt;retrieval is replaced by restoring a prior attention state&lt;/li&gt;
&lt;li&gt;the model answers after the full document context is already loaded&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That changes both latency and operational behavior.&lt;/p&gt;

&lt;p&gt;The expensive part becomes the first prefill pass. After that, repeated queries are cheap because the cache is restored instead of recomputed. The repo reports that after ingestion, the cache lives in &lt;code&gt;kv_slots/my_doc.bin&lt;/code&gt;, and future queries restore it instantly while surviving server restarts.&lt;/p&gt;

&lt;p&gt;This is a very different tradeoff from RAG. You pay a large one-time setup cost per document or corpus, then reuse that precomputed attention state repeatedly.&lt;/p&gt;

&lt;p&gt;For some workloads, that is extremely attractive.&lt;/p&gt;

&lt;p&gt;If you have a relatively fixed corpus and many follow-up queries, the economics can make sense. If your corpus changes constantly, or if you need many documents active concurrently, the tradeoff looks worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reported results from the replication
&lt;/h2&gt;

&lt;p&gt;According to the repo, all 11 GPU tests were run on an NVIDIA RTX A6000 with Qwen3.5-35B-A3B Q3_K_M at a 1,048,576 token context window. The README reports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;24.3 minute cold prefill for War and Peace at 922K tokens&lt;/li&gt;
&lt;li&gt;1.2 second KV slot restore from disk&lt;/li&gt;
&lt;li&gt;roughly 100 tokens per second decode speed at 1M context&lt;/li&gt;
&lt;li&gt;4 GB KV cache size at 1M context versus 23 GB in f16&lt;/li&gt;
&lt;li&gt;about 43% VRAM usage on the A6000 in that configuration&lt;/li&gt;
&lt;/ul&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%2Fc92jxpsh5y78wlm6lita.jpg" 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%2Fc92jxpsh5y78wlm6lita.jpg" alt=" " width="800" height="565"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It also lists successful validation for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TurboQuant cache types&lt;/li&gt;
&lt;li&gt;KV compression&lt;/li&gt;
&lt;li&gt;YaRN context extension from 262K to 1,048,576&lt;/li&gt;
&lt;li&gt;slot save and restore timing&lt;/li&gt;
&lt;li&gt;VRAM profiling&lt;/li&gt;
&lt;li&gt;Flash Attention&lt;/li&gt;
&lt;li&gt;end-to-end document QA demos&lt;/li&gt;
&lt;li&gt;concurrent query handling&lt;/li&gt;
&lt;li&gt;stress testing on War and Peace&lt;/li&gt;
&lt;li&gt;API key authentication&lt;/li&gt;
&lt;li&gt;persistence across server restarts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also a smaller demo run using Alice in Wonderland and Peter Pan where the repo reports 2 out of 2 documents ingested, 6 out of 6 queries answered correctly, average decode speed around 103 tok/s, and no OOM errors.&lt;/p&gt;

&lt;p&gt;Those numbers are useful for two reasons.&lt;/p&gt;

&lt;p&gt;First, they show the system is not just conceptually aligned with the original post. It is instrumented and benchmarked.&lt;/p&gt;

&lt;p&gt;Second, they make it easier to reason about where this architecture is actually viable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The engineering constraints are the real story
&lt;/h2&gt;

&lt;p&gt;One thing I like about both the original post and the replication is that neither pretends this is magic.&lt;/p&gt;

&lt;p&gt;The constraints are real.&lt;/p&gt;

&lt;p&gt;The replicated system is explicitly Linux and NVIDIA only. The large-model path requires 24 GB or more of VRAM for the full 1M-token configuration. Smaller VRAM tiers fall back to smaller Qwen variants and much shorter context windows. The first setup takes about 35 minutes to build CUDA kernels. The full Qwen3.5-35B path also requires a Hugging Face token.&lt;/p&gt;

&lt;p&gt;There are also architectural limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the long initial prefill still costs about 24 minutes on the A6000 for a very large document&lt;/li&gt;
&lt;li&gt;only one active corpus is supported in the current single-slot setup&lt;/li&gt;
&lt;li&gt;switching corpora means restoring a different slot&lt;/li&gt;
&lt;li&gt;the lost-in-the-middle problem remains real at extreme context depth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point is the big one.&lt;/p&gt;

&lt;p&gt;Han’s own comment on the original post says the system could generate readable answers, but hallucinated badly in the middle of the 905K-token context and mainly attended to the start and end of the document. The replicated repo reports a similar caveat in its sample War and Peace results, where one ending-related question is marked only partial because of lost-in-the-middle behavior.&lt;/p&gt;

&lt;p&gt;So no, this does not prove that traditional RAG is obsolete.&lt;/p&gt;

&lt;p&gt;What it proves is that KV-cache-centric document serving is increasingly practical as a systems pattern, and that the bottleneck is moving from “can we load this much context” toward “can the model actually use it reliably.”&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%2Fm4buhjqry3u0j2gtcr0i.jpg" 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%2Fm4buhjqry3u0j2gtcr0i.jpg" alt=" " width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that matters most to me
&lt;/h2&gt;

&lt;p&gt;The technical implementation is interesting.&lt;/p&gt;

&lt;p&gt;But the more important story is how it got built.&lt;/p&gt;

&lt;p&gt;The repo states that NEO handled setup, debugging, validation, and documentation autonomously. That means this was not just a code generation exercise. It involved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;navigating an unfamiliar architecture&lt;/li&gt;
&lt;li&gt;getting the inference stack working&lt;/li&gt;
&lt;li&gt;dealing with CUDA and shell issues&lt;/li&gt;
&lt;li&gt;validating runtime behavior on GPU&lt;/li&gt;
&lt;li&gt;wrapping the result in a usable API and CLI&lt;/li&gt;
&lt;li&gt;writing documentation that explains how the system works and where it breaks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is much closer to real engineering work than most “AI built X” demos.&lt;/p&gt;

&lt;p&gt;The valuable question is no longer whether an agent can produce a toy script from a prompt.&lt;/p&gt;

&lt;p&gt;The better question is whether it can take a new technical idea, explore the dependency stack, adapt it to real hardware constraints, instrument the result, debug its mistakes, and leave behind something another engineer can inspect and run.&lt;/p&gt;

&lt;p&gt;This replication is a good example of that threshold being crossed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would take away from this
&lt;/h2&gt;

&lt;p&gt;I do not think the lesson is “replace RAG with giant context everywhere.”&lt;/p&gt;

&lt;p&gt;I think the real lessons are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Persistent KV state is becoming a usable systems primitive.&lt;/strong&gt;&lt;br&gt;
It is not just an internal optimization anymore. It can be treated as part of application architecture.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Long-context serving changes the shape of the stack.&lt;/strong&gt;&lt;br&gt;
You can move work from retrieval infrastructure into model runtime, but only for some workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The hard part is now quality, not just capacity.&lt;/strong&gt;&lt;br&gt;
Getting 1M context to fit is impressive. Getting the model to attend well across that full range is the deeper challenge.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Autonomous agents are becoming useful for reproducing research systems.&lt;/strong&gt;&lt;br&gt;
Not in a magical “push button, get product” sense. In a practical engineering sense where they can compress a lot of setup, debugging, and validation work into one session.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last point is the reason we cared enough to run this experiment in the first place.&lt;/p&gt;

&lt;p&gt;A lot of technical posts die as inspiration. They get bookmarked, maybe discussed, and then disappear.&lt;/p&gt;

&lt;p&gt;This one turned into a runnable system in about 30 minutes.&lt;/p&gt;

&lt;p&gt;That is a meaningful change in what an AI engineering agent can do.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>llm</category>
      <category>gemma</category>
    </item>
    <item>
      <title>Gemma 4 on GPU runtime. An overview of the process.
 
#llm #gemma #benchmarks</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Tue, 14 Apr 2026 15:35:43 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/gemma-4-on-gpu-runtime-an-overview-of-the-process-llm-gemma-benchmarks-57kp</link>
      <guid>https://forem.com/gaurav_vij137/gemma-4-on-gpu-runtime-an-overview-of-the-process-llm-gemma-benchmarks-57kp</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d" class="crayons-story__hidden-navigation-link"&gt;I Ran Google's latest Gemma 4 Models on 48GB GPU. Here's What Actually Happened.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/gaurav_vij137" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F390876%2F1001f18f-15c5-4cb3-b792-3c4e81a1cc61.jpg" alt="gaurav_vij137 profile" class="crayons-avatar__image" width="400" height="400"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/gaurav_vij137" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Gaurav Vij
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Gaurav Vij
                
              
              &lt;div id="story-author-preview-content-3454289" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/gaurav_vij137" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F390876%2F1001f18f-15c5-4cb3-b792-3c4e81a1cc61.jpg" class="crayons-avatar__image" alt="" width="400" height="400"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Gaurav Vij&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 4&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d" id="article-link-3454289"&gt;
          I Ran Google's latest Gemma 4 Models on 48GB GPU. Here's What Actually Happened.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/gemma"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;gemma&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/llm"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;llm&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/gemini"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;gemini&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>A CLI tool to score fine-tuning dataset quality before training starts</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Tue, 14 Apr 2026 14:55:18 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/a-cli-tool-to-score-fine-tuning-dataset-quality-before-training-starts-23ng</link>
      <guid>https://forem.com/gaurav_vij137/a-cli-tool-to-score-fine-tuning-dataset-quality-before-training-starts-23ng</guid>
      <description>&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%2Fqsqi3tlfcrrol6uclerq.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%2Fqsqi3tlfcrrol6uclerq.png" alt=" " width="800" height="510"&gt;&lt;/a&gt;&lt;br&gt;
One of the most frustrating outcomes in machine learning is spending time and GPU budget on a fine-tuning run, only to discover later that the real issue was the dataset.&lt;/p&gt;

&lt;p&gt;A few missing fields, inconsistent structure, duplicated samples, weak coverage, or noisy records can quietly drag down results. And by the time you notice, you have already paid for the experiment.&lt;/p&gt;

&lt;p&gt;To make that easier to catch upfront, we built &lt;strong&gt;Fine-tune Dataset Quality Scorer&lt;/strong&gt; using &lt;a href="https://heyneo.com" rel="noopener noreferrer"&gt;NEO&lt;/a&gt; - First autonomous AI engineering Agent.&lt;/p&gt;

&lt;p&gt;It is a CLI tool that analyzes fine-tuning datasets before training begins and returns an actionable quality score in seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Instead of waiting for model behavior to reveal data problems, the tool scans your JSONL dataset ahead of time and surfaces issues with exact row references and concrete recommendations.&lt;/p&gt;

&lt;p&gt;It runs &lt;strong&gt;11 automated checks&lt;/strong&gt; across four layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;data integrity&lt;/li&gt;
&lt;li&gt;content coverage&lt;/li&gt;
&lt;li&gt;LLM-based review&lt;/li&gt;
&lt;li&gt;cross-dataset safety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also auto-detects dataset schema, so it can adapt to formats like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alpaca&lt;/li&gt;
&lt;li&gt;ChatML&lt;/li&gt;
&lt;li&gt;Prompt/Completion&lt;/li&gt;
&lt;li&gt;ShareGPT&lt;/li&gt;
&lt;li&gt;Generic JSONL&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How scoring works
&lt;/h2&gt;

&lt;p&gt;Each check contributes to a weighted final score from &lt;strong&gt;0 to 100&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That score maps to four grades:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;READY&lt;/strong&gt;: 92–100&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CAUTION&lt;/strong&gt;: 80–91&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NEEDS WORK&lt;/strong&gt;: 60–79&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NOT READY&lt;/strong&gt;: below 60&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The weights are configurable through YAML, so teams can tune the scoring logic to match their own standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Domain-specific analysis
&lt;/h2&gt;

&lt;p&gt;One part I especially like is that it does not stop at generic validation.&lt;/p&gt;

&lt;p&gt;The tool can also detect the dataset domain automatically, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;coding&lt;/li&gt;
&lt;li&gt;QA&lt;/li&gt;
&lt;li&gt;translation&lt;/li&gt;
&lt;li&gt;summarization&lt;/li&gt;
&lt;li&gt;conversation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then it runs coverage analysis that is specific to that type of dataset.&lt;/p&gt;

&lt;p&gt;For example, a coding dataset can be checked for things like task-type balance and error-handling coverage, instead of receiving only generic warnings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional LLM-based review
&lt;/h2&gt;

&lt;p&gt;There is also an &lt;code&gt;llm-review&lt;/code&gt; mode.&lt;/p&gt;

&lt;p&gt;This samples records and asks a Claude model to evaluate them on clarity, quality, and coherence. That score can be folded into the overall result with a 15% weight. If no API key is present, it skips this step automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example output
&lt;/h2&gt;

&lt;p&gt;We also generated an HTML report for the &lt;a href="https://huggingface.co/datasets/open-index/hacker-news" rel="noopener noreferrer"&gt;Hacker News comments dataset&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It scored &lt;strong&gt;88.8 / 100&lt;/strong&gt;, which landed in &lt;strong&gt;CAUTION&lt;/strong&gt;. Most checks passed, but the report flagged &lt;strong&gt;missing values&lt;/strong&gt; as the main issue, with completeness at &lt;strong&gt;85.6%&lt;/strong&gt;. That is a good example of the kind of problem that often slips through until much later in the pipeline. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why we built it
&lt;/h2&gt;

&lt;p&gt;This project was also a useful demonstration of what we are building with NEO.&lt;/p&gt;

&lt;p&gt;Rather than using AI only for snippets or one-off code suggestions, we wanted to show that an autonomous agent can build something practical end-to-end: a real tool, with structured logic, useful outputs, and production relevance.&lt;/p&gt;

&lt;p&gt;The result is not just a demo. It is something teams could actually plug into their workflow or CI pipeline to catch dataset issues before training starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/dakshjain-1616/Fine-tune-Dataset-Quality-Scorer" rel="noopener noreferrer"&gt;https://github.com/dakshjain-1616/Fine-tune-Dataset-Quality-Scorer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think dataset quality is still one of the most under-appreciated bottlenecks in fine-tuning workflows.&lt;/p&gt;

&lt;p&gt;A lot of “model quality” problems are really data quality problems in disguise.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>finetuning</category>
      <category>llm</category>
      <category>datascience</category>
    </item>
    <item>
      <title>I Ran Google's latest Gemma 4 Models on 48GB GPU. Here's What Actually Happened.</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Sat, 04 Apr 2026 15:58:51 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d</link>
      <guid>https://forem.com/gaurav_vij137/i-ran-googles-latest-gemma-4-models-on-48gb-gpu-heres-what-actually-happened-5d3d</guid>
      <description>&lt;p&gt;This week Google dropped Gemma 4, and I wanted to test all four variants on my workstation. &lt;/p&gt;

&lt;p&gt;The specs looked interesting: two small edge models (2B and 4B), a MoE model that claims "26B total but only 4B active", and a dense 31B beast. The question was simple: which ones actually run on a single RTX A6000 with 48GB of VRAM?&lt;/p&gt;

&lt;p&gt;The internet had answers. Most said you'd need 4-bit quantization for the larger models. Some said the MoE wouldn't fit at all. I decided to test everything in full bfloat16 precision, no quantization, and measure what actually happens.&lt;/p&gt;

&lt;p&gt;I didn't do this manually. I worked with &lt;a href="https://heyneo.so" rel="noopener noreferrer"&gt;Neo&lt;/a&gt;, an AI engineering agent made by us, to set up the benchmark pipeline. Neo researched the model architectures, wrote the loading scripts, fixed bugs when the MoE model refused to load, and ran each test iteration. When the 31B model showed weird memory numbers, Neo caught that we'd accidentally loaded it in 4-bit instead of bfloat16 and re-ran it correctly. The whole process took a few hours instead of days because Neo handled the implementation details while I focused on what the results meant.&lt;/p&gt;

&lt;p&gt;Here's what I found. A TL;DR snapshot of the quantitative evaluations:&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%2F8zq8jbh2akqye03uh60a.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%2F8zq8jbh2akqye03uh60a.png" alt="Gemma 4 model evaluations" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I tested all four models on an &lt;strong&gt;NVIDIA RTX A6000 (48GB VRAM)&lt;/strong&gt;. No quantization. No tricks. Just loading each model in native bfloat16 precision and running 15 test prompts through them.&lt;/p&gt;

&lt;p&gt;The prompts covered three areas: JSON output (5 tests), instruction following (5 tests), and general generation (5 tests). I measured peak VRAM usage, tokens per second, time to first token, and whether the models actually followed the prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Memory Surprise
&lt;/h2&gt;

&lt;p&gt;Here's the thing nobody expected. All four models loaded successfully in full bfloat16 precision. No quantization needed.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;VRAM Used&lt;/th&gt;
&lt;th&gt;% of 48GB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;E2B&lt;/td&gt;
&lt;td&gt;10.25GB&lt;/td&gt;
&lt;td&gt;21%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;E4B&lt;/td&gt;
&lt;td&gt;15.99GB&lt;/td&gt;
&lt;td&gt;33%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26B-A4B&lt;/td&gt;
&lt;td&gt;42.30GB&lt;/td&gt;
&lt;td&gt;88%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31B&lt;/td&gt;
&lt;td&gt;43.82GB&lt;/td&gt;
&lt;td&gt;91%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 31B model uses 43.82GB. The 26B-A4B MoE uses 42.30GB. Both fit. Both run. No quantization required.&lt;/p&gt;

&lt;p&gt;If you've been running these models in 4-bit because you thought they wouldn't fit, you can stop. You're using quantization for a problem that doesn't exist on 48GB hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed vs Size: The Trade-Off Gets Real
&lt;/h2&gt;

&lt;p&gt;Throughput told a different story. The smaller models are fast. The big ones are... not.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Tokens/sec&lt;/th&gt;
&lt;th&gt;Time to First Token&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;E2B&lt;/td&gt;
&lt;td&gt;16.93&lt;/td&gt;
&lt;td&gt;0.06s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;E4B&lt;/td&gt;
&lt;td&gt;13.82&lt;/td&gt;
&lt;td&gt;0.07s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26B-A4B&lt;/td&gt;
&lt;td&gt;9.58&lt;/td&gt;
&lt;td&gt;0.21s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31B&lt;/td&gt;
&lt;td&gt;0.54&lt;/td&gt;
&lt;td&gt;1.89s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 31B model generates 0.54 tokens per second. That's one token every two seconds. For a chatbot, that's painful. For batch processing, maybe fine. For real-time applications, forget it.&lt;/p&gt;

&lt;p&gt;The 26B-A4B MoE is the interesting one here. It runs at 9.58 tokens per second. That's 18 times faster than the dense 31B, using almost the same amount of VRAM. The MoE architecture activates only about 4B of parameters per token, even though all 26B weights sit in memory. You get near-31B quality with 4B inference cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "4B Active" Actually Means
&lt;/h2&gt;

&lt;p&gt;This confused me at first. The model is called "26B-A4B". Marketing says "4B active parameters". But it uses 42GB of VRAM. If it's only using 4B parameters, why does it need 42GB?&lt;/p&gt;

&lt;p&gt;The answer: "4B active" refers to computation, not memory. All 26 billion weights load into VRAM. But for each token, the model routes through only about 4 billion of them. The rest sit idle.&lt;/p&gt;

&lt;p&gt;Think of it like a restaurant with 26 chefs in the kitchen, but only 4 cook your order. You still need to pay all 26 chefs (memory cost), but only 4 are working at any moment (compute cost).&lt;/p&gt;

&lt;p&gt;This is why the MoE runs so fast. It's doing 4B worth of math per token, not 26B. But you still need the full 42GB to store all the weights.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Edge Models Are Built Differently
&lt;/h2&gt;

&lt;p&gt;The E2B and E4B models use something called Per-Layer Embeddings. Traditional transformers have one embedding layer at the start. Gemma 4's edge models add a second embedding pathway that feeds into every decoder layer.&lt;/p&gt;

&lt;p&gt;Google designed this for quantized deployment on phones and laptops. The extra embedding pathway helps small models maintain quality even when you compress them to 4-bit or 8-bit. On my 48GB GPU, they ran in full precision and used 10GB and 16GB respectively.&lt;/p&gt;

&lt;p&gt;They're fast. The E2B hits 16.93 tokens per second with 61ms time to first token. If you're building a chatbot that needs to feel instant, this is your model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt Following: The 73% Pattern
&lt;/h2&gt;

&lt;p&gt;I ran 15 prompts per model. Five asked for JSON output. Five tested instruction following. Five were general generation tasks.&lt;/p&gt;

&lt;p&gt;Three models scored 73% compliance. E4B, 26B-A4B, and 31B all passed 11 out of 15 tests. The E2B scored lower at 60%, passing 9 out of 15.&lt;/p&gt;

&lt;p&gt;The pattern wasn't random. The larger three models failed the same JSON tests. They'd produce valid JSON structure, but wrap it in markdown code blocks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you parse this as raw JSON, it fails. The parser sees the backticks and "json" label before the curly brace. &lt;strong&gt;But the JSON itself is valid.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This isn't a model capability issue. It's a formatting convention. The models learned to wrap code in markdown during training. If you strip the markdown wrappers before parsing, compliance jumps from 73% to roughly 90-95%.&lt;/p&gt;

&lt;p&gt;The E2B failed more often on instruction tests. It would truncate responses or miss constraints in multi-step prompts. The larger models followed instructions precisely.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Use for Real Projects
&lt;/h2&gt;

&lt;p&gt;After running all four, here's what I'd pick for different use cases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-time chatbot:&lt;/strong&gt; E2B. It's fast enough that users won't notice latency. 16.93 tokens per second means responses appear instantly. The 60% compliance rate is fine for casual chat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Production API:&lt;/strong&gt; E4B. Best balance of speed and capability. 13.82 tokens per second, 73% compliance, uses only 16GB VRAM. You can run this on a single mid-range GPU and serve real users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex reasoning:&lt;/strong&gt; 26B-A4B. If you need the model to think through multi-step problems or handle nuanced tasks, this is the sweet spot. Near-31B quality, 9.58 tokens per second, fits on 48GB without quantization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximum quality, no speed requirement:&lt;/strong&gt; 31B. Only if you're doing batch processing or research where throughput doesn't matter. The 0.54 tokens per second is brutal for interactive use.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Quantization Myth
&lt;/h2&gt;

&lt;p&gt;The biggest takeaway: you don't need 4-bit quantization for Gemma 4 on 48GB hardware. The models fit in full precision. The 31B uses 43.82GB. The 26B-A4B uses 42.30GB. Both leave enough headroom for context and batch processing.&lt;/p&gt;

&lt;p&gt;If you're quantizing because you think the models won't fit, try loading them in bfloat16 first. You might find you're trading quality for a problem that doesn't exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Bottleneck
&lt;/h2&gt;

&lt;p&gt;Memory isn't the bottleneck for Gemma 4 on 48GB GPUs. Throughput is.&lt;/p&gt;

&lt;p&gt;The 31B model fits. But it's so slow that you'll question whether it's usable. The MoE architecture in 26B-A4B solves this by activating fewer parameters per token. You get the quality of a 26B model with the speed of a 4B model, while still needing 42GB VRAM to store all the weights.&lt;/p&gt;

&lt;p&gt;If you're choosing between 26B-A4B and 31B for a production system, pick the MoE. The 18x speed difference matters more than the marginal quality gain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Gemma 4's architecture choices signal where the industry is heading. Per-Layer Embeddings for edge deployment. MoE for cloud workstations. Dense models for maximum quality when speed doesn't matter.&lt;/p&gt;

&lt;p&gt;The edge models (E2B, E4B) are built for phones and laptops. The MoE (26B-A4B) is built for single-GPU cloud workstations. The dense 31B is built for research and batch processing.&lt;/p&gt;

&lt;p&gt;Pick the one that matches your deployment target. Don't quantize unless you actually need to. And if you're parsing JSON, strip the markdown wrappers first.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;All benchmarks ran on NVIDIA RTX A6000 (48GB VRAM) using bfloat16 precision without quantization. Test suite: 15 prompts per model (5 JSON, 5 instruction, 5 generation).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gemma</category>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Achieving 90% Cost-Effective Transcription and Translation with Optimised OpenAI Whisper on Q Blocks</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Sat, 08 Apr 2023 21:23:06 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/achieving-90-cost-effective-transcription-and-translation-with-optimised-openai-whisper-onq-blocks-59gf</link>
      <guid>https://forem.com/gaurav_vij137/achieving-90-cost-effective-transcription-and-translation-with-optimised-openai-whisper-onq-blocks-59gf</guid>
      <description>&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%2Fgft7w0waw0itlfyc7va2.jpg" 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%2Fgft7w0waw0itlfyc7va2.jpg" alt="Optimizing OpenAI Whisper for High-Performance Transcribing and Cost Efficiency" width="800" height="450"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Large language models (LLMs) are AI models that use deep learning algorithms, such as transformers, to process vast amounts of text data, enabling them to learn patterns of human language and thus generate high-quality text outputs. They are used in applications like speech to text, chatbots, virtual assistants, language translation, and sentiment analysis.&lt;/p&gt;

&lt;p&gt;However, it is difficult to use these LLMs because they require significant computational resources to train and run effectively. More computational resources require complex scaling infrastructure and often results in higher cloud costs.&lt;/p&gt;

&lt;p&gt;To help solve this massive problem of using LLMs at scale, &lt;a href="https://www.qblocks.cloud/" rel="noopener noreferrer"&gt;Q Blocks&lt;/a&gt; has introduced a decentralized GPU computing approach coupled with optimized model deployment which not only reduces the cost of execution by multi-folds but also increases the throughput resulting in more sample serving per second.&lt;/p&gt;

&lt;p&gt;In this article, we will display (with comparison) how the cost of execution and throughput can be increased multi-folds for a large language model like OpenAI-whisper for speech to text transcribing use case by first optimising the AI model and then using Q Blocks's cost efficient GPU cloud to run it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Want early access to Q Blocks' Whisper API? Join our &lt;a href="https://regw8xqrnyn.typeform.com/monsterapi" rel="noopener noreferrer"&gt;waitlist&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Importance of optimising AI models
&lt;/h3&gt;




&lt;p&gt;For any AI model, there are 2 major phases of execution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Learning (Model training phase), and&lt;/li&gt;
&lt;li&gt;  Execution (Model deployment phase).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Training a large language model can take weeks or even months and can require specialized hardware, such as graphical processing units (GPUs) which are prohibitively expensive on traditional cloud platforms like AWS and GCP.&lt;/p&gt;

&lt;p&gt;In addition, LLMs can be computationally expensive to run, especially when processing large volumes of text or speech data in real-time. In particular, the complexity of large language models stems from the massive number of parameters that they contain. These parameters represent the model's learned representations of language patterns. More parameters can help produce higher quality outputs but it requires more memory and compute to process.  &lt;/p&gt;

&lt;p&gt;This can make it challenging to deploy these models in production environments and can limit their practical use.&lt;/p&gt;

&lt;p&gt;Efficient and low-size LLMs can result in a lower cost of deployment, higher speed, and more managed scaling. Thus, enabling businesses to deploy LLMs more quickly and effectively.&lt;/p&gt;

&lt;p&gt;This is why model optimisation becomes crucial in the domain of AI. Also, AI model optimisation process helps reduce the carbon footprint of AI models, making them more sustainable and environmentally friendly.&lt;/p&gt;

&lt;h3&gt;
  
  
  About OpenAI-Whisper Model
&lt;/h3&gt;




&lt;p&gt;OpenAI Whisper is an open-source automatic speech recognition (ASR) system trained on 680,000 hours of multilingual and multitask supervised data collected from the web. The architecture of the model is based on encoder-decoder transformers system and has shown significant performance improvement compared to previous models because it has been trained on various speech processing tasks, including multilingual speech recognition, speech translation, spoken language identification, and voice activity detection.&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%2Ff0w1veqn6mlqx2uit7es.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%2Ff0w1veqn6mlqx2uit7es.png" alt="OpenAI Whisper model encoder-decoder transformer architecture" width="800" height="606"&gt;&lt;/a&gt; &lt;a href="https://github.com/openai/whisper" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OpenAI released 6 versions of Whisper model. Each version has a different size of parameter count and more parameters lead to more memory requirment due to increased model size, but it also results in higher accuracy of the transcribed output.  &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Large-v2&lt;/code&gt; is a biggest version of whisper model and offers superior transcription quality, but it requires more GPU memory due to large size and is 32x slower than the smallest version i.e. &lt;code&gt;tiny&lt;/code&gt;. More information on versions available &lt;a href="https://github.com/openai/whisper#available-models-and-languages" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But here comes a conflict, what if you desire the highest quality transcription output but are restricted by a limited budget for GPUs to execute the model? Model optimisation is what helps us achieve that. There are a couple of optimisation approaches such as using mixed-precision training that reduces the memory requirements and computation time of the model or reducing the number of layers or using a smaller hidden dimension, to reduce the model's size and thus speed up inference.&lt;/p&gt;

&lt;p&gt;Want early access to Q Blocks' Whisper API? Join our &lt;a href="https://regw8xqrnyn.typeform.com/monsterapi" rel="noopener noreferrer"&gt;waitlist&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model optimisation and Cost improvements using Q Blocks
&lt;/h3&gt;




&lt;p&gt;Q Blocks makes it very easy for developers to train, tune and deploy their AI models using pre-configured ML environments on GPU instances that already have CUDA libraries, GPU drivers, and suitable AI frameworks loaded. As a result, the work required to set up an ML environment for development and deployment is reduced.&lt;/p&gt;

&lt;p&gt;For optimising OpenAI whisper model, we will use CTranslate2 - A C++ and Python library for efficient inference with Transformer models. CTranslate2 offers out of the box optimisations for Whisper model.&lt;/p&gt;

&lt;p&gt;CTranslate2 can be easily installed in a Q Blocks GPU instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/guillaumekln/faster-whisper.git  
cd faster-whisper  
pip install -e .[conversion]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rest of the libraries are handled by pre-installed packages in Q Blocks instances.&lt;/p&gt;

&lt;p&gt;Now we convert the whisper large-v2 model into ctranslate2 format for efficient inference using this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ct2-transformers-converter --model openai/whisper-large-v2 --output_dir whisper-large-v2-ct2 \
   --copy_files tokenizer.json --quantization float16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model is now optimised and ready to infer efficiently. Here's the python3 code for transcription:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from faster_whisper import WhisperModel
model_path = "whisper-large-v2-ct2/"
# Run on GPU with FP16
model = WhisperModel(model_path, device="cuda", compute_type="float16")
segments, info = model.transcribe("audio.mp3", beam_size=5)
print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
for segment in segments:
     print("[%.2fs -&amp;gt; %.2fs] %s" % (segment.start, segment.end, segment.text))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we run this optimised &lt;code&gt;whisper large-v2&lt;/code&gt; model on Q Blocks decentralizd Tesla V100 GPU instance and compare it with the default whisper large-v2 model while running it on AWS P3.2xlarge (Tesla V100) GPU instance.  &lt;/p&gt;

&lt;p&gt;Both GPU instances offer same GPU compute but Q Blocks GPU instance is 50% low cost than AWS out of the box.&lt;/p&gt;

&lt;p&gt;We used an audio sample of 1 hour and transcribed it with the models running on above mentioned 2 GPU instances. Below is a quick comparison in terms of no. of GPUs and cost consumed to process the same amount of audio hours in a normalized time period of execution:&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%2Fa8htzf99mjeem2q6u9p6.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%2Fa8htzf99mjeem2q6u9p6.png" alt="Benchmark table" width="634" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the above benchmarks, it is evident that running an optimised model on Q Blocks cost efficient GPUs resulted in &lt;strong&gt;12x cost reduction&lt;/strong&gt;. These numbers lead to even greater savings and performance upgrades at scale.  &lt;/p&gt;

&lt;p&gt;For example, transcribing 10,000 hours of audio files would be $3,100 less costly on Q Blocks.&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%2Ffd27w2o536qgrpqhtzs5.jpg" 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%2Ffd27w2o536qgrpqhtzs5.jpg" alt="OpenAI Whisper model benchmark on AWS v/s Q Blocks" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Using these optimisations in production
&lt;/h3&gt;




&lt;p&gt;The implications of running optimised models on a decentralized GPU cloud like Q Blocks are significant for a wide range of AI applications.&lt;br&gt;&lt;br&gt;
For instance, consider the case of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Zoom calls and video subtitles:&lt;/strong&gt; In these scenarios, real-time transcription accuracy is crucial for effective communication. By reducing costs and improving performance, a business can achieve scaling to serve millions of users without compromising on their experience.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Customer Service Chatbots:&lt;/strong&gt; With Q Blocks GPU cloud, LLM based chatbots can be trained to respond more quickly and accurately, providing a better user experience for customers.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Language Translation:&lt;/strong&gt; Serving real-time translation for millions of users require faster response time and using optimised LLMs on Q Blocks can help you achieve that.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Whisper API for speech to text transcription 🗣
&lt;/h3&gt;




&lt;p&gt;At Q Blocks, we understand the need for affordable and high-performing GPU instances to accelerate AI model development and deployment. We are making the process of accessing AI models like Whisper easier for application developers to create cutting-edge products that deliver optimal performance and cost-effectiveness.&lt;/p&gt;

&lt;p&gt;For the use case of transcribing audio files at scale, &lt;a href="https://monsterapi.ai" rel="noopener noreferrer"&gt;MonsterAPI&lt;/a&gt; (a platform for Generative AI by Q Blocks) is coming up with a ready-to-use API for the Whisper Large-v2 model which will be optimised and work out of the box at scale to serve your needs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Want early access to Q Blocks' Whisper API? Join our &lt;a href="https://regw8xqrnyn.typeform.com/monsterapi" rel="noopener noreferrer"&gt;waitlist&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;




&lt;p&gt;To conclude, performance optimization has become a crucial aspect of AI model development, and GPUs play a significant role in achieving faster training and inference times. The performance comparison of two approaches for running an AI model has shown that Q Blocks can help you optimize your AI models for performance and cost by 12 times.&lt;/p&gt;

&lt;p&gt;Reference: Thanks to GitHub project - &lt;a href="https://github.com/guillaumekln/faster-whisper" rel="noopener noreferrer"&gt;guillaumekln/faster-whisper&lt;/a&gt; for making ctranslate2 driven optimised workflow for Whisper.&lt;/p&gt;

</description>
      <category>whisper</category>
      <category>nlp</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>What do you use GPUs for?</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Mon, 16 May 2022 16:10:17 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/what-do-you-use-gpus-for-31m6</link>
      <guid>https://forem.com/gaurav_vij137/what-do-you-use-gpus-for-31m6</guid>
      <description>&lt;p&gt;GPUs are becoming better to serve general purpose computing.🚀&lt;/p&gt;

&lt;p&gt;With the help of parallel computing architecture, it is offering great speed ups for use cases like 3D rendering, machine learning, data science, crypto-mining and scientific computing.&lt;/p&gt;

&lt;p&gt;That makes me wonder, &lt;strong&gt;What do you use GPUs for today? 😀&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Often times the access to GPUs is very costly. Whether you build your own PC or run it on the cloud, the costs can burn a hole in your pocket. &lt;/p&gt;

&lt;p&gt;To solve this issue, we created &lt;a href="https://www.qblocks.cloud" rel="noopener noreferrer"&gt;Q Blocks&lt;/a&gt; - A decentralized GPU computing platform for Machine learning ! 🎉&lt;/p&gt;

&lt;p&gt;Using under-utilised computing systems to run ML drastically reduced the cost of GPU power access for ML devs. High-end GPUs are available on Q Blocks at upto 1/10th the cost.&lt;/p&gt;

&lt;p&gt;If you had access to this much GPU power then what are you going to use it for? 🤔&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>datascience</category>
      <category>python</category>
    </item>
    <item>
      <title>Why GPUs are great for Reinforcement Learning?</title>
      <dc:creator>Gaurav Vij</dc:creator>
      <pubDate>Thu, 14 Apr 2022 16:02:45 +0000</pubDate>
      <link>https://forem.com/gaurav_vij137/why-gpus-are-great-for-reinforcement-learning-iac</link>
      <guid>https://forem.com/gaurav_vij137/why-gpus-are-great-for-reinforcement-learning-iac</guid>
      <description>&lt;p&gt;This quick guide focuses on the basics of reinforcement learning (RL) and how GPUs enable accelerated performance for RL.&lt;/p&gt;

&lt;p&gt;To give a quick insight on why GPUs matter so much in today's world:&lt;br&gt;
GPUs are great for achieving faster performance using parallel computing architecture. They are designed to run 1000s of parallel threads and are thus also known as SIMD architecture i.e. Single Instruction Multi Data. &lt;/p&gt;

&lt;p&gt;A simple example for SIMD would be rendering a game scene on a screen. GPUs using 1000s of cores to render each pixel in parallel. The instruction to render a pixel is same while the data on each pixel is different.&lt;/p&gt;

&lt;p&gt;GPUs are finding a great use in Deep learning and Machine learning applications today. But sometimes it can be really frustrating to figure out the &lt;a href="https://www.qblocks.cloud/blog/best-gpu-for-deep-learning" rel="noopener noreferrer"&gt;best GPUs for deep learning&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  So first of all, what really is Reinforcement Learning?
&lt;/h2&gt;

&lt;p&gt;Reinforcement learning is a type of machine learning that provides a framework for solving problems in ways that are similar to the way humans would solve them. It is the machine equivalent of trial and error. The goal is to maximize the amount of reward received by repeatedly attempting different actions.&lt;/p&gt;

&lt;p&gt;The use cases for reinforcement learning are wide-ranging, and can be used to solve problems in domains such as healthcare, marketing, traffic management, robotics, education and more. Reinforcement learning is machine learning with experience.&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%2Fmvbzv2nt5kzpflh4lini.gif" 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%2Fmvbzv2nt5kzpflh4lini.gif" alt="Robot learning to solve Rubiks cube" width="720" height="380"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image &lt;a href="https://towardsdatascience.com/this-is-how-reinforcement-learning-works-5080b3a335d6" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The most common algorithm for reinforcement learning is called Q-learning which simulates a software agent who has to make a decision or take a course of action in each state.&lt;/p&gt;

&lt;p&gt;Open source toolkits such as &lt;a href="https://gym.openai.com/" rel="noopener noreferrer"&gt;Open AI Gym&lt;/a&gt; can be used for developing and comparing reinforcement learning algorithms.&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%2Fjb6omg9xz2o2ipdy4wnq.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%2Fjb6omg9xz2o2ipdy4wnq.png" alt="Reinforcement learning example" width="800" height="507"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image &lt;a href="https://towardsdatascience.com/deep-q-network-combining-deep-reinforcement-learning-a5616bcfc207" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Reinforcement Learning uses a reward signal to learn. Its aim is to explore all the possible cases in an environment to learn which actions can help it maximize the total reward collected over time. This exploration is performed by an RL agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPUs in Deep Learning &amp;amp; Reinforcement Learning
&lt;/h2&gt;

&lt;p&gt;Most people think of GPUs as something that is only used for gaming or video editing, but in recent years they have taken on a new role in AI. &lt;/p&gt;

&lt;p&gt;GPUs work better than CPUs when it comes to deep learning neural networks and Reinforcement learning because they can process more data at once with less power consumption. This is mainly due to their parallel processing abilities - meaning they can do more calculations at the same time.&lt;/p&gt;

&lt;p&gt;CPU vs GPU performance example:&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%2F8c1hh55frkjpppw6sxkb.gif" 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%2F8c1hh55frkjpppw6sxkb.gif" alt="CPU vs GPU performance example fo fluid rendering" width="462" height="260"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image &lt;a href="https://gfycat.com/glaringscalyirrawaddydolphin" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Deep learning is a type of machine learning where neural networks are used to make inferences about data. These neural networks are computationally demanding because they contain many layers. With the help of GPUs, deep neural nets can be trained much faster than before, which has led to an exponential increase in their use for classification and regression problems.&lt;/p&gt;

&lt;p&gt;GPUs are great at matrix multiplications and Deep neural nets have to perform thousands of matrix multiplication tasks during the algorithm training process, thus making GPUs a great fit for them.&lt;/p&gt;

&lt;p&gt;A GPU-powered reinforcement learner is a type of machine learning agent that runs the RL experiments on a GPU and tries to learn how to maximise its expected reward by interacting with an environment in which it receives rewards or punishments based on its actions.&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%2Fi5efi196iw6uuvdrnaoi.gif" 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%2Fi5efi196iw6uuvdrnaoi.gif" alt="Robot is able to play a game" width="480" height="263"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image &lt;a href="https://www.useunicorn.com/pepper-robot-uses-trial-and-error-learning-to-master-a-childs-game/" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;GPUs are also used for applications such as auto-driving, analytics, or any other application that needs to process large amounts of data in parallel where previously it was too high in cost to use them for these purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Using GPUs for Deep Learning Applications
&lt;/h2&gt;

&lt;p&gt;GPUs have been proven to be the most efficient processing hardware for deep learning applications. Over the past few years, the use of GPUs for deep learning has been on the rise because of many benefits that they provide. These advantages include high-quality training and fast processing times, as well as less overall cost of experimentation.&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%2Fyb14dj96li7i1b5kx5ml.jpg" 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%2Fyb14dj96li7i1b5kx5ml.jpg" alt="GPUs in view" width="640" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@nanadua11?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Nana Dua&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/gpu?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;GPUs are used because they have more cores, which allows them to process more data at a time and provides better performance. This makes them a great fit for deep learning applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GPU’s architecture allows it to learn more quickly and with less training data, making it an ideal option for reinforcement learning as well as supervised and unsupervised machine learning.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are the Best GPUs for Reinforcement Learning?
&lt;/h2&gt;

&lt;p&gt;A GPU (Graphics Processing Unit) executes complex algorithms efficiently by offering high bandwidth and low latency for its memory access, thus making them the fastest general-purpose compute device.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;NVIDIA Tesla V100&lt;/strong&gt; is one of the best GPU for reinforcement learning. It is capable of hosting multiple computational graphs and can be scaled almost linearly up to 8 GPU clusters.&lt;/p&gt;

&lt;p&gt;The accelerating factor for deep learning frameworks such as Caffe2, Pytorch, and TensorFlow is their ability to make use of GPU acceleration to achieve better performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Reinforcement learning is a process of trial and error by performing a lot of attempts to maximize reward and thus learn the best actions to perform. GPUs enable faster processing for Reinforcement learning by performing these actions in parallel using its parallel computing architecture.&lt;/p&gt;

&lt;p&gt;If you are a &lt;strong&gt;deep learning or machine learning engineer&lt;/strong&gt; then you'd know that GPU computing is very costly on cloud.&lt;br&gt;
We understand your pain. &lt;/p&gt;

&lt;p&gt;So to democratize GPU computing access, we built &lt;a href="https://www.qblocks.cloud/" rel="noopener noreferrer"&gt;Q Blocks&lt;/a&gt;, a decentralized computing platform that enables 50-80% cost efficient GPU computing for Machine learning and Deep learning workloads. 😀&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>distributedsystems</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
    </item>
  </channel>
</rss>
