Skillpedia
الوكلاء48k · #4250

context-degradation

ما الذي تفعله

تساعد هذه المهارة على فهم كيف قد تعاني نماذج الذكاء الاصطناعي عندما تُعطى معلومات كثيرة دفعة واحدة. تشرح أنماط «تدهور السياق»، أي الطرق التي قد يبدأ بها الذكاء الاصطناعي بالفشل أو تقديم إجابات خاطئة كلما طال النص الذي تقدمه له.

متى تستخدمها

  • ✓عندما يبدأ الذكاء الاصطناعي بتقديم إجابات غريبة في المحادثات الطويلة.
  • ✓عندما أريد معرفة سبب ارتكاب الذكاء الاصطناعي للأخطاء أو قوله أشياء غير منطقية.
  • ✓عندما أبني أنظمة ذكاء اصطناعي تحتاج إلى التعامل مع نصوص كثيرة بموثوقية.

رابط المهارة

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/context-degradation/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/context-degradation/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“لماذا ينسى الذكاء الاصطناعي المعلومات التي أعطيته إياها في بداية محادثتنا؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يعمل الذكاء الاصطناعي كدماغ له ذاكرة محدودة. وعندما يطول النص، قد يجد صعوبة في تذكر كل شيء، خاصةً ما هو في المنتصف. وهناك أنماط يمكن التنبؤ بها لهذه «مشكلات النسيان» يمكن دراستها.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Context Degradation Patterns

Language models exhibit predictable degradation patterns as context length increases. Understanding these patterns is essential for diagnosing failures and designing resilient systems. Context degradation is not a binary state but a continuum of performance degradation that manifests in several distinct ways.

When to Use

Activate this skill when:

  • Agent performance degrades unexpectedly during long conversations
  • Debugging cases where agents produce incorrect or irrelevant outputs
  • Designing systems that must handle large contexts reliably
  • Evaluating context engineering choices for production systems
  • Investigating "lost in middle" phenomena in agent outputs
  • Analyzing context-related failures in agent behavior

Core Concepts

Context degradation manifests through several distinct patterns. The lost-in-middle phenomenon causes information in the center of context to receive less attention. Context poisoning occurs when errors compound through repeated reference. Context distraction happens when irrelevant information overwhelms relevant content. Context confusion arises when the model cannot determine which context applies. Context clash develops when accumulated information directly conflicts.

These patterns are predictable and can be mitigated through architectural patterns like compaction, masking, partitioning, and isolation.

Detailed Topics

The Lost-in-Middle Phenomenon

The most well-documented degradation pattern is the "lost-in-middle" effect, where models demonstrate U-shaped attention curves. Information at the beginning and end of context receives reliable attention, while information buried in the middle suffers from dramatically reduced recall accuracy.

Empirical Evidence Research demonstrates that relevant information placed in the middle of context experiences 10-40% lower recall accuracy compared to the same information at the beginning or end. This is not a failure of the model but a consequence of attention mechanics and training data distributions.

Models allocate massive attention to the first token (often the BOS token) to stabilize internal states. This creates an "attention sink" that soaks up attention budget. As context grows, the limited budget is stretched thinner, and middle tokens fail to garner sufficient attention weight for reliable retrieval.

Practical Implications Design context placement with attention patterns in mind. Place critical information at the beginning or end of context. Consider whether information will be queried directly or needs to support reasoning—if the latter, placement matters less but overall signal quality matters more.

For long documents or conversations, use summary structures that surface key information at attention-favored positions. Use explicit section headers and transitions to help models navigate structure.

Context Poisoning

Context poisoning occurs when hallucinations, errors, or incorrect information enters context and compounds through repeated reference. Once poisoned, context creates feedback loops that reinforce incorrect beliefs.

How Poisoning Occurs Poisoning typically enters through three pathways. First, tool outputs may contain errors or unexpected formats that models accept as ground truth. Second, retrieved documents may contain incorrect or outdated information that models incorporate into reasoning. Third, model-generated summaries or intermediate outputs may introduce hallucinations that persist in context.

The compounding effect is severe. If an agent's goals section becomes poisoned, it develops strategies that take substantial effort to undo. Each subsequent decision references the poisoned content, reinforcing incorrect assumptions.

Detection and Recovery Watch for symptoms including degraded output quality on tasks that previously succeeded, tool misalignment where agents call wrong tools or parameters, and hallucinations that persist despite correction attempts. When these symptoms appear, consider context poisoning.

Recovery requires removing or replacing poisoned content. This may involve truncating context to before the poisoning point, explicitly noting the poisoning in context and asking for re-evaluation, or restarting with clean context and preserving only verified information.

Context Distraction

…

الأسئلة الشائعة

ما هي ظاهرة «الضياع في المنتصف» (lost-in-middle)؟

هي أن الذكاء الاصطناعي ينتبه أكثر للمعلومات في بداية النص ونهايته، وينسى أو يتجاهل ما يقع في المنتصف.

ما هو «تسميم السياق» (context poisoning)؟

يحدث عندما تدخل معلومات خاطئة أو مختلقة إلى نص الذكاء الاصطناعي، فيبدأ بتصديقها، فتسوء إجاباته مع الوقت.

كيف أمنع الذكاء الاصطناعي من التشتت بمعلومات غير مفيدة؟

اختر بعناية ما تضعه في نص الذكاء الاصطناعي. احذف المعلومات غير المهمة قبل إرسالها إليه، أو نظّم النص بحيث يسهل تجاهل الأجزاء غير المهمة.

التفاصيل

الوصف الأصلي من المؤلف

Language models exhibit predictable degradation patterns as context length increases. Understanding these patterns is essential for diagnosing failures and designing resilient systems.

repo: sickn33/agentic-awesome-skills

الشعبية

نجوم GitHub
48k
الترتيب
#4250
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة