DEV Community

Cover image for The Architecture of Machines That Make Decisions
Derek Mwale
Derek Mwale

Posted on

The Architecture of Machines That Make Decisions

The Architecture of Machines That Make Decisions

We usually think of a computer as a machine that executes instructions.

That description is correct.

It is also incomplete.

A computer does not merely execute.

Modern software constantly chooses.

A database chooses which index to use.

A scheduler chooses which task runs next.

A compiler chooses how to transform code.

A network chooses where packets should go.

A recommendation system chooses what you should see.

An operating system chooses which process receives CPU time.

A trading system chooses whether to buy, sell, or wait.

An autonomous vehicle chooses when to brake.

An AI system chooses an answer.

Even something as simple as:

if user.is_authenticated:
    return dashboard
else:
    return login
Enter fullscreen mode Exit fullscreen mode

is already a decision machine.

The interesting question is therefore not:

How do computers execute instructions?

It is:

How do machines turn information into decisions?

That question leads somewhere much deeper.

Because decision-making is not one operation.

It is an architecture.

A machine that makes decisions must observe something, represent it, evaluate possibilities, apply constraints, select an action, execute that action, and then observe the consequences.

That sounds almost biological.

And perhaps that is the point.

The more sophisticated software becomes, the less useful it is to think of it as a passive collection of instructions.

It begins to resemble an artificial organism.


1. A Decision Is a Transformation

At the simplest level, a decision can be represented as:

Information → Decision
Enter fullscreen mode Exit fullscreen mode

But this hides almost everything interesting.

A better model is:

              ┌──────────────┐
              │   Environment│
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │   Observe    │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │ Represent    │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │   Evaluate   │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │   Constrain  │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │    Select    │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │    Act       │
              └──────┬───────┘
                     │
                     ▼
              ┌──────────────┐
              │   Feedback   │
              └──────────────┘
Enter fullscreen mode Exit fullscreen mode

This is a decision architecture.

And notice something important:

The decision itself is only one stage.

The difficult engineering often happens before the decision.

What information is available?

How trustworthy is it?

How should it be represented?

Which possibilities are legal?

Which possibilities are useful?

What does "better" mean?

What happens if two options are equally good?

What happens if there is no valid option?

What happens when the environment changes?

These questions define the machine.

The algorithm is only one part of the architecture.


2. Machines Do Not Decide From Reality

This is one of the most important ideas in decision systems.

A machine does not directly reason about reality.

It reasons about a representation of reality.

Suppose a delivery system needs to decide whether a package should be delivered today.

Reality contains:

weather
traffic
driver location
vehicle condition
package priority
customer availability
road conditions
warehouse state
Enter fullscreen mode Exit fullscreen mode

The computer does not experience any of these things directly.

Instead, it receives:

{
  "traffic": 0.71,
  "weather": "rain",
  "driver_distance": 4.2,
  "priority": 3,
  "vehicle_status": "operational"
}
Enter fullscreen mode Exit fullscreen mode

The machine is not deciding from reality.

It is deciding from a model.

We can write:

$$
R \rightarrow M(R)
$$

where:

  • (R) is reality
  • (M(R)) is the machine's representation of reality.

The decision function is therefore not:

$$
D(R)
$$

but:

$$
D(M(R))
$$

This distinction explains a huge number of failures in software.

A perfectly implemented decision algorithm can still produce terrible decisions if the representation is wrong.

Garbage in, garbage out is not merely a data-quality slogan.

It is an architectural law.


3. The First Layer Is Observation

Every decision machine needs information.

That information may come from:

  • sensors
  • databases
  • APIs
  • users
  • logs
  • network packets
  • files
  • events
  • models
  • other machines

The first architectural layer is therefore an observation system.

World
  │
  ├── Sensors
  ├── APIs
  ├── Databases
  ├── Events
  └── Users
       │
       ▼
   Observation
Enter fullscreen mode Exit fullscreen mode

But observation is not simply data collection.

It is measurement.

And measurements are imperfect.

Imagine a temperature sensor reporting:

31.7°C
Enter fullscreen mode Exit fullscreen mode

The machine does not know that the universe contains exactly 31.7°C.

It knows that a sensor produced the value 31.7.

Those are different statements.

Therefore a decision system should often treat observations as:

value + confidence + timestamp + source
Enter fullscreen mode Exit fullscreen mode

For example:

