---
title: "InfiniteICL — paper by Cao et al. (2025) — summary and ideas"
description: "InfiniteICL turns long inputs into weight updates and tests what can still be recalled, inferred, or learned after most of the prompt is removed."
canonical: "https://research.elamur.ai/free/en/papers/cao-2025-infiniteicl-breaking-limit-context-window/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/cao-2025-infiniteicl-breaking-limit-context-window/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2025](https://md.research.elamur.ai/free/en/papers/2025/) / InfiniteICL: Breaking the Limit of Context Window Size via Long Short-term Memory Transformation

# InfiniteICL: Breaking the Limit of Context Window Size via Long Short-term Memory Transformation

Paper · 2025 · Bowen Cao, Deng Cai and Wai Lam

**Authors:** [Bowen Cao](https://md.research.elamur.ai/free/en/authors/bowen-cao/), [Deng Cai](https://md.research.elamur.ai/free/en/authors/deng-cai/) and [Wai Lam](https://md.research.elamur.ai/free/en/authors/wai-lam/) · **Year:** 2025 · **Venue:** Findings of the Association for Computational Linguistics: ACL 2025 · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **5** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/cao-2025-infiniteicl-breaking-limit-context-window/cited-by/) · Findings of the Association for Computational Linguistics: ACL 2025 · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2025.findings-acl.595/)
- [PDF](https://aclanthology.org/2025.findings-acl.595.pdf)
- [DOI 10.18653/v1/2025.findings-acl.595](https://doi.org/10.18653/v1/2025.findings-acl.595)

## Summary

A demonstration can teach an answer format, a document can supply a missing fact, and a set of corrections can change the conclusion of a reasoning problem. In-context learning makes these changes possible by placing the relevant material in the input. The material takes up space for as long as it is needed, and adding more can make answers harder to produce accurately as well as more expensive to generate. InfiniteICL tests a different arrangement. It uses the material to produce training examples, updates the system’s weights from those examples, and then frees the input space for new material.

The method first reads a passage and generates possible questions, grounded answers, and open-ended continuations. It then scores the generated responses by comparing how likely they are with and without the passage. Responses that become much more likely when the passage is present receive priority. Finally, a teacher that still sees the passage supplies next-token predictions to a student that sees only the shorter training input. The student learns to approximate those predictions. In an ongoing stream, the updated weights carry forward into the next round, while the text available for direct reading can change.

In the single-update experiments, InfiniteICL retains 0.1 of the original text in the standard setting. Across the tasks scored by exact match, it achieves a reported average recovery rate of 103%. Recovery measures the improvement over answering without context relative to the improvement obtained with the full input. The average hides a clear difference between tasks. Exact match on Natural Questions is 45.2 for InfiniteICL and 53.6 with the full passage. On CounterFact, where an incoming statement changes what answer should be given, InfiniteICL scores 66.9 and full-context prompting scores 46.8. The method also recovers most of the gains from showing classification demonstrations directly.

The sequential experiments test whether updates can carry information across many passages. On LongBench v2, InfiniteICL reaches 44.7% overall multiple-choice accuracy. The comparison using a 128K context window reaches 30.0%, and the paper reports that InfiniteICL uses 0.4% of the original context in this setting. The experiments extend to contexts reported at up to 2M tokens in the length analysis. An indefinitely long stream is a possibility of the update procedure, since it can keep accepting chunks. How much survives a long succession of updates is a separate question. The paper also identifies the computational cost of doing the training during use.

## Deep dive: InfiniteICL: Breaking the Limit of Context Window Size via Long Short-term Memory Transformation

InfiniteICL turns long inputs into weight updates and tests what can still be recalled, inferred, or learned after most of the prompt is removed. · about 33 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What a prompt has to carry

In-context learning is a way to change a system’s behavior through its input. A passage may provide evidence for an answer. Examples may show how to carry out a task, even when the names of the categories give away nothing about their meaning. An update may instruct the system to reason from a different set of facts for the current question. All these uses depend on the ability to pick up information from the input and apply it before producing an output. The demonstrations in the paper extend the basic arrangement familiar from [few-shot learning](https://md.research.elamur.ai/free/en/concepts/few-shot-learning/).

This ability is especially convenient when the content changes between requests. A user can supply a document as soon as it becomes relevant. The system can follow a demonstration without a separate training job. If the user wants another answer from the same document, though, the system still needs access to the earlier material. A sequence of interactions can bring much more text than any individual request. In the applications that motivate the paper, a research session can accumulate information from the web, and an interactive system can keep receiving experiences over time. The question is how to keep using information when the whole history no longer fits.

The paper describes ordinary context windows in the range of 8K-128K tokens. A token is a unit of input text processed by the system. A context window limits how many of these units can be available together. Within that window, attention provides a means for one position in a sequence to draw on information from other positions. This makes it possible, for instance, to relate a question near the end of an input to evidence introduced much earlier. The basic architecture is the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/).

Window size is only part of the issue. The authors point to the quadratic growth of attention computation with sequence length and the linear growth of memory for the key-value cache. The cache stores intermediate representations that attention can reuse as generation proceeds. Reusing them saves work, but the representations take up more space when there are more positions to keep. An input can thus pose a resource problem even when it is within the maximum supported length. The architecture behind that distinction is introduced in [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/).

Long inputs can also be hard to use effectively. The authors cite diminishing returns when a system is given many demonstrations and when it has to connect evidence across documents. Increasing the window makes more evidence available for attention, while the quality of the resulting answer depends on which evidence the system actually uses. These two concerns motivate the choice of classification and long-document reasoning in InfiniteICL. They also explain why the authors compare changes in task scores as well as changes in retained text. The relevant earlier benchmarks include [Many-Shot In-Context Learning](https://md.research.elamur.ai/free/en/papers/agarwal-2024-many-shot-context-learning/) and [LongBench v2](https://md.research.elamur.ai/free/en/papers/bai-2024-longbench-v2-deeper-understanding/).

#### Earlier ways to make a large input manageable

A family of earlier approaches reduces the amount of material that goes into the window. The paper describes summarization-based systems that split or rewrite the source into shorter text. A summary can preserve the main thread while removing much of the original wording. That is a plausible way to make a long document manageable when its main points matter. For a question whose answer depends on a small detail, the summary must happen to preserve that detail, or provide some way to get back to it. [RECOMP](https://md.research.elamur.ai/free/en/papers/xu-2023-recomp-improving-retrieval-augmented-lms/) is among the examples the authors discuss.

Other approaches select tokens to keep. In the paper’s account, some use information measures to identify words that appear dispensable, while others learn to prune inputs according to their effect on a downstream task. The latter can tune the selection to the intended use, at the cost of task-specific training. Earlier work cited for removing material from a prompt includes [Selective Context](https://md.research.elamur.ai/free/en/papers/li-2023-compressing-context-enhance-inference-efficiency/), [LLMLingua](https://md.research.elamur.ai/free/en/papers/jiang-2023-llmlingua-compressing-prompts-accelerated-inference/), and [LLMLingua-2](https://md.research.elamur.ai/free/en/papers/pan-2024-llmlingua-2-data-distillation-efficient/).

Compression can also take place in the representations used for attention. SnapKV reduces the set of cached keys and values along the length of the input. In this setting, the object being shortened is the collection of saved attention representations. Another line of work learns compact vectors that can be supplied as a soft prompt. The vectors carry information about the source without having to reproduce its words. The authors place both lines in the wider context-compression literature. [SnapKV](https://md.research.elamur.ai/free/en/papers/li-2024-snapkv-llm-knows-looking-before/) and [Learning to Compress Prompts with Gist Tokens](https://md.research.elamur.ai/free/en/papers/mu-2023-learning-compress-prompts-gist-tokens/) illustrate these two approaches.

A second family transfers information from a prompt into weights. This idea is known as context distillation. A teacher can use the prompt to produce behavior that a student then learns to reproduce with less input. The authors describe a literature that often studies short prompts or concentrates on a particular kind of material, such as dialogue history, instructions, or sports documents. Some of the systems they discuss use additional parameters and specialized pretraining for the transfer. Temp-LoRA brings training into the generation process and learns from the prompt and previously generated text. InfiniteICL takes it as a comparison because it also changes weights during use.

These approaches expose a design choice about the form in which earlier information survives. A shortened prompt keeps material accessible as input. A weight update makes whatever was learned accessible through a change in predictions. The latter can free the window even when the original document would take up most of it, but it also makes the quality of the training examples consequential. A system that might later be asked to retrieve a single fact, infer a consequence, or apply a classification rule needs training material that covers these different uses.

#### Why use weights as memory

The paper organizes its proposal around an analogy with short- and long-term memory. Input text is the temporary store. It is directly available while it is in the window and loses that role when it is taken out. Weights are the persistent store. An update can change how a system answers a question after the words that caused the change have left the input. The analogy guides a computational design whose important property is that the state can survive a change of prompt.

The authors also connect the idea to studies that interpret in-context learning as resembling an implicit gradient update. This gives them a way to relate ordinary prompting, which leaves weights fixed, to an explicit update trained on predictions made while the context was present. They place that explicit training within test-time computation, where additional work during use can improve the answer. The cited connections include [Transformers Learn In-Context by Gradient Descent](https://md.research.elamur.ai/free/en/papers/oswald-2022-transformers-learn-context-gradient-descent/) and [Why Can GPT Learn In-Context?](https://md.research.elamur.ai/free/en/papers/dai-2023-why-can-gpt-learn-context/).

The problem is therefore broader than finding a compact representation of a known answer. The system has the context before it knows everything a later user might ask. It must decide what behavior to rehearse, which rehearsals depend strongly on the context, and how to preserve that behavior. In a stream it must do this repeatedly, using an already updated system as the starting point for the next transformation.

### The method, step by step

#### From a passage to a lesson

Imagine a passage that introduces a classification convention. Someone reading it might ask for the label of an example, an explanation of how the labels are assigned, or a new example that follows the convention. Each request exercises a different use of the same material. InfiniteICL tries to produce such uses before the source disappears from the prompt. The same setup can elicit a factual answer from a document or a conclusion from a set of updates. The examples serve as training data for that particular input.

The system takes two roles during a transformation. As teacher, it has the full chunk and can use it to generate questions and answer them. As student, it is asked to predict the response from the shorter input. The difference in what the two roles can see creates a training signal. Where the teacher predicts a response more confidently with the chunk, learning to make the same prediction without the chunk can change what remains available when the text is removed.

Open-ended continuations supplement the question-and-answer examples. They ask the teacher to extend the material and thus exercise its ability to continue a pattern or a passage. The question route can deliberately explore details and implications. The continuation route lets a sequence develop without first imposing a specific information request. The two routes share the goal of producing behavior worth transferring, and the same scoring procedure can filter their outputs.

How InfiniteICL turns a context chunk into updated weights The steps in order.

#### Eliciting uses of the context

The query-generation prompt asks the teacher to anticipate requests a reader might make. It offers families of requests instead of imposing the same questionnaire on every passage. A passage can lend itself to a condensed account, a question about an event, an explanation of a pattern, an inferred application, or a request to reproduce wording. The teacher determines which kinds make sense for the material. The prompt also asks it to name the subject of a question clearly, so that the question can still be understood when presented without the source.

That last constraint matters for the transfer. A reader who can see a document might understand a question built around an ambiguous pronoun. The student sees the question without its original surroundings, so the same wording could fail to identify what it asks about. Explicit naming makes it possible to test and learn the intended association. The prompt supplies examples of query types and a structured output format. One prompt call asks for 20 numbered queries and uses a delimiter to mark where the list ends. This is a generation instruction within the larger procedure that assembles the transfer set for a chunk.

The teacher samples a query from its response to the structured prompt. In the authors’ notation, this step is:

```
qᵢ ∼ Mθ(· | p(c))
```

Here qᵢ is the query at index i. The symbol ∼ means that the query is sampled from the distribution on its right. Mθ is the predictor with teacher weights θ. The dot stands for the possible generated query, and the vertical bar marks the input that conditions generation. The function p builds the query-generation prompt from the context c.

Next the teacher answers each query while seeing the source. This gives the procedure a context-grounded response for the same query that the student will later receive.

```
rᵢ ∼ Mθ(· | c, qᵢ)
```

The response is rᵢ, with i matching the index of query qᵢ. The sampling symbol ∼ again signifies a draw from the teacher’s output distribution. Mθ uses teacher weights θ, and the dot now stands for the possible response. The inputs after the vertical bar are the original context c and the query qᵢ.

The context and these paired sequences make up a transfer set. The elicitation formula describes the query-and-response route. Open-ended examples enter the implemented set through a separate instruction to extend the passage.

```
T = (c, {qᵢ}ᵢ₌₁ⁿ, {rᵢ}ᵢ₌₁ⁿ)
```

T is the transfer set and c is the source context. The braces collect the queries qᵢ and their corresponding responses rᵢ. The index i runs from 1 through n, with n denoting the number of pairs. A query and a response belong together when they have the same index.

In the standard setup, the authors generate 200 query-response pairs and 200 open-ended continuations per context. The main implementation description gives 512 tokens as the entry length, and the training description applies the loss to responses up to 512 tokens. Sampling for queries and responses uses temperature 1. Temperature controls how much generation explores alternatives to the most probable token. With varied candidates, there can be multiple ways to express or apply the knowledge in a passage. The scoring stage determines which of those examples reach training.

#### Selecting context-sensitive responses

A response can be fluent and appropriate while depending very little on the current passage. A question about a widely known fact may elicit the same answer even when the source is absent. Conversely, a response that uses an unusual label mapping or follows a newly introduced fact may be highly probable with the passage and unlikely without it. InfiniteICL gives priority to the latter kind of discrepancy. The score compares the probability of the same completed response under each input.

```
ΔPPL(r) = log Pθ(r | c, q) − log Pθ′(r | q)
```

ΔPPL(r) is the selection score that the paper calls the perplexity discrepancy for response r. The expression uses log probabilities of the response sequence. The function log takes a logarithm. Pθ is the teacher’s sequence probability under weights θ, and Pθ′ is the student’s sequence probability under weights θ′. The prime distinguishes the student’s parameters from the teacher’s. The vertical bar denotes conditioning. On the teacher side the conditioning inputs are context c and query q. On the student side the conditioning input is q. The minus sign puts examples higher in the ranking when their response is more strongly favored by the teacher with context.

For an individual candidate, a large score says that the passage makes a difference to the prediction being considered. It can indicate a new fact, a localized convention, or a way of continuing the text that becomes plausible after reading it. The score is computed from the response that was actually generated. It therefore asks whether that response is informative for transfer. It does not require an annotated judgment of its importance to a future reader.

The authors retain the top k examples for each context and call the selected set Tₖ. The usual run keeps 200. Selection serves both a training-budget purpose and a statistical one. It reduces the number of examples used in the update, and it changes the composition of the examples towards responses whose likelihood depends more on the passage. A response can be context-sensitive and still leave out an important detail or express an inference poorly. Context dependence is the property this filter measures.

#### Training the student

The overall target is a change in the student’s distribution. If the teacher would produce a sequence after reading the passage, the authors would ideally like the updated student to favor that sequence without reading it. Their definition writes the target as:

```
Pθ′(y) = Pθ(y | c)     ∀ y
```

Pθ′ denotes the student’s probability distribution after updating weights θ′. The candidate output is y. Pθ denotes the teacher’s probability distribution with weights θ, and the vertical bar indicates that this distribution is conditioned on context c. The symbol ∀ means that the equality is intended for every y. On the student side, the full context c is absent. The practical setup still conditions responses on a query, as the transfer examples and the loss make explicit. The equality describes the intended transfer, while training can only measure agreement on the examples and prediction positions it uses.

In the practical loss, the teacher predicts each response with its source and query available. The student predicts it with the query available. The authors write the objective as an average over selected context records and the query-response pairs within them.

```
ℒ = E₍c,Q,R₎∼Tₖ E₍q,r₎∼₍Q,R₎ D(c, q, r)
```

ℒ is the training loss. E denotes an expectation, or an average under the indicated sampling arrangement. The outer expectation takes a record from Tₖ, the selected transfer set. Each record has a context c, a collection Q of queries, and a collection R of corresponding responses. The inner expectation takes a paired query q and response r from those collections. The sampling notation ∼ identifies the source of each draw. D is the mismatch evaluated on that context and pair. R in this formula is a response collection. The evaluation section uses the same letter for a different quantity, the recovery rate.

The mismatch has a common structure across the different objectives tested in the paper.

```
D(c, q, r) = f(Mθ′(r | q), Mθ(r | c, q))
```

D is the mismatch for context c, query q, and response r. The function f measures a difference between the predictions or representations supplied to it. Mθ′ is the student with weights θ′, and Mθ is the teacher with weights θ. The vertical bars show their different conditioning inputs. The expression refers to the outputs associated with response r, which can include the distribution over the next token at each position in that response.

The main experiments use forward Kullback–Leibler divergence, abbreviated forward KL. At each response position it compares the teacher’s distribution to the student’s distribution. The teacher’s relative probabilities provide information about alternatives even though only one token appears at that position in the sampled sequence. The authors express the forward comparison as follows.

```
KL(Mθ(y | c, x) ∥ Mθ′(y | x))
```

KL names Kullback–Leibler divergence, a directional measure of disagreement between distributions. The symbol ∥ separates the first distribution from the second. The variable y represents the next-token possibilities. The input x is the conditioning input available at that prediction, including the relevant response prefix when comparing at a response position. The teacher Mθ also sees the context c, as shown after the vertical bar. The student Mθ′ uses the same shorter input x. The weights are θ for the teacher and θ′ for the student.

The paper also tests the opposite ordering.

```
KL(Mθ′(y | x) ∥ Mθ(y | c, x))
```

KL and ∥ have the same meanings as in the forward comparison, with the distributions in reverse order. The first distribution now comes from the student Mθ′ with weights θ′ and input x. The second comes from the teacher Mθ with weights θ, the same x, and the context c. The token variable is y, and the bars again identify what each side is conditioned on. The other tested objectives vary the weighting of the two KL directions, add a preference-based objective, match intermediate representations, or train by imitation of the sampled response.

#### What changes between transformations

The principal implementation starts from Llama-3-8B-instruct with an 8K window. It uses LoRA [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) to make the updates. LoRA restricts the adjustment to trainable low-rank components. The reported rank is 8, the scaling setting is 16, the dropout is 0.05, and the learning rate is 1e−4. Of the 200 selected examples, 160 are used for training and 40 for validation. Only response positions contribute to the loss. Training stops if the development loss fails to decrease after two consecutive evaluations. At evaluation, temperature 0 produces greedy decoding, which selects the most probable next token at each step.

The comparison protocol allows a short piece of the original input to remain. The retention ratio specifies how much.

```
ρ = |c′| / |c|
```

The Greek letter ρ is the retention ratio. The context c is the original input and c′ is its retained portion. The bars denote the length of the text they enclose. The slash divides the retained length by the original length. The default is 0.1. For InfiniteICL and the distillation comparisons, the retained portion is the end of the source. Compression systems determine their retained content using their own rules. Keeping the same suffix in the Local Context comparison lets the authors ask how much the update adds to what can already be answered from that suffix.

In the sequential setting, the method applies the same kind of training to consecutive chunks. What moves from one transformation to the next is the parameter state. The paper denotes a single transformation in the stream this way:

```
Tᵢ : θᵢ₋₁ + Cᵢ → θᵢ
```

Tᵢ is the transformation at turn i. The state θᵢ₋₁ is the set of weights entering that turn, and Cᵢ is the new chunk. The plus sign means the update takes those weights and that chunk as inputs. The arrow points to θᵢ, the updated state that can be carried into the next turn. This Tᵢ denotes an operation, distinct from the transfer set T. The notation makes the streaming objective clear. A later turn can use predictions influenced by earlier updates while devoting the current window to incoming material.

### Experiments and results

#### What each task asks the system to preserve

The single-transformation experiments limit test contexts to within 8K tokens. This gives full-context prompting access to the source and lets the authors compare it with a shorter residual prompt after an update. The experiment asks what the transfer preserves when it is carried out once. The tasks distinguish several kinds of preservation that could otherwise be hidden by one aggregate score.

Natural Questions tests factual [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/). The questions come from real users, and the contexts are Wikipedia passages. A correct answer can depend on a small piece of information within a much longer source. A teacher may be able to answer with the passage in view, while the training data generated from the passage can miss the particular fact that the evaluation later requests. The dataset comes from [Natural Questions](https://md.research.elamur.ai/free/en/papers/kwiatkowski-2019-natural-questions-benchmark-question-answering/).

The classification experiments show the system 300 demonstrations sampled from each dataset’s training set. TREC Coarse is a 6-class question categorization task, TREC Fine is a 50-class question typing task, and NLU is a 68-class intent detection task. The authors replace the original labels with randomly assigned numerical labels. The intended effect is to make the demonstrations necessary for learning which numerical output corresponds to which category. A system that already understands the distinction between kinds of questions still has to learn the convention used in the test.

The knowledge-update tasks ask the system to use incoming statements that can conflict with earlier knowledge. In CounterFact, each context supplies a counterfactual factual statement. In MQuAKE, the context joins successive updates into a passage, and questions can require using more than one link in a reasoning chain. The tests give the student an opportunity to show that its predictions have changed in a way that supports application of the new information. The source datasets are [CounterFact](https://md.research.elamur.ai/free/en/papers/meng-2022-locating-editing-factual-associations-gpt/) and [MQuAKE](https://md.research.elamur.ai/free/en/papers/zhong-2023-mquake-assessing-knowledge-editing-language/).

For text generation, the paper uses the PG19 test set. Each item contains a 2048-token passage and a subsequent 256-token continuation. The passage is the source for the transformation, and the following segment is used to assess prediction. This test probes whether the transferred material helps with how a text continues. PG19 is associated with [Compressive Transformers](https://md.research.elamur.ai/free/en/papers/rae-2019-compressive-transformers-long-range-sequence/).

#### Comparisons and measures

Full Context and No Context give reference points for interpreting the scores. In the single-transformation tasks, Full Context puts the whole source in the input. No Context asks what can be done without that source. Local Context uses just the final portion allowed by the retention ratio. The comparison with Local Context is particularly relevant for the default InfiniteICL setting because both can use the same remaining text. The score difference then concerns the addition of the transfer pipeline to that input.

The compression baselines handle the source in different ways. ReadAgent segments it and forms summaries. Selective Context, LLMLingua, and LLMLingua-2 remove parts of the text. SnapKV retains a subset of the attention cache. Temp-LoRA is the distillation comparison, with direct training on the context. These comparisons put InfiniteICL alongside ways to reduce dependence on a long prompt and alongside another way to put context into weights.

The authors use exact match for document questions, classification, and knowledge updates. Exact match credits a response when it agrees with the target under the task’s matching rule. PG19 uses perplexity, which measures how surprising the continuation is under the predicted distribution. Lower perplexity means the observed continuation is assigned higher probability. Because perplexity is on a different scale, the paper leaves PG19 out of its single-transformation average. LongBench v2 uses accuracy on multiple-choice questions.

The paper also reports a recovery rate, which asks how much of the gain from the source a method achieves.

```
R = (M − L) / (U − L)
```

Here R is the recovery rate, M is the method’s performance, L is the no-context reference, and U is the full-context or other upper reference for the evaluation. Parentheses group the difference between a score and the no-context result, and the slash divides the two differences. If the method reaches the lower reference, recovery is 0. Reaching the upper reference gives a recovery of 1. Scores can yield values beyond either reference because the bounds describe comparison settings. For perplexity, the lower numerical score is the better result, and the differences in the formula reflect that direction. The recovery calculation and raw task score answer different questions. The former is sensitive to the distance between the reference scores.

#### Results after a single update

On the principal Llama setup, InfiniteICL records 70.4 as its average exact-match score across the included single-transformation tasks. The paper gives 68.6 for Full Context and 5.3 for No Context on that average. The standard retention setting is 0.1. The reported average recovery is 103%. The compression methods in the comparison use much less of the improvement associated with full context at that retention setting, and direct distillation with Temp-LoRA scores 19.3 on the same average.

Average exact match across the single-transformation tasks scored by exact match InfiniteICL leads the shortened-input comparisons and finishes above full-context prompting on this average.

**The numbers**

| System or setting | exact match % |
| --- | --- |
| No Context | 5.3 |
| SnapKV | 7.3 |
| LLMLingua-2 | 10.4 |
| Temp-LoRA | 19.3 |
| Local Context | 34.8 |
| Full Context | 68.6 |
| InfiniteICL (this paper) | 70.4 |

Natural Questions illustrates the gap between retaining many useful behaviors and retaining a particular answer. InfiniteICL obtains 45.2 exact match, compared with 53.6 for Full Context and 21.4 for No Context. The reported recovery is 74%, which credits improvement beyond what the system can do without the document. The result exceeds Local Context at 31.4 and ReadAgent at 43.0. A substantial amount of the document’s value survives in the update and suffix, yet this is the main single-transformation task in which the authors emphasize the shortfall relative to reading the full source.

For the demonstration-based classification tasks, the pattern differs across datasets. InfiniteICL obtains 59.0 on TREC Fine, compared with 61.2 for Full Context. The corresponding TREC Coarse scores are 83.4 and 79.2. On NLU, InfiniteICL reaches 72.7 and Full Context reaches 78.4. The paper reports 98% average recovery for this group. On TREC Coarse, Local Context already reaches 65.2. On NLU it scores 33.0. The difference between those suffix-only results helps explain why the same retained fraction can carry quite different amounts of usable information across datasets.

The knowledge-update experiments produce some of the strongest results. InfiniteICL scores 66.9 on CounterFact exact match, and Full Context scores 46.8. On MQuAKE, the scores are 95.4 and 92.4. The corresponding recovery entries in the main results are 1.43 and 1.04. This is consistent with the idea that training can amplify the influence of a statement or inference that would otherwise be available through the prompt alone. The experiment measures that influence through correct answers to the benchmark questions.

The PG19 result brings a different perspective. InfiniteICL has perplexity 17.9, Full Context has 14.6, and No Context has 22.6. Local Context and Temp-LoRA each report 19.9. The transferred context helps predict the continuation compared with relying on the suffix alone, and reading the full passage remains stronger on this measure. The score is separate from the exact-match average because it measures prediction uncertainty over a continuation.

The appendix repeats the single-transformation experiments with Mistral-7B-instruct-v0.3. The paper again reports 103% average recovery. The tasks contributing to it have a different pattern. InfiniteICL reaches 43.4 on Natural Questions, with Full Context at 47.6 and Temp-LoRA at 47.0. InfiniteICL scores 48.6 on TREC Fine versus 47.2 with Full Context, and 67.8 on CounterFact versus 50.3. On MQuAKE, Full Context gives 86.6 and InfiniteICL gives 81.2. The appendix reports 101% average recovery for classification and 114% for knowledge updates. The repeat supports the general pattern of useful transfer, while individual wins and shortfalls depend on the starting system and the task.

#### Results across a stream of chunks

The sequential experiment uses LongBench v2. The benchmark includes questions about documents, classification from examples, dialogue, code repositories, and structured data. Its materials come from settings including legal documents, scientific articles, and technical manuals. The paper describes the benchmark’s source lengths as ranging from 8K to 2M words. Its performance-by-length analysis describes the long-input settings in tokens, including inputs up to 2M tokens. The accuracy table groups items as short below 32K, medium at 32K-128K, and long above 128K.

For this test, the authors use a 128K-context Llama-3.1-8B-instruct comparison from the benchmark authors. Inputs that exceed its capacity are truncated in the middle. The table also gives an 8K Context comparison and the No Context reference. The sequential setup tests repeated adaptation to an incoming source. Evaluation uses the multiple-choice questions associated with that source after the transformations.

Overall multiple-choice accuracy on LongBench v2 Sequential InfiniteICL achieves the highest overall accuracy among these context and distillation settings.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| 8K Context | 18.5 |
| No Context | 22.7 |
| 128K Context | 30.0 |
| Temp-LoRA | 32.4 |
| InfiniteICL (this paper) | 44.7 |

The advantage appears across the difficulty groups. On the easy questions, InfiniteICL reports 49.5% accuracy, Temp-LoRA 34.4%, and the 128K Context comparison 30.7%. On the hard questions, the corresponding scores are 41.8%, 31.2%, and 29.6%. The raw scores indicate that the hard group remains harder for InfiniteICL, even as the method leads the comparisons in both groups.

The length groups also help explain the overall result. InfiniteICL has 41.7% accuracy on short inputs, 46.1% on medium inputs, and 47.2% on long inputs. For the 128K Context comparison, the corresponding figures are 35.0%, 27.9%, and 25.9%. The paper reports that InfiniteICL uses 0.4% of the original context in this sequential evaluation. A rise in accuracy across the length groups can reflect differences in the benchmark items as well as the method’s ability to handle long inputs. The strong long-group result shows that a short residual input can be useful when earlier chunks have produced updates.

The long group also illustrates how recovery rates can become large. The 128K comparison reports 25.9% accuracy, No Context reports 19.4%, and InfiniteICL reports 47.2%. The recovery entry for InfiniteICL in this group is 4.30. The raw accuracy and the recovery figure convey different aspects of the result. Accuracy describes how many questions are answered correctly. Recovery expresses the method’s improvement on a scale defined by the two reference settings, which are relatively close in this group.

### What the ablations show

#### The mix of questions and continuations

The elicitation ablation asks whether the method benefits from generating different kinds of training examples. The authors use 10% of the data from each single-transformation task. One setting generates 400 open-ended continuations. Another generates 400 question-response pairs. The mixed setting generates 200 candidates of each type. All use the same selection procedure and retain 200 entries. This holds the candidate and retained-set budgets fixed while varying the material available for selection.

The results show that the type of example matters. On Natural Questions, the open-ended setting gives 36.0 exact match, the question-response setting gives 42.0, and the mix gives 46.0. A targeted question can lead the teacher to state a detail directly. A continuation may use key aspects of a passage without supplying exactly the kind of answer that a later fact question expects. The mixed result shows that giving the selector both sources of training examples works better on this subset than filling the candidate pool with either type alone.

The balance shifts on other tasks. On NLU, open-ended elicitation gives 75.3 exact match and question-response elicitation gives 53.6. The mixed setting reaches 72.4. On CounterFact, the respective scores are 59.0, 68.0, and 71.0. The mixture leads on CounterFact, while the open-ended setting retains the best NLU result. PG19 also favors open-ended generation among these settings. Its perplexity is 22.6 with open-ended candidates, 29.7 with question-response candidates, and 22.7 with the mixed pool.

These results clarify why the authors make the elicitation procedure broad. Questions can prompt the teacher to surface specific facts and consequences. Free continuation can expose how a format, classification exercise, or passage develops. The ablation measures the effect of giving the selector these alternatives. It leaves open which particular retained examples are responsible for a task’s change in score.

#### How much selection adds

Another subset experiment compares random selection, selection based on KL divergence, and the authors’ response log-probability difference. Each method selects from 400 continuations. The reported average scores use 10% of each task’s data. With 50 retained continuations, the authors’ method scores 69.61, the random method scores 68.54, and the KL-based method scores 66.54. With 100, the scores are 70.47, 69.83, and 68.12, respectively. With 200, the authors’ score reaches 72.27.

Average single-transformation performance on the ablation subset with 200 continuations retained Ranking by the response log-probability difference gives the strongest result at this retained-set size.

**The numbers**

| System or setting | average exact match % |
| --- | --- |
| Random selection | 69.91 |
| KL-based selection | 70.60 |
| InfiniteICL PPL-based selection (this paper) | 72.27 |

The comparison at each retained-set size supports the use of the paper’s scoring rule in this pipeline. It also provides a check on the difference between good examples and a good way of choosing them. Random selection already gives substantial performance, so the candidate pool itself contains useful training material. Ranking by context-sensitive sequence probability gives a further gain over that pool. The improvement from increasing the selected count occurs under each rule in this comparison, though the strongest result comes from combining the larger retained set with the paper’s ranking.

The appendix studies count and length together. The candidate groups in that study contain equal numbers of query-response pairs and open-ended continuations. Longer or larger settings include the content used in their shorter or smaller counterparts. The strongest tested configuration has 200 continuations of 512 tokens and scores 72.27. At the same continuation length, increasing the count to 300 gives 69.53. This makes the amount of text an incomplete predictor of performance. More continuations can expose further uses of a context, and the extra examples can also change the focus of the update. The paper interprets the inversion as a possible decline in the density of useful information.

#### What the student should match

The loss ablation uses the same 10% task subsets as the selection study. The authors compare matching the teacher’s output distribution, matching its hidden states, and teaching the student to reproduce sampled sequences. Among the distribution-based methods, they test forward KL, reverse KL, adaptive KL, and a preference-based approach called DPKD. Hidden-state alignment uses mean squared error, abbreviated MSE, to penalize differences in intermediate representations. Sequence-level imitation, called SeqKD, trains on the teacher’s sampled responses.

Forward KL gives 46.0 exact match on the document question subset, 73.5 on the many-shot average, and 83.5 on the knowledge-update average. It gives 22.7 perplexity on PG19. Reverse KL scores 44.0 on the document questions, 72.5 on the many-shot average, and 80.0 on the knowledge-update average. Adaptive KL reaches 83.0 on the knowledge-update average. These comparisons place forward KL close to the strongest tested results across the main behaviors, which explains its use in the standard system.

The hidden-state comparison separates an apparently similar generation result from a large change elsewhere. MSE yields perplexity 23.8 on PG19, near forward KL’s 22.7. On the document question subset, MSE scores 26.0 exact match and forward KL scores 46.0. The two objectives can produce comparable predictive fit on a natural continuation while differing substantially in how well a particular answer comes out. Intermediate representation matching and answer prediction place different demands on the update.

Sequence imitation gives the strongest PG19 result in this comparison, with perplexity 5.5 against forward KL’s 22.7. It also gives 48.0 exact match on the document questions, compared with 46.0 for forward KL. Its knowledge-update average is 35.5, however, and on MQuAKE it records 6.0 exact match next to forward KL’s 96.0. The authors read this as support for matching the teacher’s predictions across response positions when the student must apply compositional relationships. The experiment shows which objectives accompany good outcomes on each task. The token-by-token transfer of the underlying reasoning is an interpretation of that pattern.

#### How much context to leave and how much to process at once

In the retention analysis, the authors vary the fraction of the original context available at evaluation from 0.7 to 0. InfiniteICL’s average score goes from 68.8 at the larger residual fraction to 62.3 at the zero endpoint in the figure discussion, with a reported peak of 72.3 at 0.1. The baselines shown in that analysis degrade towards the extreme setting. A score at zero retention directly tests what the updated system can do when the original context contributes no text to the evaluation prompt. The difference between the peak and the zero-retention score also shows the value of the joint arrangement in the standard run.

The analysis by total context length reorders the LongBench v2 results to examine stability beyond the coarse length groups. The paper reports an average decline of 15.4% ± 12.8% for the baselines in the 8K–64K range. It observes that some of them improve around 512K. No Context improves there too, leading the authors to attribute the spike to what the starting system already knows or can infer from the questions. InfiniteICL is more stable into the reported 1M–2M range, where the authors describe severe failures for competing approaches. The coincident No Context spike is important because going from one length group to another also changes which questions are being answered.

A separate study varies the amount of text in each transformation turn. The authors uniformly sample 100 LongBench v2 contexts with 112 associated questions. With 1k tokens per turn, the average is 277 turns and overall performance is 45.54. The 3k setting gives 93 turns and 44.64. Performance reaches 49.11 with 5k per turn and 53 turns on average. The 6k setting needs 46 turns on average and gives 46.43.

The chunking comparison suggests that integration has a useful working scale for this setup. A shorter chunk makes the teacher generate training material from a smaller piece of the source. Facts or examples that make sense together can end up in different transformations. A larger chunk lets the teacher see more per turn and reduces the number of updates, but it also gives more material to account for in the same procedure. The peak at 5k is an observation for the system with the 8K window and the sampled benchmark contexts. The proposed explanations of fragmentation and information load are the authors’ readings of the pattern.

### Limitations

#### Limits the authors identify

The authors identify the concentration on Llama-3-8B-instruct as a limit on how far the results can generalize. The Mistral appendix adds a second starting point for the single-transformation tasks. It reproduces the reported headline recovery rate while changing the outcome on individual datasets. The main sequential results still rely on the principal implementation. Similar average results in single updates give limited evidence about whether a different starting system will preserve knowledge through an equally long chain.

The other stated limitation is the cost of gradient-based fine-tuning. Each transformation involves candidate generation, candidate scoring, and training. The paper reports an average fine-tuning time of 2.3 minutes for a 7K-token context on 8×A100 GPUs in its implementation. A shorter prompt can reduce the later inference burden. On the TREC Coarse example with 300 demonstrations, the paper reports 3.5x generation speed after transformation. This is a measurement of generation after the update. How quickly the up-front work pays for itself depends on how frequently the updated state is reused. The authors suggest a hypernetwork as a possible way to reduce the cost of transformation in future work.

The paper also highlights weaker performance on document-based fact recall. The main Natural Questions experiment recovers 74% of the improvement available from full context, despite leading the other shortened-context methods in that comparison. The authors relate this to the difference between learning the substance of a passage and memorizing the particular details a reader might eventually want. In this pipeline, query generation has to anticipate those details while the teacher still has the full source. Selection and distillation can preserve only what becomes available as a usable training signal.

#### Limits of the evidence

An indefinitely repeatable procedure and indefinite faithful memory are different claims. The update rule can accept a new chunk after each transformation because the state passed forward consists of weights. The length analysis provides evidence about behavior through the longest contexts evaluated, up to the reported 2M-token setting. It leaves open the longevity of any particular fact under further updates. The LongBench v2 evaluation gives a score after processing the source, with no systematic test of recalling the same item after progressively more unrelated or conflicting chunks.

The formal equality between the teacher’s and the student’s distributions is an ideal target. The optimization compares behavior on selected responses, so strong performance establishes that the update preserved behavior tested by the benchmarks. It cannot establish distributional agreement for arbitrary queries. A question never anticipated by elicitation may depend on a sentence absent from the transfer set. Even when an example about that sentence survives selection, the student may fail to apply it in a new formulation. These possibilities matter particularly for exact details, which can be sparse in the generated material.

The retention setting also affects what can be attributed to the weights. At the default ratio, the final source fragment remains available. The Local Context comparison evaluates the value of that same input without the transformation, while the zero-retention experiment measures the system when the original text is entirely absent from the evaluation input. Results at non-zero retention reflect the behavior of the combination. For instance, a question may include a reference that the suffix resolves while the updated weights encode facts needed to choose the answer.

There are limits to what the reference settings can establish. Full Context in the single-update evaluation is a prompting condition whose complete input can still be difficult to use. An update can produce better answers because it reinforces specific predictions or makes evidence easier to apply. In the sequential comparison, the 128K reference also has a different starting configuration, and middle truncation can remove parts of an overlong source. A higher score for InfiniteICL shows that its pipeline beats that particular long-window comparison. It leaves open the outcome against a system that can read the entire longest source with an effective attention mechanism.

Likewise, recovery is relative to the available reference gain. It can exceed 1 when an update beats the upper reference. It can become large when the gap between Full Context and No Context is narrow. A high number can therefore coexist with substantial error on the actual questions. Task scores provide the grounding for statements about practical accuracy. This matters for LongBench v2 in particular, where group-level recovery and accuracy can suggest different impressions of how difficult the remaining questions are.

The choices about chunk size, continuation length, and distillation objective are supported by particular comparisons. The chunk-size experiment uses a subset and one window capacity. An optimum on that slice leaves open how the balance changes with other source structures or different places to divide a text. The loss comparisons use task subsets too, and their reversals across tasks show that an aggregate score can obscure a change in what the system learns. The choice of forward KL follows from the breadth of the behaviors tested, with other losses achieving stronger results on particular measures.

Finally, the paper distinguishes the cost of storing a long prompt during inference from the cost of learning an update. The timing examples show that the latter can be incurred separately and that subsequent generation can be faster. The experiments leave the full resource tradeoff unresolved for requests with little reuse and for very long streams that require repeated candidate generation and training. The evidence for freeing input space is direct. The value of doing so in a particular workload depends on the work needed to produce and use the resulting state.

### What came after

Later citations place InfiniteICL alongside work on self-distillation, continual learning, and context distillation. The connection is clearest at the level of the training setup. InfiniteICL creates an advantage for the teacher by letting it read material the student cannot see. It then asks whether the student can preserve the resulting behavior in its weights. The titles of the later papers identify different questions to which this general arrangement is relevant, while the citations alone give no basis for attributing InfiniteICL’s specific candidate filter, chunk sizes, or measured results to them.

[Reinforcement Learning via Self-Distillation](https://md.research.elamur.ai/free/en/papers/hubotter-2026-reinforcement-learning-self-distillation/) places self-distillation in a reinforcement-learning setting. InfiniteICL’s related use of self-generated supervision comes from the predictions of the text-conditioned teacher. The later paper’s title identifies a different training setting for self-distillation. Its citation connects that setting to the earlier research on using a system’s own predictions as supervision.

[Self-Distillation Enables Continual Learning](https://md.research.elamur.ai/free/en/papers/shenfeld-2026-self-distillation-enables-continual-learning/) takes continual learning as its subject. The closest connection in InfiniteICL is the sequence of updates in which the state produced from one chunk becomes the state used to process the next. The citation puts that streaming experiment in the context of a broader learning problem. For InfiniteICL, successful answers after reading a long source give one way to measure whether a series of updates has preserved useful information.

[On-Policy Context Distillation for Language Models](https://md.research.elamur.ai/free/en/papers/ye-2026-policy-context-distillation-language-models/) returns to context distillation itself and identifies on-policy learning as its focus. InfiniteICL builds its transfer set from teacher-generated responses and selects them before updating the student. The later title brings the policy that supplies training examples into view. That connection concerns a central decision in context distillation. The distribution of examples used for training determines which parts of the teacher’s context-dependent behavior the student gets to practice.

## Cite

Cite as Bowen Cao, Deng Cai and Wai Lam. 2025. InfiniteICL: Breaking the Limit of Context Window Size via Long Short-term Memory Transformation. Findings of the Association for Computational Linguistics: ACL 2025.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2025.findings-acl.595](https://doi.org/10.18653/v1/2025.findings-acl.595)

```bibtex
@inproceedings{cao2025infiniteicl,
  title = {{InfiniteICL: Breaking the Limit of Context Window Size via Long Short-term Memory Transformation}},
  author = {Bowen Cao, Deng Cai and Wai Lam},
  booktitle = {Findings of the Association for Computational Linguistics: ACL 2025},
  year = {2025},
  doi = {10.18653/v1/2025.findings-acl.595},
  url = {https://doi.org/10.18653/v1/2025.findings-acl.595}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
