Beam Search Demo

This demo shows how two different text generation strategies work using the Qwen2.5-0.5B model. The left side uses greedy search, which picks the most probable token at every generation step (deterministic), while the right side uses beam search, which explores multiple beams concurrently to choose the most likely sequence of tokens.

Important: This model works best with prompts that need completion rather than question-answering. For example, instead of 'What is the capital of France?', use prompts like 'The capital of France is' or 'Here is a story about:'

Use the controls below to enter your prompt, adjust the maximum number of newly generated tokens, and set the number of beams for beam search. The results for both strategies are displayed side by side for easy comparison.

Repo: Beam Search Demo

Input

1 100
1 20