ΕπόμενοΕπόμενος οδηγός
Τυπική δειγματοληψία
Γλώσσα AI
ΟΔΗΓΟΣ ΓΛΩΣΣΑΣ AI
Top-k and nucleus (top-p) sampling are stochastic decoding methods that truncate a model’s next-token distribution before drawing a token.
Ακούστε αυτόν τον οδηγόαφήγηση με AI · ~2 min
Temperature rescales logits and changes distribution sharpness; none of these settings guarantees factual accuracy.
Holtzman et al. identify a gap between likelihood training and open-ended generation: likelihood-maximizing decoding can produce bland and repetitive text in their experiments. Nucleus sampling retains a dynamic set of tokens containing most probability mass and samples from it, trimming the unreliable tail. Top-k instead fixes the number of candidates. Later analysis explains properties and limitations of truncation heuristics; their findings are scoped to the studied models and tasks. For a no-sampling baseline, greedy decoding selects the highest-scoring next token directly. This removes token-sampling randomness for a fixed model and input; it does not guarantee correct code, and deployment-level reproducibility can also depend on system details.
Top-k keeps a fixed number of high-probability tokens at a step.
Top-p keeps the smallest probability-ranked set whose cumulative mass reaches the chosen threshold.
Temperature changes the relative sharpness of the distribution before sampling.
When evaluating open-ended outputs, compare decoding settings on diversity, coherence and repetition rather than assuming one setting is best.
Choose decoding settings by task-specific evaluation and record the model, prompt and sampling parameters for reproducibility. Assess diversity and coherence alongside task success. The cited papers do not establish a universal default or guarantee that sampling prevents repetition or errors.
Δωρεάν ενημερωτικό δελτίο
Τρία επαληθευμένα νέα AI κάθε πρωί της εβδομάδας, γραμμένα σε απλή αγγλική. Δωρεάν για πάντα, χωρίς διαφημίσεις.
Ένα email κάθε εργάσιμη ημέρα. Κατάργηση συνδρομής με ένα κλικ. Δεν πουλάμε ή μοιραζόμαστε ποτέ τη διεύθυνσή σας.
Δοκιμάστε τον εαυτό σας
Άμεση ανάδραση σε κάθε απάντηση, και πιστοποιητικό με επαληθεύσιμο ID μόλις περάσετε το μάθημα.
Υποστηρίξτε τη δωρεάν εκπαίδευση AI. AI Understanding είναι μια μη κερδοσκοπική οργάνωση 501(c)(3) — χωρίς διαφημίσεις, χωρίς τοίχο πληρωμής, ποτέ. Κάντε μια δωρεά
Top-k and nucleus (top-p) sampling are stochastic decoding methods that truncate a model’s next-token distribution before drawing a token. Temperature rescales logits and changes distribution sharpness; none of these settings guarantees factual accuracy.
Το Top-k περικόπτει την κατανομή σε έναν σταθερό αριθμό k των πιο πιθανών διακριτικών, επανακανονικοποιεί και λαμβάνει δείγματα από αυτά.
Το Top-p διατηρεί τη μικρότερη ομάδα κορυφαίων διακριτικών των οποίων η αθροιστική πιθανότητα φτάνει το όριο p και, στη συνέχεια, λαμβάνει δείγματα μεταξύ τους.
Το υποψήφιο σύνολο του Top-p συρρικνώνεται όταν το μοντέλο έχει αυτοπεποίθηση και αυξάνεται όταν είναι αβέβαιο, σε αντίθεση με το σταθερό πλήθος του top-k.
Η χαμηλότερη θερμοκρασία συγκεντρώνει την πιθανότητα στα top tokens (πιο ντετερμινιστική). υψηλότερη θερμοκρασία το ισοπεδώνει (πιο ποικιλόμορφο).
Holtzman et al. report that sampling from the dynamic nucleus produced more diverse generations while retaining fluency and coherence in their evaluated setups; this is not a universal guarantee.
Συνέχισε να μαθαίνεις
Επιλέχθηκαν περισσότεροι οδηγοί για αυτό το θέμα
ΕπόμενοΕπόμενος οδηγός
Τυπική δειγματοληψία
Γλώσσα AI