[ACL 2026] LaMPE: Length-aware Multi-grained Positional Encoding for Adaptive Long-context Scaling Without Training
LaMPE contains evaluation scripts for long-context position mapping experiments across RULER, InfiniteBench, LongBench, and LEval.
ruler/: RULER data preparation and evaluation scripts.InfiniteBench/: InfiniteBench evaluation scripts and task data.longbench_eval/LongBench-main/: LongBench prediction and evaluation scripts.LEval/: LEval baselines, data, and evaluation scripts.run_all.sh: top-level launcher for the benchmark scripts.
Run one benchmark group:
bash run_all.sh ruler
bash run_all.sh infinitebench
bash run_all.sh longbench
bash run_all.sh levalRun all benchmark groups in sequence:
bash run_all.sh allModel paths, data paths, output directories, and Conda environments can be configured with environment variables such as LLAMA_MODEL_PATH, LONGBENCH_DATA_DIR, RULER_OUTPUT_DIR, CONDA_PROFILE, and LAMPE_CONDA_ENV.
Install the tested core environment:
pip install -r requirements.txtKey package versions are pinned from the development environment:
torch==2.0.1transformers==4.43.3flash-attn==2.5.6accelerate==1.3.0datasets==3.6.0evaluate==0.4.3
Benchmark-specific requirements are also kept in InfiniteBench/requirements.txt and longbench_eval/LongBench-main/requirements.txt.
Large benchmark inputs are not committed to this repository. Set INFINITEBENCH_DATA_DIR, LONGBENCH_DATA_DIR, and LONGBENCH_E_DATA_DIR to point to local copies of the corresponding benchmark data before running evaluations.