# DSL-Bench: Evaluating and Explaining LLM Code Generation Across Domain-Specific Languages

DevFeed: [DSL-Bench: Evaluating and Explaining LLM Code Generation Across Domain-Specific Languages](<https://devfeed.tech/articles/dsl-bench-evaluating-and-explaining-llm-code-generation-across-domain-specific-languages-116205.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.05168>)

Author: Zihan Zhou, Mingxi Ye, Yan Gao, Guipeng Wei, Zibin Zheng

Published: 2026-11-04T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [domain-specific language](<https://devfeed.tech/topics/domain-specific-language.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [Vectors & LLMs](<https://devfeed.tech/topics/vectors-llms.md>)

Tags: [bench](<https://devfeed.tech/tags/bench.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [domain-specific-languages](<https://devfeed.tech/tags/domain-specific-languages.md>), [llm](<https://devfeed.tech/tags/llm.md>), [semantic](<https://devfeed.tech/tags/semantic.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

## AI overview

DSL-Bench evaluates code generation across 18 domain-specific languages using syntax checkers and task-level semantic oracles. Across seven LLMs, average syntax pass rate was 31.37%, while semantic pass rate was 11.64%, showing that valid syntax often does not ensure correct behavior. DSL differences accounted for 76.99% of semantic pass-rate variation, compared with 7.86% attributed to model differences; Knowledge Demand had the strongest negative association among four DSL-level factors. Prompt-engineering gains varied across DSLs. In five targeted DSLs, RAG-Refinement improved semantic correctness by an average 16.29 percentage points over matched baselines. These abstract-level findings underscore the need to evaluate DSL outputs semantically, while the targeted improvement result applies only to the five studied DSLs.

## Source excerpt

arXiv:2611.05168v1 Announce Type: new Abstract: Large language models (LLMs) are increasingly used in software-engineering workflows, but code-generation benchmarks largely focus on general-purpose languages. Domain-specific languages (DSLs) have distinct syntax, semantics, and validation requirements, making results from individual DSL benchmarks difficult to compare. We present DSL-Bench, an executable benchmark and analysis framework for cross-DSL code generation. Starting from 13,045 DSL-related papers, LLM-assisted open card sorting identifies 18 representative application domains. For each domain, we select an evaluable DSL and provide a syntax checker and task-level semantic oracle. Evaluating 7 LLMs on 18 DSLs, we observe mean syntax and semantic pass rates of 31.37% and 11.64%, respectively, revealing a substantial gap between syntax acceptance and semantic correctness. A variance decomposition attributes 76.99% of semantic pass-rate variation to differences among DSLs and 7.86% to differences among models. Among four DSL-level factors, Knowledge Demand has the strongest negative association with semantic correctness (r = -0.508). We evaluate prompt engineering across all 18 DSLs and study five improvement methods on five targeted DSLs. Prompt engineering yields uneven gains; RAG-Refinement, the strongest targeted method, improves semantic correctness by 16.29 percentage points on average over matched baselines. We further derive capability profiles and DSL-Profiler summaries for interpreting data-scarce DSLs. These results highlight toolchain-specific semantic bottlenecks and the need to evaluate DSL code generation beyond syntax acceptance.