← 返回卡片

原书出处

Designing Large Language Model Applications

First Edition · 核验版本的摘录快照 · 导入于 2026-11-14T13:54:13.937Z

Greedy Decoding The simplest form of decoding is to just generate the token that has the highest probability. The drawback of this approach is that it causes repetitiveness in the output. Here is an example: input = tokenizer('The keyboard suddenly came to life. It ventured up the', return_tensors='pt').to(torch_device) output = model.generate(**inputs, max_new_tokens=50) print(tokenizer.decode(output[0], skip_special_tokens=True)) You can see that the output starts getting repetitive. Therefore, greedy

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Designing Large Language Model Applications/_epub-src/OEBPS/ch05.html

EPUB SHA-256:1b4d2347fec2f949fcddfbaf4fad597a1ae20887a096cfae64c59a619b4781bf