# Oral 31836

- Kind: Oral
- Talk page and recording: https://iclr.cc/virtual/2025/oral/31836

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

I I'm starting with the like what state tracking is and uh why do we care for language modelling applications. So I want to start with this uh uh real world example with a cat uh that is trying to predict the position of the ball. Yeah, so this cat is actually doing state tracking because uh as you can see like it needs to keep track of the the movements of the caps because it cannot observe uh the position of the ball.
And uh uh it needs to essentially recreate a word model uh inside his head of uh the position of the ball uh because he cannot see it. And we can also simplify this set-up. Uh so here uh we just have three states where that uh it are a represent the position of the ball and uh three transitions that represent a swap between two cups.
Uh so what we did is essentially constructing the final state automaton. So we discretise the system, uh and to do so like uh we can describe more even more general system, uh we need uh like a set of state, an alphabet that represents transitions, then initial state and the transition function. And for for this talk at least the the state tracking will be uh essentially to uh mimic uh uh uh final state automaton. So given a final state automaton we would like to map the
a sequences of transitions that correspond to the update of the system of the automaton to sequences of state that this automaton uh can take. And as we will see this problem uh can be pro uh uh like current models and the large enterprise models are not too struggle uh in this kind of situation, what do we we want to predict this final state automaton.
And uh uh so why do we care for our for language modelling? You can think about uh for example if you want to track the state of a chess board given just uh um the um
the sequence of uh um movements of the pieces uh in in this notation you you don't know like which piece pieces you are moving, so essentially you you have a uh non-observable state when you observe just a sequence of moves, and you need to do state tracking and for uh uh um other uh application for example in code evaluation or entity tracking uh having this capability is is useful and uh more generally for uh reasoning p this is linked also to reasoning and uh i
like more as a tap this uh this capability uh as shown for example improved performance in math.
And the class of model that we will study d are uh language models that are um uh linear R_R_N_s, that this include for example state space models uh or linear attention variants. And these are described by a sequence of layers, where in each layer you first compute a um um a recurrence uh that is linear in the in the previous uh state of the system and is governed by the state transition matrix A_ and that can be input dependent in this case.
case and uh uh and then you you compute um uh the output as a nonlinear function of the current state and and current input. Uh for example in in in our notation we put uh this nonlinearity in this the other function and there is the M_L_P_ also there.
Uh and uh so several models uh fall into this class, for example Mamba has a diagonal uh state transition matrix uh and s uh so does uh gated linear tension uh and uh but more recently non-diagonal uh models have been proposed such as Delta net which uses the structure which is identity minus a constant beta t and then you have a vector output product.
And uh the the idea of all these models is that if you combine the linearity of the recurrence with the the fact that you are have have any structured matrices, then you can make the recurrence uh efficiently parallelisable as we also saw in the previous talk. And uh and so you can uh uh you can do the training efficiently and this model can be competitive with the transformers.
Uh moreover the transformers can also be seen in this light uh but they have like an infinite dimensional state and the transition uh matrix is actually a the the identity here. Uh so you cannot compute uh the recurrence because you have an infinite dimensional state uh uh and and thus you you are less efficient essentially for for long sequences for this reason.
Okay, so in this talk we we will focus on very simple finite state automatons. Uh so this is the party state automaton, you just have two states and uh you you will go uh from one state to the next if you see a one, otherwise you stay in the in the same state. And we would like to map uh uh transitions to to states for arbitrary sequence length.
Uh like if you want to complicate things a bit you can consider additional modulo too. So uh a m a modulo three for example. So parity is additional modulo two. Uh and that for additional modulo three you you add one state and one transition, you complicate things a bit. And more more in general you can think about uh like every final state automaton that we consider, like you can map it to uh some form of pem permutation compositions, for example the permutation of five elements is known to be like
i like quite hard to to to be able to solve. Uh so what is the issue with uh with linear and and uh and why can't and and why can't they solve for example parity? So I want to illustrate this with uh uh explaining two possible solutions, so h here you just have a colour linear and and
And uh you can do uh you can solve uh uh a parity in in this way, so you can simply sum all the previous inputs in the state, and then you compute the modulo two function to to compute the output. However, if you do so uh the state H_D_ uh can blow up. Because for example if you have a sequence of one in your inputs, then uh the state is uh is T_ so it uh grows linearly with T_ Another Mm. solution is by setting uh the state transition matrix corresponding to the one
uh equal to negative one. In this way you can have uh an oscillating state. And so you can represent um uh you can represent essentially uh parity in your state, and it doesn't blow up. However, it requires negative values to to do so. And uh current uh uh I mean m most um uh linear and and models, especially the time um
uh the time variant ones uh they all have a state transition matrices that have only allow positive again values and usually in the range at zero one. And uh like the the example that they show you before, like you can make this more uh more formal and you can prove that diagonal linear and with positive values cannot solve parity, if you restrict for example f in finite precision. Uh so the state uh should be for example if uh should have a finite precision, finite number of values you can take.
Moreover, general they also transform they are known to to struggle uh even in more relaxed precision settings, for example uh growing logarithmically with sequence length. And this is in sharp contrast with the s uh standard that like classical R_N_N_s or even linear R_N_N_s with a full matrix. Because these can track states even with only one layer. However, they cannot be parallelised efficiently.
So uh in this talk we uh explored like what about uh like scalable uh so l linear remands that can be trained efficiently such as that than it. Uh and what we show is that uh if you only uh allow for a positive uh eigenvalues, then uh uh your linear remand even with a an arbitrary number of layers cannot uh solve parity.
and uh instead if you if you go to modular counting, this is a subset of modular addition, uh if you are in finite precision and you only allow for real-like values, but in this case uh for products of uh um state transition matrices.
Uh then uh you cannot you cannot solve the addition model, M_ o if M_ is not a power of two. And uh in this case the result is a bit more nuanced like you have that the number of elements in the in the product is uh uh can grow with the with the layer count. And this means that you can gain expressivity with uh with more layers in this case.
Uh so this uh tells uh that that uh most linear elements cannot solve uh even parity because they only allow positive eigenvalues. And uh diagonal and even triangular uh real valued linear elements cannot do modular counting. Okay so we saw the limitations of a of diagonal uh linear elements. So what about non-diagonal ones? So here we consider uh for example a rank one uh updates which are in delta network structured in this form. But you can also think about uh
having a products of this uh kind of updates uh so that you have uh a rank rank two updates or rank one updates and uh we show to this in our workshop uh paper and in the delta product. And uh the nice thing about having this product structure is that you can make the recurrence uh stable by considering the range of the of the methods and uh and the norm of the the keys. So it's quite simple to make the recurrence stable.
So here we study uh this class of uh uh state transition matrices which are a produce of K uh generalised also the matrices. So the matrices that that have this structure, identity minus uh a vector of their product. And here the c uh K is the number of elements in the products. It trades off uh between computational efficiency and expressivity. And omega is the eigenvalue range of uh of these matrices which uh uh also c uh increases the expressivity.
So for delta net uh we have k equal to one and the omega is equal to zero one. However, this is uh is problematic because orthogonal matrices are included only if a negative one is included as uh in the eigenvalue range, which corresponds to set in beta I_ to two.
And uh uh why is this useful because if you uh if you have just one generalised or Zolter matrix with a negative one as an eigenvalue then you can model a swap between two elements. If you have uh uh instead a product of two, you can model a permutation of three elements and so on. And what we can show is that uh like in final precision you can model
any final state automaton was transitions correspond to permutation of at most k elements. If you have products of k minus one generalise also their matrices. And you can do this with one uh in one layer. Instead if you want to model uh a general final state automaton, these correspond to solving uh for example any f uh regular language, then you can do so with multiple layers uh like i in the same setup as before, if you allow for multiple layers, you can do it.
And the so this is a a quite powerful result and it tells us that uh we can easily modify DeltaNet uh to have state transition matrices that include negative one as an eigenvalue and thus more than uh swap permutations.
And uh so this is what we do. So we modify both Mamba and uh and Delta networks architectures. And for Mamba uh the change requires a change in the underlying uh CUDA kernels. So it's quite complex, but for Delta networks this is a one-line change that you can do. And we can see that if we do this modification you can uh solve uh so both models are able to solve parity. And we test this by doing uh length generalisation experiments.
Um and uh instead for a modular arithmetic only the non-diagonal models are able to solve uh to solve this task. Um
Yeah, uh so modular arithmetic is uh like very similar to modular addition. In this case, it contains addition modulo five. Uh coming up with the language modelling experiments, we see that uh like we train model up to for up to one point three billion uh parameters, and we can see that uh uh we have an improvement in perplexity for state tracking related tasks uh for uh for the delta net uh and uh uh yeah, uh for uh retrieving instead uh heavy tasks we
we don't see this improvement, but we also don't don't expect don't expect it. Okay, so I I will uh end here and uh I will take uh questions. Uh what's the actual uh eigenvalue distributions from negative to uh to uh to positive uh for all the eigenvalues? You mean uh like after after training? Yes.
Uh so we uh briefly checked, but the for for language modelling actually you see a lot of values are positive, like we didn't study extensively the distribution. Uh-huh. Like you have some values that are in the negative but mostly positive, like Right. we should study this Yeah, better. I'm just wondering that's because you take negatives uh negative eigenvalues into consideration and it seems to be powerful. Would the distribution actual distribution uh be like uh uh uh there there are actually a lot of negative ones or or only very s
is very sparse in active Yeah, parts. it seems uh but so the state tracking is uh I think like o you also have uh like few tasks that actually exploit this state tracking. So we should study this uh on uh tasks that actually exploit this. Like you can see in in this uh kind of experiments, like with this synthetic experiments, you really see that you you you really exploit negative I_M_ values and very close to to negative one. Hi um thanks for the talk. Uh like for the modular arithmetic,
think it would seem natural like to try uh like complex eigenvalues. Did did you explore that or So uh we so if you have negative eigenvalues with uh with that structure that you saw before, this is generally is also older than a product of two gives uh actually complex eigenvalues. And this is actually why why you can this task. Because otherwise you you shouldn't be able to solve it if you don't have complex.
