Toolverse
All skills

long-context

by davila7

Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques. Use when processing long documents (32k-128k+ tokens), extending pre-trained models beyond original context limits, or implementing efficient positional encodings. Covers

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
davila7
Category
Security

About this skill

Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques. Use when processing long documents (32k-128k+ tokens), extending pre-trained models beyond original context limits, or implementing efficient positional encodings. Covers rotary embeddings, attention biases, interpolation methods, and extrapolation strategies for LLMs.

How to use

  1. Zainstaluj wymagane biblioteki: pip install transformers torch. Dla dodatkowych możliwości dodaj einops (operacje tensorowe) oraz rotary-embedding-torch (samodzielna implementacja RoPE). Opcjonalnie zainstaluj flash-attn dla lepszej wydajności: pip install flash-attn --no-build-isolation.

  2. Zaimportuj moduł RotaryEmbedding z biblioteki transformers lub użyj samodzielnej implementacji. Moduł ten obsługuje rotacyjne osadzenia pozycji, które są kluczowe do rozszerzenia kontekstu.

  3. Skonfiguruj model transformera, aby używał wybranej techniki: RoPE dla rotacyjnych osadzeń, YaRN dla zaawansowanej interpolacji, ALiBi dla odchyleń uwagi liniowej lub Position Interpolation dla elastycznego skalowania. Każda technika ma inne zastosowania w zależności od Twoich potrzeb.

  4. Załaduj pretrenowany model (np. LLaMA, Mistral) i zastosuj wybraną metodę rozszerzenia kontekstu. Transformers automatycznie wspiera RoPE i YaRN dla kompatybilnych modeli.

  5. Przetestuj model na długich dokumentach (32k, 64k lub 128k+ tokenów) aby sprawdzić, czy rozszerzenie kontekstu działa poprawnie. Monitoruj wydajność i zużycie pamięci.

  6. Jeśli chcesz dostroić model dla jeszcze dłuższych sekwencji, użyj Position Interpolation lub YaRN z minimalnym nakładem obliczeniowym. Dokumentacja zawiera referencje do artykułów naukowych (RoFormer, YaRN, ALiBi) z szczegółowymi algorytmami.

Related skills

zendesk

by vm0-ai

Zendesk Support REST API for managing tickets, users, organizations, and support operations. Use this skill to create tickets, manage users, search, and automate customer support workflows.

Security
11100

openapi-spec-generation

by wshobson

Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, or ensuring API contract compliance.

Security
18109

skill-writer

by pytorch

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

Security
15116

ui-audit

by openclaw

AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.

Security
1223

google-analytics

by davila7

Analyze Google Analytics data, review website performance metrics, identify traffic patterns, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization.

Security
1260

security-compliance

by davila7

Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding

Security
1172