PLAIN/TEXT — ISSUE 371/456 COMPUTER SCIENCE · FOUNDATION / LANGUAGE SEARCH · ~4 MIN READING DATE: 2027-10-07 ARCHIVE: https://plaintext.click/newsletter/ SUBJECT: Why an AI may keep several unfinished answers Why an AI may keep several unfinished answers ============================================= / START HERE The best first word does not necessarily begin the best complete sentence. Beam search is a procedure that keeps several promising partial outputs while building a longer output. It can recover a strong continuation that would be lost by committing immediately to the highest-ranked first choice. / WHY NOW Imagine a system choosing a short caption. A locally popular opening might leave only weak continuations, while a slightly less popular opening leads to a coherent whole. Looking across several unfinished paths makes that difference visible. / THE IDEA A beam is one retained partial sequence. At each step, the procedure extends retained sequences with possible next pieces and scores the longer candidates. It keeps only a chosen number, called the beam width, before continuing. Pruning means permanently dropping the other paths. For a fixed-length toy, a sequence probability is the product of its step probabilities. Each later probability is conditional: it depends on the pieces already chosen on that path. A larger beam explores more alternatives, but it still searches only a small fraction of all possible sequences. / THE FORMAL IDEA P(A then X) = P(A) × P(X | A) - P means probability; the vertical bar means given the preceding choice. - All candidates below have two pieces, so multiplying scores compares equal lengths. Real systems often use logarithms and length adjustments. / RUN THE TINY EXAMPLE Change one thing. Predict what happens. First choices: A has probability 0.6; B has 0.4. Best continuation after A is X with 0.5: complete score 0.6 × 0.5 = 0.30. After B, Y has 0.9: score 0.4 × 0.9 = 0.36. Change beam width from 1 to 2: B survives the first cut, allowing BY to beat AX. The wider search found the higher-probability complete output without changing the model’s estimates. With width one, the first decision made that outcome unreachable even though the winning final score was larger. / SO WHAT? This is a search-quality versus resource trade-off, not a direct measure of meaning. Keeping more paths uses more computation and memory, and a model can assign high probability to bland or mistaken text. For open-ended writing, maximising sequence probability may also suppress variety that a reader would prefer. Evaluate complete outputs against the job, not only their internal scores. / ONE CAVEAT The invented example has equal output lengths and no stopping complications. Wider beams do not guarantee globally optimal answers or monotonically better human judgements; scoring rules and model errors still matter. / KEEP THIS Keeping more partial paths can avoid an early commitment, but only according to the scoring rule being searched. / SOURCE TRAIL [1] Hugging Face — Beam search https://huggingface.co/docs/transformers/en/generation_strategies NEXT: Why two uncertain lengths do not always add worst cases --- HARD IDEAS. PLAIN TEXT. You are receiving this because you asked for one clear computer-science or physics idea each day. Unsubscribe: https://plaintext.click/unsubscribe View in browser: https://plaintext.click/newsletter/2027/10/2027-10-07-beam-search-tradeoff.html From: Plain/Text / Brickston Consulting · 30 N Gould St Ste N, Sheridan, WY 82801 US · knowledge@plaintext.click