DSLs Enable Reliable Use of LLMs
so by narrowing the possible outcomes - LLMs perform better
My observation is that DSLs make LLMs more reliable because they respond so well to a few in-context examples. A general-purpose language like Java offers lots of valid ways to express the same intent. A DSL strips the variation away. Giving the model a few examples is enough to reliably generate the correct syntax. It’s worth noting that frontline models are already heavily exposed to PlantUML or Java fluent interfaces during training, so they aren’t starting from scratch. It will be curious to see how smaller, more constrained models perform when tasked with a truly novel DSL.
Quote Citation: Unmesh Joshi, “DSLs Enable Reliable Use of LLMs”, https://martinfowler.com/articles/llm-and-dsls.html
