## Welcome and the Mamba Lineage
Norris: Welcome back to Mechanical Dreams, the podcast where we parse the weights and biases of the latest machine learning and natural language processing research. I am Professor Norris, and across the desk from me is my ever-enthusiastic student, Linda. Linda: Hi everyone! I am super excited for today's episode. We are looking at a brand new paper from researchers at Carnegie Mellon, Princeton, Together AI, and Cartesia AI. It is called Mamba-3: Improved Sequence Modeling using State Space Principles. Norris: Ah, Mamba-3. It feels like just yesterday we were discussing Mamba-1 and the resurrection of State Space Models, or SSMs. And then Mamba-2 came along with its structured state space duality. I have to admit, Linda, my first thought seeing this title was a healthy dose of skepticism. Do we really need a third iteration so soon? Are we just chasing tiny increments on benchmark leaderboards? Linda: I knew you would say that, Professor! But this is not just a minor architectural tweak for the sake of a few points on a leaderboard. The entire driving force behind Mamba-3 is inference efficiency. The authors take a very strict inference-first perspective, which is incredibly relevant given how people are using LLMs right now. Norris: Fair enough. Inference compute has definitely become the elephant in the room. With the rapid rise of parallel, agentic workflows, chain-of-thought reasoning, and test-time scaling, the inference phase is eating up massive amounts of compute budgets. But do our current Transformer models not handle this well enough? We have highly optimized attention kernels and paged KV caches now. Linda: Transformers are great, and they are the industry standard for a reason, but they still have a fundamental, mathematical bottleneck. They require quadratically increasing compute and linearly increasing memory demands during generation because of that KV cache. As context windows grow and agentic loops run longer, that memory requirement becomes a massive deployment hurdle. That is exactly what spurred the development of sub-quadratic models like linear attention and the Mamba lineage. They retain constant memory and linear compute. Norris: Right, the holy grail of constant memory. But let us be honest, earlier linear models often traded off actual model quality and capability to get that algorithmic efficiency. I recall recent papers showing that these sub-quadratic models fail miserably at simple state tracking tasks. And even though they are theoretically linear, their hardware utilization during decoding is often notoriously inefficient. Linda: Exactly! You hit the nail on the head. That is the exact gap Mamba-3 is trying to close. The authors want to advance the Pareto frontier between model quality and inference efficiency. To do that, they introduce three core methodological improvements inspired strictly by the state space model viewpoint. They aim to fix those expressivity issues and hardware inefficiencies without bloating the latency. Norris: Okay, you have successfully piqued my interest. So they are looking deeply at the math of State Space Models to find rigorous ways to improve both expressivity and hardware utilization. That sounds like a much better approach than just stacking more MLPs or throwing in random heuristic layers. So, what is the first big methodological change they make?
## Exponential-Trapezoidal Discretization
Linda: The first major methodological change they introduce is what they call 'Exponential-Trapezoidal Discretization.' Norris: Ah, discretization. The bridge between continuous mathematics and discrete computations. Taking the continuous-time ordinary differential equations that define a State Space Model and converting them into discrete steps our GPUs can actually process. Linda: Exactly! In Mamba-1 and Mamba-2, they adapted a zero-order hold method for their time-varying systems. But because selective SSMs are so complex, the released implementations actually relied on an extra heuristic approximation. The authors of Mamba-3 formalized this and proved it was mathematically equivalent to an 'exponential-Euler' method. Norris: An Euler approximation? That is a classic, but it is only a first-order approximation. It is notoriously simplistic for complex dynamics, and the local truncation error scales quadratically with the step size. I am guessing the authors realized they were leaving a lot of accuracy on the table by using such a basic method? Linda: You hit the nail on the head. To fix this, they upgraded the discretization to a generalized trapezoidal rule. Instead of just holding the right endpoint of the interval constant, like Euler's rule does, the trapezoidal method approximates the state-input integral using a data-dependent, convex combination of both interval endpoints. Norris: That makes perfect sense mathematically. It pushes the system to a second-order approximation, which significantly reduces the truncation error. But I have to ask, Linda, does this extra mathematical rigor actually translate to better neural network performance? Sometimes these elegant theoretical improvements just add computational overhead without moving the needle on the validation loss. Linda: It absolutely moves the needle! But the really fascinating part is not just the lower error rate, it is what this new recurrence reveals structurally. When you expand the math for this exponential-trapezoidal update, it turns out it is mathematically equivalent to applying a data-dependent convolution of size two directly on the state-input. Norris: Wait, an implicit convolution? Built right into the core mathematical recurrence of the state update? Linda: Yes! It acts as a width-two convolution weighted by the trapezoidal parameters, applied before passing the input into the linear recurrence. And this has a massive architectural consequence. Because this convolution is baked natively into the time-step recurrence itself, Mamba-3 can completely drop the separate, explicit short causal convolution layer that was required in all previous Mamba architectures. Norris: Now that is truly elegant. I have always felt that the extra convolutional layer in previous sub-quadratic architectures felt a bit tacked on. It was like a hack to give the model some local token context before feeding it into the SSM, rather than arising naturally from the state space principles. Linda: It was definitely a widely accepted hack! Many researchers hypothesized it was strictly essential for recurrent models to perform well on language modeling. But the authors of Mamba-3 ablated this extensively. They found that combining this generalized discretization with some new explicit bias terms on the input and output projections naturally handles that local context. The standalone convolution layer becomes completely redundant. Norris: I love it when better math leads to a simpler, cleaner architecture. It is the ultimate vindication of theory. So, we get a second-order accurate discretization, we remove an ad-hoc architectural block, and the model still performs better. That is a solid win. But what about the state-tracking failures we mentioned earlier? Does this new discretization fix the issue where linear models fail at basic tasks like calculating parity? Linda: That is a great question. Unfortunately, a better discretization alone does not fix the state-tracking problem. To solve that, we have to look at the nature of the hidden state transitions themselves. And that brings us to their second major innovation, which involves bringing complex numbers back into the mix.
## Complex-Valued States and the RoPE Trick
Norris: So, at the end of the last chapter, you mentioned bringing complex numbers back to solve the state-tracking problem. I have to admit, my skepticism is flaring up again. We have tried complex-valued neural networks for decades. They usually double the memory footprint, complicate the gradients, and tank the training speed. Are they really worth it just to pass a synthetic state-tracking test? Linda: Normally, I would agree with you, Professor! But let us look at exactly why Mamba-2 and other real-valued linear models fail at these tasks. Take a simple task like determining the parity of a sequence of bits, or doing modular arithmetic. Norris: Ah, the classic Chomsky hierarchy tasks. A simple one-layer LSTM from the nineties can solve parity, but you are telling me a state-of-the-art Mamba-2 model cannot? Linda: Exactly! And the reason is purely mathematical. Mamba-2 restricted the eigenvalues of its state transition matrix to real numbers to keep the model efficient. But to solve parity, the hidden state needs to act like a toggle switch, flipping back and forth as it reads ones and zeros. That requires rotational dynamics. Norris: I see. And real eigenvalues can only scale things up or down, or perhaps flip the sign once, but they cannot represent a continuous rotation in the state space. You need imaginary components for that. Linda: Bingo. That limitation forces the model into a restricted computational class. To break out of it and get those rotational dynamics, Mamba-3 shifts to a complex-valued State Space Model. But, and here is the absolute genius part, they do not actually compute it using complex arithmetic during the forward pass. Norris: Wait, if the underlying math defines a complex-valued model, how do they avoid the computational penalty of complex arithmetic on the GPUs? Linda: They use what they call the RoPE trick. The authors proved mathematically that if you take a complex SSM and apply their exponential-Euler or exponential-trapezoidal discretization, it is perfectly equivalent to a real-valued SSM with a doubled state dimension, where the transition matrix is a scalar decay multiplied by a block-diagonal matrix of two-by-two rotations. Norris: A block-diagonal matrix of two-by-two rotations... hold on. That sounds exactly like how Rotary Position Embeddings, or RoPE, operate in standard Transformer attention. Linda: You are right on the money, Professor! Under the State Space Duality framework introduced in Mamba-2, the B and C projections of the SSM act exactly like the Keys and Queries in attention. The authors showed that applying these complex state transitions is mathematically equivalent to applying a data-dependent RoPE to those B and C components. Norris: That is absolutely brilliant. Instead of relying on a standard, fixed-frequency RoPE just to inject positional information, they are using a data-dependent RoPE to literally simulate complex-valued state transitions for free! The engineering elegance of that is just delightful. You get the expressivity of complex numbers with the hardware efficiency of real numbers. Linda: It really is a beautiful mathematical bridge. And the empirical results completely back it up. In the paper, they evaluate on parity and modular arithmetic without brackets. Mamba-3 gets a perfect one hundred percent accuracy on parity. Norris: And Mamba-2? Linda: Mamba-2 gets less than one percent accuracy. It basically performs no better than random guessing. Even Mamba-3 modified to use standard, data-independent RoPE fails completely at the task. Norris: So the data-dependent aspect of the rotation is the real secret sauce. The model learns how much to rotate the hidden state based on the current input token. That is a massive capability leap for linear models, proving that this data-dependent RoPE is fundamentally what grants the model its state-tracking ability. Linda: Exactly. It is a perfect example of how viewing these models strictly through the lens of classical State Space theory leads to tangible improvements that you might not find if you were only looking at them as associative memory or linear attention models. Norris: Okay, Linda, consider my skepticism officially dismantled for this chapter. We have a mathematically rigorous second-order discretization, and now we have complex-state tracking disguised as a clever RoPE trick. Both are fantastic theoretical wins. But you mentioned earlier that the biggest bottleneck for these models is hardware utilization during decoding. All the theory in the world will not help if the GPUs are starving for data. How does Mamba-3 tackle the memory bandwidth problem? Linda: That is where we move from pure math into hardcore hardware mechanics. It involves a concept called Multi-Input, Multi-Output, which completely changes the arithmetic intensity of the decoding phase. We will dive into that right after this.
## MIMO and Hardware Arithmetic Intensity
Norris: Welcome back. Before the break, Linda, you left us on a cliffhanger. We have our elegant complex state tracking via the RoPE trick, and a rigorous second-order discretization. But you mentioned the GPUs were still starving for data during decoding. How does Mamba-3 fix the memory bandwidth problem? Linda: It all comes down to a metric called arithmetic intensity. During token generation, SSM decoding is notoriously memory-bound. To give you an idea, the arithmetic intensity for a single generation in Mamba is around 2.5 operations per byte loaded. But a modern H100 GPU can handle about 295 operations per byte using bfloat16 matrix multiplications! Norris: Wow. So the compute cores are essentially taking a coffee break while waiting for the memory to load the hidden state. That is a massive waste of silicon. Linda: Precisely. To fix this, the authors looked back at classical state space literature and pulled out MIMO, which stands for Multi-Input, Multi-Output. Previous Mamba models use a SISO, or Single-Input, Single-Output, architecture. Norris: Let me guess. If you expand a single input into multiple inputs, and single outputs into multiple outputs, you are increasing the dimensionality of the operations. You increase the rank, let us call it R. Linda: You got it! In the SISO formulation, the state update relies on an outer product between the B projection and the input vector. But memory traffic is almost entirely dominated by loading the massive hidden state matrix. By transforming the inputs and B projections to have that extra rank R, that outer product becomes a matrix-matrix multiplication. Norris: Oh, that is very clever! The amount of memory you have to load from the high bandwidth memory stays practically the same because the hidden state size does not change. But because you are now doing a matrix multiplication instead of an outer product, the FLOPs scale up by a factor of R. Linda: Exactly! You drastically increase the arithmetic intensity. And because GPUs have highly optimized tensor cores specifically built for matrix multiplications, you compute those extra FLOPs incredibly fast. They are essentially free compute overlaid on top of the unavoidable memory latency. Norris: So you get a significantly more expressive model during decoding without actually increasing the wall-clock time. You get more modeling power for the exact same latency. I have to admit, as someone who loves hardware-aware algorithmic design, that brings a tear to my eye. But Linda, there is no such thing as a free lunch. If you increase the rank by R, what happens to the parameter count and training time? Linda: You are right to be suspicious. A naive implementation would explode the parameter count. But Mamba-3 handles this beautifully. They use a multi-value attention head structure where the B and C projections are shared across heads. So, they only apply the MIMO rank expansion to the head-specific components, like the input and output projections, and use an element-wise scale to keep the parameter growth strictly additive rather than multiplicative. Norris: That is a very neat trick to keep the memory footprint manageable. And what about the training speed? Training is typically compute-bound, so those extra FLOPs are no longer free. Linda: Training is indeed slower, but they mitigate it using a chunked algorithm. Essentially, a MIMO SSM can be expressed as a sum of R parallel SISO SSMs. By utilizing the existing chunked parallel algorithms from Mamba-2 as a black box, the training cost only increases by a factor of R, rather than R squared. For example, with a rank of four, the MIMO kernels only incur a two-times slowdown compared to the base SISO variant. Norris: Trading a bit of training compute for a permanent boost in inference capability and hardware utilization is a fantastic trade-off, especially for large-scale deployments where models spend most of their lives doing inference. The inference-first perspective is really paying off here. Linda: It really is! The MIMO formulation pushes the architecture into a compute-bound regime where modern hardware thrives. It is the perfect marriage of signal processing theory and GPU mechanics. Norris: I am thoroughly impressed. We have covered the theory, the architecture, and the hardware utilization. I think it is time we look at the actual empirical results. Let us see if all these elegant tricks actually push the Pareto frontier. We will dive into the benchmarks right after this.
## Performance Results and Wrap Up
Norris: Welcome back. Alright, Linda, the theoretical appetizer was delicious. We have our second-order discretization, our complex state tracking via data-dependent RoPE, and our free compute from MIMO. But what is for the main course? How do the empirical results actually look? Linda: The main course is a massive shift in the Pareto frontier! The authors pretrained models up to the 1.5 billion parameter scale on 100 billion tokens of the FineWeb-Edu dataset. Let us look at downstream language modeling first. The base Mamba-3 SISO model outperforms the next best linear model, Gated DeltaNet, by 0.6 percentage points on average accuracy. Norris: A solid win for the base model, proving the discretization and bias additions work. But what about that MIMO variant we spent all that time drooling over before the break? Does that free arithmetic intensity actually translate to better downstream task performance? Linda: It absolutely does. The MIMO variant adds another 1.2 points on top of the SISO gains. So overall, Mamba-3 MIMO beats Gated DeltaNet by 1.8 points, Mamba-2 by 1.9 points, and standard Transformers by 2.2 points across their evaluation suite! Norris: Over two points better than a Transformer at the 1.5 billion scale? That is not just a minor bump; that is a decisive victory for sub-quadratic architectures. What about the inference speed tradeoff? The whole premise of this paper was taking an inference-first perspective. Linda: That is where the Pareto frontier visualization in the paper is so striking. If you plot the state size, which is a great proxy for inference speed, against pretraining perplexity, Mamba-3 MIMO with a state size of 64 exactly matches the perplexity of Mamba-2 with a state size of 128. Norris: Let me make sure I am hearing that correctly. It achieves the exact same language modeling performance, but requires half the state size? Which effectively means it runs at half the latency during decoding? Linda: You heard it perfectly, Professor! Half the latency for the same quality, or significantly better quality at the same latency. It is a massive win for deployment efficiency. Norris: Okay, I am completely sold. The authors did not just chase a leaderboard; they went back to the fundamental signal processing roots of state space models, fixed the math, improved the hardware utilization, and delivered a model that is practically superior for real-world deployment. Are there any weaknesses at all? Linda: Well, they did extensive evaluations on retrieval capabilities. Like all fixed-state linear models, Mamba-3 still inherently struggles a bit with recalling long, unstructured data compared to a Transformer with a massive KV cache. However, the authors showed that using Mamba-3 in a hybrid architecture interleaved with a few self-attention layers largely mitigates those weaknesses, achieving excellent performance on needle-in-a-haystack tasks. Norris: Which makes perfect architectural sense. Use Mamba-3 as your hyper-efficient sequence mixing backbone, and sprinkle in attention only where you need exact retrieval. It is the pragmatic future of large language model design. Linda, this was an outstanding paper to bring in today. Linda: I am so glad you liked it! The Mamba lineage is definitely proving that viewing these models as true dynamical systems, rather than just associative memory approximations, opens up an entirely different and fruitful design space. Norris: Indeed it does. Thank you to our listeners for joining us on this mathematical journey today. We hope your gradients are stable, and your arithmetic intensity is always high. Until next week, keep dreaming in mechanical!