SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.07138 · NeurIPS · 2024

An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encoding

Tong Wu, Yanpeng Zhao

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.07138.json · badge: /api/ran/2406.07138.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
bigai-nlco/cream canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
FunctionStatusWhere it lives
LlamaYaRNScaledRotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
bigai-nlco/cream/src/my_flash_modeling_llama.py
pointer only (licence: NONE) · get_code("b6c738c248f2c092")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bigai-nlco/cream when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_yarn_find_correction_dim Ran
ran, honoured the contract we drafted
bigai-nlco/cream/src/my_flash_modeling_llama.py
pointer only (licence: NONE) · get_code("55979cfafb52e292")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bigai-nlco/cream when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_yarn_find_correction_range Ran
ran, honoured the contract we drafted
bigai-nlco/cream/src/my_flash_modeling_llama.py
pointer only (licence: NONE) · get_code("865433623de706f3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bigai-nlco/cream when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_yarn_get_mscale Ran
ran, honoured the contract we drafted
bigai-nlco/cream/src/my_flash_modeling_llama.py
pointer only (licence: NONE) · get_code("73912c53aaa16b02")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bigai-nlco/cream when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_yarn_linear_ramp_mask Ran
ran, honoured the contract we drafted
bigai-nlco/cream/src/my_flash_modeling_llama.py
pointer only (licence: NONE) · get_code("5c2707e010f48e5d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bigai-nlco/cream when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
_yarn_find_correction_dim
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.03157 (2024-07)
Let the Code LLM Edit Itself When You Edit the Code
_yarn_find_correction_range
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.03157 (2024-07)
Let the Code LLM Edit Itself When You Edit the Code
_yarn_get_mscale
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.03157 (2024-07)
Let the Code LLM Edit Itself When You Edit the Code
_yarn_linear_ramp_mask
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.03157 (2024-07)
Let the Code LLM Edit Itself When You Edit the Code

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recently, many methods have been developed to extend the context length of pre-trained large language models (LLMs), but they often require fine-tuning at the target length (≫ 4K) and struggle to effectively utilize information from the middle part of the context. To address these issues, we propose Continuity-Relativity indExing with gAussian Middle (CREAM), which interpolates positional encodings by manipulating position indices. Apart from being simple, CREAM is training-efficient: it only requires fine-tuning at the pre-trained context window (e.g., Llama 2-4K) and can extend LLMs to a much longer target context length (e.g., 256K). To ensure that the model focuses more on the information in the middle, we introduce a truncated Gaussian to encourage sampling from the middle part of the context during fine-tuning, thus alleviating the "Lost-in-the-Middle" problem faced by long-context LLMs. Experimental results show that CREAM successfully extends LLMs to the target length for both Base and Chat versions of Llama2-7B with "Never Miss A Beat". Our code is publicly available at https://github.com/bigai-nlco/cream.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.07138")
get_code_for_paper("2406.07138")
have("2406.07138")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.07138.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.07138.svg)](https://syntology.ai/paper/2406.07138)

Connect an agent — have() is free.