context-degradation

Recognize patterns of context failure: lost-in-middle, poisoning, distraction, and clash

Author

Install

Hot:7

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-context-degradation&locale=en&source=copy

Context Degradation - AI Context Degradation Pattern Recognition Skill

Skill Overview


Context Degradation helps developers identify and diagnose performance degradation patterns of large language models in long-context scenarios, including lost-in-middle effects, context poisoning, distractions, and conflicts, providing guidance for designing degradation-resistant AI systems.

Applicable Scenarios

1. AI Agent Long-Conversation Performance Diagnosis


Use this skill to analyze whether context degradation is occurring when an agent's performance declines over multiple turns, output quality becomes unstable, or it begins to forget earlier instructions. It is especially suitable for debugging AI assistants in production that need to track conversation history and execute complex task sequences.

2. Production System Context Architecture Design


When designing enterprise-grade AI applications, evaluate the effectiveness of different context management strategies. Help architects decide between direct long-context input, retrieval augmentation, sub-agent isolation, or hybrid approaches to balance performance, cost, and reliability.

3. Context Engineering and Optimization Research


Suitable for AI researchers and engineers who study context window utilization efficiency, test degradation thresholds of different models, and validate the practical effects of mitigation techniques such as compaction, masking, and partitioning.

Core Functions

1. Degradation Pattern Identification and Diagnosis


Identify five major context degradation patterns: Lost-in-Middle (middle information is ignored), Context Poisoning (incorrect information reinforced through repeated referencing), Context Distraction (irrelevant information divides attention), Context Confusion (confusion caused by switching task types), and Context Clash (conflicting pieces of information). Provides symptom checklists to help locate specific issues.

2. Model Degradation Threshold References


Provide empirical degradation benchmark data for mainstream large models, including the degradation onset points (approximately 64K–500K tokens) and severe degradation points for models such as GPT-5.2, Claude Opus 4.5, Claude Sonnet 4.5, Gemini 3 Pro/Flash. These data are based on authoritative benchmarks such as RULER and help in choosing appropriate models and context strategies.

3. Architectural Mitigation Strategy Guidance


Offer four core mitigation strategies: Write (save context outside the window), Select (retrieve relevant context), Compress (summarize and abstract/compress), and Isolate (partition context across sub-agents). Each strategy comes with concrete architectural patterns and practical examples.

Frequently Asked Questions

What is the AI "lost in middle" phenomenon?


Lost-in-Middle refers to the behavior where a large language model pays more attention to the beginning and end of the context while the recall accuracy for middle portions of the context significantly decreases. Studies indicate that recall accuracy for middle information can be 10–40% lower than for the head and tail. This is due to the allocation characteristics of the attention mechanism—the model allocates a lot of attention to the BOS token as an "attention sink," and as context grows, middle tokens receive insufficient attention weight.

How to detect if an AI agent is experiencing context degradation?


Observe the following symptoms: tasks that were previously completed correctly begin to fail or decline in quality; called tools or parameters do not match task requirements; persistent hallucinations appear in outputs and repeat even after correction; the model seems to ignore explicitly given instructions. If these symptoms are correlated with increasing context length (for example, from 8K to 60K+ tokens), context degradation is likely occurring.

Which large models perform best under long contexts?


According to 2025 benchmark data: Gemini 3 Pro has the highest degradation threshold (degradation begins at about 500K) and supports a 1M context window; Claude Opus 4.5 begins degrading around 100K but has the lowest hallucination rate and a conservative refusal policy; GPT-5.2 begins degrading around 64K but its thinking mode can reduce hallucinations through stepwise verification. When choosing, consider task type—prioritize Claude for high accuracy, Gemini for ultra-long context needs, and GPT-5.2 thinking mode for inference-intensive tasks.

    Context Degradation - AI Context Degradation Pattern Recognition and Optimization Guide - Open Skills