arXiv

The Invisible Lottery: How Subtle Cues Steer Algorithm Choice in LLM Code Generation

Title: The Invisible Lottery: How Subtle Cues Steer Algorithm Choice in LLM Code Generation

Abstract: Large language models (LLMs) are increasingly tasked with generating significant volumes of production-grade code, frequently for problems that admit multiple valid algorithmic approaches. Research indicates that incidental prompt cues—such as contextual words or metadata not directly specified in the task requirements—can influence the specific algorithm a model selects, even when all resulting outputs satisfy identical testing criteria. While prompt sensitivity is widely recognized as a method to enhance output quality, this study focuses on "output policy," defined here as the selection of algorithms under conditions of fixed correctness. We conceptualize "algorithm steering" as cue-driven changes in the distribution of algorithm families. To investigate this phenomenon, we conducted 46,535 controlled experiments spanning 11 distinct tasks, 19 types of cues (including 18 channels and a semantic-vs-surface ablation of memoization that alters typography and punctuation while preserving meaning), and 15 model configurations. Our findings reveal substantial, systematic shifts in algorithm-family distributions, with variations reaching up to 100 percentage points. These shifts generally align with the semantics of the cues and persist even in applied scenarios such as rate limiting. Among the mitigation strategies tested, explicitly naming the algorithm proved to be the most effective. Consequently, accidental contextual information creates an "invisible lottery" affecting performance, security, and code maintainability.


Source: arXiv Generated at: 2026-06-04 00:00:00 UTC

Related Articles

AI Concentration Risk Is the Problem: 3-Minutes MLIV
Bloomberg

AI Concentration Risk Is the Problem: 3-Minutes MLIV

The article argues that AI concentration risk, rather than the technology itself, is the primary concern. It highlights ...

Reuters

Foxconn announces strategic collaboration with Intel on next-gen AI infrastructure

Foxconn and Intel announced a strategic partnership to develop next-generation AI infrastructure. This collaboration aim...

SpaceX Seeks to Raise $75 Billion in Record IPO (Video)
Bloomberg

SpaceX Seeks to Raise $75 Billion in Record IPO (Video)

SpaceX aims for a record $75 billion valuation through an initial public offering. This historic IPO marks a significant...

Broadcom AI Chip Outlook Disappoints Investors
Bloomberg

Broadcom AI Chip Outlook Disappoints Investors

Broadcom’s AI chip projections disappointed investors, dampening market sentiment. The outlook fell short of expectation...

Reuters

Europe's tech 'liberation day'? Computer says not yet

Europe’s expected tech breakthrough remains unrealized, as current systems indicate that a true "liberation day" has not...

Hiranandani Group CEO on Powering India's Digital Future
Bloomberg

Hiranandani Group CEO on Powering India's Digital Future

Hiranandani Group CEO discusses driving India's digital transformation.