Why it matters

Contrastive search reduces repetition. Understanding shapes decoding.

Advertisement

The architecture

Score = (1-alpha) * log p - alpha * max cosine similarity to previous.

Contrastive searchLog-prob term1-alpha weightSimilarity penaltyalpha weightScore + sampletop-k pickedSu + Collier 2022; alpha 0.6 typical; useful for long generations
Contrastive.
Advertisement

How it works end to end

Su + Collier 2022.

Alpha = 0.6 typical.

Top-k on combined score.

HF Transformers supports.