SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.10400 · ICLR · 2024

PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training

Dawei Zhu, Liang, Nan Yang, Yifan Song, Wenhao Wu, ♡ Furu, Sujian Li, Msra Li

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2309.10400.json · badge: /api/ran/2309.10400.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
dwzhu-pku/pose canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
train_preprocess_function_pi Ran
ran; our contract draft was wrong, not the code
dwzhu-pku/pose/src/train_pose.py
code served (permissive licence) · get_code("b1e7a91e8f004527")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Stand-in tokenizer that mimics HuggingFace tokenizer behavior
class StandInTokenizer:
    def __call__(self, texts, padding=False, truncation=False, max_length=None):
        # Return a dict with 'input_ids' key containing token sequences
        if isinstance(texts, str):
            texts = [texts]
        
        input_ids = []
        for text in texts:
            # Simple mock: convert text length to token count
            tokens = [101, 2054, 2003, 1045] + [103] * max(0, len(text) - 4)
            if max_length and len(tokens) > max_length:
                tokens = tokens[:max_length]
            input_ids.append(tokens)
        
        return {
            'input_ids': input_ids,
            'attention_mask': [[1] * len(ids) for ids in input_ids]
        }

# Create example data
examples = {
    'text': ['hello world', 'this is a test']
}

# Create tokenizer
tokenizer = StandInTokenizer()

# Set position embedding parameters
scaled_max_position_embeddings = 8
model_max_position_embeddings = 512

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'scaled_max_position_embeddings': scaled_max_position_embeddings,
    'model_max_position_embeddings': model_max_position_embeddings
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_preprocess_function_pose Ran
ran; our contract draft was wrong, not the code
dwzhu-pku/pose/src/train_pose.py
code served (permissive licence) · get_code("bf446254dc4125e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import random

torch.manual_seed(0)
random.seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __call__(self, texts, padding=False, truncation=False, max_length=None):
        # Return a dict with 'input_ids' key containing token sequences
        # Make sequences of varying lengths to test the chunking logic
        input_ids = []
        for text in texts:
            # Create token sequences of different lengths
            seq_len = random.randint(20, 40)
            tokens = [random.randint(100, 1000) for _ in range(seq_len)]
            input_ids.append(tokens)
        return {'input_ids': input_ids}

# Create example data
examples = {
    'text': [
        'This is the first example text for testing the preprocessing function.',
        'This is the second example text with different content for the model.'
    ]
}

# Create tokenizer instance
tokenizer = MinimalTokenizer()

# Set parameters
scaled_max_position_embeddings = 128
model_max_position_embeddings = 32

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'scaled_max_position_embeddings': scaled_max_position_embeddings,
    'model_max_position_embeddings': model_max_position_embeddings
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_preprocess_function_pose Ran
ran; our contract draft was wrong, not the code
dwzhu-pku/pose/src/train_pose.py
code served (permissive licence) · get_code("694357d45a3a5b27")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import random

torch.manual_seed(0)
random.seed(0)

class SimpleTokenizer:
    def __call__(self, texts, padding=False, truncation=False, max_length=None):
        # Return a dict with 'input_ids' key containing lists of token ids
        # Create variable-length sequences for testing
        input_ids = []
        for text in texts:
            # Create a sequence of token ids based on text length
            seq_len = min(len(text) * 3, max_length) if max_length else len(text) * 3
            token_ids = list(range(1, seq_len + 1))
            input_ids.append(token_ids)
        return {'input_ids': input_ids}

# Create example data
examples = {
    'text': ['hello world', 'this is a test']
}

# Create tokenizer
tokenizer = SimpleTokenizer()

# Set parameters
scaled_max_position_embeddings = 32
model_max_position_embeddings = 16

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'scaled_max_position_embeddings': scaled_max_position_embeddings,
    'model_max_position_embeddings': model_max_position_embeddings
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_preprocess_function_randomized Ran
ran; our contract draft was wrong, not the code
dwzhu-pku/pose/src/train_pose.py
code served (permissive licence) · get_code("13ff067830de686c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import random

torch.manual_seed(0)
random.seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __call__(self, texts, padding=False, truncation=False, max_length=None):
        # Return a dict with 'input_ids' key containing token sequences
        # Each text gets tokenized into a small sequence
        input_ids = []
        for text in texts:
            # Simple mock tokenization: convert text length to token count
            tokens = [101] + [1000 + i for i in range(min(3, len(text)))] + [102]
            if max_length and len(tokens) > max_length:
                tokens = tokens[:max_length]
            input_ids.append(tokens)
        return {'input_ids': input_ids}

# Create example data
examples = {
    'text': ['hello world', 'foo bar baz']
}

# Create tokenizer
tokenizer = MinimalTokenizer()

# Set parameters
scaled_max_position_embeddings = 8
model_max_position_embeddings = 512

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'scaled_max_position_embeddings': scaled_max_position_embeddings,
    'model_max_position_embeddings': model_max_position_embeddings
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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.

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

Repositories linked to this paper

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

Abstract

Large Language Models (LLMs) are trained with a pre-defined context length, restricting their use in scenarios requiring long inputs. Previous efforts for adapting LLMs to a longer length usually requires fine-tuning with this target length (Fulllength fine-tuning), suffering intensive training cost. To decouple train length from target length for efficient context window extension, we propose Positional Skip-wisE (PoSE) training that smartly simulates long inputs using a fixed context window. This is achieved by first dividing the original context window into several chunks, then designing distinct skipping bias terms to manipulate the position indices of each chunk. These bias terms and the lengths of each chunk are altered for every training example, allowing the model to adapt to all positions within target length. Experimental results show that PoSE greatly reduces memory and time overhead compared with Full-length fine-tuning, with minimal impact on performance. Leveraging this advantage, we have successfully extended the LLaMA model to 128k tokens using a 2k training context window. Furthermore, we empirically confirm that PoSE is compatible with all RoPE-based LLMs and position interpolation strategies. Notably, our method can potentially support infinite length, limited only by memory usage in inference. With ongoing progress for efficient inference, we believe PoSE can further scale the context window beyond 128k.

For agents

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

get_harvested_code_for_paper("2309.10400")
get_code_for_paper("2309.10400")
have("2309.10400")

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

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

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

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

Connect an agent — have() is free.