Skip to main content

Why Problem Structure is the First Question You Should Ask When Building with AI

· 4 min read
Pedro Arantes
CTO | Product Developer

In the rush to build "agentic" systems, most teams jump straight to prompting strategies, tool calling, retrieval setups, or orchestration frameworks. That's putting the cart before the horse.

The very first question you must answer, before any architecture diagram or code, is this: Is the problem (or each sub-problem) you're trying to solve well-structured or ill-structured?

This single classification determines whether traditional deterministic software, probabilistic AI (LLMs and other ML models), or a hybrid of both is the right approach.

Defining the Two Categories

Well-structured problems are those where:

  • Rules can be explicitly and completely defined.
  • Inputs are bounded, typed, and predictable.
  • Valid outputs can be enumerated or computed deterministically.
  • Success criteria are objective and verifiable without subjective judgment.

Real-world examples:

  • Form validation (email format, required fields, date ranges).
  • Calendar availability checks and slot intersection.
  • Payment processing and fraud rule enforcement.

These problems have been reliably solved for decades using conventional programming, schemas, state machines, and rule engines, at near-zero marginal cost, instant speed, and 100% consistency.

Ill-structured problems are those where:

  • Key information is missing, ambiguous, or implicit.
  • Context heavily influences interpretation.
  • Multiple valid solutions exist; no single output is objectively "correct."
  • Requirements often emerge only through exploration or dialogue.

Real-world examples:

  • Understanding user intent from free-form natural language.
  • Generating personalized content, recommendations, or creative ideas.
  • Diagnosing complex issues from unstructured symptoms or logs.
  • Negotiating trade-offs in scheduling or planning conversations.
  • Summarizing nuanced documents or extracting insights from messy data.

These are precisely the domains where modern large language models and probabilistic AI excel.They handle uncertainty, approximate patterns, and generate coherent responses where rigid rules fall short.

The Allocation Principle: Match Paradigm to Structure

From the Foundations of Hybrid Allocation and specifically The Principle of Problem Structure Allocation:

Well-structured problems: Solve with deterministic systems (code, schemas, validators, APIs, state machines).

Ill-structured problems: Solve with probabilistic AI (LLMs, embeddings, ML models).

This isn't a suggestion. It's the foundational rule for building systems that are reliable, performant, and economically viable.

The High Cost of Misallocation

Consequence 1: Using LLMs/agents for well-structured problems

You introduce unnecessary expense (tokens aren't free), latency (API calls take hundreds of milliseconds), and (worst of all) variability and hallucinations into a domain that demands perfect consistency.

Example: Using an LLM to validate JSON output or check if a date is in the future when Pydantic schemas or simple if statements would do it instantly and flawlessly.

Result: higher operational costs, unpredictable failures, and a system that occasionally "invents" invalid data.

Consequence 2: Using only traditional deterministic systems for ill-structured problems

You end up with brittle, rule-heavy codebases that explode in complexity. Every new edge case requires another hardcoded branch. Users encounter rigid, unhelpful responses.

Example: Building a customer support chatbot with nested if-else trees instead of leveraging language understanding.

Result: poor user experience, constant maintenance overhead, and eventual abandonment as the system fails to handle real-world nuance.

The Winning Strategy: Surgical Hybridization

Following The Principle of Mandatory Hybridization, the most effective modern agentic systems are never purely agentic nor purely traditional. They are deliberately hybrid:

  • Probabilistic AI handles perception, understanding, exploration, and generation in ill-structured domains.

  • Deterministic components handle validation, execution, state management, and side effects everywhere else.

They allocate compute surgically: expensive LLM calls only where ambiguity genuinely exists, and rock-solid code enforcement for everything that can be nailed down.

Make Problem Structure Diagnosis Your First Step

Next time you're scoping a feature, designing an agent workflow, or debating whether to add another tool call:

  1. Break the problem into sub-problems.
  2. Classify each as well-structured or ill-structured (see The Corollary of Structural Diagnosis).
  3. Allocate accordingly.
  4. Enforce deterministic guardrails around any probabilistic output (see The Corollary of Deterministic Enforcement Supremacy).

Do this consistently, and you'll build systems that are faster, cheaper, more reliable, and far more likely to survive contact with production reality.

Problem structure isn't just academic theory. It's the first, most powerful filter for making sound architectural decisions in the age of agents. Don't ignore it.