GPT-2 Text Generation
Enter a prompt and experiment with decoding parameters to see how they affect output. Courses: 100 Deep Learning ch4, 200 Transformer ch4
10 200
0.1 2
0 100
0.1 1
1 2
Examples
| Prompt | Max New Tokens | Temperature | Top-k (0 = no limit) | Top-p (nucleus) | Repetition Penalty | Show token probabilities |
|---|
Temperature: Controls randomness. Low (0.1-0.3) = focused/repetitive. High (1.0-2.0) = creative/chaotic.
Top-k: Only consider the top-k most likely tokens. Lower = more focused. 0 = no limit.
Top-p (nucleus sampling): Only consider tokens whose cumulative probability exceeds p. Lower = more focused.
Repetition Penalty: Penalizes tokens that already appeared. >1.0 reduces repetition.
Try these experiments:
- Set temperature=0.1 → very deterministic, same output each time
- Set temperature=2.0 → chaotic, often incoherent
- Set top_k=5 → very restricted vocabulary
- Compare top_p=0.5 vs top_p=1.0