observation = {
    "value": 31.7,
    "confidence": 0.94,
    "timestamp": 1726230000,
    "source": "sensor-17"
}
Enter fullscreen mode Exit fullscreen mode

Now the architecture becomes more realistic.

The machine is not merely asking:

What is true?

It is asking:

What evidence do I currently possess about what might be true?

That is much closer to real decision-making.


4. State Is the Machine's Memory of the World

A decision without state is often meaningless.

Consider:

if temperature > 40:
    turn_on_cooling()
Enter fullscreen mode Exit fullscreen mode

This works for a simple system.

But imagine a real industrial controller.

It may need to know:

current temperature
previous temperature
cooling state
equipment state
maintenance state
energy budget
operator overrides
historical failures
current load
Enter fullscreen mode Exit fullscreen mode

This is state.

State is the machine's internal memory.

We can represent the system as:

$$
S_t
$$

where (S_t) is the state at time (t).

A new observation (O_t) modifies that state:

$$
S_{t+1} = f(S_t, O_t)
$$

Then the machine makes a decision:

$$
A_t = \pi(S_t)
$$

where:

  • (S_t) = current state
  • (O_t) = observation
  • (A_t) = action
  • (\pi) = decision policy

This simple equation describes an enormous amount of software.

Operating systems.

Robotics.

Game AI.

Distributed systems.

Recommendation engines.

Financial systems.

Workflow engines.

Autonomous agents.

They all maintain some representation of state.


5. The Decision Function Is a Policy

A machine needs a mechanism that maps state to action.

That mechanism is often called a policy.

Formally:

$$
\pi: S \rightarrow A
$$

Given state (S), choose action (A).

A simple policy might be:

def decide(order):
    if order.total > 10000:
        return "manual_review"

    if order.risk_score > 0.8:
        return "reject"

    return "approve"
Enter fullscreen mode Exit fullscreen mode

This is a policy.

But policies can become far more sophisticated.

They can use:

  • rules
  • scoring
  • optimization
  • probability
  • search
  • machine learning
  • reinforcement learning
  • heuristics
  • planning
  • constraint solving

The underlying architecture remains surprisingly similar.

State
  │
  ▼
Policy
  │
  ▼
Action
Enter fullscreen mode Exit fullscreen mode

The difference is how the policy computes its answer.


6. Rules Are the Simplest Decision Engine

Rules are perhaps the oldest form of machine decision-making.

if condition:
    action()
Enter fullscreen mode Exit fullscreen mode

They are powerful because they are explicit.

For example:

if user.role == "admin":
    allow()

elif user.role == "manager" and resource.owner == user.id:
    allow()

else:
    deny()
Enter fullscreen mode Exit fullscreen mode

There is little mystery.

The machine can explain its behavior:

Condition A was true.
Therefore action B was selected.
Enter fullscreen mode Exit fullscreen mode

But rules have a problem.

Reality grows faster than the rule set.

Consider:

10 rules
100 rules
1,000 rules
10,000 rules
Enter fullscreen mode Exit fullscreen mode

At some point, the system becomes difficult to reason about.

Rules begin interacting.

One rule overrides another.

Exceptions create exceptions.

Soon the architecture becomes:

Rule
 ├── Exception
 │    └── Exception
 │         └── Exception
Enter fullscreen mode Exit fullscreen mode

The machine still makes decisions.

But humans can no longer easily understand the decision surface.

This is where decision architecture becomes more interesting.


7. Scoring Turns Decisions Into Geometry

Instead of asking:

Is this condition true?

we can assign a score.

Suppose a fraud detector calculates:

$$
R = w_1x_1 + w_2x_2 + w_3x_3
$$

where:

  • (x_i) are features
  • (w_i) are weights
  • (R) is risk.

Then:

if risk > threshold:
    reject()
else:
    approve()
Enter fullscreen mode Exit fullscreen mode

Now the machine is not operating on one rule.

It is operating inside a decision boundary.

Imagine a two-dimensional feature space:

Feature Y
   ^
   |
   |        APPROVE
   |      /
   |    /
   |  /
   | /
   |/________________> Feature X
   |
   | REJECT
Enter fullscreen mode Exit fullscreen mode

The boundary separates regions.

This is an important conceptual transition.

Decision systems can be understood geometrically.

A machine does not always "think" in sentences.

It can effectively divide a mathematical space into regions:

$$
S \rightarrow A
$$

Different regions produce different actions.

Machine learning makes this idea even more powerful.


