Chuyển đến nội dung
Skillpedia
Agent48k · #4250

context-degradation

Skill này làm gì

Công cụ này giúp hiểu cách các model AI có thể gặp khó khăn khi nhận quá nhiều thông tin cùng lúc. Nó giải thích các mẫu “suy giảm ngữ cảnh” (context degradation), tức là cách AI có thể bắt đầu thất bại hoặc trả lời sai khi văn bản bạn cung cấp quá dài.

Khi nào nên dùng

  • ✓Khi AI bắt đầu trả lời lạ trong các cuộc trò chuyện dài.
  • ✓Để tìm hiểu vì sao AI mắc lỗi hoặc nói những điều vô nghĩa.
  • ✓Khi xây dựng hệ thống AI cần xử lý lượng lớn văn bản một cách đáng tin cậy.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/context-degradation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Vì sao AI quên thông tin mà tôi đã đưa ở đầu cuộc trò chuyện?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI hoạt động như một bộ não có bộ nhớ giới hạn. Khi văn bản quá dài, nó có thể khó nhớ mọi thứ, đặc biệt là phần ở giữa. Có những mẫu có thể dự đoán được đối với các vấn đề “quên” này mà chúng ta có thể nghiên cứu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

…

Câu hỏi thường gặp

Hiện tượng “lost-in-middle” là gì?

Đó là khi AI chú ý nhiều hơn đến thông tin ở đầu và cuối văn bản bạn cung cấp, và quên hoặc bỏ qua thông tin ở giữa.

“Context poisoning” là gì?

Điều này xảy ra khi thông tin sai hoặc bịa đặt lọt vào văn bản của AI, và nó bắt đầu tin vào đó, dẫn đến câu trả lời ngày càng tệ.

Làm sao để AI không bị phân tâm bởi thông tin vô ích?

Hãy chọn kỹ những gì đưa vào văn bản cho AI. Loại bỏ thông tin không quan trọng trước khi đưa cho AI, hoặc sắp xếp văn bản để các phần không liên quan dễ bị bỏ qua.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4250
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự