---
title: "Context Window — 上下文窗口"
source: "https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3"
wiki: "systems-analysis.info/int"
article: "Context_Window_—_上下文窗口"
language: "zh"
categories:
  - "Category:Chinese"
  - "Category:Large language models"
  - "Category:Machine learning"
revision_id: 1202
wiki_created_at: 2026-09-06T22:44:57Z
wiki_modified_at: 2026-09-06T22:44:57Z
downloaded_at: 2026-09-07T22:44:36Z
---

# Context Window — 上下文窗口

**上下文窗口**（Context Window）在大型语言模型（LLM）中，指模型在生成回应时能够处理的最大文本信息量（以词元为单位）<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。换言之，它类似于模型的“工作记忆”，决定了模型能同时将多少文本（包括用户的原始请求和模型先前生成的句子）保留在上下文中<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。上下文窗口的大小以**词元**（token）为单位来衡量——词元是模型处理输入时所分割成的文本基本单元（可以是单词、单词片段或字符）<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。上下文窗口的长度直接影响生成回应的连贯性和相关性：较大的上下文允许模型更好地利用先前的信息，在长对话中保持细节，并在处理长文档时不会丢失核心思想<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

## 上下文窗口大小的演变

早期的 Transformer 语言模型具有相对较小的上下文窗口。例如，在2018-2019年，最大上下文长度约为**512-1024个词元**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。GPT-3模型（2020年）一次已能处理多达**2048个词元**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。在ChatGPT（2022年）初期，上下文限制约为**4000个词元**（约3000个单词），这限制了对话的长度——当超过约3000个单词时，聊天机器人会开始“迷失”并产生偏离主题的幻觉<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