8. Machine Learning Builds Decision Surfaces

A trained model can approximate a function:

$$
f(x) \rightarrow y
$$

But from an architectural perspective, something more interesting is happening.

The model is constructing a decision surface.

Consider classification:

          x₂
          ^
      A A | B B
      A A | B B
      A A | B B
      ----+-----> x₁
      A A | B B
Enter fullscreen mode Exit fullscreen mode

The model has learned a boundary between classes.

A neural network might contain millions or billions of parameters.

Yet eventually it still produces an output:

state → prediction → decision
Enter fullscreen mode Exit fullscreen mode

The model is therefore not the whole decision system.

It is one component inside it.

This distinction is critical.

A model can say:

fraud_probability = 0.93
Enter fullscreen mode Exit fullscreen mode

But someone still has to decide:

if fraud_probability > 0.8:
    block_transaction()
Enter fullscreen mode Exit fullscreen mode

The model estimates.

The architecture decides.


9. Prediction Is Not Decision

This distinction deserves its own section.

Suppose an AI model predicts:

$$
P(\text{rain}) = 0.8
$$

That is a prediction.

It is not yet a decision.

A decision requires a cost model.

Maybe cancelling an outdoor event costs $50,000.

Maybe continuing the event in dangerous weather costs $500,000.

Then the optimal decision depends on consequences.

Suppose:

$$
C(\text{cancel}) = 50,000
$$

and

$$
C(\text{continue under rain}) = 500,000
$$

A probability of 0.8 may justify cancellation.

But if cancellation costs only $100 and rain costs $101, the threshold could be completely different.

Therefore:

$$
\text{Prediction} \neq \text{Decision}
$$

A prediction describes uncertainty.

A decision incorporates consequences.

This is one of the most important architectural distinctions in intelligent systems.


10. Utility Gives the Machine a Reason to Choose

A decision system needs some notion of preference.

We can express this with a utility function:

$$
U(a,s)
$$

which describes how desirable action (a) is in state (s).

The machine chooses:

$$
a^* = \arg\max_a U(a,s)
$$

In plain language:

Choose the action with the highest expected value.

For example:

actions = {
    "ship_now": 80,
    "delay": 50,
    "cancel": -20
}

decision = max(actions, key=actions.get)
Enter fullscreen mode Exit fullscreen mode

Now the architecture becomes:

State
  │
  ▼
Possible Actions
  │
  ▼
Evaluate Utility
  │
  ▼
Select Maximum
  │
  ▼
Action
Enter fullscreen mode Exit fullscreen mode

Optimization algorithms are essentially sophisticated versions of this idea.


11. Constraints Define What the Machine Is Allowed to Do

Utility alone is dangerous.

Suppose the machine wants to maximize profit.

Without constraints, it might discover terrible solutions.

Therefore we introduce:

$$
\max U(x)
$$

subject to:

$$
g_i(x) \leq 0
$$

and

$$
h_j(x) = 0
$$

Now the machine has an optimization problem.

The architecture becomes:

                 Possible Actions
                       │
             ┌─────────┴─────────┐
             ▼                   ▼
        Valid Actions       Invalid Actions
             │
             ▼
        Utility Function
             │
             ▼
        Best Valid Action
Enter fullscreen mode Exit fullscreen mode

This is a profound idea:

Constraints reduce possibility, but that reduction creates useful decision space.

Without constraints, the machine may have infinite possibilities.

With constraints, it can search intelligently.

Constraints are therefore not merely limitations.

They are computational structure.


12. Search Is Decision-Making Through Possibilities

Some machines cannot decide immediately.

They must simulate possible futures.

Games are an obvious example.

A chess engine can evaluate:

Current position
       │
       ▼
Possible moves
   /    |    \
 M1    M2    M3
 |     |     |
 ▼     ▼     ▼
Future positions
Enter fullscreen mode Exit fullscreen mode

It searches through a tree.

Mathematically:

$$
s_0 \rightarrow s_1 \rightarrow s_2 \rightarrow \dots
$$

The machine estimates which path leads toward a desirable outcome.

This creates another architectural layer:

Current State
      │
      ▼
Generate Possibilities
      │
      ▼
Simulate
      │
      ▼
Evaluate
      │
      ▼
Choose
Enter fullscreen mode Exit fullscreen mode

This architecture appears far beyond games.

Planning systems use it.

Robotics uses it.

Compilers use it.

