atlas

Research map / Large language models / Reasoning and chain of thought

Mesa-Extrapolation: A Weave Position Encoding Method for Enhanced Extrapolation in LLMs

NeurIPS 2024 · Large language models › Reasoning and chain of thought · approach: Efficient LLM serving · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Mesa-Extrapolation, a training-free weave-PE method that chunks the input into a triangular attention layout and applies Stair PE to the final chunk to extend LLM context beyond the max training length with lower memory and linear decoding cost.

Problem

LLMs' inference ability sharply declines beyond their maximum training length (the length extrapolation problem), and existing extrapolation fixes either need fine-tuning or incur quadratic memory and time cost or discard tokens.

Approach

Introduces Stair PE, a weave function that keeps relative positions exact up to N and then increases them in fixed-width steps, combined with a chunk-based triangular attention matrix whose last chunk uses Stair PE; the authors give theory that weave PE lets hidden states stay above a threshold beyond the effective window.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use Mesa-Extrapolation instead of the unmodified model for inputs beyond the training windowLLaMA2-7B-Chat · GovReport, 5k–11kROUGE-1/ROUGE-2/ROUGE-LHelped
Use Mesa-Extrapolation instead of Dynamic-NTKLLaMA2-7B-Chat · GovReport, 3k–11kROUGE-1/ROUGE-2/ROUGE-LMixed
Use Mesa-Extrapolation instead of ReRoPE or Leaky-ReRoPELLaMA2-7B-Chat · GovReport, 1k–11kBLEUMixed
Use chunk-based triangular attention with Stair PEMesa-Extrapolation · Long-context inferencememory usageHelped
Use chunk-based triangular attention with Stair PEMesa-Extrapolation · Long-context inferencedecoding timeHelped
Apply Mesa-Extrapolation instead of OriginLLaMA models · Passkey retrieval beyond maximum training lengthaccuracyHelped
Apply Mesa-Extrapolation instead of ReRoPE or Leaky-ReRoPELLaMA models · Passkey retrievalmaximum extrapolation lengthHelped
Apply Mesa-Extrapolation to MPT-7BMPT-7B · Passkey retrieval beyond maximum training lengthaccuracyHurt
Apply Mesa-Extrapolation instead of other methodsMPT-7B · LongEval LinesaccuracyHelped
Apply Mesa-ExtrapolationPyThia-6.9B · LongEval LinesaccuracyHurt

Surprising findings

Limitations

Experimental setup

Datasets: Pile GovReport LongBench LongEval generated passkey dataset

Benchmarks: passkey retrieval Pile perplexity GovReport ROUGE/BLEU LongEval lines

Metrics: accuracy NLL/perplexity ROUGE-1/2/L BLEU memory usage decoding latency

Baselines: Origin ReRoPE Leaky-ReRoPE Dynamic-NTK LM-Infinite Streaming-LLM

Builds on: RoPE ALiBi ReRoPE Leaky-ReRoPE Self-Extend

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy