Hugging Face BlogNov 8, 2022, 12:00 AMimportant 70

在 Transformers 中使用對比搜索(Contrastive Search)生成達到人類水準的文本 🤗

Original: Generating Human-level Text with Contrastive Search in Transformers 🤗

In the field of natural language generation (NLG), enabling language models to produce coherent and natural long-form text has long been a…

Hugging Face 介紹了全新解碼方法「對比搜索(Contrastive Search)」,現已整合至 Transformers 庫中。該方法透過引入「退化懲罰」機制,在保持模型預測概率的同時,避免生成與前文語意重複的詞彙。相比傳統的束搜索(Beam Search)或隨機採樣(Sampling),對比搜索能生成更具連貫性、多樣性且無重複的長文本,達到接近人類寫作的水準。

In the field of natural language generation (NLG), enabling language models to produce coherent and natural long-form text has long been a major challenge. Traditional decoding methods such as "Greedy Search" and "Beam Search," while computationally efficient, are highly prone to falling into infinite loops and semantic repetition. "Sampling" methods (such as Top-k or Top-p) increase diversity but can easily produce incoherent or nonsensical (hallucinated) content.

Full summary

Free shows the 3-line summary; Pro unlocks the full deep summary (~300 words) so you never have to click through.

See Pro plans →

Want the original English / full article?

Read on Hugging Face Blog →

Summaries are AI-generated; the original article is authoritative.