ML/AI research engineer. Ex stats professor. Author of "Build a Large Language Model From Scratch" (https://t.co/O8LAAMRzzW) & reasoning (https://t.co/5TueQKx2Fk)
Some food for thought when designing benchmarks... So, here's a little computer-use (visual) comparison between GPT-5.6 Astra and Qwen3.8 Max. The task here was to recreate the image in the center using the Paint UI. Super interesting how the two different LLMs+Harnesses approached this totally differently by default. I.e., Astra tried to approach this by drawing and layering geometric shapes. Qwen approached this pixel by pixel. (Of course, the pixel-by-pixel result looks closer to the original, it's essentially a low-res version of that by nature.) So, the Qwen-generated image would surely score higher in the sense that it's closer to the original. But I wouldn’t conclude from this example that one LLM generalizes better than the other on other tasks. Also, I wouldn't say Qwen has better compute-use capabilities or better visual understanding than Astra. But it highlights an interesting point about how slippery benchmarks are when they only compare final results.
My take on AI model pacing as a framework for release checks and the competitive pressure around model releases.
Since I had to discuss the "pacing" with a lot of people this weekend, here are my two cents: I don't think pacing literally means that these companies will be "slowing down" training and development in any way. "Pacing" here means adding a framework for more checks. We have seen some of that "pacing" already in recent months, when Mythos wasn't released as-is but instead a delayed, nerfed Fable variant was released. Or when Astra wasn't released right away / there is an existing Astra model that hasn't been released yet. These Mythos/Fable and Astra pacing decisions were ad hoc. If you are a company, you have to weigh the pros and cons of a delayed release in terms of keeping up with the competition, making money, pleasing shareholders, mitigating risks and harms, and so on. I f there is a formal framework that everyone has to abide by, that essentially relieves some of the pressure on a company to rush out its model just to take the top spot on the leaderboard, since it knows that the competition "has to" play by the same rules. Based on the discussions today, I think "pacing" primarily means just that, rather than a halt in training the models. TL;DR: Pacing != pacing development.
Activity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubActivity on repository
rasbt pushed llm-architecture-gallery
View on GitHubA 90-minute LinkedIn Learning course on how reasoning models relate to conventional LLMs and how they are developed.
Activity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubBig overhaul on DeepSeek V4.1 using an encoder-decoder setup. Tbh they should have called it DeepSeek V5! Super cool and refreshing, though!
🚀 Introducing DeepSeek-V4.1-Flash: smarter, faster, more efficient. 🔹 Introducing the smallest model in our new architecture family, with native visual understanding. 🔹 Designed for greater capability, faster inference, higher throughput, and scaling to larger models. 1/6
Nice showcase that interesting LLM work can be done on single GPU!
I extended the GPT-2-style code from @rasbt's "Build a Large Language Model (from Scratch)" so that it was a 6-expert (2 active) mixture-of-experts, and trained it from scratch over 8 days. It worked well! Full writeup with maths and code at https://www.gilesthomas.com/2026/09/gpt-2-to-moe
View quoted postActivity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt opened a pull request in LLMs-from-scratch
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt opened a pull request in reasoning-from-scratch
View on GitHubA lot of hype around OpenAI's Astra model here on my timeline today. Apparently, this goes back to a new article from The Information, which said Astra is a "recurrent depth or looped transformer". It's always interesting to read about new or different approaches (including rumors about what the closed labs may be up to), but let's debunk this a bit. About 2 months ago, I shared the architecture details of Nanbeige, for example, where "Nanbeige4.2-3B is pretrained from scratch on 28T tokens with a Looped Transformer that reuses the layer stack to increase capacity without adding parameters." Yes, that's it. The looped transformer idea is just reusing layers in the transformer block. In the case of Nanbeige, the main idea is to reuse the same 22-layer stack (=transformer block) twice instead of once. So, effectively it extends the 22-layer architecture to 44 layers, but without duplicating the weights. In simple terms, this roughly doubles the size of the model (if we ignore the embedding and output layers for a second). But instead of requiring 2x the storage and RAM to host this model, it stays at the same size since we reuse the components. However, it's almost 2x as expensive in terms of compute, because we run the embedded text through almost 2x as many layers. Why? In the Nanbeige 4.2 technical report, the researchers found that two passes gave the best trade-off and retained about 75% of the token efficiency of a standard architecture. (More passes gave barely any gains but made the training much slower and much more expensive.) While, as far as I know, Nanbeige 4.2 is the first notable open-weight model that adopted this approach, the idea goes back to the NeurIPS paper "Mixture-of-recursions: Learning dynamic recursive depths for adaptive token-level computation". Actually, this paper proposes a mechanism that is a bit more sophisticated by adding a learned router that determines whether each token receives one, two, or more passes. So, easy tokens ...
Activity on rasbt/reasoning-from-scratch
rasbt opened a pull request in reasoning-from-scratch
View on GitHubActivity on rasbt/ai-detector-from-scratch
rasbt contributed to rasbt/ai-detector-from-scratch
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubA short video on how conventional LLMs relate to reasoning models and agents, along with Python and PyTorch setup using uv.
Activity on rasbt/LLMs-from-scratch
rasbt opened a pull request in LLMs-from-scratch
View on GitHubActivity on rasbt/deep-learning-book
rasbt closed an issue in deep-learning-book
View on GitHubTwo free live book club Q&A sessions on September 3 about Build a Reasoning Model From Scratch and related reader questions.
Activity on rasbt/llm-architecture-gallery
rasbt closed an issue in llm-architecture-gallery
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt commented on an issue in llm-architecture-gallery
View on GitHubActivity on repository
rasbt pushed reasoning-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubNow we know: The popular Ox Alpha LLM was GLM-5.3-Flash... Compared to GLM-5.2, this new GLM-5.3-Flash model uses: - a Kimi Linear-style 3:1 (super*) hybrid attention pattern with 34 Kimi Delta Attention layers (KDA) and 11 Multi-heat Latent Attention (MLA) / DeepSeek Sparse Attention (DSA) layers; - a scaled-down GLM-5.2-style sparse MoE backbone, going from 744B-A40B to 320B-A18B; - a DeepSeek V4-style mHC residual path with four parallel streams; - plus a native vision encoder (not shown). * "Super hybrid" because both KDA and MLA/DSA are "efficient" components. E.g., Kimi only uses KDA + full attention GQA, DeepSeek V3.2 uses DSA + full attention MLA. PS: Sry for the excessive tech jargon. Explainers on all these components (MLA, DSA, KDA, mhC, etc.) in my LLM Architecture Gallery PPS: Haha, maybe justification for getting that pricey Mac Studio M5 Ultra 256 GB / 512 GB to run this locally...
Introducing GLM-5.3-Flash - Leading capabilities at a highly competitive price - Natively multimodal with a 1M-token context window - A 320B-A18B model released under the MIT License - Previously previewed as Ox Alpha, running entirely on Chinese AI chips Blog:
Activity on repository
rasbt pushed reasoning-from-scratch
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt opened a pull request in reasoning-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed a pull request in LLMs-from-scratch
View on GitHubNice case study on using optimized functions whenever possible (except for educational purposes, though 😆)
By switching from a hand-rolled GELU to PyTorch's built-in one, I improved my LLM training speed -- and much more than I expected, from 21,000 tokens/second to 25,000! https://www.gilesthomas.com/2026/08/built-in-gelu
View quoted postActivity on repository
rasbt pushed llm-architecture-gallery
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubA short illustration of how the Claude's watermarking is supposed to work (based on my read of their released materials). In general, when we are generating tokens, there can be multiple high-scoring tokens at certain next-word positions. Usually, we sample with top-k or top-p sampling so the highest-scoring token is most often selected (if we repeat the sampling many times), but other tokens may be selected as well. With watermarking, there is a key that says which of the (ideally equally) highest-scoring tokens to select. Or, more concretely, the secret key and previous token influence the randomness here. Now, if we repeat this at many token positions, this creates the watermark as it will be a pattern that is statistically unlikely to get otherwise (due to combinatorics). One thing I am confused about: They basically say that they HAVE to do this for everyone due to EU regulation. Why? Sure, but this is an inference-time technique that doesn't require retraining or training a separate model, so, if they wanted, they could only do that for EU users? 🤔
We’ve written an FAQ to answer some of the questions we've received about watermarking. In summary: • We’re implementing watermarking to comply with the EU AI Act. Other major model developers have signed the same Code of Practice and will also be implementing watermarking;
View quoted postShort illustration of how Claude's text watermarking is supposed to work based on Anthropic's released materials.
RT ACM Education & Learning Center 8/19, join us for the #ACMTechTalk, "From Conventional LLMs to Reasoning Models to Agents," w/AI & LLM Research Engineer @rasbt. ACM Practitioner Board Co-Chaior @marlene_zw (@Microsoft) will moderate. Register (free) to attend live or on demand: https://bit.ly/3S5p0dp
Whoa, Meta released a new open-weight LLM yesterday, something that hasn't happened since the good old Llama days. Their Meta Muse Glimmer model is a 30B multimodal reasoning model with a Gemma-like architecture design. (“Glimmer” is probably a wordplay on “Spark,” the more likely capable model from which Glimmer was distilled. Muse Spark is only available through Meta’s Model API, though.) Architecture-wise, here are some of the main points: 1. "Only" a 131k context window, compared to Qwen3.6 and Gemma 4, which support 2x that natively; it's reasonable, but maybe on the shorter end in the age of agent harnesses 2. It's a dense model, not a mixture-of-experts. (So, it's fairer to compare it to Qwen3.6 27B than Qwen3.6 30B-A3B.) 3. Hybrid attention with grouped-query attention (GQA) and sliding window attention (SWA); the SWA:GQA pattern is a 3:1 local:global ratio. Other models like Gemma 4, which uses similar components, have a 5:1 ratio for comparison. 4. It adopts gated attention for both GQA and SWA; gated attention has become quite common in recent months. It basically applies a sigmoid gate to the attention output to decide how much of the attention information enters the residual connection. The interesting point is that it uses relatively standard GQA and SWA rather than hybrid attention mechanisms such as Nemotron or Qwen3.6. 5. A very extreme GQA ratio: 32 query heads and only 2 KV heads; for comparison, Gemma 4 31B uses 32 Q / 16 KV in the local heads and 32 Q / 4 KV in the global heads. This means that Meta Glimmer has a very small KV cache. Overall, the probably most similar architecture is Gemma 3 27B (including the Gemma-style pre/post RMSNorm placement) and Gemma 4 31B, but with some tweaks like SwiGLU instead of GeGLU activations, gated attention, and the more extreme GQA:SWA pattern mentioned before. What stands out is its extreme KV-cache efficiency. I.e., the KV CACHE / TOKEN ratios (in BF16) are: - Muse Glimmer: 52 KiB (lower is bett...
Short architecture note on Meta Muse Glimmer 30B, including gated local and global GQA, KV-cache efficiency, and release-time benchmark comparisons.
Activity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed a pull request in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt opened a pull request in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt opened a pull request in LLMs-from-scratch
View on GitHubJust saw that the LLMs-from-scratch repository passed 100,000 stars on GitHub! This is super cool and motivating. I am really happy to see that this open-source repo has helped so many people. Thanks also to everyone who shared ideas and opened PRs with improvements! Of course, I plan to keep adding new material, including new attention variants and architectures (while bigger projects like RL and Reasoning From Scratch live in their separate repositories). I am also currently working on a larger applied custom “small” LLM project. It has been keeping me super busy this month, but I will share more on that soon. If you are new to it, some of the highlights include 1. Of course, the complete code path from tokenization and attention to pretraining, classification, and instruction fine-tuning, etc. All of it FROM SCRATCH, of course! (RL lives in a companion repo.) 2. From-scratch implementations of Llama, Qwen, Gemma, and Olmo (smaller variants that run locally and can be plugged into the training scripts). 3. From-scratch implementations of attention alternatives and other architecture components, such as GQA, MLA, sliding-window attention, Gated DeltaNet, DeepSeek Sparse Attention, cross-layer KV sharing, and mixture-of-experts 4. Materials on KV caching, training performance, memory-efficient weight loading, DPO, evaluation, and LoRA So, if you don’t have any weekend plans yet, happy tinkering!
Short note celebrating the LLMs-from-scratch repository passing 100,000 GitHub stars and summarizing its learning materials.
RT Hamel Husain It’s been a long time since I’ve been excited to work through a technical book @rasbt It’s time to bring more ML back into my life
Activity on rasbt/mlxtend
rasbt closed a pull request in mlxtend
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt closed an issue in reasoning-from-scratch
View on GitHubActivity on repository
rasbt pushed reasoning-from-scratch
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt commented on an issue in reasoning-from-scratch
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt opened a pull request in reasoning-from-scratch
View on GitHubRT Sophia Yang, Ph.D. Happy August! Our AI book club is reading @rasbt's Build a Reasoning Model this month. I have 10 free copies to give away (thanks @ManningBooks)! Join our book club and comment below why you're interested in reading this book & I'll pick the winners. Excited to read together!
Activity on repository
rasbt starred rasbt/LLMs-from-scratch
View on GitHubActivity on repository
rasbt pushed llm-architecture-gallery
View on GitHubActivity on rasbt/llm-architecture-gallery
rasbt contributed to rasbt/llm-architecture-gallery
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt closed an issue in LLMs-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt commented on an issue in LLMs-from-scratch
View on GitHubConsistent with what I found with Qwen3.6 a while back: Claude Code uses 2-3x as many tokens than (many) other harnesses at similar success rate. - Unoptimized? - Buggy? - Deliberate (coz that helps it in more challenging cases)? Need to find some time to investigate more...
We ran Kimi K3 through 3 agent harnesses (Claude Code, Hermes, Kimi Code) on 28 identical tasks. All 3 harnesses completed the tasks at similar success rates, but the interesting story is token efficiency: the same task cost up to 30x more tokens depending on the harness. 🧵🧵
View quoted postActivity on repository
rasbt pushed reasoning-from-scratch
View on GitHubActivity on repository
rasbt pushed reasoning-from-scratch
View on GitHubActivity on rasbt/LLMs-from-scratch
rasbt opened a pull request in LLMs-from-scratch
View on GitHubActivity on rasbt/reasoning-from-scratch
rasbt opened a pull request in reasoning-from-scratch
View on GitHub