Scheduling systems use it.

Route planners use it.

AI agents increasingly use it.

Decision-making is often search under constraints.


13. Time Changes Everything

A static decision is easy.

A dynamic decision is harder.

Suppose:

$$
A_t = \pi(S_t)
$$

The machine chooses an action at time (t).

That action changes the world.

Therefore:

$$
S_{t+1} = f(S_t,A_t,E_t)
$$

where (E_t) represents external events.

Now the machine is inside a feedback loop.

       ┌───────────────┐
       │    Observe    │
       └───────┬───────┘
               ▼
       ┌───────────────┐
       │    Decide     │
       └───────┬───────┘
               ▼
       ┌───────────────┐
       │      Act      │
       └───────┬───────┘
               ▼
       ┌───────────────┐
       │     World     │
       └───────┬───────┘
               │
               └──────────────► Observe
Enter fullscreen mode Exit fullscreen mode

This is fundamentally different from ordinary batch processing.

The machine acts.

The world responds.

The machine observes.

Then it acts again.

That is a control system.


14. Feedback Turns Software Into a System

Consider a thermostat.

It observes:

temperature = 18°C
Enter fullscreen mode Exit fullscreen mode

Target:

temperature = 22°C
Enter fullscreen mode Exit fullscreen mode

Decision:

turn heater on
Enter fullscreen mode Exit fullscreen mode

Later:

temperature = 21°C
Enter fullscreen mode Exit fullscreen mode

Decision:

keep heating
Enter fullscreen mode Exit fullscreen mode

Later:

temperature = 22.1°C
Enter fullscreen mode Exit fullscreen mode

Decision:

turn heater off
Enter fullscreen mode Exit fullscreen mode

This is a feedback loop.

The architecture is:

$$
\text{Observe} \rightarrow \text{Compare} \rightarrow \text{Act} \rightarrow \text{Observe}
$$

Many modern software systems work similarly.

Autoscaling systems observe CPU utilization.

Queue processors observe backlog.

Fraud systems observe transactions.

Recommendation systems observe user interactions.

Infrastructure systems observe health metrics.

The machine continuously updates its decisions based on feedback.


15. Confidence Is Part of Decision Architecture

A dangerous mistake is treating every machine output as equally reliable.

Suppose an AI model produces:

answer = X
confidence = 0.52
Enter fullscreen mode Exit fullscreen mode

Should the system automatically act?

Probably not.

A better architecture is:

if confidence >= 0.95:
    execute()
elif confidence >= 0.70:
    request_verification()
else:
    escalate()
Enter fullscreen mode Exit fullscreen mode

Now uncertainty is part of the architecture.

We can define:

$$
D =
\begin{cases}
A_1 & \text{if } C \geq t_1 \
A_2 & \text{if } t_2 \leq C < t_1 \
A_3 & \text{if } C < t_2
\end{cases}
$$

The machine does not merely choose what to do.

It chooses how strongly it should trust its own decision.

That is a deeper form of intelligence.


16. Sometimes the Best Decision Is No Decision

One of the most underrated capabilities of decision systems is abstention.

Suppose the machine has three options:

approve
reject
escalate
Enter fullscreen mode Exit fullscreen mode

The third option is extremely important.

It acknowledges that the machine may not know enough.

This creates:

              ┌──────────┐
              │  Input   │
              └────┬─────┘
                   │
                   ▼
              ┌──────────┐
              │ Evaluate │
              └────┬─────┘
                   │
         ┌─────────┼─────────┐
         ▼         ▼         ▼
      Approve    Reject    Escalate
Enter fullscreen mode Exit fullscreen mode

Good decision architecture does not force certainty where uncertainty exists.

It gives uncertainty somewhere to go.


17. Hierarchical Decision Systems

Large systems rarely have one decision-maker.

They have layers.

Consider an operating system.

Application
     │
     ▼
Runtime
     │
     ▼
Operating System
     │
     ▼
Kernel
     │
     ▼
Hardware
Enter fullscreen mode Exit fullscreen mode

Each layer makes different decisions.

The application decides what business operation it wants.

The runtime decides how to execute it.

The operating system decides resource allocation.

The kernel decides scheduling and memory behavior.

The hardware makes microarchitectural decisions.

This creates a hierarchy of decisions.

The same pattern appears in autonomous systems:

Strategic
   ↓
Tactical
   ↓
Operational
   ↓
