Nguyen T Thach

Author directory

2026

Can large language models (LLMs) synthesize programs that satisfy complex game-theoretic constraints? We investigate this question by applying LLMs to multi-facility location mechanism design, a canonical problem where a social planner must place facilities to minimize total distance to strategic agents while ensuring *strategyproofness*—the property that no agent can benefit by misreporting their preference. This problem provides a challenging testbed for LLM-driven program synthesis given the vast search space (mechanisms are arbitrary Python functions) and the adversarial constraint (robustness against any misreport by any agent). In response, we propose LLMMech, an evolutionary framework that embeds a pre-trained LLM within a search loop to generate interpretable, empirically strategyproof mechanisms as Python code. Unlike prior neural approaches, LLMMech requires no handcrafted features or hyperparameter tuning. To prevent premature convergence in the constrained search space, we introduce *prompt evolution*—an automatic procedure for evolving the prompts themselves. Experiments on both unweighted and weighted settings show that LLMMech outperforms existing hand-crafted and deep learning-based mechanisms across various problem settings. The resulting mechanisms are also interpretable and generalizable to unseen distributions and instance sizes.