Back to Blog
Tangled wires versus clean architectural structure with green accents - representing prompt fragility vs system engineering

Deep Dive

Beyond Magic Words: System Engineering for AI

November 20, 2025 · 6 min read · By Yusuf Tunc Karadut

If your system breaks because you changed an adjective, the problem isn't your prompt; it's your architecture. "Prompt engineering" as a discipline is temporary scaffolding. The mature approach is System Engineering: standardized inputs, structured outputs, evaluation pipelines.

The Fragility of Natural Language Prompts

Hand-crafted prompts are brittle. Model version changes, few-shot example ordering, even whitespace can cause performance swings. Prompts operate in high-dimensional latent space using vague natural language approximations of logic. Relying on emotional appeals ("it is critical for my career") to improve outputs is a sign of an unoptimized system.

DSPy: Compiling Prompts

Khattab, Singhvi, Maheshwari et al.'s DSPy framework demonstrates the shift. Instead of writing prompts, you define signatures (input → output interfaces) and chain them into programs. A compiler automatically optimizes instructions and selects few-shot examples to maximize your metric.

Switch models from GPT-4 to Claude? Recompile. The framework generates optimal prompts for the new architecture. This moves optimization from human trial-and-error to algorithmic search.

Constrained Decoding: Guaranteed Structure

Parsing free-text output is a reliability hole. Constrained decoding tools (Guidance, Outlines) mask logits during inference, permitting only tokens that conform to a predefined grammar: JSON Schema, SQL syntax, whatever you need. The output is mathematically guaranteed to be syntactically valid.

This shifts the failure mode from "parsing error" (fatal) to "content error" (validatable). Build the machine that contains the stochastic component. Don't negotiate with it.

Anthropic's Constitutional AI work by Bai, Kadavath, Kundu, Askell et al. demonstrates how principles can be systematically encoded into model behavior, moving from ad-hoc prompting to structured behavioral constraints.

Sources

Khattab, O., Singhvi, A., Maheshwari, P., et al. (2024)

DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines

ICLR 2024 · arXiv:2310.03714

Tam, Z. R., et al. (2025)

Generating Structured Outputs from Language Models

arXiv:2501.10868

Bai, Y., Kadavath, S., Kundu, S., Askell, A., et al. (2022)

Constitutional AI: Harmlessness from AI Feedback

arXiv:2212.08073

See AI applied to real financial research

Archivist helps analysts and investors explore SEC and SEDAR filings through natural conversation, grounded in real sources.

Try Archivist

Your first 10 queries are on us