Control
Enter fullscreen mode Exit fullscreen mode

For example:

Strategic: Where should we go?
Tactical: Which route should we take?
Operational: Which lane should we use?
Control: How much should the steering angle change?
Enter fullscreen mode Exit fullscreen mode

A single algorithm cannot efficiently solve all these problems.

Decision architecture distributes them across levels.


18. Local Decisions and Global Decisions

Another important distinction is scope.

A local decision optimizes the immediate situation.

A global decision considers the entire system.

Imagine a distributed scheduler.

One server might decide:

"This request should run here."
Enter fullscreen mode Exit fullscreen mode

But the global scheduler asks:

"How should the entire workload be distributed?"
Enter fullscreen mode Exit fullscreen mode

Local optimization can conflict with global optimization.

This is a classic systems problem.

Suppose:

$$
U_{local}(a) > U_{local}(b)
$$

but:

$$
U_{global}(a) < U_{global}(b)
$$

The locally optimal decision is globally harmful.

This is why architecture matters.

A decision machine needs to understand the level at which it is optimizing.


19. Decisions Create New State

An important property of decision systems is that decisions are not free.

Every action changes the system.

Suppose:

balance = $100
Enter fullscreen mode Exit fullscreen mode

The system decides:

withdraw $50
Enter fullscreen mode Exit fullscreen mode

Now:

balance = $50
Enter fullscreen mode Exit fullscreen mode

The decision changed state.

Therefore decision systems are better represented as:

$$
(S_t, A_t) \rightarrow S_{t+1}
$$

rather than simply:

$$
S_t \rightarrow A_t
$$

This matters enormously in transactional software.

A banking system cannot merely decide:

transfer approved
Enter fullscreen mode Exit fullscreen mode

It must ensure the corresponding state transition actually occurs.

That is where decision architecture meets consistency.


20. Authorization Is a Decision Machine

Security systems are excellent examples.

An authorization engine receives:

subject
resource
action
context
policy
Enter fullscreen mode Exit fullscreen mode

and produces:

allow
deny
Enter fullscreen mode Exit fullscreen mode

Formally:

$$
D(subject, resource, action, context) \rightarrow {allow, deny}
$$

For example:

def authorize(user, resource, action):
    if user.role == "admin":
        return True

    if action == "read" and resource.owner_id == user.id:
        return True

    return False
Enter fullscreen mode Exit fullscreen mode

Modern authorization systems can become much more sophisticated.

They may evaluate:

identity
device
location
time
risk
resource classification
network
history
policy
Enter fullscreen mode Exit fullscreen mode

The architecture remains a decision machine.

This is why security is fundamentally about controlling decisions.

Authentication answers:

Who are you?

Authorization answers:

What decision should the system make about your requested action?


21. APIs Are Decision Boundaries

We often describe APIs as interfaces between systems.

But APIs increasingly become decision boundaries.

An API may receive:

POST /payment
Enter fullscreen mode Exit fullscreen mode

and then determine:

Is the user authenticated?
Is the account valid?
Is the transaction allowed?
Is the amount within limits?
Is fraud risk acceptable?
Should additional verification be required?
Enter fullscreen mode Exit fullscreen mode

The API is therefore not merely transporting data.

It is participating in a decision pipeline.

Request
  │
  ▼
Authentication
  │
  ▼
Validation
  │
  ▼
Authorization
  │
  ▼
Risk Evaluation
  │
  ▼
Business Rules
  │
  ▼
Decision
  │
  ▼
State Transition
Enter fullscreen mode Exit fullscreen mode

This is one reason modern APIs are becoming more intelligent.

They are evolving from static contracts into computational boundaries.


22. Decision Logs Are the Memory of Judgment

If a machine makes important decisions, we eventually ask:

Why did it do that?

This creates the need for decision logs.

Instead of recording only:

transaction rejected
Enter fullscreen mode Exit fullscreen mode

record:

{
  "decision": "reject",
  "risk_score": 0.94,
  "threshold": 0.80,
  "policy": "fraud-v4",
  "model_version": "7.2",
  "timestamp": "2026-09-13T12:30:00Z"
}
Enter fullscreen mode Exit fullscreen mode

Now the decision becomes inspectable.

This creates an important architectural principle:

A decision system should preserve enough information to reconstruct its judgment.

For critical systems, that may include:

  • input state
  • policy version
  • model version
  • constraints
  • confidence
  • alternatives
  • selected action
  • human overrides
  • resulting state

Without this, the system may act correctly but remain impossible to audit.


23. Explainability Is an Architectural Property

People often ask whether an AI model is explainable.

But explainability does not have to belong entirely to the model.

The surrounding system can provide explanations.

Consider:

Model
  ↓
Risk = 0.91
  ↓
Policy
  ↓
Threshold = 0.80
  ↓
Decision
  ↓
Reject
Enter fullscreen mode Exit fullscreen mode

The system can explain:

Rejected because risk score 0.91 exceeded policy threshold 0.80.
Enter fullscreen mode Exit fullscreen mode

Even if the internal model is complex.

This suggests a useful distinction:

Model interpretability
        ≠
System explainability
Enter fullscreen mode Exit fullscreen mode

Architecture can make opaque components more accountable.


24. Humans Can Become Part of the Decision Loop

The future of decision systems is not necessarily:

Machine → decision
Enter fullscreen mode Exit fullscreen mode

It is often:

Machine → recommendation → human → decision
Enter fullscreen mode Exit fullscreen mode

Or:

Machine → decision → human review when uncertain
Enter fullscreen mode Exit fullscreen mode

This creates a hybrid architecture.

                    ┌─────────────┐
                    │   Machine   │
                    └──────┬──────┘
                           │
                     confidence
                           │
                 ┌─────────┴─────────┐
                 ▼                   ▼
              High                 Low
                 │                   │
                 ▼                   ▼
             Execute              Human
                                   Review
                                     │
                                     ▼
                                  Execute
Enter fullscreen mode Exit fullscreen mode

This is often more powerful than trying to eliminate humans completely.

The machine handles scale.

The human handles ambiguity.


25. Decision Machines Have Failure Modes

Every decision architecture can fail.

Bad observation

The system receives incorrect information.

Bad representation

The information is correct but modeled incorrectly.

Bad policy

The rules or objective are wrong.

Bad constraints

The machine is prevented from taking the correct action.

Bad optimization

The machine optimizes the wrong thing.

Bad state

The machine has stale or inconsistent information.

Bad feedback

The system interprets its own consequences incorrectly.

This can be visualized as:

Observation
    ↓
Representation
    ↓
State
    ↓
Policy
    ↓
Constraints
    ↓
Optimization
    ↓
Decision
    ↓
Action
    ↓
Feedback
Enter fullscreen mode Exit fullscreen mode

Every arrow is a possible failure boundary.

That is why building intelligent systems is fundamentally an architecture problem.


26. The Most Dangerous Bug Is Often the Objective

A machine can execute perfectly and still be wrong.

Imagine a delivery system optimized for:

$$
\minimize(delivery_time)
$$

It may produce extremely fast deliveries.

But perhaps the real objective should have been:

$$
\minimize(delivery_time + fuel_cost + accident_risk)
$$

The implementation may be flawless.

The architecture may still be wrong.

This is the difference between:

algorithmic correctness

and

goal correctness.

Software engineers spend enormous effort ensuring that code faithfully implements specifications.

But sometimes the specification itself is the problem.

A decision machine will optimize exactly what you tell it to optimize.

It does not automatically understand what you meant.


27. Reward Functions Are Compressed Intent

This becomes particularly interesting in AI.

Suppose an agent receives a reward:

$$
R = +1
$$

for completing a task.

The agent will search for strategies that maximize cumulative reward.

But if the reward function does not fully capture the intended objective, the agent may discover strange solutions.

This is sometimes called reward hacking.

The architecture is effectively:

Human Intent
     │
     ▼
Reward Function
     │
     ▼
Optimization
     │
     ▼
Behavior
Enter fullscreen mode Exit fullscreen mode

The dangerous step is the compression:

$$
Intent \rightarrow Objective
$$

Human intentions are rich.

Mathematical objectives are narrow.

The gap between them is where many intelligent-system failures originate.


28. Decision Architecture Is Really About Possibility

Here is a deeper way to think about all of this.

A machine starts with a space of possible actions:

$$
A
$$

Constraints reduce that space:

$$
A' \subseteq A
$$

State changes which actions make sense.

Prediction estimates consequences.

Utility ranks outcomes.

Policy selects an action.

So:

