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

Akanksha Narula, Mofasshara Binte Rafique, Laurent Bindschaedler
6/2/2026
cs.SEcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) now generate substantial production code, often for tasks with multiple valid algorithmic solutions. Incidental prompt cues, meaning contextual words or metadata outside the task specification, can steer which algorithm the model selects, even when all outputs pass the same tests.

Show full abstract

Prompt sensitivity is well studied as a tool to improve output quality. Here, output policy means algorithm choice under fixed correctness. We define algorithm steering as cue-induced shifts in algorithm-family distributions and run 46,535 controlled experiments across 11 tasks, 19 cue types (18 channels plus a memoization semantic-vs-surface ablation that preserves meaning while changing typography and punctuation), and 15 model configurations. We find large, systematic shifts in algorithm-family distributions (up to 100 pp), largely consistent with cue semantics, including in applied tasks such as rate limiting. Direct algorithm naming is the most reliable mitigation we tested. Accidental context therefore creates an "invisible lottery" over performance, security, and maintainability.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{narula2026invisible,
  title  = {The Invisible Lottery: How Subtle Cues Steer Algorithm Choice in LLM Code Generation},
  author = {Akanksha Narula and Mofasshara Binte Rafique and Laurent Bindschaedler},
  year   = {2026},
  eprint = {2606.04057},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.04057v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.04057.svg)](https://codeofpaper.com/paper/2606.04057)

Discussion