Tiếp theoHướng dẫn tiếp theo
Bối cảnh dài so với RAG
Ngôn ngữ AI
HƯỚNG DẪN AI về ngôn ngữ
Long-context modeling studies how Transformer-based language models process larger input sequences.
Nghe hướng dẫn nàyAI thuật lại · ~2 min
A model’s advertised context window is a token limit, while effective use depends on attention computation, position handling and retrieval performance across the input.
The Transformer’s standard self-attention computes interactions across token positions, and its attention computation grows quadratically with sequence length. FlashAttention is an exact, IO-aware attention algorithm that uses tiling to reduce reads and writes between GPU memory levels; it does not remove the underlying attention relationships. Rotary position embeddings (RoPE) encode token positions. Position Interpolation is a paper-specific method that rescales positions to extend context in RoPE-based pretrained models and is evaluated on tasks such as retrieval and long-document summarization. The Lost in the Middle study finds position-sensitive performance on long-context QA and retrieval tasks. RULER extends simple needle retrieval with multi-hop tracing and aggregation. Prompt Cache studies reusing attention state for reusable prompt segments. These are distinct methods with different assumptions; longer context limits do not ensure reliable use of all supplied information.
Testing document question answering with relevant passages moved to different positions in the context.
Evaluating long-context models on multi-hop tracing and aggregation tasks, not only a single fact-retrieval prompt.
Applying IO-aware attention kernels to reduce attention-memory traffic.
Reusing attention state for repeated prompt segments where the serving method supports it.
Effective context should be measured with task-specific tests across positions and sequence lengths. The Lost in the Middle and RULER studies show why a stated context window alone is insufficient evidence of retrieval or reasoning quality. Report model, task, length, latency and cost when comparing context methods.
Bản tin miễn phí
Ba câu chuyện AI đã được xác minh vào mỗi buổi sáng các ngày trong tuần, được viết bằng tiếng Anh đơn giản. Miễn phí mãi mãi, không có quảng cáo.
Một email mỗi ngày trong tuần. Hủy đăng ký trong một cú nhấp chuột. Chúng tôi không bao giờ bán hoặc chia sẻ địa chỉ của bạn.
Tự kiểm tra
Phản hồi tức thì về mọi câu trả lời và chứng chỉ có thể chia sẻ với ID có thể xác minh sau khi bạn vượt qua khóa học.
Hỗ trợ giáo dục AI miễn phí. AI Understanding là tổ chức phi lợi nhuận 501(c)(3) — không bao giờ có quảng cáo, không có tường phí. Hãy quyên góp
Long-context modeling studies how Transformer-based language models process larger input sequences. A model’s advertised context window is a token limit, while effective use depends on attention computation, position handling and retrieval performance across the input.
Cửa sổ ngữ cảnh là ngân sách mã thông báo mà mô hình có thể đọc và suy luận đồng thời trong một lần chuyển tiếp.
Tự chú ý so sánh mọi mã thông báo với mọi mã thông báo khác, do đó, tỷ lệ chi phí là O(n bình phương) trong độ dài chuỗi n.
Các nghiên cứu cho thấy độ chính xác khi truy xuất giảm xuống đối với nội dung được đặt ở giữa một ngữ cảnh dài, do đó, chỉ độ dài thôi không đảm bảo cho việc ghi nhớ.
FlashAttention tính toán sự chú ý trong các ô mà không cụ thể hóa toàn bộ ma trận chú ý trong bộ nhớ, giúp giảm chi phí bộ nhớ cho các chuỗi dài.
RoPE encodes position. Position Interpolation is one specific method that rescales positions to extend tested RoPE-based models; the result is model- and task-dependent.
Tiếp tục học hỏi
Đã chọn thêm hướng dẫn cho chủ đề này
Tiếp theoHướng dẫn tiếp theo
Bối cảnh dài so với RAG
Ngôn ngữ AI