作者pacino (扫地僧)
看板Soft_Job
标题Re: [心得] token maximum
时间Sat Mar 7 10:12:44 2026
看了这两串, 充满了疑问..
想讨论一下这个主题: token
(1) 每个LLM 都有自己的max. tokens
这是在training model时就要决定的
(2) max output tokens是让agent在送给LLM 之前处理用的,避免超过LLM model的max. to
(3) rules 没被执行,有可能是context可能超过LLM model的max. tokens, agent 主动压?
这样不就解释了两串原po的问题?
麻烦指正,若我的了解有误。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.249.83.213 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Soft_Job/M.1772849566.A.402.html
1F:嘘 MoonCode: 03/07 10:24
2F:嘘 DrTech: 1. LLM什麽时後会停止回答,跟你设定多长的 max output to03/07 14:26
3F:→ DrTech: ken无关。2.max output token不是写在prompt里面。03/07 14:26
为了避免LLM不处理超过model的max tokens (听说 LLM会传回error,往返也是cost)
所以才要靠agent把关, 不是吗?
Max output token是给agent用的
当有需要减少context,
agent有个机制会压缩整个context(prompt, history, rules, referenced files..)
再把压缩後的context送往LLM
4F:→ DrTech: LLM要停止输出,不看max output tokens,是看有没有算出EO 03/07 14:32
5F:→ DrTech: S token。与你怎麽设定OS环境变数,是否放在prompt无关。 03/07 14:32
6F:推 DrTech: 按错,我不是要嘘。 03/07 14:45
※ 编辑: pacino (111.249.83.213 台湾), 03/07/2026 15:16:09
7F:→ DrTech: 完全错误。首先,LLM本身不会回传error或output error。丢 03/07 23:12
8F:→ DrTech: 太长的文字序列或向量进去,向量长度不合,"应用层程式码" 03/07 23:12
9F:→ DrTech: (例如pytorch)就报error了。 03/07 23:12
10F:→ DrTech: LLM根本没处理,更不会回传error,。 03/07 23:12
11F:→ DrTech: 另外,Max output token,不是给agent看的。在预设的情况 03/07 23:17
12F:→ DrTech: ,agent 做任何选择,agent输出什麽文字,根本不看Max out 03/07 23:17
13F:→ DrTech: put token设定多少。 max output tokens通常是设定在servi 03/07 23:17
14F:→ DrTech: ng service层(例如vllm)跟agent根本无关。 03/07 23:17
15F:→ DrTech: 简单话:控制LLM输出的长度,永远不是LLM在做。是应用层程 03/07 23:22
16F:→ DrTech: 式码在做。 03/07 23:22
17F:→ DrTech: agent或LLM不会把关长度的。 03/08 00:48