作者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/m.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