Skip to content

Extend transformer context windows with RoPE, YaRN, ALiBi, and position interpolation techniques.

CCM score
59 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers rotary embeddings, attention biases, interpolation methods, and extrapolation strategies for long-document LLM processing
  • Includes runnable PyTorch sketches for RotaryEmbedding, apply_rotary_pos_emb, get_alibi_slopes, and create_alibi_bias
  • Shows a LLaMA position-interpolation setup via rope_scaling with linear and dynamic factors, plus a method comparison table
  • Designed for extending pre-trained models beyond original context limits, or for training models with length extrapolation

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill long-context -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Long Context: Extending Transformer Context Windows

When to Use This Skill

Use Long Context techniques when you need to:

  • Process long documents (32k, 64k, 128k+ tokens) with transformer models
  • Extend context windows of pre-trained models (LLaMA, Mistral, etc.)
  • Implement efficient positional encodings (RoPE, ALiBi)
  • Train models with length extrapolation capabilities
  • Deploy models that handle variable-length inputs efficiently
  • Fine-tune existing models for longer contexts with minimal compute

Key Techniques: RoPE (Rotary Position Embeddings), YaRN, ALiBi (Attention with Linear Biases), Position Interpolation

Papers: RoFormer (arXiv 2104.09864), YaRN (arXiv 2309.00071), ALiBi (arXiv 2108.12409), Position Interpolation (arXiv 2306.15595)

Installation

# HuggingFace Transformers (includes RoPE, YaRN support)
pip install transformers torch

# For custom implementations
pip install einops  # Tensor operations
pip install rotary-embedding-torch  # Standalone RoPE

# Optional: FlashAttention for efficiency
pip install flash-attn --no-build-isolation

Quick Start

RoPE (Rotary Position Embeddings)

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI Agents & LLM Apps, Data Science & Analytics
First seen
Jun 3, 2026

Questions

What is long-context?

long-context is an agent skill listed on Claude Marketplaces in the AI Agents & LLM Apps category. The listing describes long-context like this: Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques.

How do I install long-context?

Run npx -y skills add orchestra-research/ai-research-skills --skill long-context -y in a project to install long-context. After that, the agent can use long-context in that project.

Which category is long-context in?

long-context is in the AI Agents & LLM Apps category on Claude Marketplaces. Other listings in that category next to long-context include microsoft-foundry, azure-ai and google-agents-cli-adk-code.

Where is the source code of long-context?

The source code of long-context is on GitHub at https://github.com/orchestra-research/ai-research-skills. The orchestra-research account on GitHub publishes long-context.

More from orchestra-research/ai-research-skills

All 92

Similar to Long Context

More AI Agents & LLM Apps