1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:35,275 [Hal Turing] Today we're looking at "The Illusion of State in State-Space Models," by William Merrill at New York University, with Jackson Petty, also at NYU, and Ashish Sabharwal at the Allen Institute for AI. It appeared at ICML 2024. State-space models like S4 and Mamba are pitched as the recurrent alternative to transformers. The paper asks whether that recurrence buys real state-tracking power. 3 00:00:35,275 --> 00:00:50,650 [Dr. Ada Shannon] The answer is no, in the worst case. S4 and Mamba sit in the same parallel-computation class as transformers, so the "state" is largely an illusion. The authors also show a small change that does let an SSM track state. 4 00:00:50,650 --> 00:00:54,575 [Hal Turing] Let's pin down "state tracking." What is the task? 5 00:00:54,575 --> 00:01:15,025 [Dr. Ada Shannon] You get a sequence of updates to a small world and must report the final state. The paper's Figure 1 uses five people with coins. All are dimes except Carl's. Alice and Carl trade, then others trade, and you're asked who holds the odd coin. The same shape shows up when you evaluate code that swaps variables, or follow chess moves written as source square and target square. 6 00:01:15,025 --> 00:01:18,900 [Hal Turing] So that's entity tracking in a story, basically. 7 00:01:18,900 --> 00:01:40,100 [Dr. Ada Shannon] Yes. Formally it's the monoid word problem: multiply a sequence of elements from a finite group and report the product. The easiest case is one light switch. Each token flips it or leaves it alone, and you report the final position. That's addition mod 2, or parity. Now make it five people swapping coins. The state is one of 120 rearrangements, the group S5, and swaps don't commute. Order matters. 8 00:01:40,100 --> 00:01:44,750 [Hal Turing] Why is S5 the hard one, and not S4 or something bigger? 9 00:01:44,750 --> 00:02:04,975 [Dr. Ada Shannon] Barrington's theorem, from 1985. For any non-solvable group, S5 being the smallest example, the word problem is complete for a class called NC1. Solvable groups, like parity or S3 and S4, are easier. Intuitively, S5 is the point where non-commutativity can no longer be unwound into simpler pieces. 10 00:02:04,975 --> 00:02:09,625 [Hal Turing] Okay, I need NC1 explained. And TC0. 11 00:02:09,625 --> 00:02:44,500 [Dr. Ada Shannon] Think of a computation as a circuit. TC0 means constant depth, polynomial size, with threshold gates, which are majority-like. That's extremely parallel: the number of sequential steps doesn't grow with input length. NC1 allows depth that grows logarithmically. Everyone believes NC1 is strictly bigger, the conjecture TC0 not equal to NC1, but it's unproven. So the claim is conditional. If the conjecture holds, no TC0 model solves S5 at arbitrary length. And it's worst-case and asymptotic. It says nothing about how often real data hits the hard case. 12 00:02:44,500 --> 00:02:47,500 [Hal Turing] Where do transformers fall in this? 13 00:02:47,500 --> 00:03:08,225 [Dr. Ada Shannon] Merrill and Sabharwal's 2023 paper, "The Parallelism Tradeoff: Limitations of Log-Precision Transformers," showed that constant-depth transformers are in TC0. That's the first assumption to flag: they model numbers as carrying about log n bits for length n. Real models use fixed fp32 or bf16. We'll come back to that gap. 14 00:03:08,225 --> 00:03:14,000 [Hal Turing] And there's an empirical angle too, right? Transformers do some of this in practice. 15 00:03:14,000 --> 00:03:33,775 [Dr. Ada Shannon] Liu and colleagues, "Transformers Learn Shortcuts to Automata," ICLR 2023, framed these problems as monoid word problems. They showed shallow transformers can solve them using shortcuts, like composing pieces in parallel, with depth around log n. But those shortcuts proved brittle. The depth still has to grow with length. 16 00:03:33,775 --> 00:03:41,225 [Hal Turing] Now the SSM side. Mamba and S4 look like recurrent networks. What's the layer actually doing? 17 00:03:41,225 --> 00:04:13,575 [Dr. Ada Shannon] The hidden state updates as h_i equals A_i times h_{i-1}, plus B_i times x_i. The key detail is that there's no nonlinearity inside the recurrence. A classic RNN squashes the state through a nonlinearity at every step. Here the update is linear, so you can compute it two ways: step by step like a recurrence, or all at once as a convolution or parallel scan. S4 uses a fixed transition matrix A. Mamba, also called S6, makes the transition depend on the current input, but only a diagonal matrix. 18 00:04:13,575 --> 00:04:22,075 [Hal Turing] But Gu and colleagues in 2021 argued SSMs can simulate RNNs. Doesn't that contradict this? 19 00:04:22,075 --> 00:04:44,075 [Dr. Ada Shannon] No, and the reason matters. That simulation assumes you can stack unboundedly many layers. An RNN reuses one layer across every time step, so one layer handles any length. A fixed-depth, TC0-style model has to handle a longer input with more layers. So "has a recurrent form" does not imply "has recurrent power." The parallel scan that makes SSMs fast to train is the same property that caps them. 20 00:04:44,075 --> 00:04:48,200 [Hal Turing] So what exactly would count as a refutation of that? 21 00:04:48,200 --> 00:05:00,875 [Dr. Ada Shannon] An SSM that solves S5 at every length with a fixed number of layers. The paper says S4 and Mamba can't, if the conjecture holds, and then shows one small change that can. 22 00:05:00,875 --> 00:05:07,325 [Hal Turing] So how do you prove that Mamba can't do this? Presumably you can't just point at the architecture. 23 00:05:07,325 --> 00:05:29,400 [Dr. Ada Shannon] You show it fits inside a parallel circuit family. The key step is Lemma 4.1. An SSM layer, written in its convolutional form, needs products of the transition matrices over every interval of the sequence. If those products are computable in TC0, the whole layer is in TC0. The rest of the layer, meaning the projections and nonlinearities, follows the same simulations Merrill and Sabharwal used for transformers. 24 00:05:29,400 --> 00:05:33,325 [Hal Turing] So everything hinges on that matrix product. 25 00:05:33,325 --> 00:06:04,425 [Dr. Ada Shannon] Yes. For S4 the transition matrix is the same at every step, so the product over an interval is just that one matrix raised to a power. Matrix powering is in TC0. That's Theorem 4.2. For Mamba the transition changes with the input, but it's diagonal. A product of diagonal matrices is a pile of independent scalar products, one per diagonal entry, and iterated scalar multiplication is also in TC0. That's Theorem 4.4. The appendix also covers matrices that are simultaneously diagonalizable, which is Theorem 4.6. 26 00:06:04,425 --> 00:06:17,425 [Hal Turing] Then Corollary 4.7 falls out: S5 is NC1-complete, these models are in TC0, so no log-precision S4 or Mamba solves it, assuming the conjecture. 27 00:06:17,425 --> 00:06:31,375 [Dr. Ada Shannon] Right. An RNN gets there with one layer, because the nonlinearity inside the recurrence lets one layer carry the state forward. And that doesn't clash with the simulation result, since that one needed unbounded depth. 28 00:06:31,375 --> 00:06:36,375 [Hal Turing] Where does chess come in? How do you get from permutations to a chessboard? 29 00:06:36,375 --> 00:06:57,625 [Dr. Ada Shannon] Proposition 3.3 builds a board with a rook and queens, where each swap of two pieces becomes a fixed sequence of legal moves. Chain those together and the final board encodes the permutation. The catch is the notation. This works for source-target moves, the UCI format. Standard notation also names the piece, which may make tracking easier. The paper doesn't claim hardness there. 30 00:06:57,625 --> 00:07:12,100 [Dr. Ada Shannon] Entity tracking is the same story. The format in Kim and Schuster's 2023 paper is not NC1-complete. The paper's own Figure 1 variant is. So the theory depends on how the task is written. 31 00:07:12,100 --> 00:07:15,400 [Hal Turing] Now the fixes. What are the escape routes? 32 00:07:15,400 --> 00:07:33,450 [Dr. Ada Shannon] Two, and both need input dimension above one. First, put a nonlinearity inside the recurrence. That's an RNN, and it handles any regular language, including S5. But you lose the parallel scan, because a scan needs the update to be associative, and a nonlinearity breaks that. 33 00:07:33,450 --> 00:07:53,900 [Dr. Ada Shannon] The second is IDS4. The transition matrix becomes a full, non-diagonal, affine function of the current input. Iterated products of general matrices are outside TC0, so the earlier argument no longer applies. And matrix multiplication is still associative, so you can compute it with a log-depth scan. 34 00:07:53,900 --> 00:07:57,600 [Hal Turing] Why does that let it do S5 in one layer? 35 00:07:57,600 --> 00:08:18,600 [Dr. Ada Shannon] Take any finite automaton and look at what each input symbol does to its states. Each symbol becomes a transition matrix, and multiplying matrices matches composing those state maps. Start with a one-hot vector at the initial state and let the product run. The final vector tells you where the automaton ended up. The beginning-of-string symbol is what puts that initial vector in place. 36 00:08:18,600 --> 00:08:22,475 [Hal Turing] Fine on expressivity. Now what did they run? 37 00:08:22,475 --> 00:09:01,025 [Dr. Ada Shannon] A tagging task. The model reads a sequence of group elements, and at every position it has to output the running product so far. That gives dense supervision, which is the easier way to set the problem up. The main group is A5, the even permutations of five items, the smallest non-solvable group. The controls are A4×Z5, which is non-abelian but solvable, and Z60, which is abelian. All three have 60 elements, so the difficulty comes from the group structure. The models are a transformer, an RNN, S4, Mamba and IDS4, with IDS4 initialized near the identity. The metric is the fewest layers that reach above 90 percent accuracy, and lower is better. 38 00:09:01,025 --> 00:09:02,750 [Hal Turing] And the result? 39 00:09:02,750 --> 00:09:20,400 [Dr. Ada Shannon] The RNN and IDS4 need one layer from length 5 through 20, on all three groups. On A5, the transformer, S4 and Mamba climb from about one layer to about four over the same range. Those are readings off the plot. The text gives no exact counts. 40 00:09:20,400 --> 00:09:23,600 [Hal Turing] That matches the theory. What's the catch? 41 00:09:23,600 --> 00:09:45,600 [Dr. Ada Shannon] The same climb shows up on A4×Z5, which is solvable and so should sit inside TC0. The paper offers two readings. Either those models can't express it, or they can but don't learn a constant-depth solution. The data can't separate the two. One more observation: S4 and Mamba need as many layers as the transformer, or fewer. So they're somewhat better at approximate tracking, but they still can't escape the growth. 42 00:09:45,600 --> 00:09:49,675 [Hal Turing] Is that last claim solid, or just an observation? 43 00:09:49,675 --> 00:10:09,175 [Dr. Ada Shannon] Just an observation, and no variance is reported. The setup also leaves out width, learning rate, training budget, seeds and error bars, and lengths stop at 20. The text says test accuracy and the caption says validation accuracy. It fits the theory's actual claim, though: SSMs aren't useless, they just aren't RNN-like. 44 00:10:09,175 --> 00:10:20,725 [Hal Turing] Let's look harder at Figure 3. Required depth goes from one layer to about four as sequences grow from 5 to 20. Is that evidence of unbounded growth? 45 00:10:20,725 --> 00:10:40,875 [Dr. Ada Shannon] No. It's consistent with the theory, but it can't confirm it. Over that range a log-depth requirement, a linear one, and an optimization problem all produce a similar curve. Also, the theorem is asymptotic, worst-case, and conditional on TC0 not equalling NC1. A curve over twenty tokens can't speak to any of those three. 46 00:10:40,875 --> 00:10:53,200 [Hal Turing] The A4×Z5 group bothers me. The theory says it's solvable and inside TC0, so a transformer should handle it at fixed depth. But the depth grows there too. 47 00:10:53,200 --> 00:11:10,675 [Dr. Ada Shannon] That's the most important weakness in the experiment. Depth growth shows up where the theory doesn't require it, and the authors test neither of their two readings. So the A5 result can't be cleanly credited to NC1 hardness, because a general learnability gap would look the same. 48 00:11:10,675 --> 00:11:12,900 [Hal Turing] What would separate the two? 49 00:11:12,900 --> 00:11:32,550 [Dr. Ada Shannon] Training on short sequences and testing on long ones is one option. A model that has found the algorithm should extrapolate, while one using a shortcut should fall apart. The paper doesn't run that. It does put all 3,600 length-2 sequences into every training set, which is a detail you'd want to understand before comparing models. 50 00:11:32,550 --> 00:11:35,750 [Hal Turing] Then the baselines. How tuned were they? 51 00:11:35,750 --> 00:11:57,050 [Dr. Ada Shannon] We can't tell. The paper gives no search budget, and it says S4 initialization is crucial. An under-tuned S4 or Mamba would need more layers, and so would an unlucky seed. The cutoff is also coarse, because 89 percent and 91 percent land on different layer counts. Tuned sweeps with several seeds at each length would settle how much of the curve is real. Longer lengths would settle whether it keeps climbing. 52 00:11:57,050 --> 00:12:04,225 [Hal Turing] The theory assumes log-precision numbers. Real models run fp32 or bf16. 53 00:12:04,225 --> 00:12:24,900 [Dr. Ada Shannon] Right. Constant-bit SSMs could be weaker still. Finite-precision transformers can't even represent uniform attention over a long context. But the paper doesn't say how that changes the separation, and I won't guess. Also, at fixed length with fixed depth, any model is a finite function, so the asymptotic class says little about a bounded deployment. 54 00:12:24,900 --> 00:12:33,875 [Hal Turing] And Mamba itself? The proof treats a generalized linear layer, but the real block has a short convolution and a gated branch. 55 00:12:33,875 --> 00:12:51,850 [Dr. Ada Shannon] The diagonal input-dependent transition in Gu and Dao's 2023 Mamba paper is the part that keeps it in TC0, and that's the part the proof handles directly. How the gating branch interacts with the bound isn't worked through in the material I have, so I'd call it an open detail. 56 00:12:51,850 --> 00:12:55,000 [Hal Turing] Chain of thought isn't addressed either. 57 00:12:55,000 --> 00:13:10,125 [Dr. Ada Shannon] Merrill and Sabharwal's 2024 paper on transformers with chain of thought showed that polynomially many decoding steps lift transformers beyond TC0. Whether SSMs get the same lift isn't answered here. 58 00:13:10,125 --> 00:13:14,775 [Hal Turing] So does failing at S5 predict failure at real tasks? 59 00:13:14,775 --> 00:13:35,800 [Dr. Ada Shannon] The paper doesn't show that. Liu and colleagues' shortcuts paper found shallow solutions to automata problems, but brittle ones. Chess in source-target notation and code evaluation reduce to the hard case in the worst case. Nobody measured how often natural data hits it. And the paper itself notes that Kim and Schuster's entity-tracking format isn't NC1-complete. 60 00:13:35,800 --> 00:13:40,500 [Hal Turing] What about the fix? IDS4 does S5 in one layer. 61 00:13:40,500 --> 00:14:03,100 [Dr. Ada Shannon] On three 60-element groups, with near-identity initialization and per-token supervision, which is the easier setup. Whether that initialization is doing the work isn't tested. Open issues include gradient explosion or vanishing from iterated products of general matrices, whether log-depth scans are practical on hardware, and whether the nonlinear RNN-style SSM can be parallelized at all. It's also untested at language-model scale. 62 00:14:03,100 --> 00:14:05,350 [Hal Turing] So what do we take away? 63 00:14:05,350 --> 00:14:25,875 [Dr. Ada Shannon] The proof is solid under its assumptions. Standard S4 and Mamba are in TC0, so conditional on the conjecture they can't solve S5 at arbitrary length. The experiments agree with that at small scale. But the result is worst-case, asymptotic and log-precision, and the experiments have no reported variance and top out at length 20. 64 00:14:25,875 --> 00:14:34,901 [Hal Turing] So it's a strong expressivity separation and weak evidence about practical capability. Thanks for listening, everyone.