Agentic AI
AI-Generated Code Lacks Built-in Variability—Researchers Propose Regeneration-Based Product Lines
A new study reveals that LLM-generated programs collapse all design choices into generation time, and proposes letting the AI engine derive product variants on demand.
Vibe coding—where a large language model generates entire programs from natural language descriptions—has upended traditional software engineering practice. But a critical weakness has emerged: the resulting code contains almost no built-in variability to support different configurations, platforms, or feature sets.
The Missing Piece#
Researchers analysing 10 vibe-coded C/C++ projects found that all variability—the carefully engineered flexibility that classical software allows—gets locked in at a single moment: generation time, when the LLM writes the source code. Unlike traditional approaches, which preserve choices until compile or runtime, AI-generated artifacts offer virtually no flexibility after that point. This is not accidental; it reflects how the generative model resolves all design decisions in a single pass, collapsing the design space into one concrete implementation.
A New Approach: Regeneration-Based Product Lines#
Rather than treating this as a bug, researchers propose Variability by Regeneration (VbR), the first product-line technique that reframes the LLM as a derivation engine. Instead of baking variants into code, VbR:
- Accepts a declarative specification of product features
- Instructs the LLM to generate a separate, optimized binary for each variant
- Uses a variant dispatcher to transparently route user requests to the correct binary
- Produces binaries free of dead code, since each is tailored to a single variant
The approach was demonstrated on a word-count (wc) product family, showing the full pipeline from specification to deployment.
Rethinking Variability in AI Software#
The finding inverts conventional wisdom about where variability belongs. In classical software product line engineering, variability lives in the code and is resolved at compile or runtime. For AI-generated software, the researchers argue, variability should reside in the specification, and the LLM should handle variant derivation. This shifts the burden from runtime branching and feature flags to generative re-specification—trading code flexibility for semantic clarity and generation-time optimization.

