Research

Paper

AI LLM February 25, 2026

An Evaluation of Context Length Extrapolation in Long Code via Positional Embeddings and Efficient Attention

Authors

Madhusudan Ghosh, Rishabh Gupta

Abstract

The rapid advancement of large language models (LLMs) has led to a significant increase in automated tools in the software engineering, capable of performing various code-related tasks such as code generation, completion, and translation. Despite these advancements, its effectiveness is constrained by fixed context lengths, limiting its ability to generalize across long, domain-specific code sequences. To address this challenge, we investigate zero-shot, inference-only methods aimed at improving position encodings and optimizing attention mechanisms. Our goal is to provide a thorough analysis of current approaches that facilitate context length extrapolation in code, particularly in the context of long code completion tasks.

Metadata

arXiv ID: 2602.21800
Provider: ARXIV
Primary Category: cs.SE
Published: 2026-02-25
Fetched: 2026-02-26 05:00

Related papers

Raw Data (Debug)
{
  "raw_xml": "<entry>\n    <id>http://arxiv.org/abs/2602.21800v1</id>\n    <title>An Evaluation of Context Length Extrapolation in Long Code via Positional Embeddings and Efficient Attention</title>\n    <updated>2026-02-25T11:27:34Z</updated>\n    <link href='https://arxiv.org/abs/2602.21800v1' rel='alternate' type='text/html'/>\n    <link href='https://arxiv.org/pdf/2602.21800v1' rel='related' title='pdf' type='application/pdf'/>\n    <summary>The rapid advancement of large language models (LLMs) has led to a significant increase in automated tools in the software engineering, capable of performing various code-related tasks such as code generation, completion, and translation. Despite these advancements, its effectiveness is constrained by fixed context lengths, limiting its ability to generalize across long, domain-specific code sequences. To address this challenge, we investigate zero-shot, inference-only methods aimed at improving position encodings and optimizing attention mechanisms. Our goal is to provide a thorough analysis of current approaches that facilitate context length extrapolation in code, particularly in the context of long code completion tasks.</summary>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.SE'/>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.AI'/>\n    <published>2026-02-25T11:27:34Z</published>\n    <arxiv:primary_category term='cs.SE'/>\n    <author>\n      <name>Madhusudan Ghosh</name>\n    </author>\n    <author>\n      <name>Rishabh Gupta</name>\n    </author>\n  </entry>"
}