Telling the model its RAM and wall-time budget takes correct-and-in-budget code generation from 0/5 to 4/5
Claude Opus 5, GPT-5.6-Sol and Gemini 3.7 Flash generated code for a high-dimensional pairwise distance task either from the task alone or with an explicit 128 MB RAM and 10.0 s wall-time contract in the prompt. Contract disclosure cut peak process memory in 13 of 14 index-aligned comparisons and cut mean wall time in all three cohorts, making execution up to 3.1x faster; at a tighter 96 MB contract, correct-and-within-budget outcomes went from 0/5, 1/5 and 0/5 to 4/5, 5/5 and 3/5. The models responded structurally, not cosmetically, adopting bounded blocking, float32 retention, upper-triangle traversal and memory-mapped buffers, which makes a one-line execution contract one of the cheapest prompt additions available.
↳ Follow the thread