现代旗舰模型显著提高了这一阈值：例如，GPT-4提供了**8192**和**32768个词元**窗口的版本<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>，而Anthropic公司的Claude模型在2023年实现了**10万个词元**的窗口（约7.5万个单词，即数百页文本）<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。到2024年，出现了上下文长度达到约**12.8万个词元**的模型（如Meta的LLaMA 3.1）<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>，甚至高达**100万个词元**（Google Gemini 1.5 Pro）<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。2025年，Meta宣布推出LLAMA 4 Scout，其上下文窗口达到了创纪录的**1000万个词元**<sup>[\[4\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-cloudflare-llama4-4)</sup>，相当于数万页的文本量<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。然而，如此极端的数值在很大程度上是理论性的：内存和训练数据的限制使得模型在实践中无法完全利用整个1000万词元的上下文<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。尽管如此，扩大上下文窗口的竞赛已成为LLM发展的新阶段，其重要性可与模型参数数量的增长相媲美<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

以下是一些模型的最大上下文长度示例：

- GPT-3 – 高达约2048个词元<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>
- GPT-4 – 8192个词元（标准版）和高达32768个词元（扩展版）<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>
- Anthropic Claude – 高达10万个词元<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>
- LLaMA 3.1 – 高达128000个词元<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>
- Google Gemini 1.5 Pro – 高达1,000,000个词元<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>
- Meta LLAMA 4 Scout – 声称高达10,000,000个词元<sup>[\[4\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-cloudflare-llama4-4)</sup>

上下文窗口的增长极大地扩展了模型的能力<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。如果说3.2万个词元相当于约50页文本，那么10万个词元则约为7.5万个单词<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。模型能够在数秒内处理如此大的信息量，例如分析整部小说或一份技术报告，并从中找出所需的细节<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。因此，具有长上下文的模型可以在其“记忆”中容纳整本书、大量文档集或长篇对话，从而开辟了新的应用场景——从详细的摘要和跨文档问答分析到处理大型代码片段。

## 长上下文的局限与挑战

增加上下文窗口伴随着严峻的技术和实践挑战<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。其中最主要的是**计算复杂度的组合式增长**<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。在Transformer模型中，自注意力机制的复杂度与序列长度成二次方关系：当上下文长度加倍时，所需的内存和计算量大约增加四倍<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。例如，将上下文从1024个词元增加到4096个词元，理论上会使资源消耗增加约16倍<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。这无论是在训练阶段（由于GPU内存和训练时间的限制，很难使用过长的序列）还是在推理阶段都构成了限制——长请求会显著减慢回应生成速度，并在使用商业API时增加成本<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。输入词元的处理通常是收费的，因此向模型提交的长文本会直接按比例增加回应的成本<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。

**信息过载**是另一个重要因素<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。虽然大窗口允许向模型提供更多数据，但过多的细节可能导致模型**无法在“噪音”中识别出关键信息**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。研究表明，现代LLM对相关信息的感知是不均匀的：它们倾向于更多地关注位于长上下文输入开头或结尾的事实（首因效应和近因效应），而在从大型文档中部提取知识方面表现要差得多<sup>[\[6\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-lost-in-middle-6)</sup>。用过多细节填充提示词（prompt）可能会**降低回应的准确性**<sup>[\[6\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-lost-in-middle-6)</sup>。因此，超过某个限度后，增加上下文的容量可能适得其反<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。由此产生的实践建议是，在长请求中只包含真正必要的数据，并对上下文进行结构化处理，将关键信息放在消息的开头（或结尾）附近<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

此外，实践中发现，模型的名义窗口长度与其实际**有效利用**的长度之间存在差异<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。许多模型无法在整个可用长度上都表现出色——它们的有效上下文深度远小于最大值<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。例如，在测试中，一个训练上下文为128k的LLaMA 3.1模型，对于距离开头超过约64k词元的信息几乎不会影响其回应<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。总的来说，大多数开源LLM的实际有效记忆都不到其设计上下文长度的一半<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。研究人员将此归因于训练的特性：即使模型在形式上是在长序列上进行训练的，但极远位置在数据中出现的频率远低于初始位置，导致模型**在窗口末端训练不足**<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。在典型的语料库中，极长序列的出现频率呈指数级下降<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。这种“左偏”的位置分布导致模型对近处上下文的掌握远胜于远处上下文<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。解决方案可能包括更仔细地筛选和标注训练数据，以及采用特殊方法来补偿训练不足的位置<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。总的来说，克服这一限制是一个活跃的研究领域<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。

## 扩展上下文窗口的方法

扩展LLM的上下文窗口需要结合架构和算法上的改进。现代研究中采用的主要方向包括：

- **在长序列上进行训练**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。一个直接的方法是为模型提供与期望上下文长度相当的训练样本。实践中常采用按长度的课程学习（curriculum learning）：在训练过程中逐步增加文本的大小<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。此外，还会使用梯度累积和特殊的数据预处理等技术<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。
- **优化注意力机制**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。由于标准自注意力的成本是二次方的，研究人员积极探索替代方案：稀疏注意力、滑动窗口（sliding window）、上下文的多维切分等<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。例如，**环形注意力（Ring Attention）**是IBM提出的一种注意力优化方法，可降低长序列的计算负荷<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。在IBM Granite模型中，加入环形注意力使其上下文长度得以显著增加<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。
- **改进位置编码**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。Transformer的一个关键部分是对词元位置进行编码的方式<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。经典的绝对位置编码器在超出其训练长度时外推能力较差<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。因此，对于长上下文，通常采用相对位置和其他方法<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。例如，具有128k上下文的Granite版本从绝对位置编码转向了基于**相对位置**的词元编码<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。**旋转位置编码（Rotary Positional Encoding, RoPE）**被广泛使用<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>，它能更好地保持远距离词元间的相对位置，并支持上下文扩展<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。另一种方法是线性偏置注意力（Attention with Linear Biases, ALiBi），它在注意力机制中为长距离引入线性增长的偏置<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。这些技术的组合——例如，缩放RoPE的基础频率（如LLaMA 3中所实现的）——目前被用于使模型能够支持100k+词元的窗口<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。
- **记忆与上下文压缩**<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。另一种途径不是直接增加窗口长度，而是对长输入进行**紧凑表示**<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。例如，IBM的一项技术是让一个模型使用另一个LLM生成长文本的压缩表示（摘要）<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。另一种方法是连接外部**长期记忆**或知识库：模型将其上下文窗口之外的重要事实存储起来，并在需要时加载它们<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。后一种方案已发展成为**检索增强生成（Retrieval-Augmented Generation, RAG）**等方法<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。

值得注意的是，上述每种策略都有其代价<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。在长上下文上训练需要巨大的计算资源和精心挑选的数据<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。新的注意力和位置编码机制使模型架构更加复杂，有时还会降低在短文本上的表现<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。因此，工程师必须在窗口大小、训练稳定性和最终模型性能之间进行仔细权衡<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。

## 长上下文与信息检索（RAG）的对比

LLM的最大上下文增长到数十万甚至更多词元，引发了一场关于在模型拥有如此强大能力的情况下是否还需要外部知识库和搜索算法的讨论<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。如果所有相关信息都能直接放入上下文窗口，理论上模型无需查询外部来源即可作答<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。一些研究人员推测，随着窗口的增大，诸如**检索增强生成（RAG）**这类预先从数据库中检索文本并提供给模型的方法可能会失去其意义<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。支持这一观点的论据包括检索阶段的信息损失：搜索只返回少数几个排名靠前的文档，而“提示词填充”（直接将数据包含在请求中）则允许将所有上下文信息一次性提供给模型<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。IBM研究员Pin-Yu Chen指出，如果可以直接将所有需要的书籍和文件加载到模型中，没有人会愿意费心去配置RAG<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

然而，相反的观点认为，即使是非常大的窗口也**无法消除对RAG的需求**<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。IBM的代表和其他专家强调，**数据的时效性和可控性**仍然是一个严峻的问题<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。一个拥有巨大上下文的模型仍然不知道其训练数据中未包含的信息——例如今天的新闻<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。为了按需快速整合最新信息，检索机制是必不可少的<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。此外，在企业应用中，RAG允许从受保护的存储库中有选择地提取事实，同时遵守访问权限，避免泄露不必要的机密数据<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。最后，经济因素也很重要：处理数百万词元的“空转”成本高昂，通常先找到几个真正相关的片段（从而缩短上下文）比每次都让模型阅读数千页的输入更为明智<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。由于这些原因，RAG目前仍然是AI应用的重要组成部分<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>，建议谨慎使用大型上下文窗口<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。很可能，**混合方法**——结合扩展上下文（用于以缓存形式存储常用数据，即缓存增强生成 Cache-Augmented Generation）和从外部来源选择性地检索新知识——将成为最优架构<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>。

## 应用与前景

可用上下文的增加显著扩展了语言模型能够解决的任务范围。**长文档的摘要与分析**是其直接应用之一<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。一个拥有10万词元窗口的模型能够在一个请求内阅读一份冗长的报告、一本书或技术文档，并就其内容提供摘要或回答问题<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。这在法律（解析和概述合同）、科学（自动文献综述）和商业分析等领域都有应用。例如，Claude成功处理了整本小说《了不起的盖茨比》（约72000个词元），并能在几秒钟内识别出文本中的微小修改<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。

**支持长时程对话**<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。对于聊天机器人来说，大上下文意味着能够记住数十甚至数百轮对话<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。扩展的窗口还允许在对话中整合大量的参考数据<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。

**编程与代码处理**<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>。在与源代码分析相关的任务中，长上下文被证明尤为宝贵<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>。代码通常分布在多个文件中；为了给出正确的回答，模型需要“看到”尽可能大的代码库片段<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>。IBM的研究表明，扩展上下文显著提高了模型在代码生成任务上的质量<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。拥有128k词元窗口的Granite模型能够在请求中理解大量的库文档<sup>[\[1\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-ibm-context-1)</sup>。

**多模态应用**<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。最新的模型（如前述的LLaMA 4、Gemini）是多模态的，不仅可以接收文本输入，还可以处理其他类型的数据（音频、图像、视频）<sup>[\[3\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-anthropic-100k-3)</sup>。在这种情况下，大上下文有助于例如一次性分析长音频记录（对话转录）或视频（带有描述的帧序列）<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。据报道，拥有100万词元窗口的Gemini 1.5模型能够在上下文中容纳长达**1小时的音频或3小时的视频**而不会丢失重要细节<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。这为自动转录和摘要数小时的会议、电影等开辟了前景<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。

尽管取得了令人瞩目的成就，但专家们强调，大上下文**并非万能药**<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>，而是一个需要巧妙使用的工具<sup>[\[8\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-meibel-impact-8)</sup>。它显著提高了对基础设施（内存、速度）的要求，并增加了模型部署的成本<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。因此，在开发基于LLM的系统时，建议仔细评估任务真正需要的上下文量，并结合多种方法<sup>[\[5\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-f5-rag-5)</sup>。尽管如此，趋势是显而易见的：未来的模型将致力于将更长的上下文与更高效的利用方式相结合<sup>[\[2\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-datanorth-context-2)</sup>。解决当前的问题（注意力机制的扩展、长序列训练、消除“中间遗忘”）将使新一代LLM能够处理更大量的信息，同时保持准确性和一致性<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。这将极大地扩展AI的应用边界——从全能助手到复杂的分析系统<sup>[\[7\]](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_note-arxiv-short-context-7)</sup>。

## 外部链接

- <a href="https://research.ibm.com/blog/larger-context-window" class="external text" rel="nofollow">Why larger LLM context windows are all the rage - IBM Research</a>
- <a href="https://datanorth.ai/blog/context-length" class="external text" rel="nofollow">Context Length in LLMs: What Is It and Why It Is Important - DataNorth</a>
- <a href="https://www.meibel.ai/post/understanding-the-impact-of-increasing-llm-context-windows" class="external text" rel="nofollow">Understanding the Impact of Increasing LLM Context Windows - Meibel</a>
- <a href="https://www.anthropic.com/news/100k-context-windows" class="external text" rel="nofollow">Introducing 100K Context Windows - Anthropic</a>
- <a href="https://arxiv.org/html/2307.03172" class="external text" rel="nofollow">Lost in the Middle: How Language Models Use Long Contexts (arXiv)</a>
- <a href="https://arxiv.org/html/2410.18745v1" class="external text" rel="nofollow">Why Does the Effective Context Length of LLMs Fall Short? (arXiv)</a>
- <a href="https://www.f5.com/company/blog/rag-in-the-era-of-llms-with-10-million-token-context-windows" class="external text" rel="nofollow">RAG in the Era of LLMs with 10 Million Token Context Windows - F5 Labs</a>

## 注释

1.  <span id="cite_note-ibm-context-1">↑ <sup>[1.00](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-0)</sup> <sup>[1.01](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-1)</sup> <sup>[1.02](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-2)</sup> <sup>[1.03](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-3)</sup> <sup>[1.04](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-4)</sup> <sup>[1.05](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-5)</sup> <sup>[1.06](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-6)</sup> <sup>[1.07](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-7)</sup> <sup>[1.08](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-8)</sup> <sup>[1.09](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-9)</sup> <sup>[1.10](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-10)</sup> <sup>[1.11](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-11)</sup> <sup>[1.12](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-12)</sup> <sup>[1.13](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-13)</sup> <sup>[1.14](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-14)</sup> <sup>[1.15](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-15)</sup> <sup>[1.16](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-16)</sup> <sup>[1.17](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-17)</sup> <sup>[1.18](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-18)</sup> <sup>[1.19](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-19)</sup> <sup>[1.20](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-20)</sup> <sup>[1.21](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-21)</sup> <sup>[1.22](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-22)</sup> <sup>[1.23](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-23)</sup> <sup>[1.24](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-24)</sup> <sup>[1.25](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-25)</sup> <sup>[1.26](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-ibm-context_1-26)</sup> "Why larger LLM context windows are all the rage". *IBM Research Blog*. <a href="https://research.ibm.com/blog/larger-context-window" class="external autonumber" rel="nofollow">[1]</a></span>
2.  <span id="cite_note-datanorth-context-2">↑ <sup>[2.00](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-0)</sup> <sup>[2.01](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-1)</sup> <sup>[2.02](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-2)</sup> <sup>[2.03](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-3)</sup> <sup>[2.04](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-4)</sup> <sup>[2.05](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-5)</sup> <sup>[2.06](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-6)</sup> <sup>[2.07](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-7)</sup> <sup>[2.08](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-8)</sup> <sup>[2.09](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-9)</sup> <sup>[2.10](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-10)</sup> <sup>[2.11](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-11)</sup> <sup>[2.12](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-12)</sup> <sup>[2.13](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-13)</sup> <sup>[2.14](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-14)</sup> <sup>[2.15](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-15)</sup> <sup>[2.16](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-16)</sup> <sup>[2.17](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-17)</sup> <sup>[2.18](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-18)</sup> <sup>[2.19](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-19)</sup> <sup>[2.20](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-20)</sup> <sup>[2.21](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-21)</sup> <sup>[2.22](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-22)</sup> <sup>[2.23](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-23)</sup> <sup>[2.24](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-24)</sup> <sup>[2.25](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-25)</sup> <sup>[2.26](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-26)</sup> <sup>[2.27](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-27)</sup> <sup>[2.28](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-28)</sup> <sup>[2.29](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-29)</sup> <sup>[2.30](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-30)</sup> <sup>[2.31](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-31)</sup> <sup>[2.32](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-32)</sup> <sup>[2.33](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-33)</sup> <sup>[2.34](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-datanorth-context_2-34)</sup> "Context Length in LLMs: What Is It and Why It Is Important". *DataNorth Blog*. <a href="https://datanorth.ai/blog/context-length" class="external autonumber" rel="nofollow">[2]</a></span>
3.  <span id="cite_note-anthropic-100k-3">↑ <sup>[3.00](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-0)</sup> <sup>[3.01](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-1)</sup> <sup>[3.02](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-2)</sup> <sup>[3.03](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-3)</sup> <sup>[3.04](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-4)</sup> <sup>[3.05](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-5)</sup> <sup>[3.06](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-6)</sup> <sup>[3.07](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-7)</sup> <sup>[3.08](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-8)</sup> <sup>[3.09](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-anthropic-100k_3-9)</sup> "Introducing 100K Context Windows". *Anthropic Blog*. <a href="https://www.anthropic.com/news/100k-context-windows" class="external autonumber" rel="nofollow">[3]</a></span>
4.  <span id="cite_note-cloudflare-llama4-4">↑ <sup>[4.0](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-cloudflare-llama4_4-0)</sup> <sup>[4.1](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-cloudflare-llama4_4-1)</sup> "Meta's Llama 4 is now available on Workers AI". *Cloudflare Blog*. <a href="https://blog.cloudflare.com/meta-llama-4-is-now-available-on-workers-ai/" class="external autonumber" rel="nofollow">[4]</a></span>
5.  <span id="cite_note-f5-rag-5">↑ <sup>[5.00](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-0)</sup> <sup>[5.01](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-1)</sup> <sup>[5.02](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-2)</sup> <sup>[5.03](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-3)</sup> <sup>[5.04](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-4)</sup> <sup>[5.05](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-5)</sup> <sup>[5.06](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-6)</sup> <sup>[5.07](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-7)</sup> <sup>[5.08](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-8)</sup> <sup>[5.09](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-9)</sup> <sup>[5.10](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-10)</sup> <sup>[5.11](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-11)</sup> <sup>[5.12](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-f5-rag_5-12)</sup> "RAG in the Era of LLMs with 10 Million Token Context Windows". *F5 Labs Blog*. <a href="https://www.f5.com/company/blog/rag-in-the-era-of-llms-with-10-million-token-context-windows" class="external autonumber" rel="nofollow">[5]</a></span>
6.  <span id="cite_note-lost-in-middle-6">↑ <sup>[6.0](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-lost-in-middle_6-0)</sup> <sup>[6.1](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-lost-in-middle_6-1)</sup> Liu, Shi et al. (2023). "Lost in the Middle: How Language Models Use Long Contexts". *arXiv*. <a href="https://ar5iv.labs.arxiv.org/html/2307.03172" class="external autonumber" rel="nofollow">[6]</a></span>
7.  <span id="cite_note-arxiv-short-context-7">↑ <sup>[7.00](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-0)</sup> <sup>[7.01](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-1)</sup> <sup>[7.02](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-2)</sup> <sup>[7.03](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-3)</sup> <sup>[7.04](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-4)</sup> <sup>[7.05](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-5)</sup> <sup>[7.06](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-6)</sup> <sup>[7.07](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-7)</sup> <sup>[7.08](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-8)</sup> <sup>[7.09](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-9)</sup> <sup>[7.10](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-10)</sup> <sup>[7.11](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-arxiv-short-context_7-11)</sup> Yang, Qingyu et al. (2024). "Why Does the Effective Context Length of LLMs Fall Short?". *arXiv*. <a href="https://arxiv.org/html/2410.18745v1" class="external autonumber" rel="nofollow">[7]</a></span>
8.  <span id="cite_note-meibel-impact-8">↑ <sup>[8.0](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-0)</sup> <sup>[8.1](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-1)</sup> <sup>[8.2](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-2)</sup> <sup>[8.3](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-3)</sup> <sup>[8.4](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-4)</sup> <sup>[8.5](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-5)</sup> <sup>[8.6](https://systems-analysis.info/int/Context_Window_%E2%80%94_%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3#cite_ref-meibel-impact_8-6)</sup> "Understanding the Impact of Increasing LLM Context Windows". *Meibel Blog*. <a href="https://www.meibel.ai/post/understanding-the-impact-of-increasing-llm-context-windows" class="external autonumber" rel="nofollow">[8]</a></span>
