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

Madhusudan Ghosh, Rishabh Gupta
2/25/2026
cs.SEcs.AI

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ghosh2026evaluation,
  title  = {An Evaluation of Context Length Extrapolation in Long Code via Positional Embeddings and Efficient Attention},
  author = {Madhusudan Ghosh and Rishabh Gupta},
  year   = {2026},
  eprint = {2602.21800},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.21800v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.21800.svg)](https://codeofpaper.com/paper/2602.21800)

Discussion