# Poster 30782

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/30782

> 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.

Hello everybody, my name is Thien Rui Liu and I'll be presenting our work on permutation invariance context composition with state space models. To motivate our work, I first introduce retrieval augmented generation, which is a popular method used to allow language models to leverage vast external knowledge bases for generation. This works by retrieving certain documents or contexts from an external data set at inference time and then prepending it to the language model's context for generation.
For effective, this improvement does not come for free, right? It incurs very significant latency costs, including the cost of retrieve, process, and generate from the increased context sizes. In transformer-based architectures, the last two costs alone, processing and generation, increases the total latency in a way that scales quadratically with the length of the retrieve documents. And so the goal of our work is to improve this process.
We leverage a class of models called state space models, which can encode arbitrary length input sequences into a fixed size state vector. This state vector can then be conditioned on to generate new tokens without having to revisit the original input. Essentially, pre-pending a document and conditioning on the state obtained from processing that document are equivalent for this class of models. So using these models, we have a very natural solution to increase our rank efficiency.
We can simply take the entire database of documents, pre-process it into a database of states, and then given a current inference time, we simply retrieve them from the relevant state and condition on it to generate our resulting output. This gives us almost negligible online inference costs from REC after amortizing the cost of pre-processing these documents. And this all works perfectly when we only wish to retrieve and condition on a single document.
However, this poses a problem when we want to condition on multiple pieces of retrieved documents or states. While this is easy to do for raw textural tokens, since we can simply concatenate them, this is currently a problem for existing state -space models, where there's no trivial way to condition generation on multiple states. Consequently, we need a way to be able to compose these states at inference time. To tackle this problem,
We know that most of today's most powerful state space models fall under a class of SSMs known as linear input varying SSMs. These are state space models whose update matrices are conditioned on the inputs at that particular time step. And these models enjoy a very nice property which is that our states, obtained from a sequence of inputs, can be written as a linear combination of states computed from different partitionings of the input.
where the coefficients themselves are generated and computed from these partition inputs. So this provides a very easy way to concatenate documents by simply pre-processing the coefficients and the states before composing them in inference time. But while this is able to mathematically approximate the effect of concatenation.
It might not be the best way. Since states are computed causally, the order in which different documents are presented affects the resulting state. When there's no natural ordering between documents, different orders of presentation result in different states, which is undesirable in such tasks. So instead, we propose to enforce order invariance using our proposed method, Picasso. So how this works is that given n documents, we first generate all possible permutations of these documents.
We then compose states based on each permutation using the previously described method. We simply then take the average across all of these states. While this sounds super costly at first glance, since it requires computing and averaging states across n factorial different permutations, we show that this can be computed exactly, in fact, in cubic time using dynamic programming techniques, and further reduce the linear time by accepting slight approximations.
In our experiments, we use a state -of-the-art SSM, Mambato 2 .7b, to demonstrate the benefits of our method on RAC. So compared to the best baseline demonstrated on this graph above, our method performs comparably but with much faster speeds, and while our method currently does not perform as well as the best baseline in a zero-shot setting.
We have developed a fine-tuning method specifically to improve the methods' models' ability to handle composed states, which results in a model that retains the 5.4 times faster speedup compared to the base baseline, but matches its performance across any number of retrieved documents. So for more details, we encourage you to visit our poster at ICLIS.
