跳到正文
Hugging Face Blog·· 2022-11-08AI 评分52

Hugging Face transformers 新增对比搜索解码方法

Generating Human-level Text with Contrastive Search in Transformers 🤗

AI 导读

Hugging Face 在 transformers 库中新增了 Contrastive Search 解码方法,支持 PyTorch 和 TensorFlow。该方法在模型置信度基础上引入退化惩罚,以缓解贪心搜索的重复问题和随机采样的语义不连贯。文中展示了使用 GPT-2 和 OPT 模型时,对比搜索生成的文本在流畅性和事实准确性上均优于传统方法。

来源:Hugging Face Blog · huggingface.co