728: Use Contrastive Search to get Human-Quality LLM Outputs — with Jon Krohn (@JonKrohnLearns)

Topics covered
Popular Clips
Episode Highlights
Sampling Methods
Sampling methods in LLMs, such as top k and nuclear sampling, are pivotal for generating coherent and human-like text outputs. explains that these methods rely on probability distributions to select words, resulting in varied outputs each time a model is run, unlike deterministic methods like greedy or beam search 1. This randomness is why tools like ChatGPT provide unique responses to the same query.
In this paradigm, the highest probability word will be selected most frequently, but not always more specifically, using the technical terminology of probability theory, we sample words in this sampling paradigm according to the probability distribution that we extract from the large language model that we're using.
---
Despite their effectiveness, Krohn notes that contrastive search offers superior results, making it a preferred choice for production environments.
Advanced Techniques
Top k and nuclear sampling are specific techniques within the broader sampling paradigm that enhance the fluency of LLM outputs. highlights that these methods support the generation of human-like text by leveraging the probability distribution of words 1. However, he emphasizes that contrastive search, introduced at the NeuRIps conference, surpasses these methods in producing the most human-like outputs.
Two specific and popular decoding approaches that leverage sampling are top k sampling and nuclear sampling.
---
Krohn encourages the use of contrastive search in production, as it consistently yields superior results.
Related Episodes

772: In Case You Missed It in March 2024 — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
SDS 464: A.I. vs Machine Learning vs Deep Learning — with Jon Krohn
Answers 383 questions
670: LLaMA: GPT-3 performance, 10x smaller — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
720: OpenAI’s DALL-E 3, Image Chat and Web Search — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
684: Get More Language Context out of your LLM — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions

808: In Case You Missed It in July 2024 — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
666: GPT-4 — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
750: How AI is Transforming Science — with Jon Krohn (@JonKrohnLearns)
Answers 383 questions
SDS 568: PaLM: Google's Breakthrough Natural Language Model — with Jon Krohn
Answers 383 questions
740: Q*: OpenAI's Rumored AGI Breakthrough — with @JonKrohnLearns
Answers 383 questions
