上下文窗口管理(Context Window
Management)在有限上下文窗口内分配输入与输出
token,并处理超限信息。窗口容量不等于模型能同等利用每一处信息。Context window management allocates input and output tokens inside a
finite window and handles overflow. Capacity does not mean every
position will be used equally well.
01 · 四个人共用一只行李箱01 · Four travelers, one suitcase
输入、历史、检索证据和输出都想多带一点;总量超出
4,096 token
时,应该偷偷丢掉、压成摘要,还是明确拒绝?Input, history, retrieved evidence, and output all want more room.
When the total exceeds 4,096 tokens, should the system silently
drop content, summarize it, or reject the request?
Σ≤W
02拖动四块预算,超限后选择截断、摘要或拒绝并回放答案后果Resize Four Budget Blocks, Then Choose Truncate, Summarize, or
Reject and Replay the Consequence
所有概率、命中率、得分与输出均为固定种子的教学模拟,不代表真实模型。拖回主变量即可复核结论。All probabilities, hit rates, scores, and outputs are fixed-seed
teaching simulations, not real model output. Move the main
variable back to verify the conclusion.
03把刚才的变化拆成 4 个零件Break the Change into Four Parts
Context Window Management
INPUT
当前输入Current input
任务与本轮材料占用基础预算。The task and current-turn material consume the base
budget.
HISTORY
对话历史Conversation history
旧消息需保留、淘汰或摘要。Prior messages must be retained, evicted, or summarized.
RETRIEVAL
检索证据Retrieved evidence
证据完整度与来源定位受预算影响。Budget affects evidence completeness and source
localization.
OUTPUT
输出预留Output reserve
不能把全部窗口都塞给输入。The entire window cannot be consumed by input.
04最小机制:主交互能逐项验证Minimal Mechanism: Verify Each Link in the Interaction
MECHANISM
input + history + retrieval + output ≤ window
四个滑块直接验证总和;超限策略不改变窗口上限,只改变哪些信息被保留以及系统是否继续生成。The four sliders verify the sum directly. Overflow policy does
not change window capacity; it changes what survives and whether
generation proceeds.
05把四块拖到 5,500 token 后仍选择截断Push the Four Blocks to 5,500 Tokens and Keep Truncation
主动制造失败Create a failure
边界实验Boundary experiment
系统仍会给答案,但末尾检索证据可能消失。容量问题被处理了,证据完整性问题却暴露出来。The system still answers, but trailing retrieved evidence can
disappear. Capacity is handled while evidence integrity
degrades.
尚未执行。先在主交互中观察正常机制。Not run yet. Observe the normal mechanism in the main interaction
first.
✗ S3-18 和本页讲的是同一件事。S3-18 and this page teach the same thing.→ ✓ S3-18
定义窗口是什么;本页练习怎样分配和处理超限。S3-18 defines the window; this page manages allocation and
overflow.
✗ 把输出预算设为 0 能装最多证据。Set output reserve to zero to fit maximum
evidence.→ ✓ 没有输出空间,系统也无法完成回答。Without output capacity, the system cannot complete an
answer.
✗ 截断后能生成就说明信息够用。If truncation still generates, enough information
survived.→ ✓ 答案可生成不等于关键证据仍完整。A generated answer does not prove key evidence
survived.
06 · 一句话带走06 · One line to keep
上下文窗口管理是在固定容量内分配输入、历史、检索和输出;超限时必须显式选择截断、摘要或拒绝,并检查答案后果。Context window management allocates input, history, retrieval, and
output within fixed capacity. Overflow requires an explicit
truncate, summarize, or reject policy—and a check of the answer
consequence.