DeepSeek V4.1 Flash 编程最佳上下文长度:建议 300K–500K,默认 400K
作者认为 1M 上下文对多数编程任务过大,300K–500K 才是甜点区;超过后变慢、变贵且注意力下降,且部分 agent 会把最大输出计入上限,建议默认 400K 并手动压缩。
I've been trying to figure out the best context length for DeepSeek V4.1 Flash when coding, and the honest answer is that 1M is too much for most tasks. From everything I've read, the sweet spot seems to be somewhere between 300K and 500K, and it makes sense. Past that, the model gets slower, every message costs more, and it starts paying less attention to what's actually in front of it. Having a 1M window doesn't mean the model can really use all of it. One thing that surprised me is that some agents count your max output toward the limit before compacting. So if you set 500K with 128K reserved for output, it'll actually start compacting closer to 370K. My plan is 400K as the default, and compacting by hand when the task changes instead of waiting for it to fill up.