<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Machine Learning on Matt Suiche</title><link>https://www.msuiche.com/categories/machine-learning/</link><description>Recent content in Machine Learning on Matt Suiche</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 05 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.msuiche.com/categories/machine-learning/index.xml" rel="self" type="application/rss+xml"/><item><title>Local Models Within Reach: Everything That Changed in Eight Months</title><link>https://www.msuiche.com/posts/local-models-within-reach-everything-that-changed-in-eight-months/</link><pubDate>Sun, 05 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.msuiche.com/posts/local-models-within-reach-everything-that-changed-in-eight-months/</guid><description>&lt;p&gt;Eight months ago I published &lt;a href="https://www.msuiche.com/posts/building-agents-for-small-language-models-a-deep-dive-into-lightweight-ai/"&gt;Building Agents for Small Language Models&lt;/a&gt;, a set of hard-won notes from shipping agents on 270M–32B parameter models. At the time, running useful local models meant embracing constraints: small context windows, CPU-only fallbacks, broken UTF-8 streams, and reasoning that fell apart past two steps.&lt;/p&gt;
&lt;p&gt;I stand by that post. But the ground has shifted fast. What was a set of careful workarounds in August 2025 is starting to look like the default architecture for a large class of workloads. Local models are no longer the constrained sibling of cloud APIs — for many agent use cases, they are the better answer. Here is what has changed.&lt;/p&gt;</description></item><item><title>RustBPE: High-Performance BPE Tokenizer Training in Rust</title><link>https://www.msuiche.com/posts/rustbpe-high-performance-bpe-tokenizer-training-in-rust/</link><pubDate>Wed, 15 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.msuiche.com/posts/rustbpe-high-performance-bpe-tokenizer-training-in-rust/</guid><description>&lt;h2 id="introduction"&gt;Introduction &lt;a href="#introduction" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Byte Pair Encoding (BPE) tokenization is used in modern language models, but efficient training implementations are limited. OpenAI&amp;rsquo;s &lt;code&gt;tiktoken&lt;/code&gt; handles inference well, while HuggingFace&amp;rsquo;s &lt;code&gt;tokenizers&lt;/code&gt; supports training but has complexity and overhead. &lt;strong&gt;RustBPE&lt;/strong&gt; is a Rust implementation that provides training capabilities with better performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RustBPE was developed by Andrej Karpathy&lt;/strong&gt; as part of the &lt;a href="https://github.com/karpathy/nanochat/tree/master/rustbpe" target="_blank" rel="noopener"&gt;nanochat project&lt;/a&gt;. This analysis covers the RustBPE implementation, including its architecture, performance characteristics, and Python integration.&lt;/p&gt;
&lt;p&gt;For those interested in understanding BPE implementation from first principles, &lt;a href="https://sebastianraschka.com/blog/2025/bpe-from-scratch.html" target="_blank" rel="noopener"&gt;Sebastian Raschka provides an excellent deep-dive into implementing BPE from scratch&lt;/a&gt; in his blogpost, and this is also covered in his book &amp;ldquo;Build a Large Language Model (From Scratch)&amp;rdquo;. His work offers invaluable insights into the algorithmic foundations that underpin implementations like RustBPE.&lt;/p&gt;</description></item><item><title>Optimizing AlphaFold's Triangle Multiplicative Update: A First Look at GPU Performance Engineering</title><link>https://www.msuiche.com/posts/optimizing-alphafolds-triangle-multiplicative-update-a-first-look-at-gpu-performance-engineering/</link><pubDate>Tue, 30 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.msuiche.com/posts/optimizing-alphafolds-triangle-multiplicative-update-a-first-look-at-gpu-performance-engineering/</guid><description>&lt;h2 id="background"&gt;Background &lt;a href="#background" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;I recently encountered the &lt;a href="https://www.gpumode.com/v2/leaderboard/496?tab=submission" target="_blank" rel="noopener"&gt;GPU MODE TriMul challenge&lt;/a&gt; while exploring GPU optimization. Coming from a systems engineering background without prior PyTorch or Triton experience, this challenge provided an opportunity to learn GPU performance engineering through a practical problem.&lt;/p&gt;
&lt;p&gt;The Triangle Multiplicative Update (TriMul) is a core operation in AlphaFold2 and AlphaFold3—the protein structure prediction systems that earned the 2024 Nobel Prize in Chemistry. The operation&amp;rsquo;s O(n³) complexity creates severe performance bottlenecks in production, forcing AlphaFold3 to use batch size 1 during training despite having under 1B parameters. This makes the optimization problem both practically relevant and technically challenging.&lt;/p&gt;</description></item><item><title>The Hidden Math Bug That Makes AI Unpredictable</title><link>https://www.msuiche.com/posts/the-hidden-math-bug-that-makes-ai-unpredictable/</link><pubDate>Sun, 14 Sep 2025 00:00:00 +0200</pubDate><guid>https://www.msuiche.com/posts/the-hidden-math-bug-that-makes-ai-unpredictable/</guid><description>&lt;p&gt;This &lt;a href="https://x.com/awnihannun/status/1966953027451118012" target="_blank" rel="noopener"&gt;tweet from Awni Hannun&lt;/a&gt; demonstrates in one line of MLX code the nondeterminism phenomenon detailed in &lt;a href="https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/" target="_blank" rel="noopener"&gt;Thinking Machines&amp;rsquo; research&lt;/a&gt;. We will explore the PyTorch equivalent that reveals a fundamental issue in AI systems, because I&amp;rsquo;ve found that tweet extremely helpful to understand what the original blogpost was about.&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Here&amp;#39;s a one-line code summary in MLX of the &lt;a href="https://twitter.com/thinkymachines?ref_src=twsrc%5Etfw"&gt;@thinkymachines&lt;/a&gt; blog post on non-determinism in LLM inference.&lt;br&gt;&lt;br&gt;I&amp;#39;d guess the difference is larger the lower the precision, as you get larger affects from non-associativity of FP math.&lt;br&gt;&lt;br&gt;Interestingly, that implies that training at low… &lt;a href="https://t.co/jYcDK9GiLn"&gt;pic.twitter.com/jYcDK9GiLn&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Building Agents for Small Language Models: A Deep Dive into Lightweight AI</title><link>https://www.msuiche.com/posts/building-agents-for-small-language-models-a-deep-dive-into-lightweight-ai/</link><pubDate>Wed, 27 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.msuiche.com/posts/building-agents-for-small-language-models-a-deep-dive-into-lightweight-ai/</guid><description>&lt;p&gt;The landscape of AI agents has been dominated by large language models (LLMs) like GPT-4 and Claude, but a new frontier is opening up: lightweight, open-source, locally-deployable agents that can run on consumer hardware. This post shares internal notes and discoveries from my journey building agents for small language models (SLMs) – models ranging from 270M to 32B parameters that run efficiently on CPUs or modest GPUs. These are lessons learned from hands-on experimentation, debugging, and optimizing inference pipelines.&lt;/p&gt;</description></item></channel></rss>