$$
Decision =
\arg\max_{a \in A'} U(a \mid S)
$$

That single expression contains much of the architecture.

The machine is essentially performing:

Generate possibility
        ↓
Remove impossibility
        ↓
Estimate consequences
        ↓
Rank possibilities
        ↓
Choose one
        ↓
Act
Enter fullscreen mode Exit fullscreen mode

Decision-making is therefore not magic.

It is structured reduction of possibility.


29. From If-Statements to Intelligent Systems

There is a fascinating continuum here.

At one end:

if x > 10:
    return A
Enter fullscreen mode Exit fullscreen mode

Then:

score = w1*x1 + w2*x2
Enter fullscreen mode Exit fullscreen mode

Then:

probability = model.predict(x)
Enter fullscreen mode Exit fullscreen mode

Then:

actions = generate_actions(state)
Enter fullscreen mode Exit fullscreen mode

Then:

future_states = simulate(actions)
Enter fullscreen mode Exit fullscreen mode

Then:

best = optimize(future_states, constraints, objective)
Enter fullscreen mode Exit fullscreen mode

And eventually:

Observe
→ Model
→ Predict
→ Generate
→ Simulate
→ Evaluate
→ Constrain
→ Optimize
→ Act
→ Learn
→ Repeat
Enter fullscreen mode Exit fullscreen mode

The architecture becomes increasingly sophisticated.

But the fundamental problem has not changed.

The machine is still answering:

Given what I know, what should I do next?


30. The Machine That Makes Decisions Is a Loop

The most complete abstraction is not a function.

It is a loop.

                 ┌────────────────────┐
                 │      WORLD         │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │     OBSERVE        │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │      STATE         │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │     PREDICT        │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │    GENERATE        │
                 │    OPTIONS         │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │    CONSTRAIN       │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │     EVALUATE       │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │      SELECT        │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │       ACT          │
                 └─────────┬──────────┘
                           │
                           └───────────────► WORLD
Enter fullscreen mode Exit fullscreen mode

This is the architecture hiding inside many intelligent machines.

And there is something almost philosophical about it.

The machine never possesses reality.

It possesses observations.

It never possesses certainty.

It possesses estimates.

It never knows the future.

It predicts possibilities.

It never has unlimited freedom.

It operates under constraints.

And it never makes a decision in isolation.

Every action changes the next state.


31. Software Engineers Are Increasingly Designing Decision Machines

This changes how we should think about software architecture.

A traditional application might be described as:

Frontend
   ↓
API
   ↓
Database
Enter fullscreen mode Exit fullscreen mode

But many modern systems are better represented as:

                ┌──────────────┐
                │   Inputs     │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │    State     │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │   Models     │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │   Policies   │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │ Constraints  │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │  Decision    │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │    Action    │
                └──────┬───────┘
                       ▼
                ┌──────────────┐
                │  Feedback    │
                └──────────────┘
Enter fullscreen mode Exit fullscreen mode

The database is still important.

The API is still important.

The frontend is still important.

But the center of gravity is moving toward decision architecture.

Software increasingly does not merely store and retrieve information.

It interprets information and chooses what happens next.


32. A Minimal Decision Engine

We can implement a tiny decision architecture in Python:

from dataclasses import dataclass


@dataclass
class State:
    temperature: float
    battery: float
    workload: float


@dataclass
class Decision:
    action: str
    confidence: float
    reason: str


def evaluate(state: State) -> Decision:
    if state.battery < 10:
        return Decision(
            action="shutdown",
            confidence=0.99,
            reason="battery critically low"
        )

    if state.temperature > 90:
        return Decision(
            action="cool",
            confidence=0.98,
            reason="temperature above safety threshold"
        )

    if state.workload > 80:
        return Decision(
            action="scale_up",
            confidence=0.90,
            reason="workload is high"
        )

    return Decision(
        action="continue",
        confidence=0.75,
        reason="system operating within normal range"
    )
Enter fullscreen mode Exit fullscreen mode

This tiny program contains several important concepts:

State
Decision
Constraints
Policy
Confidence
Reason
Action
Enter fullscreen mode Exit fullscreen mode

We could then add feedback:

while True:
    state = observe_system()

    decision = evaluate(state)

    execute(decision.action)

    record_decision(state, decision)
Enter fullscreen mode Exit fullscreen mode

Now we have a primitive autonomous system.

The sophistication can increase indefinitely.

But the skeleton remains.


33. The Future Is Not Just Faster Machines

We often imagine the future of computing as:

faster CPU
more memory
larger models
more GPUs
Enter fullscreen mode Exit fullscreen mode

Those things matter.

But another transition is happening.

Machines are becoming better at choosing.

They are moving from:

execute this
Enter fullscreen mode Exit fullscreen mode

toward:

determine what should happen
Enter fullscreen mode Exit fullscreen mode

That is a much larger shift.

A calculator executes a formula.

A traditional application executes business logic.

A decision engine evaluates conditions.

A machine-learning system predicts.

An autonomous agent observes, plans, acts, and learns.

The trajectory is from execution toward agency.

And agency is fundamentally an architectural problem.


34. The Real Architecture of Intelligence

If we strip away the buzzwords, many intelligent systems contain the same pieces:

                 INFORMATION
                      │
                      ▼
                 REPRESENTATION
                      │
                      ▼
                     STATE
                      │
          ┌───────────┼───────────┐
          ▼           ▼           ▼
       PREDICT     GENERATE    CONSTRAIN
          │           │           │
          └───────────┼───────────┘
                      ▼
                   EVALUATE
                      │
                      ▼
                    SELECT
                      │
                      ▼
                     ACT
                      │
                      ▼
                   FEEDBACK
                      │
                      └──────────► STATE
Enter fullscreen mode Exit fullscreen mode

That architecture appears in remarkably different domains.

A robot.

A game engine.

A financial system.

A recommendation engine.

A security platform.

An operating system.

An autonomous vehicle.

An AI agent.

A distributed scheduler.

They may use completely different technologies.

But underneath, they face the same computational question:

$$
\boxed{\text{What should happen next?}}
$$


35. The Deepest Layer Is Not the Algorithm

This is perhaps the most important conclusion.

When engineers build decision systems, they often focus on the algorithm.

Should we use:

  • a neural network?
  • a decision tree?
  • reinforcement learning?
  • Bayesian inference?
  • an optimizer?
  • a heuristic?
  • a rules engine?

Those are important questions.

But they are not the first questions.

The deeper questions are:

What does the machine observe?

What does it believe?

How does it represent state?

What actions are possible?

Which actions are forbidden?

What does "better" mean?

What happens when the machine is uncertain?

How does it learn from consequences?

Who can override it?

Can we reconstruct why it acted?

These are architecture questions.

And architecture determines what kind of machine you are actually building.


Conclusion: Machines Are Becoming Engines of Choice

Computers began as machines for calculation.

Then they became machines for storing information.

Then communication.

Then automation.

Now they are increasingly becoming machines for decision-making.

That transformation is deeper than simply adding AI.

A decision-making machine requires an architecture for uncertainty, state, constraints, prediction, evaluation, action, and feedback.

It needs to know what it sees.

It needs to represent what it sees.

It needs to understand what actions are available.

It needs boundaries around what it is allowed to do.

It needs an objective.

It needs a mechanism for selecting among alternatives.

And perhaps most importantly, it needs a way to recognize when it does not know enough.

The simplest machine says:

Do this.
Enter fullscreen mode Exit fullscreen mode

A more advanced machine says:

Given this state, do this.
Enter fullscreen mode Exit fullscreen mode

A smarter machine says:

Given this state, these are the possible actions.
Enter fullscreen mode Exit fullscreen mode

A more sophisticated one says:

Given this state, these actions are possible,
these are forbidden,
these outcomes are likely,
these outcomes are valuable,
and this is the best action.
Enter fullscreen mode Exit fullscreen mode

The most mature systems eventually say something even more interesting:

I don't have enough confidence to act.
Enter fullscreen mode Exit fullscreen mode

That is not failure.

That is architecture.

Because intelligence is not simply the ability to produce answers.

It is the ability to choose actions under uncertainty and constraints.

And once we start seeing software this way, a strange pattern emerges.

The operating system is a decision machine.

The database is a decision machine.

The compiler is a decision machine.

The network is a decision machine.

The API is a decision machine.

The recommendation engine is a decision machine.

The robot is a decision machine.

The AI agent is a decision machine.

Different machines.

Different algorithms.

Different layers of abstraction.

Same fundamental problem.

Observe. Represent. Evaluate. Constrain. Choose. Act. Learn.

That may be one of the deepest architectural patterns in computing.

We did not merely build machines that calculate.

We built machines that increasingly decide what calculation should happen next.

And perhaps the future of software engineering is not primarily about teaching machines how to execute more instructions.

It is about designing the architecture through which machines decide which instructions should exist in the first place.

Top comments (0)