# State-Inference-Based Prompting for Natural Language Trading with Game NPCs

arXiv: https://arxiv.org/abs/2507.07203 · HTML: https://mlsanity.com/paper/2507.07203/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 6 of its 18 references that are in the map.
- First posted on arXiv 9 Jul 2025.

## Builds on (most cited first, 6 of 6)

- [Generative Agents: Interactive Simulacra of Human Behavior](https://mlsanity.com/paper/2304.03442/) (2023)
- [A Survey on Large Language Model based Autonomous Agents](https://mlsanity.com/paper/2308.11432/) (2023)
- [Procedural Content Generation in Games: A Survey with Insights on Emerging LLM Integration](https://mlsanity.com/paper/2410.15644/) (2024)
- [AgreeMate: Teaching LLMs to Haggle](https://mlsanity.com/paper/2412.18690/) (2024)
- [LLM-Driven NPCs: Cross-Platform Dialogue System for Games and Social Platforms](https://mlsanity.com/paper/2504.13928/) (2025)
- [Leveraging Large Language Models for Active Merchant Non-player Characters](https://mlsanity.com/paper/2412.11189/) (2024)

## Abstract (arXiv)

Large Language Models enable dynamic game interactions but struggle with rule-governed trading systems. Current implementations suffer from rule violations, such as item hallucinations and calculation errors, that erode player trust. Here, State-Inference-Based Prompting (SIBP) enables reliable trading through autonomous dialogue state inference and context-specific rule adherence. The approach decomposes trading into six states within a unified prompt framework, implementing context-aware item referencing and placeholder-based price calculations. Evaluation across 100 trading dialogues demonstrates >97% state compliance, >95% referencing accuracy, and 99.7% calculation precision. SIBP maintains computational efficiency while outperforming baseline approaches, establishing a practical foundation for trustworthy NPC interactions in commercial games.
