Papers › Stacked from One: Multi-Scale Self-Injection for Context Window Extension

Stacked from One: Multi-Scale Self-Injection for Context Window Extension

5 Mar 2026arXiv:2603.04759added by Syntology

Wei Han, Pan Zhou, Soujanya Poria, Shuicheng Yan

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

The limited context window of contemporary large language models (LLMs) remains a primary bottleneck for their broader application across diverse domains. Although continual pre-training on long-context data offers a straightforward solution, it incurs prohibitive data acquisition and computational costs. To address this challenge, we propose~\modelname, a novel framework based on multi-grained context compression and query-aware information acquisition. SharedLLM comprises two stacked short-context LLMs: a lower model serving as a compressor and an upper model acting as a decoder. The lower model compresses long inputs into compact, multi-grained representations, which are then forwarded to the upper model for context-aware processing. To maximize efficiency, this information transfer occurs exclusively at the lowest layers, bypassing lengthy forward passes and redundant cross-attention operations. This entire process, wherein the upper and lower models are derived from the same underlying LLM layers, is termed~\textit{self-injection}. To support this architecture, a specialized tree-based data structure enables the efficient encoding and query-aware retrieval of contextual information. Despite being trained on sequences of only 8K tokens, \modelname~effectively generalizes to inputs exceeding 128K tokens. Across a comprehensive suite of long-context modeling and understanding benchmarks, \modelname~achieves performance superior or comparable to strong baselines, striking an optimal balance between efficiency and accuracy. Furthermore, these design choices allow \modelname~to substantially reduce the memory footprint and yield notable inference speedups (2× over streaming and 3× over encoder-decoder architectures).

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2603.04759")

Code

Syntology Ran 8 of 21 code samples harvested from 1 repository linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 5 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: found in paper text by Syntology: 21 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Clement25/SharedLLM found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

21 samples harvested; 8 ran; 1 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
5ran · our draft was wrong
1ran · fixture could not drive it
13unverified

Licence: 21 of the 21 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Clement25/SharedLLM. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

apply_rotary_pos_emb Clement25/SharedLLM/modeling/modeling_llama_sharedllm_flash.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · f725bc2d76076485 · report
count_score Clement25/SharedLLM/LongBenchTest/metrics.py found in paper text by Syntology ran · honoured contract fingerprinted no licence file found · pointer only · b349b79d9cc2934b · report
normalize_answer Clement25/SharedLLM/LongBenchTest/metrics.py found in paper text by Syntology ran · our draft was wrong fingerprinted no licence file found · pointer only · e7e75981cb464788 · report
normalize_answer Clement25/SharedLLM/utils.py found in paper text by Syntology ran · our draft was wrong fingerprinted no licence file found · pointer only · 6c668580324cfd97 · report
normalize_zh_answer Clement25/SharedLLM/LongBenchTest/metrics.py found in paper text by Syntology ran · our draft was wrong fingerprinted no licence file found · pointer only · 8c5c581f9264c810 · report
post_process Clement25/SharedLLM/LongBenchTest/pred.py found in paper text by Syntology ran · violated contract fingerprinted no licence file found · pointer only · 4489113b536ca6eb · report
remove_citations Clement25/SharedLLM/utils.py found in paper text by Syntology ran · our draft was wrong fingerprinted no licence file found · pointer only · 5df8b525aada9853 · report
rotate_half Clement25/SharedLLM/modeling/modeling_llama_sharedllm_flash.py found in paper text by Syntology ran · our draft was wrong fingerprinted no licence file found · pointer only · b99eea6376d1e212 · report
add_eos Clement25/SharedLLM/data_beacon.py found in paper text by Syntology unverified no licence file found · pointer only · be4b1c17cda256bb · report
apply_rotary_pos_emb_single Clement25/SharedLLM/modeling/modeling_llama_sharedllm_flash.py found in paper text by Syntology unverified no licence file found · pointer only · e8582b3a91d38ecb · report
are_elements_of_same_length Clement25/SharedLLM/data_beacon.py found in paper text by Syntology unverified no licence file found · pointer only · 1a27d72ff0a9a025 · report
build_chat Clement25/SharedLLM/LongBenchTest/summ/compress.py found in paper text by Syntology unverified no licence file found · pointer only · 04b0e165da9a0405 · report
build_chat Clement25/SharedLLM/LongBenchTest/pred.py found in paper text by Syntology unverified no licence file found · pointer only · 9fc77302e79f7b27 · report
f1_score Clement25/SharedLLM/utils.py found in paper text by Syntology unverified no licence file found · pointer only · 27f9fcd2b79fea52 · report
get_max_length_in_nested_lists Clement25/SharedLLM/data_beacon.py found in paper text by Syntology unverified no licence file found · pointer only · 74dab428120d8998 · report
get_word_len Clement25/SharedLLM/LongBenchTest/summ/compress.py found in paper text by Syntology unverified no licence file found · pointer only · 03bffbf21c24cb7b · report
get_word_list Clement25/SharedLLM/LongBenchTest/summ/compress.py found in paper text by Syntology unverified no licence file found · pointer only · b80b1e9bf939544f · report
load_data Clement25/SharedLLM/dataset_utils.py found in paper text by Syntology unverified no licence file found · pointer only · 45d38779c4dcf77e · report
load_qa_templates Clement25/SharedLLM/dataset_utils.py found in paper text by Syntology unverified no licence file found · pointer only · c1dc7ad8978154d9 · report
parse_args Clement25/SharedLLM/LongBenchTest/pred.py found in paper text by Syntology unverified no licence file found · pointer only · 0dcb2bf78dd172f3 · report
preprocess_alce Clement25/SharedLLM/dataset_utils.py found in paper text by Syntology unverified no licence file found · pointer only · 6ec1f8f1d608c575 · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2603.04759, was issued in March 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections