ARTFEED — Contemporary Art Intelligence

Strategies for Guiding LLMs to Use Singleton Design Pattern

ai-technology · 2026-05-27

A recent study published on arXiv (2605.26898) explores methods for encouraging Large Language Models (LLMs) to integrate the Singleton design pattern into their code outputs. The researchers conducted a computational experiment involving 13 LLMs tackling 164 Java coding tasks sourced from HumanEval-X. They evaluated four different prompting techniques: straightforward instructions, binary automated feedback, comprehensive automated feedback, and detailed feedback paired with few-shot prompts. Findings suggest that the most effective strategy varies based on the specific LLM and its context. The research underscores the difficulty of guiding LLMs to adhere to architectural principles, which is essential for the long-term viability of software products.

Key facts

  • arXiv paper 2605.26898
  • Focus on Singleton design pattern
  • 13 LLMs tested
  • 164 Java coding challenges from HumanEval-X
  • Four prompting strategies: instructions, binary automated feedback, extensive automated feedback, extensive feedback with few-shot prompts
  • Optimal strategy depends on LLM and context
  • Goal: identify strategies for guiding LLMs to use design patterns
  • LLMs often fail to consistently follow higher-level architectural structures

Entities

Institutions

  • arXiv

Sources