# Oral 31886

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

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

Hi everyone, my name is Honglei Zhang from Google DeepMind and today I will talk about our work on inference scaling for long context rec. This work is mostly done by our excellent student researcher Jenry Yue and also with contributions from all the data courses listed here. So there's been a serious that is showing that
Just in many different tasks, increasing task time computation can actually lead to consistent improvement in task performance. We've already seen a lot of examples in coding tasks and math tasks where you can see the performance can sort of increase almost linearly as it increases the task time computation. And actually, as Charlie just shown in the first talk, that sometimes this can be even similarly effective or even more effective than spending those.
computing resource on their training time.
But when we look into RAC tasks, so there's been some studies in RAC sort of touches on this topic where they try to study how the RAC performance scale with the test time computation. What most of this work done is they try to increase the number of documents, retrieved documents, or trying to increase the length of the documents and then trying to see how RAC performance scale. And they sort of converge to the same conclusion as you can see from the figure.
figure the direct performance central saturates so after a certain point and as you further increase the number of documents or like the extending the length of the documents the direct performance doesn't increase anymore or sometimes even start to decrease
This is currently not very ideal given that we're developing all these storage language models with a longer like super long contacts windows but if we cannot make full usage of all this super long contacts window for retrack tasks there would be a waste of the test time computation.
So in this work, what we did was trying to conduct a more comprehensive study of the inference scaling for RAG. And so the basic question is if we have a budget of, for example, one million input tokens, and how are we going to better leverage these tokens, like better spend this budget instead of just throwing in all these retrieved documents?
So in this work, we try two more strategies. The first one is we start to introduce more demos, some rec demos, sort of teach the model how to locate useful information. And the next one is data track where we further allow the model to do iterative querying. So allow the model to issue queries based on previous rounds. And what we're going to show is with the combination of these strategies, as long as they are optimally configured,
good, we can actually see that rack performance can scale almost linearly with the log scale of the test time computation.
All right, so I'm going to dive into details. Well, to start, let us first define what we mean by inference time computation. So in this work, we measured inference time computation by effective context length. And what it means is for a single round strategy, this basically means the number of input tokens. Okay, that's straightforward. For multi-round strategies, it's going to be the sum of the number of input tokens for every LLM cost.
So this definition aligns pretty well with the pricing model of many current day commercial AI apps and notice that we didn't take the output token into account because in our task they are usually pretty short and negligible.
So the baseline method, which is vanilla red, it's pretty straightforward. You have a retriever, you take documents, concatenate them with a query, give it to ALM, get the answer. Notice that in this strategy, the only knob that users can tune in order to increase the input context length is the number of documents K. So the only way you can try to scale it up, the inference length limitation is to increase the number of documents.
and then we start to introduce different ways to utilize input context window for example you can start to add demonstration so in our work each demonstration is going to be a complete rag call where you're going to have all the receive documents and a query and a ground truth answers so this whole thing is called one demo and we can have multiple demos into the input context window and so basically find out like an alternative way to expand your
your budget. In this strategy, you're going to have two different parameters where you can tune like the number of documents and the number of demos. And we further allow the model to issue iterative issue queries based on previous rounds. So this is yet another way to spend your input context window budget. So in these things...
The models can basically, like after it finished one round of query, it can issue further issues new sub -queries based on previous rounds of answer, retrieve new documents, and then give another round of answer. In our experiments, the models just sort of decide how many iterations they want to go after five iterations. And in this strategy, there's going to be three parameters you can tune, right? You can tune number of documents, you can tune the number of incorrect samples.
In theory, you can also tune the upper bound or the number of iterations you want the model to take.
All right, so with all these tools, and now we're going to actually look into how to rag performance scale with the inference time computation. So we're starting like a fixed budget optimal configuration performance. So we're given a fixed budget L and different strategy. And you will notice that for each budget, you're going to have multiple ways to satisfy the budget constraint. Like we have 2K token, you can have.
like five documents and just one demo or you can have two documents for each demo but just but you can have two demos so both both configuration can satisfy your budget constraint and apparently different configuration is going to have different rack performance and what we are interested in is just the optimal rack performance among all these different configurations
So yeah, that's what we did. We enumerate many different configurations for each budget and strategy and then trying to get the right performance based on the configuration and that's how we get this huge matrix on the right hand side.
Now among all these configurations, we're going to find the optimal rack performance. Uh for example say this is like 2K token budget and these are all the configurations that satisfy the 2K uh budget constraint. Um and this will be for example optimal performance within 2K. And then we Mm. can say, let's say if we have token budget of five uh 8K and this will be the opton optimal performance within uh the budget of 8K. And 32K and this is optimal configuration for 32K etc.
etc. And so based on this
And now let's make a huge assumption. Assume we can always find optimal configuration for each budget. And how does that optimal configuration, sorry, how does that optimal performance scale with a budget? So this is what we got. Like we plot all these configurations on this graph. The x-axis is going to be the budget, sorry, the effective contrast then. And the y-axis is going to be the normalized drag performance.
We did this on four different data sets where you measure three different metrics. We normalized all these metrics to make sure they're comparable and plotted onto one single graph. And the red dots there are highlighted as the optimal performance. So each red dot here is for a certain budget, what is the rack performance and how much token they spend. And you can see this nice linear relationship between the rack performance.
And the budget, the input token computation you actually use, which is different from what people mostly found previously in rec performance, in rec studies.
So now we know that with direct and interdirect, as long as we can find optimal configuration, we can leverage the contact window better than just vanilla rec. But how do we actually find the optimal configuration? Because so far, we've been enumerating all these brute force enumerating all these different configurations. And we're actually using the numbers from test time data sets. But this is apparently not practical. So we also have like inference computation allocation model.
So essentially this model is going to take a configuration as input and trying to predict what a rack performance would be. So in this model data is going to be all the configuration parameters you have. A, B and C are going to parameters you're going to learn from this model. I is just some data set specific informative misfactor that you can sort of derive for each data set.
So fitting this model actually gives us around R square of 0.9 which is pretty pretty good and we also show that this model can generate pretty well for example we take three data sets to fit the model
And trying to use the bit model to predict the optimal configuration on the fourth data set. And on a table you can see the predictive performance is very close to the oracle optimal performance. And also we try to do length generalisation where we take all the configuration within a certain length and trying to fit the model and predict performance on longer length. And it also shows that our model can do a pretty well job.
To summarize, we in this work we comprehensively investigate inference scaling for REC tasks in the regime of long context LMs and we show that by combining different strategies REC performance can actually scale almost linearly to a large scale of test time computation and we also develop a quantitative model to predict the REC performance for any given configuration which shows its value in
in practice. And thank you. I'll take any question. Nice to speak here. Thank you for the great talk. So I'm just wondering, essentially, I mean, when you try to learn the optimal configuration, right? So essentially, you kind of create some data set. Yeah, so...
Can this be generalizable? Yeah, so this is essentially what we try to answer in this slide where you can see the first table, we only train the model on, for example, three of the data sets and we're trying to predict the performance on the fourth data set. So ideally you imagine like this model we fit on all this data set we collect can be generalized to another like to the fifth data set and hopefully it can still perform very well.
Back on this table is showing this basically doing a pretty good job trying to predict the best performance over here. Okay, so can I say basically you are using brutal force kind of things, I mean to find the optimal ground truth day? Yeah, so sort of like in this work would really collect a lot of data on our site and hopefully the model sort of fit on our data set can be used.
Like when you actually apply it you don't need the brute-force process again like you can just directly use the model hopefully I see. Yeah, Thank you. thank you So let's do one more quick question there as well. Sure. Hi, thank you so much for the presentation. Really nice. I have a quick question in terms of, I think you show in the graph that the performance is kind of linear growing in terms of the number of the contact length. I was just interesting to observe the last two points, actually.
be the performance is kind of a flat I was wondering that do we have like you know plan to test in terms of further increasing the content length we actually sustain the performance growth yeah So you will see that that is about a point of 1 million input token. So that is the limit of Gemini, like Gemini 1.5 Pro has 1 million input token. And if we want to go further, you will have to rely on iterative approach.
But we don't have enough data points at that part. So it started to sort of go down a little bit. But the belief right now from my side is if we have, for example, more powerful model with longer context window, or if we have, we will be able to have better strategies, it should keep increasing linearly. So, yeah.
